diff --git a/TrooperEngineDLL/TrooperEngine/MathEngine/cRandom.cpp b/TrooperEngineDLL/TrooperEngine/MathEngine/cRandom.cpp index 9e109f3..b9cfadf 100644 --- a/TrooperEngineDLL/TrooperEngine/MathEngine/cRandom.cpp +++ b/TrooperEngineDLL/TrooperEngine/MathEngine/cRandom.cpp @@ -45,4 +45,14 @@ const unsigned long int cRandom::Rand( const unsigned long int max, const unsign const float cRandom::Rand( const float max, const float min /*= 0.0f*/ ) const { return (float)((max - min) * rand()/(float)RAND_MAX + min); -} \ No newline at end of file +} + +const double cRandom::Rand(const double max, const double min) const +{ + return (double)((max - min) * rand() / (double)RAND_MAX + min); +} + +const long double cRandom::Rand(const long double max, const long double min) const +{ + return (long double)((max - min) * rand() / (long double)RAND_MAX + min); +} diff --git a/TrooperEngineDLL/TrooperEngine/MathEngine/cRandom.hpp b/TrooperEngineDLL/TrooperEngine/MathEngine/cRandom.hpp index c45aa08..912183d 100644 --- a/TrooperEngineDLL/TrooperEngine/MathEngine/cRandom.hpp +++ b/TrooperEngineDLL/TrooperEngine/MathEngine/cRandom.hpp @@ -22,9 +22,14 @@ namespace MathEngine { const bool Setup() const; + /* Gives you a Random Integer less then or equal to max and more then or equal to min */ const unsigned long int Rand( const unsigned long int max, const unsigned long int min = 0 ) const; + /* Gives you a Random float less then or equal to max and more then or equal to min */ const float Rand( const float max, const float min = 0.0f ) const; - + /* Gives you a Random double less then or equal to max and more then or equal to min */ + const double Rand(const double max, const double min = 0.0f) const; + /* Gives you a Random long double less then or equal to max and more then or equal to min */ + const long double Rand(const long double max, const long double min = 0.0f) const; private: /// Variables static cRandom* sp_inst;/// = nullptr diff --git a/TrooperEngineDLL/TrooperEngine/UtilityEngine/cString.hpp b/TrooperEngineDLL/TrooperEngine/UtilityEngine/cString.hpp index f8163c0..a15994e 100644 --- a/TrooperEngineDLL/TrooperEngine/UtilityEngine/cString.hpp +++ b/TrooperEngineDLL/TrooperEngine/UtilityEngine/cString.hpp @@ -19,6 +19,7 @@ EXPIMP_TEMPLATE template class EXPORT_FROM_MYDLL std::basic_string; #define __cString__MAX_LEN 65535 namespace UtilityEngine { + /* smaller then std::string */ class EXPORT_FROM_MYDLL cString { public: diff --git a/TrooperEngineDLL/TrooperEngine/UtilityEngine/cUtility.cpp b/TrooperEngineDLL/TrooperEngine/UtilityEngine/cUtility.cpp index 54c6302..692b848 100644 --- a/TrooperEngineDLL/TrooperEngine/UtilityEngine/cUtility.cpp +++ b/TrooperEngineDLL/TrooperEngine/UtilityEngine/cUtility.cpp @@ -18,16 +18,6 @@ cUtility::cUtility() cUtility::~cUtility() {} -/// public: -// cUtility& cUtility::operator=( const cUtility& copy ) -// { -// if (this != ©) -// { -// } -// -// return *this; -// } - /// Functions /*static*/ cUtility& cUtility::Inst() { diff --git a/TrooperEngineDLL/TrooperEngine/UtilityEngine/cUtility.hpp b/TrooperEngineDLL/TrooperEngine/UtilityEngine/cUtility.hpp index 94cbd11..6b682e4 100644 --- a/TrooperEngineDLL/TrooperEngine/UtilityEngine/cUtility.hpp +++ b/TrooperEngineDLL/TrooperEngine/UtilityEngine/cUtility.hpp @@ -46,8 +46,10 @@ namespace UtilityEngine { static cUtility& Inst(); static void Delete(); + /* prints out a message to stderror. */ void Message( const cString& msg, const cString& debugInfo = "", const eTypeSDL typeSDL = eTypeSDL::NONE ) const; + /* Prints out what Version of SDL2, SDL2_image, SDL2_mixer, SDL2_net, and SDL2_ttf based on what you pass it to stderror. */ void PrintVersion( const eTypeSDL typeSDL = eTypeSDL::ALL ) const; private: diff --git a/TrooperEngineDLL/TrooperEngine/VideoEngine/cAnimatedSprite.hpp b/TrooperEngineDLL/TrooperEngine/VideoEngine/cAnimatedSprite.hpp index d544cd2..64aa75a 100644 --- a/TrooperEngineDLL/TrooperEngine/VideoEngine/cAnimatedSprite.hpp +++ b/TrooperEngineDLL/TrooperEngine/VideoEngine/cAnimatedSprite.hpp @@ -11,6 +11,7 @@ #include "dllExport.h" namespace VideoEngine { + /* cAnimatedSprite is Sprite that only displays a small part of the texture and can be move up, down, left, and right to display the next frame. */ class EXPORT_FROM_MYDLL cAnimatedSprite : public cSprite { public: @@ -63,8 +64,7 @@ namespace VideoEngine { unsigned long int m_nextTime;/// = 0 - unsigned long int m_RATE;/// = 0 - + unsigned long int m_RATE;/// = 0 };/// END CLASS DEFINITION cAnimatedSprite }/// END NAMESPACE DEFINITION VideoEngine #endif/// END IFNDEF _CANIMATEDSPRITE_HPP_ diff --git a/TrooperEngineDLL/TrooperEngine/VideoEngine/cCamera.hpp b/TrooperEngineDLL/TrooperEngine/VideoEngine/cCamera.hpp index fd5dd52..acbe0cb 100644 --- a/TrooperEngineDLL/TrooperEngine/VideoEngine/cCamera.hpp +++ b/TrooperEngineDLL/TrooperEngine/VideoEngine/cCamera.hpp @@ -13,6 +13,7 @@ using UtilityEngine::cString; namespace VideoEngine { + /* cCamera is texture that cSprites and cAnimatedSprites can be rendered and then renderer cCamera to the Screen */ class EXPORT_FROM_MYDLL cCamera { public: diff --git a/TrooperEngineDLL/TrooperEngine/VideoEngine/cImage.hpp b/TrooperEngineDLL/TrooperEngine/VideoEngine/cImage.hpp index 5d41e8b..a9a13df 100644 --- a/TrooperEngineDLL/TrooperEngine/VideoEngine/cImage.hpp +++ b/TrooperEngineDLL/TrooperEngine/VideoEngine/cImage.hpp @@ -14,6 +14,7 @@ using UtilityEngine::cString; namespace VideoEngine { + /* cImage holds a SDL_Texture or SDL_Surface for use by a cSprite or cAnimatedSprite */ class EXPORT_FROM_MYDLL cImage { public: diff --git a/TrooperEngineDLL/TrooperEngine/VideoEngine/cImageFile.hpp b/TrooperEngineDLL/TrooperEngine/VideoEngine/cImageFile.hpp index 7daf5c9..2f661bc 100644 --- a/TrooperEngineDLL/TrooperEngine/VideoEngine/cImageFile.hpp +++ b/TrooperEngineDLL/TrooperEngine/VideoEngine/cImageFile.hpp @@ -15,6 +15,7 @@ using UtilityEngine::cString; namespace VideoEngine { + /* cImageFile holds a SDL_Texture or SDL_Surface from a file on the system for use by a cSprite or cAnimatedSprite */ class EXPORT_FROM_MYDLL cImageFile : public cImage { public: diff --git a/TrooperEngineDLL/TrooperEngine/VideoEngine/cSprite.hpp b/TrooperEngineDLL/TrooperEngine/VideoEngine/cSprite.hpp index 1b6446c..d494f90 100644 --- a/TrooperEngineDLL/TrooperEngine/VideoEngine/cSprite.hpp +++ b/TrooperEngineDLL/TrooperEngine/VideoEngine/cSprite.hpp @@ -21,6 +21,7 @@ using UtilityEngine::cString; namespace VideoEngine { + /* cSprite is a class that holds an cImage to be displayed to a Screen or cCamera */ class EXPORT_FROM_MYDLL cSprite { public: