it's coming along nicely,
but the code is not written for performance at all.
objects are passed by value, especially for the Vector stuff there is way too much copying going on..
for example a simple function:
Code: Select allvirtual void SetFogColor(Vector3 v){fogColor = v;}
should be written as:
Code: Select allvirtual void SetFogColor(const Vector3& v){fogColor = v;}
otherwise a dummy vec3 is created on the stack when calling the function, that dummy (v) is used to set the fogColor, then imediately destroyed again...
i also saw some dynamic casts, for example to check what stuff to draw?
that's really wastefull, and could easily be done by simply overloading a virtual function (after all, that's what they are for!)
another example:
Code: Select allIModel *base = renderer->RegisterModel("Models/MapObjects/CheckPoint.kv6");
stuff like that should be done at startup, not every frame (yes, it is stored in a map, but that means finding items in a map everytime they need to be drawn), again very wastefull.
also, it needs some fixing to be able to build it in MSVC.
__PRETTY_FUNCTION__ should be defined (for MSVC) as __FUNCDNAME__
NOMINMAX should be defined before including windows.h (maybe even project wide)
atoll does not exist in msvc (NetClient.cpp)
the vararg expansion in macro's also should be done a little different for msvc.
Code: Select all#ifdef _MSC_VER
#define SPLog(format, ...) ::spades::LogMessage(__FILE__, __LINE__, format, __VA_ARGS__ )
#else
#define SPLog(format, args...) ::spades::LogMessage(__FILE__, __LINE__, format, ##args )
#endif
also, GameMap::CastRay2 does not return a value on the path where IsSolidWrapped returns false.
there are shittons of warnings about typeconversions (int to float or double),
and signed / unsigned comparisons.