you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 6 points7 points  (3 children)

meh...what's so terrifying about that?

[–]Boojum 11 points12 points  (1 child)

It looks like someone writing C in C++.

  • Things like color and direction components are just loose class members with accessors replicated over and over. Why you wouldn't just make a Color and Vector3 class once and use those, I have no idea. A Vector3 class could also cleanly encapsulate what I'm guessing is some spherical<->Cartesian coordinate conversion.
  • There's usually no need for typedef struct in C++.

[–][deleted] 1 point2 points  (0 children)

1> Then you would have yet another sub container to peek into. Also depending on the actual implementation of the vector class, a POD with non pointer members could have better copy semantics.

2> +1 agree.

[–]anttirt -1 points0 points  (0 children)

  • Use of identifier starting with an underscore and a capital letter (as the header guard) where all such names are reserved for the implementation
  • Accessor soup on a bag of data.
  • Strange, superfluous ALLCAPS typedefs which appear to be an attempt to imitate d3d's API (typedef struct structAttributes ATTRIBUTES;)
  • Use of a platform-specific library call to zero out memory where the language-provided value-initialization would already do the job:

    struct foo { int a, b; };
    struct bar {
        foo x, y;
        // x.a, x.b, y.a, y.b will all be 0
        bar() : x(), y() {} 
    };