History

Merge pull request #8422 from sethalves/sidestep-linux-gcc-bug

sidestep linux gcc linker? bug

Brad Davis committed 10 years ago

Commit fdbbd702 parents 5b09748 77a49e61 file · +22 −21Browse files

Showing the changes to libraries/render-utils/src/AnimDebugDraw.cpp (1 of 1 file). Show all

Unified · Split

libraries/render-utils/src/AnimDebugDraw.cpp+22−21
@@ -19,13 +19,14 @@ · 18 unmodified lines
1919
2020 #include "AnimDebugDraw.h"
2121
22−struct Vertex {
23− glm::vec3 pos;
24− uint32_t rgba;
25−};
26−
2722 class AnimDebugDrawData {
2823 public:
24+
25+ struct Vertex {
26+ glm::vec3 pos;
27+ uint32_t rgba;
28+ };
29+
2930 typedef render::Payload<AnimDebugDrawData> Payload;
3031 typedef Payload::DataPointer Pointer;
3132
@@ -119,18 +120,18 @@ AnimDebugDraw::AnimDebugDraw() : · 87 unmodified lines
119120 }
120121
121122 // HACK: add red, green and blue axis at (1,1,1)
122− _animDebugDrawData->_vertexBuffer->resize(sizeof(Vertex) * 6);
123+ _animDebugDrawData->_vertexBuffer->resize(sizeof(AnimDebugDrawData::Vertex) * 6);
123124
124− static std::vector<Vertex> vertices({
125− Vertex { glm::vec3(1.0, 1.0f, 1.0f), toRGBA(255, 0, 0, 255) },
126− Vertex { glm::vec3(2.0, 1.0f, 1.0f), toRGBA(255, 0, 0, 255) },
127− Vertex { glm::vec3(1.0, 1.0f, 1.0f), toRGBA(0, 255, 0, 255) },
128− Vertex { glm::vec3(1.0, 2.0f, 1.0f), toRGBA(0, 255, 0, 255) },
129− Vertex { glm::vec3(1.0, 1.0f, 1.0f), toRGBA(0, 0, 255, 255) },
130− Vertex { glm::vec3(1.0, 1.0f, 2.0f), toRGBA(0, 0, 255, 255) },
125+ static std::vector<AnimDebugDrawData::Vertex> vertices({
126+ AnimDebugDrawData::Vertex { glm::vec3(1.0, 1.0f, 1.0f), toRGBA(255, 0, 0, 255) },
127+ AnimDebugDrawData::Vertex { glm::vec3(2.0, 1.0f, 1.0f), toRGBA(255, 0, 0, 255) },
128+ AnimDebugDrawData::Vertex { glm::vec3(1.0, 1.0f, 1.0f), toRGBA(0, 255, 0, 255) },
129+ AnimDebugDrawData::Vertex { glm::vec3(1.0, 2.0f, 1.0f), toRGBA(0, 255, 0, 255) },
130+ AnimDebugDrawData::Vertex { glm::vec3(1.0, 1.0f, 1.0f), toRGBA(0, 0, 255, 255) },
131+ AnimDebugDrawData::Vertex { glm::vec3(1.0, 1.0f, 2.0f), toRGBA(0, 0, 255, 255) },
131132 });
132133 static std::vector<uint16_t> indices({ 0, 1, 2, 3, 4, 5 });
133− _animDebugDrawData->_vertexBuffer->setSubData<Vertex>(0, vertices);
134+ _animDebugDrawData->_vertexBuffer->setSubData<AnimDebugDrawData::Vertex>(0, vertices);
134135 _animDebugDrawData->_indexBuffer->setSubData<uint16_t>(0, indices);
135136 }
136137
@@ -161,7 +162,7 @@ static const uint32_t blue = toRGBA(0, 0, 255, 255); · 24 unmodified lines
161162
162163 const int NUM_CIRCLE_SLICES = 24;
163164
164−static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius, Vertex*& v) {
165+static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius, AnimDebugDrawData::Vertex*& v) {
165166
166167 const float XYZ_AXIS_LENGTH = radius * 4.0f;
167168
@@ -236,7 +237,7 @@ static void addBone(const AnimPose& rootPose, const AnimPose& pose, float radius · 68 unmodified lines
236237 }
237238
238239 static void addLink(const AnimPose& rootPose, const AnimPose& pose, const AnimPose& parentPose,
239− float radius, const glm::vec4& colorVec, Vertex*& v) {
240+ float radius, const glm::vec4& colorVec, AnimDebugDrawData::Vertex*& v) {
240241
241242 uint32_t color = toRGBA(colorVec);
242243
@@ -298,7 +299,7 @@ static void addLink(const AnimPose& rootPose, const AnimPose& pose, const AnimPo · 55 unmodified lines
298299 }
299300 }
300301
301−static void addLine(const glm::vec3& start, const glm::vec3& end, const glm::vec4& color, Vertex*& v) {
302+static void addLine(const glm::vec3& start, const glm::vec3& end, const glm::vec4& color, AnimDebugDrawData::Vertex*& v) {
302303 uint32_t colorInt = toRGBA(color);
303304 v->pos = start;
304305 v->rgba = colorInt;
@@ -347,10 +348,10 @@ void AnimDebugDraw::update() { · 42 unmodified lines
347348 numVerts += (int)DebugDraw::getInstance().getRays().size() * VERTICES_PER_RAY;
348349
349350 // allocate verts!
350− std::vector<Vertex> vertices;
351+ std::vector<AnimDebugDrawData::Vertex> vertices;
351352 vertices.resize(numVerts);
352353 //Vertex* verts = (Vertex*)data._vertexBuffer->editData();
353− Vertex* v = nullptr;
354+ AnimDebugDrawData::Vertex* v = nullptr;
354355 if (numVerts) {
355356 v = &vertices[0];
356357 }
@@ -403,8 +404,8 @@ void AnimDebugDraw::update() { · 46 unmodified lines
403404 }
404405 DebugDraw::getInstance().clearRays();
405406
406− data._vertexBuffer->resize(sizeof(Vertex) * numVerts);
407− data._vertexBuffer->setSubData<Vertex>(0, vertices);
407+ data._vertexBuffer->resize(sizeof(AnimDebugDrawData::Vertex) * numVerts);
408+ data._vertexBuffer->setSubData<AnimDebugDrawData::Vertex>(0, vertices);
408409
409410 assert((!numVerts && !v) || (numVerts == (v - &vertices[0])));
410411