class BWAVector3 { private: float x; float y; float z; public: ... float& operator[] (const int index); }; float& BWAVector3::operator[] (const int index) { if (index == 0) { return x; } else if (index == 1) { return y; } else { return z; } }(Thanks for the submission Graham Wihlidal)
Epic failures in the game development field.
This blog covers funny/weird issues and bugs from games that happened during development.
Send your own contributions to igetyourfail at repi.se (can be anonymous if specified)
Tuesday, April 30, 2013
Highly optimized and accurate vector subscript operator
Epic alignment fail...
extern "C" void* __wrap_memalign(size_t Alignment, size_t Size) { extern void* __real_memalign(size_t,size_t); return __real_memalign(Size, Alignment); }
(Thanks Graham Wihlidal)
Sunday, April 28, 2013
Subscribe to:
Posts (Atom)