diff --git a/include/eepp/audio/base.hpp b/include/eepp/audio/base.hpp index bd917f286..4ce0eb6dc 100644 --- a/include/eepp/audio/base.hpp +++ b/include/eepp/audio/base.hpp @@ -3,11 +3,11 @@ #include -#include -#include -#include +#include +#include +#include #include -#include +#include using namespace EE::System; #include diff --git a/include/eepp/audio/music.hpp b/include/eepp/audio/music.hpp index 79739bbcb..ccb6795c2 100755 --- a/include/eepp/audio/music.hpp +++ b/include/eepp/audio/music.hpp @@ -23,16 +23,16 @@ class EE_API Music : public SoundStream { bool OpenFromMemory( const char * Data, std::size_t SizeInBytes ); /** Open a Music file from a file inside a pack file */ - bool OpenFromPack( cPack * Pack, const std::string& FilePackPath ); + bool OpenFromPack( Pack * Pack, const std::string& FilePackPath ); /** Get the Music Duration */ - cTime GetDuration() const; + Time GetDuration() const; private : virtual bool OnStart(); virtual bool OnGetData(Chunk& Data); - virtual void OnSeek( cTime timeOffset); + virtual void OnSeek( Time timeOffset); SoundFile * mFile; ///< Sound file float mDuration; ///< Music duration, in seconds diff --git a/include/eepp/audio/sound.hpp b/include/eepp/audio/sound.hpp index f4b766131..865d3fda1 100755 --- a/include/eepp/audio/sound.hpp +++ b/include/eepp/audio/sound.hpp @@ -88,12 +88,12 @@ class EE_API Sound { Status State() const; /** Get the current playing position of the sound */ - virtual cTime PlayingOffset() const; + virtual Time PlayingOffset() const; /** Set the current playing position of the sound * @param TimeOffset : New playing position */ - virtual void PlayingOffset( const cTime &TimeOffset ); + virtual void PlayingOffset( const Time &TimeOffset ); /** Assignment operator */ Sound& operator =(const Sound& Other); diff --git a/include/eepp/audio/soundbuffer.hpp b/include/eepp/audio/soundbuffer.hpp index 70d7c73a5..1ccdb14d0 100755 --- a/include/eepp/audio/soundbuffer.hpp +++ b/include/eepp/audio/soundbuffer.hpp @@ -22,7 +22,7 @@ class EE_API SoundBuffer { bool LoadFromFile( const std::string& Filename ); /** Load the Sound Buffer from a file inside a pack file*/ - bool LoadFromPack( cPack* Pack, const std::string& FilePackPath ); + bool LoadFromPack( Pack* Pack, const std::string& FilePackPath ); /** Load the Sound Buffer from a file in memory */ bool LoadFromMemory( const char* Data, std::size_t SizeInBytes ); @@ -46,7 +46,7 @@ class EE_API SoundBuffer { unsigned int GetChannelCount() const; /** Get the Sound Duration */ - cTime GetDuration() const; + Time GetDuration() const; /** Assignment operator */ SoundBuffer& operator =(const SoundBuffer& Other); @@ -55,7 +55,7 @@ class EE_API SoundBuffer { unsigned int mBuffer; ///< OpenAL buffer identifier std::vector mSamples; ///< Samples buffer - cTime mDuration; ///< Sound duration, in seconds + Time mDuration; ///< Sound duration, in seconds typedef std::set SoundList; mutable SoundList mSounds; diff --git a/include/eepp/audio/soundloader.hpp b/include/eepp/audio/soundloader.hpp index c05838539..65286b795 100644 --- a/include/eepp/audio/soundloader.hpp +++ b/include/eepp/audio/soundloader.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include namespace EE { namespace Audio { @@ -13,9 +13,9 @@ namespace EE { namespace Audio { #define SND_LT_SAMPLES (4) /** @brief A helper template to load sounds in synchronous or asynchronous mode. -** @see cObjectLoader */ +** @see ObjectLoader */ template -class tSoundLoader : public cObjectLoader { +class tSoundLoader : public ObjectLoader { public: /** @brief Load the sound from file */ tSoundLoader( tSoundManager * SndMngr, const T& id, const std::string& filepath ); @@ -27,7 +27,7 @@ class tSoundLoader : public cObjectLoader { tSoundLoader( tSoundManager * SndMngr, const T& id, const Int16* Samples, std::size_t SamplesCount, unsigned int ChannelCount, unsigned int SampleRate ); /** @brief Load the sound from the Pack file */ - tSoundLoader( tSoundManager * SndMngr, const T& id, cPack* Pack, const std::string& FilePackPath ); + tSoundLoader( tSoundManager * SndMngr, const T& id, Pack* Pack, const std::string& FilePackPath ); ~tSoundLoader(); @@ -47,7 +47,7 @@ class tSoundLoader : public cObjectLoader { Uint32 mSamplesCount; Uint32 mChannelCount; Uint32 mSampleRate; - cPack * mPack; + Pack * mPack; void Start(); private: @@ -61,7 +61,7 @@ template tSoundLoader::tSoundLoader( tSoundManager * SndMngr, const T& id, const std::string& filepath -) : cObjectLoader( cObjectLoader::SoundLoader ), +) : ObjectLoader( ObjectLoader::SoundLoader ), mLoadType(SND_LT_PATH), mSndMngr(SndMngr), mId(id), @@ -74,7 +74,7 @@ tSoundLoader::tSoundLoader( tSoundManager * SndMngr, const T& id, const char * Data, std::size_t SizeInBytes -) : cObjectLoader( cObjectLoader::SoundLoader ), +) : ObjectLoader( ObjectLoader::SoundLoader ), mLoadType(SND_LT_MEM), mSndMngr(SndMngr), mId(id), @@ -90,7 +90,7 @@ tSoundLoader::tSoundLoader( tSoundManager * SndMngr, std::size_t SamplesCount, unsigned int ChannelCount, unsigned int SampleRate -) : cObjectLoader( cObjectLoader::SoundLoader ), +) : ObjectLoader( ObjectLoader::SoundLoader ), mLoadType(SND_LT_SAMPLES), mSndMngr(SndMngr), mId(id), @@ -103,9 +103,9 @@ tSoundLoader::tSoundLoader( tSoundManager * SndMngr, template tSoundLoader::tSoundLoader( tSoundManager * SndMngr, - const T& id, cPack* Pack, + const T& id, Pack* Pack, const std::string& FilePackPath -) : cObjectLoader( cObjectLoader::SoundLoader ), +) : ObjectLoader( ObjectLoader::SoundLoader ), mLoadType(SND_LT_PACK), mSndMngr(SndMngr), mId(id), @@ -121,7 +121,7 @@ tSoundLoader::~tSoundLoader() { template void tSoundLoader::Start() { if ( NULL != mSndMngr ) { - cObjectLoader::Start(); + ObjectLoader::Start(); if ( SND_LT_PATH == mLoadType ) LoadFromPath(); diff --git a/include/eepp/audio/soundmanager.hpp b/include/eepp/audio/soundmanager.hpp index d093726d3..c903ffe9c 100755 --- a/include/eepp/audio/soundmanager.hpp +++ b/include/eepp/audio/soundmanager.hpp @@ -35,7 +35,7 @@ class tSoundManager { ** @param id The id to use to identificate the sound ** @param Pack The Pack file ** @param FilePackPath The pack file path */ - bool LoadFromPack( const T& id, cPack* Pack, const std::string& FilePackPath ); + bool LoadFromPack( const T& id, Pack* Pack, const std::string& FilePackPath ); /** @return The sound buffer of the sound id */ SoundBuffer& GetBuffer( const T& id ); @@ -65,7 +65,7 @@ class tSoundManager { }; template -bool tSoundManager::LoadFromPack( const T& id, cPack* Pack, const std::string& FilePackPath ) { +bool tSoundManager::LoadFromPack( const T& id, Pack* Pack, const std::string& FilePackPath ) { if ( tSounds.find( id ) == tSounds.end() ) { // if id doesn't exists sSound * tSound = &tSounds[id]; diff --git a/include/eepp/audio/soundstream.hpp b/include/eepp/audio/soundstream.hpp index 3b47b08a5..c93fdd3e5 100755 --- a/include/eepp/audio/soundstream.hpp +++ b/include/eepp/audio/soundstream.hpp @@ -7,7 +7,7 @@ namespace EE { namespace Audio { /** @brief Abstract base class for streamed audio sources */ -class EE_API SoundStream : private cThread, private Sound { +class EE_API SoundStream : private Thread, private Sound { public: using Sound::Pause; using Sound::Pitch; @@ -69,12 +69,12 @@ class EE_API SoundStream : private cThread, private Sound { /** @brief Get the current playing position of the stream ** @return Current playing position, from the beginning of the stream. */ - cTime PlayingOffset() const; + Time PlayingOffset() const; /** @brief Change the current playing position of the stream ** The playing position can be changed when the stream is either paused or playing. ** @param timeOffset New playing position, from the beginning of the stream. */ - void PlayingOffset( const cTime &timeOffset ); + void PlayingOffset( const Time &timeOffset ); /** Set the stream loop state. This parameter is disabled by default * @param Loop True to play in loop, false to play once @@ -94,7 +94,7 @@ class EE_API SoundStream : private cThread, private Sound { virtual bool OnGetData( Chunk& Data ) = 0; - virtual void OnSeek( cTime timeOffset ) = 0; + virtual void OnSeek( Time timeOffset ) = 0; /** Fill a new buffer with audio data, and push it to the playing queue * @param Buffer Buffer to fill diff --git a/include/eepp/gaming/base.hpp b/include/eepp/gaming/base.hpp index a3e5ce5e3..a0ba6e9d3 100644 --- a/include/eepp/gaming/base.hpp +++ b/include/eepp/gaming/base.hpp @@ -10,10 +10,10 @@ using namespace EE::Math; #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include using namespace EE::System; diff --git a/include/eepp/gaming/cmap.hpp b/include/eepp/gaming/cmap.hpp index 47a21b58b..ad643531f 100644 --- a/include/eepp/gaming/cmap.hpp +++ b/include/eepp/gaming/cmap.hpp @@ -50,15 +50,15 @@ class EE_API cMap { virtual bool Load( const std::string& path ); - virtual bool LoadFromStream( cIOStream& IOS ); + virtual bool LoadFromStream( IOStream& IOS ); - virtual bool LoadFromPack( cPack * Pack, const std::string& FilePackPath ); + virtual bool LoadFromPack( Pack * Pack, const std::string& FilePackPath ); virtual bool LoadFromMemory( const char * Data, const Uint32& DataSize ); virtual void Save( const std::string& path ); - virtual void SaveToStream( cIOStream& IOS ); + virtual void SaveToStream( IOStream& IOS ); virtual void Draw(); diff --git a/include/eepp/gaming/mapeditor/cmapeditor.hpp b/include/eepp/gaming/mapeditor/cmapeditor.hpp index 0ae026643..d5b0de934 100644 --- a/include/eepp/gaming/mapeditor/cmapeditor.hpp +++ b/include/eepp/gaming/mapeditor/cmapeditor.hpp @@ -90,7 +90,7 @@ class EE_API cMapEditor { void OnBlueChange( const cUIEvent * Event ); - void CreateLightContainer(); + void CreateLighContainer(); cUISelectButton * AddObjContButton( String text , Uint32 mode ); diff --git a/include/eepp/graphics/base.hpp b/include/eepp/graphics/base.hpp index ee54b370d..da0f670c7 100644 --- a/include/eepp/graphics/base.hpp +++ b/include/eepp/graphics/base.hpp @@ -6,19 +6,18 @@ #include #include #include -#include #include using namespace EE::Math; #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include using namespace EE::System; diff --git a/include/eepp/graphics/cconsole.hpp b/include/eepp/graphics/cconsole.hpp index a324cb6b1..064c1e073 100755 --- a/include/eepp/graphics/cconsole.hpp +++ b/include/eepp/graphics/cconsole.hpp @@ -13,7 +13,7 @@ using namespace EE::Window; namespace EE { namespace Graphics { -class EE_API cConsole : protected iLogReader { +class EE_API cConsole : protected LogReaderInterface { public: //! The Console Callback return a vector of parameters ( String ) typedef cb::Callback1& > ConsoleCallback; @@ -81,15 +81,15 @@ class EE_API cConsole : protected iLogReader { bool Expand() const { return mExpand; } /** Set the fade time */ - void FadeSpeed( const cTime& fadespeed ) { mFadeSpeed = fadespeed; } + void FadeSpeed( const Time& fadespeed ) { mFadeSpeed = fadespeed; } /** @return The fading speed in ms */ - const cTime& FadeSpeed() const { return mFadeSpeed; } + const Time& FadeSpeed() const { return mFadeSpeed; } /** @brief Creates the new console * @param Font The cFont pointer to class * @param MakeDefaultCommands Register the default commands provided by the class? - * @param AttachToLog Attach the console to the cLog instance + * @param AttachToLog Attach the console to the Log instance * @param MaxLogLines Maximun number of lines stored on the console * @param TextureId Background texture id ( 0 for no texture ) */ @@ -142,7 +142,7 @@ class EE_API cConsole : protected iLogReader { Float mMaxAlpha; Float mTempY; Float mFontSize; - cTime mFadeSpeed; + Time mFadeSpeed; Uint32 mMyCallback; Uint32 mVidCb; diff --git a/include/eepp/graphics/cfontmanager.hpp b/include/eepp/graphics/cfontmanager.hpp index 97f11fee2..2036823ce 100644 --- a/include/eepp/graphics/cfontmanager.hpp +++ b/include/eepp/graphics/cfontmanager.hpp @@ -9,7 +9,7 @@ namespace EE { namespace Graphics { /** @brief The Font Manager is a singleton class that manages all the instance of fonts instanciated. And releases the font instances automatically. So the user doesn't need to release any font instance. */ -class EE_API cFontManager : public tResourceManager { +class EE_API cFontManager : public ResourceManager { SINGLETON_DECLARE_HEADERS(cFontManager) public: diff --git a/include/eepp/graphics/cimage.hpp b/include/eepp/graphics/cimage.hpp index 1a7295b77..5539b54ad 100644 --- a/include/eepp/graphics/cimage.hpp +++ b/include/eepp/graphics/cimage.hpp @@ -13,7 +13,7 @@ using namespace EE::System; #include namespace EE { namespace System { -class cPack; +class Pack; }} namespace EE { namespace Graphics { @@ -77,7 +77,7 @@ class EE_API cImage { * @param FilePackPath The path of the file inside the pack file. * @param forceChannels Number of channels to use for the image, default 0 means that it use the default image channels. */ - cImage( cPack * Pack, std::string FilePackPath, const unsigned int& forceChannels = 0 ); + cImage( Pack * Pack, std::string FilePackPath, const unsigned int& forceChannels = 0 ); virtual ~cImage(); @@ -186,7 +186,7 @@ class EE_API cImage { void Allocate( const Uint32& size, eeColorA DefaultColor = eeColorA(0,0,0,0), bool memsetData = true ); - void LoadFromPack( cPack * Pack, const std::string& FilePackPath ); + void LoadFromPack( Pack * Pack, const std::string& FilePackPath ); }; }} diff --git a/include/eepp/graphics/cparticlesystem.hpp b/include/eepp/graphics/cparticlesystem.hpp index 2cdb29d03..0bea21ca9 100755 --- a/include/eepp/graphics/cparticlesystem.hpp +++ b/include/eepp/graphics/cparticlesystem.hpp @@ -74,7 +74,7 @@ class EE_API cParticleSystem { /** Update the particles effect * @param Time The time transcurred between the last update. */ - void Update(const cTime &Time ); + void Update(const Time &time ); /** Update the particles effect taking the elapsed time from cEngine */ void Update(); diff --git a/include/eepp/graphics/cscrollparallax.hpp b/include/eepp/graphics/cscrollparallax.hpp index 1df22a032..7bd10d6ef 100755 --- a/include/eepp/graphics/cscrollparallax.hpp +++ b/include/eepp/graphics/cscrollparallax.hpp @@ -85,7 +85,7 @@ class EE_API cScrollParallax { eeVector2f mSpeed; eeSizef mSize; eeRecti mRect; - cClock mElapsed; + Clock mElapsed; eeVector2i mTiles; eeRectf mAABB; eeSizef mRealSize; diff --git a/include/eepp/graphics/cshader.hpp b/include/eepp/graphics/cshader.hpp index 1d7072bff..3516c5ea7 100644 --- a/include/eepp/graphics/cshader.hpp +++ b/include/eepp/graphics/cshader.hpp @@ -24,7 +24,7 @@ class EE_API cShader { cShader( const Uint32& Type, const char * Data, const Uint32& DataSize ); /** Create a type of shader loaded from a pack file */ - cShader( const Uint32& Type, cPack * Pack, const std::string& Filename ); + cShader( const Uint32& Type, Pack * Pack, const std::string& Filename ); /** Create a type of shader from memory, and compile it. */ cShader( const Uint32& Type, const char ** Data, const Uint32& NumLines ); @@ -87,7 +87,7 @@ class EE_API cVertexShader : public cShader { cVertexShader(); cVertexShader( const std::string& Filename ); cVertexShader( const char * Data, const Uint32& DataSize ); - cVertexShader( cPack * Pack, const std::string& Filename ); + cVertexShader( Pack * Pack, const std::string& Filename ); cVertexShader( const char ** Data, const Uint32& NumLines ); }; @@ -97,7 +97,7 @@ class EE_API cFragmentShader : public cShader { cFragmentShader(); cFragmentShader( const std::string& Filename ); cFragmentShader( const char * Data, const Uint32& DataSize ); - cFragmentShader( cPack * Pack, const std::string& Filename ); + cFragmentShader( Pack * Pack, const std::string& Filename ); cFragmentShader( const char ** Data, const Uint32& NumLines ); }; diff --git a/include/eepp/graphics/cshaderprogram.hpp b/include/eepp/graphics/cshaderprogram.hpp index 8ba32321b..ffefce2f1 100644 --- a/include/eepp/graphics/cshaderprogram.hpp +++ b/include/eepp/graphics/cshaderprogram.hpp @@ -25,7 +25,7 @@ class EE_API cShaderProgram { static cShaderProgram * New( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& name = "" ); /** Creates the vertex shader and fragment shader from two files inside a pack */ - static cShaderProgram * New( cPack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name = "" ); + static cShaderProgram * New( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name = "" ); /** Creates the vertex and fragment shader from an array of strings */ static cShaderProgram * New( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& name = "" ); @@ -164,7 +164,7 @@ class EE_API cShaderProgram { cShaderProgram( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& name = "" ); /** Constructor that creates the vertex shader and fragment shader from two files inside a pack */ - cShaderProgram( cPack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name = "" ); + cShaderProgram( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name = "" ); /** Constructor that creates the vertex and fragment shader from an array of strings */ cShaderProgram( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& name = "" ); diff --git a/include/eepp/graphics/cshaderprogrammanager.hpp b/include/eepp/graphics/cshaderprogrammanager.hpp index 98fc8887c..c466ece63 100644 --- a/include/eepp/graphics/cshaderprogrammanager.hpp +++ b/include/eepp/graphics/cshaderprogrammanager.hpp @@ -8,7 +8,7 @@ namespace EE { namespace Graphics { /** @brief The Shader Program Manager is a singleton class that manages all the instances of Shader Programs instanciated. Releases the Shader Program instances automatically. So the user doesn't need to release any Shader Program instance. */ -class EE_API cShaderProgramManager : public tResourceManager { +class EE_API cShaderProgramManager : public ResourceManager { SINGLETON_DECLARE_HEADERS(cShaderProgramManager) public: diff --git a/include/eepp/graphics/csprite.hpp b/include/eepp/graphics/csprite.hpp index c8990f6bd..cd8cb7268 100755 --- a/include/eepp/graphics/csprite.hpp +++ b/include/eepp/graphics/csprite.hpp @@ -342,7 +342,7 @@ class EE_API cSprite { cSprite * Copy(); /** Update the sprite animation */ - void Update( const cTime& ElapsedTime ); + void Update( const Time& ElapsedTime ); /** Update the sprite animation using the current elapsed time provided by cEngine */ void Update(); diff --git a/include/eepp/graphics/ctextureatlas.hpp b/include/eepp/graphics/ctextureatlas.hpp index ebf9efe79..b7d91b243 100644 --- a/include/eepp/graphics/ctextureatlas.hpp +++ b/include/eepp/graphics/ctextureatlas.hpp @@ -9,7 +9,7 @@ namespace EE { namespace Graphics { /** @brief The texture atlas class represents a large image containing a collection of sub-images, or "atlas" which contains many smaller sub-images. * The texture atlas in eepp can represent more than one texture or image, but the common use should be a image with sub-images. * More information about Texture Atlases: http://en.wikipedia.org/wiki/Texture_atlas */ -class EE_API cTextureAtlas : public tResourceManager { +class EE_API cTextureAtlas : public ResourceManager { public: /** Creates a new texture atlas with the given name. */ cTextureAtlas( const std::string& name = "" ); diff --git a/include/eepp/graphics/ctextureatlasloader.hpp b/include/eepp/graphics/ctextureatlasloader.hpp index d0fafbcd7..aae08eea7 100644 --- a/include/eepp/graphics/ctextureatlasloader.hpp +++ b/include/eepp/graphics/ctextureatlasloader.hpp @@ -5,8 +5,8 @@ #include #include #include -#include -#include +#include +#include namespace EE { namespace Graphics { @@ -47,7 +47,7 @@ class EE_API cTextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - cTextureAtlasLoader( cPack * Pack, const std::string& FilePackPath, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); + cTextureAtlasLoader( Pack * Pack, const std::string& FilePackPath, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); /** Loads a texture atlas from a io stream. * If the loader is not threaded, it will load the atlas immediately. @@ -55,7 +55,7 @@ class EE_API cTextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - cTextureAtlasLoader( cIOStream& IOS, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); + cTextureAtlasLoader( IOStream& IOS, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); ~cTextureAtlasLoader(); @@ -72,7 +72,7 @@ class EE_API cTextureAtlasLoader { * If the loader is not threaded, it will load the atlas immediately. * @param IOS The io stream to use for the loading. */ - void LoadFromStream( cIOStream& IOS ); + void LoadFromStream( IOStream& IOS ); /** Loads a texture atlas from memory. * If the loader is not threaded, it will load the atlas immediately. @@ -87,7 +87,7 @@ class EE_API cTextureAtlasLoader { * @param Pack The pointer of the pack instance to be used to load the file. * @param FilePackPath The path of the file inside the pack. */ - void LoadFromPack( cPack * Pack, const std::string& FilePackPath ); + void LoadFromPack( Pack * Pack, const std::string& FilePackPath ); /** @return If the loader is threaded ( asynchronous ). */ bool Threaded() const; @@ -123,11 +123,11 @@ class EE_API cTextureAtlasLoader { /** Sets a load notification callback. */ void SetLoadCallback( GLLoadCallback LoadCallback ); protected: - cResourceLoader mRL; + ResourceLoader mRL; std::string mTextureAtlasPath; bool mThreaded; bool mLoaded; - cPack * mPack; + Pack * mPack; bool mSkipResourceLoad; bool mIsLoading; cTextureAtlas * mTextureAtlas; diff --git a/include/eepp/graphics/ctextureatlasmanager.hpp b/include/eepp/graphics/ctextureatlasmanager.hpp index 8a30b8992..0189545b9 100644 --- a/include/eepp/graphics/ctextureatlasmanager.hpp +++ b/include/eepp/graphics/ctextureatlasmanager.hpp @@ -9,7 +9,7 @@ namespace EE { namespace Graphics { /** @brief The Texture Atlas Manager is a singleton class that manages all the instances of Texture Atlases instanciated. Releases the Texture Atlases instances automatically. So the user doesn't need to release any Texture Atlas instance. */ -class EE_API cTextureAtlasManager : public tResourceManager { +class EE_API cTextureAtlasManager : public ResourceManager { SINGLETON_DECLARE_HEADERS(cTextureAtlasManager) public: @@ -19,13 +19,13 @@ class EE_API cTextureAtlasManager : public tResourceManager { cTextureAtlas * Load( const std::string& TextureAtlasPath ); /** Loads a texture atlas from a io stream. */ - cTextureAtlas * LoadFromStream( cIOStream& IOS ); + cTextureAtlas * LoadFromStream( IOStream& IOS ); /** Loads a texture atlas from memory. */ cTextureAtlas * LoadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ); /** Loads a texture atlas from a pack file. */ - cTextureAtlas * LoadFromPack( cPack * Pack, const std::string& FilePackPath ); + cTextureAtlas * LoadFromPack( Pack * Pack, const std::string& FilePackPath ); /** It will search for a SubTexture Name in the texture atlases loaded. * @return The first SubTexture found with the given name in any atlas. */ diff --git a/include/eepp/graphics/ctexturefactory.hpp b/include/eepp/graphics/ctexturefactory.hpp index a3fd28c63..ddec72b28 100755 --- a/include/eepp/graphics/ctexturefactory.hpp +++ b/include/eepp/graphics/ctexturefactory.hpp @@ -2,14 +2,14 @@ #define EECTEXTUREFACTORY_H #include -#include +#include namespace EE { namespace Graphics { class cTexture; /** @brief The Texture Manager Class. Here we do all the textures stuff. (Singleton Class) */ -class EE_API cTextureFactory : protected cMutex { +class EE_API cTextureFactory : protected Mutex { SINGLETON_DECLARE_HEADERS(cTextureFactory) public: @@ -49,7 +49,7 @@ class EE_API cTextureFactory : protected cMutex { * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @return Internal Texture Id */ - Uint32 LoadFromPack( cPack* Pack, const std::string& FilePackPath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + Uint32 LoadFromPack( Pack* Pack, const std::string& FilePackPath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Load a texture from memory * @param ImagePtr The image data in RAM just as if it were still in a file @@ -63,14 +63,14 @@ class EE_API cTextureFactory : protected cMutex { Uint32 LoadFromMemory( const unsigned char* ImagePtr, const unsigned int& Size, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Load a Texture from stream - * @param Stream The cIOStream instance + * @param Stream The IOStream instance * @param Mipmap Use mipmaps? * @param ClampMode Defines the CLAMP MODE * @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 ) * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @return The internal Texture Id */ - Uint32 LoadFromStream( cIOStream& Stream, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + Uint32 LoadFromStream( IOStream& Stream, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Load a Texture from a file path * @param Filepath The path for the texture diff --git a/include/eepp/graphics/ctexturefont.hpp b/include/eepp/graphics/ctexturefont.hpp index c68b8bef9..ae102d9c8 100755 --- a/include/eepp/graphics/ctexturefont.hpp +++ b/include/eepp/graphics/ctexturefont.hpp @@ -40,7 +40,7 @@ class EE_API cTextureFont : public cFont { * @param FilePackPath The path of the file inside the pack * @return True success */ - bool LoadFromPack( const Uint32& TexId, cPack * Pack, const std::string& FilePackPath ); + bool LoadFromPack( const Uint32& TexId, Pack * Pack, const std::string& FilePackPath ); /** Load's a texture font and then load's the character coordinates file previously loaded on memory ( generated by the cTTFFont class ) * @param TexId The texture id returned by cTextureFactory @@ -55,7 +55,7 @@ class EE_API cTextureFont : public cFont { * @param IOS IO stream file for the coordinates * @return True if success */ - bool LoadFromStream( const Uint32& TexId, cIOStream& IOS ); + bool LoadFromStream( const Uint32& TexId, IOStream& IOS ); private: unsigned int mStartChar; unsigned int mTexColumns; diff --git a/include/eepp/graphics/ctexturefontloader.hpp b/include/eepp/graphics/ctexturefontloader.hpp index 766487833..0549e5e52 100644 --- a/include/eepp/graphics/ctexturefontloader.hpp +++ b/include/eepp/graphics/ctexturefontloader.hpp @@ -4,14 +4,14 @@ #include #include #include -#include +#include #include namespace EE { namespace Graphics { /** @brief The Texture Font loads a texture font in synchronous or asynchronous mode. -@see cObjectLoader */ -class EE_API cTextureFontLoader : public cObjectLoader { +@see ObjectLoader */ +class EE_API cTextureFontLoader : public ObjectLoader { public: /** Loads a texture font from a texture ( only for monospaced fonts ) * @param FontName The font name @@ -37,7 +37,7 @@ class EE_API cTextureFontLoader : public cObjectLoader { * @param Pack The pack used to load the characters coordinates * @param FilePackPath The character coordinates file path inside the pack ( this is the file created when the TTF font was converted to a texture font. @see cTTFFont::Save ). */ - cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, cPack * Pack, const std::string& FilePackPath ); + cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, Pack * Pack, const std::string& FilePackPath ); /** Load's a texture font and then load's the character coordinates file ( generated by the cTTFFont class ) from memory. * @param FontName The font name @@ -50,7 +50,7 @@ class EE_API cTextureFontLoader : public cObjectLoader { virtual ~cTextureFontLoader(); /** Updates the current state of the loading in progress ( must be called from the instancer thread, usually the main thread ). - * @see cObjectLoader::Update */ + * @see ObjectLoader::Update */ void Update(); /** @brief Releases the font loaded ( if was already loaded ) */ @@ -85,7 +85,7 @@ class EE_API cTextureFontLoader : public cObjectLoader { unsigned int mTexRows; unsigned int mNumChars; - cPack * mPack; + Pack * mPack; const char * mData; Uint32 mDataSize; diff --git a/include/eepp/graphics/ctextureloader.hpp b/include/eepp/graphics/ctextureloader.hpp index 6bf0e40eb..3714afb74 100644 --- a/include/eepp/graphics/ctextureloader.hpp +++ b/include/eepp/graphics/ctextureloader.hpp @@ -2,16 +2,16 @@ #define EE_GRAPHICSCTEXTURELOADER #include -#include +#include namespace EE { namespace Graphics { class cTexture; /** @brief The Texture loader loads a texture in synchronous or asynchronous mode. -@see cObjectLoader +@see ObjectLoader */ -class EE_API cTextureLoader : public cObjectLoader { +class EE_API cTextureLoader : public ObjectLoader { public: /** Load a Texture from stream * @param Stream The io stream instance @@ -20,7 +20,7 @@ class EE_API cTextureLoader : public cObjectLoader { * @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 ) * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) */ - cTextureLoader( cIOStream& Stream, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + cTextureLoader( IOStream& Stream, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Load a Texture from a file path * @param Filepath The path for the texture @@ -49,7 +49,7 @@ class EE_API cTextureLoader : public cObjectLoader { * @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 ) * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) */ - cTextureLoader( cPack * Pack, const std::string& FilePackPath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + cTextureLoader( Pack * Pack, const std::string& FilePackPath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Loads a RAW Texture from Memory * @param Pixels The Texture array @@ -70,7 +70,7 @@ class EE_API cTextureLoader : public cObjectLoader { void SetColorKey( eeColor Color ); /** This must be called for the asynchronous mode to update the texture data to the GPU, the call must be done from the same thread that the GL context was created ( the main thread ). - ** @see cObjectLoader::Update */ + ** @see ObjectLoader::Update */ void Update(); /** @brief Releases the texture loaded ( if was already loaded ), it will destroy the texture from memory. */ @@ -99,8 +99,8 @@ class EE_API cTextureLoader : public cObjectLoader { EE_CLAMP_MODE mClampMode; bool mCompressTexture; bool mLocalCopy; - cPack * mPack; - cIOStream * mStream; + Pack * mPack; + IOStream * mStream; const Uint8 * mImagePtr; Uint32 mSize; @@ -116,7 +116,7 @@ class EE_API cTextureLoader : public cObjectLoader { int mImgType; int mIsCompressed; - cClock mTE; + Clock mTE; void LoadFile(); void LoadFromPath(); diff --git a/include/eepp/graphics/cttffont.hpp b/include/eepp/graphics/cttffont.hpp index 5a941ef99..ef0a90add 100755 --- a/include/eepp/graphics/cttffont.hpp +++ b/include/eepp/graphics/cttffont.hpp @@ -54,7 +54,7 @@ class EE_API cTTFFont : public cFont { * @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling * @return If success */ - bool LoadFromPack( cPack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true ); + bool LoadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true ); /** Loads a True Type Font from memory * @param TTFData The pointer to the data diff --git a/include/eepp/graphics/cttffontloader.hpp b/include/eepp/graphics/cttffontloader.hpp index 698194ce5..d0cef3171 100644 --- a/include/eepp/graphics/cttffontloader.hpp +++ b/include/eepp/graphics/cttffontloader.hpp @@ -4,14 +4,14 @@ #include #include #include -#include +#include namespace EE { namespace Graphics { /** @brief The TTF Font loader loads a true type font to memory in synchronous or asynchronous mode. -@see cObjectLoader +@see ObjectLoader */ -class EE_API cTTFFontLoader : public cObjectLoader { +class EE_API cTTFFontLoader : public ObjectLoader { public: /** Load a True Type Font from path * @param FontName The font name @@ -38,7 +38,7 @@ class EE_API cTTFFontLoader : public cObjectLoader { * @param OutlineColor The Outline Color * @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling */ - cTTFFontLoader( const std::string& FontName, cPack * Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true ); + cTTFFontLoader( const std::string& FontName, Pack * Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const eeColor& FontColor = eeColor(), const Uint8& OutlineSize = 0, const eeColor& OutlineColor = eeColor(0,0,0), const bool& AddPixelSeparator = true ); /** Loads a True Type Font from memory * @param FontName The font name @@ -58,7 +58,7 @@ class EE_API cTTFFontLoader : public cObjectLoader { /** This must be called for the asynchronous mode to update the texture data to the GPU, the call must be done from the same thread that the GL Context was created ( the main thread ). ** The TTF Font creates texture from the data obtained from the true type file. - ** @see cObjectLoader::Update */ + ** @see ObjectLoader::Update */ void Update(); /** Releases the Font instance and the texture loaded ( if was already loaded ), it will destroy the font texture from memory */ @@ -90,7 +90,7 @@ class EE_API cTTFFontLoader : public cObjectLoader { Uint8 mOutlineSize; eeColor mOutlineColor; bool mAddPixelSeparator; - cPack * mPack; + Pack * mPack; Uint8 * mData; unsigned int mDataSize; diff --git a/include/eepp/math/cinterpolation.hpp b/include/eepp/math/cinterpolation.hpp index da637121f..ac869d93d 100644 --- a/include/eepp/math/cinterpolation.hpp +++ b/include/eepp/math/cinterpolation.hpp @@ -2,7 +2,7 @@ #define EE_MATHCINTERPOLATION_H #include -#include +#include #include using namespace EE::System; @@ -53,7 +53,7 @@ class EE_API cInterpolation { void SetStepCallback( OnStepCallback StepCallback ); /** Update the movement interpolation */ - void Update( const cTime& Elapsed ); + void Update( const Time& Elapsed ); /** Reset the class */ void Reset(); @@ -88,7 +88,7 @@ class EE_API cInterpolation { void Enabled( const bool& Enabled ); /** Instead if setting the time between every waypoing, this set a total time for all the movement interpolation. */ - void SetTotalTime( const cTime& TotTime ); + void SetTotalTime( const Time& TotTime ); /** @return the vector of points */ const std::vector& GetPoints() const; diff --git a/include/eepp/math/cwaypoints.hpp b/include/eepp/math/cwaypoints.hpp index 5ad71bdd4..a994929a8 100755 --- a/include/eepp/math/cwaypoints.hpp +++ b/include/eepp/math/cwaypoints.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include using namespace EE::System; @@ -57,7 +57,7 @@ class EE_API cWaypoints { void SetStepCallback( OnStepCallback StepCallback ); /** Update the movement interpolation */ - void Update( const cTime& Elapsed ); + void Update( const Time& Elapsed ); /** Reset the class */ void Reset(); @@ -78,7 +78,7 @@ class EE_API cWaypoints { bool Ended() const; /** Instead if setting the time between every waypoing, this set a total time for all the movement interpolation. */ - void SetTotalTime( const cTime & TotTime ); + void SetTotalTime( const Time & TotTime ); /** @return The Current Node */ cWaypoint * GetCurrentActual() const; diff --git a/include/eepp/network/ftp.hpp b/include/eepp/network/ftp.hpp index d17957c42..9d6522362 100644 --- a/include/eepp/network/ftp.hpp +++ b/include/eepp/network/ftp.hpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include @@ -174,14 +174,14 @@ public: ** This function tries to connect to the server so it may take ** a while to complete, especially if the server is not ** reachable. To avoid blocking your application for too long, - ** you can use a timeout. The default value, cTime::Zero, means that the + ** you can use a timeout. The default value, Time::Zero, means that the ** system timeout will be used (which is usually pretty long). ** @param server Name or address of the FTP server to connect to ** @param port Port used for the connection ** @param timeout Maximum time to wait ** @return Server response to the request ** @see Disconnect */ - Response Connect(const IpAddress& server, unsigned short port = 21, cTime timeout = cTime::Zero); + Response Connect(const IpAddress& server, unsigned short port = 21, Time timeout = Time::Zero); /** @brief Close the connection with the server ** @return Server response to the request diff --git a/include/eepp/network/http.hpp b/include/eepp/network/http.hpp index 2d2d968d2..35d946c18 100644 --- a/include/eepp/network/http.hpp +++ b/include/eepp/network/http.hpp @@ -5,11 +5,11 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -265,12 +265,12 @@ class EE_API Http : NonCopyable { ** Warning: this function waits for the server's response and may ** not return instantly; use a thread if you don't want to block your ** application, or use a timeout to limit the time to wait. A value - ** of cTime::Zero means that the client will use the system defaut timeout + ** of Time::Zero means that the client will use the system defaut timeout ** (which is usually pretty long). ** @param request Request to send ** @param timeout Maximum time to wait ** @return Server's response */ - Response SendRequest(const Request& request, cTime timeout = cTime::Zero); + Response SendRequest(const Request& request, Time timeout = Time::Zero); /** Definition of the async callback response */ typedef cb::Callback3 AsyncResponseCallback; @@ -278,7 +278,7 @@ class EE_API Http : NonCopyable { /** @brief Sends the request and creates a new thread, when got the response informs the result to the callback. ** This function does not lock the caller thread. ** @see SendRequest */ - void SendAsyncRequest( AsyncResponseCallback cb, const Http::Request& request, cTime timeout = cTime::Zero ); + void SendAsyncRequest( AsyncResponseCallback cb, const Http::Request& request, Time timeout = Time::Zero ); /** @return The host address */ const IpAddress& GetHost() const; @@ -289,9 +289,9 @@ class EE_API Http : NonCopyable { /** @return The host port */ const unsigned short& GetPort() const; private: - class cAsyncRequest : public cThread { + class cAsyncRequest : public Thread { public: - cAsyncRequest( Http * http, AsyncResponseCallback cb, Http::Request request, cTime timeout ); + cAsyncRequest( Http * http, AsyncResponseCallback cb, Http::Request request, Time timeout ); void Run(); protected: @@ -299,16 +299,16 @@ class EE_API Http : NonCopyable { Http * mHttp; AsyncResponseCallback mCb; Http::Request mRequest; - cTime mTimeout; + Time mTimeout; bool mRunning; }; friend class cAsyncRequest; - tThreadLocalPtr mConnection; ///< Connection to the host + ThreadLocalPtr mConnection; ///< Connection to the host IpAddress mHost; ///< Web host address std::string mHostName; ///< Web host name unsigned short mPort; ///< Port used for connection with host std::list mThreads; - cMutex mThreadsMutex; + Mutex mThreadsMutex; bool mIsSSL; void RemoveOldThreads(); diff --git a/include/eepp/network/ipaddress.hpp b/include/eepp/network/ipaddress.hpp index 89a877ee7..7e46592e0 100644 --- a/include/eepp/network/ipaddress.hpp +++ b/include/eepp/network/ipaddress.hpp @@ -2,7 +2,7 @@ #define EE_NETWORKCIPADDRESS_HPP #include -#include +#include using namespace EE::System; #include @@ -96,7 +96,7 @@ class EE_API IpAddress ** @param timeout Maximum time to wait ** @return Public IP address of the computer ** @see GetLocalAddress */ - static IpAddress GetPublicAddress(cTime timeout = cTime::Zero); + static IpAddress GetPublicAddress(Time timeout = Time::Zero); // Static member data static const IpAddress None; ///< Value representing an empty/invalid address diff --git a/include/eepp/network/socketselector.hpp b/include/eepp/network/socketselector.hpp index 1cebe75ad..b74a6ea56 100644 --- a/include/eepp/network/socketselector.hpp +++ b/include/eepp/network/socketselector.hpp @@ -2,7 +2,7 @@ #define EE_NETWORKCSOCKETSELECTOR_HPP #include -#include +#include using namespace EE::System; namespace EE { namespace Network { @@ -52,10 +52,10 @@ class EE_API SocketSelector ** ready, use the isReady function. ** If you use a timeout and no socket is ready before the timeout ** is over, the function returns false. - ** @param timeout Maximum time to wait, (use cTime::Zero for infinity) + ** @param timeout Maximum time to wait, (use Time::Zero for infinity) ** @return True if there are sockets ready, false otherwise ** @see IsReady */ - bool Wait(cTime timeout = cTime::Zero); + bool Wait(Time timeout = Time::Zero); /** @brief Test a socket to know if it is ready to receive data ** This function must be used after a call to Wait, to know diff --git a/include/eepp/network/ssl/sslsocket.hpp b/include/eepp/network/ssl/sslsocket.hpp index a2d3d2eb9..90a8a2d53 100644 --- a/include/eepp/network/ssl/sslsocket.hpp +++ b/include/eepp/network/ssl/sslsocket.hpp @@ -22,7 +22,7 @@ class EE_API SSLSocket : public TcpSocket { virtual ~SSLSocket(); - Status Connect(const IpAddress& remoteAddress, unsigned short remotePort, cTime timeout = cTime::Zero); + Status Connect(const IpAddress& remoteAddress, unsigned short remotePort, Time timeout = Time::Zero); void Disconnect(); diff --git a/include/eepp/network/tcpsocket.hpp b/include/eepp/network/tcpsocket.hpp index af52ca7dd..73c52a17b 100644 --- a/include/eepp/network/tcpsocket.hpp +++ b/include/eepp/network/tcpsocket.hpp @@ -2,7 +2,7 @@ #define EE_NETWORKCTCPSOCKET_HPP #include -#include +#include using namespace EE::System; namespace EE { namespace Network { @@ -48,7 +48,7 @@ class EE_API TcpSocket : public Socket { ** @param timeout Optional maximum time to wait ** @return Status code ** @see Disconnect */ - virtual Status Connect(const IpAddress& remoteAddress, unsigned short remotePort, cTime timeout = cTime::Zero); + virtual Status Connect(const IpAddress& remoteAddress, unsigned short remotePort, Time timeout = Time::Zero); /** @brief Disconnect the socket from its remote peer ** This function gracefully closes the connection. If the diff --git a/include/eepp/physics/base.hpp b/include/eepp/physics/base.hpp index 607447286..357bcddb8 100644 --- a/include/eepp/physics/base.hpp +++ b/include/eepp/physics/base.hpp @@ -12,7 +12,7 @@ using namespace EE::Math; #include #include -#include +#include using namespace EE::System; //! Default settings are defined here diff --git a/include/eepp/system.hpp b/include/eepp/system.hpp index 7904ac072..66238a653 100644 --- a/include/eepp/system.hpp +++ b/include/eepp/system.hpp @@ -5,24 +5,24 @@ #include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/include/eepp/system/cclock.hpp b/include/eepp/system/cclock.hpp deleted file mode 100644 index 770e5ee78..000000000 --- a/include/eepp/system/cclock.hpp +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef EE_SYSTEMCTIMER_H -#define EE_SYSTEMCTIMER_H - -#include -#include - -namespace EE { namespace System { - -namespace Platform { class cClockImpl; } - -class EE_API cClock { - public: - /** Clock constructor. Must be called from the same thread that calls GetElapsedTime() */ - cClock(); - - ~cClock(); - - /** Restarts the timer */ - void Restart(); - - /** @returns time since initialisation or last reset */ - cTime GetElapsedTime() const; - - /** Time in time elapsed between this call and the last call to Elapsed() - * This is the equivalent to call GetElapsedTime() and then Restart(). - */ - cTime Elapsed(); - private: - Platform::cClockImpl * mClockImpl; -}; - -}} -#endif diff --git a/include/eepp/system/clock.hpp b/include/eepp/system/clock.hpp index 9e9032b75..f86f9e854 100644 --- a/include/eepp/system/clock.hpp +++ b/include/eepp/system/clock.hpp @@ -1,28 +1,33 @@ -#ifndef EE_SYSTEM_CLOCK_HPP -#define EE_SYSTEM_CLOCK_HPP +#ifndef EE_SYSTEMCTIMER_H +#define EE_SYSTEMCTIMER_H -#include -#include +#include +#include namespace EE { namespace System { -class cMutex; +namespace Platform { class ClockImpl; } -/** @brief Automatic wrapper for locking and unlocking mutexes */ -class EE_API cLock : NonCopyable { - public : - /** @brief Construct the lock with a target mutex - * The mutex passed to cLock is automatically locked. - * @param mutex Mutex to lock */ - explicit cLock( cMutex& mutex ); +class EE_API Clock { + public: + /** Clock constructor. Must be called from the same thread that calls GetElapsedTime() */ + Clock(); - /** @brief Destructor - * The destructor of cLock automatically unlocks its mutex. */ - ~cLock(); - private : - cMutex& mMutex; ///< Mutex to lock / unlock + ~Clock(); + + /** Restarts the timer */ + void Restart(); + + /** @returns time since initialisation or last reset */ + Time GetElapsedTime() const; + + /** Time in time elapsed between this call and the last call to Elapsed() + * This is the equivalent to call GetElapsedTime() and then Restart(). + */ + Time Elapsed(); + private: + Platform::ClockImpl * mClockImpl; }; }} - -#endif +#endif diff --git a/include/eepp/system/colors.hpp b/include/eepp/system/colors.hpp index 0a36fc7be..6709c5d27 100755 --- a/include/eepp/system/colors.hpp +++ b/include/eepp/system/colors.hpp @@ -192,9 +192,9 @@ template const tColorA tColorA::Black = tColorA(0,0,0,255); typedef tColor eeColor; -typedef tColor eeColorf; +typedef tColor eeColorf; typedef tColorA eeColorA; -typedef tColorA eeColorAf; +typedef tColorA eeColorAf; typedef tColorA eeColorAff; //! @brief Small class to help in some color operations diff --git a/include/eepp/system/ccondition.hpp b/include/eepp/system/condition.hpp similarity index 95% rename from include/eepp/system/ccondition.hpp rename to include/eepp/system/condition.hpp index 0ba3aa7ac..a81e6791f 100755 --- a/include/eepp/system/ccondition.hpp +++ b/include/eepp/system/condition.hpp @@ -6,10 +6,10 @@ namespace EE { namespace System { -namespace Platform { class cConditionImpl; } +namespace Platform { class ConditionImpl; } /** @brief Blocks concurrent access to shared resources from multiple threads */ -class EE_API cCondition : NonCopyable { +class EE_API Condition : NonCopyable { public: //! Constants for arg 2 of WaitAndLock() enum LockType @@ -21,12 +21,12 @@ class EE_API cCondition : NonCopyable { /** Initializes a Condition object and sets its internal value to value. * Thus using WaitAndLock(value, ...) will immediately return. */ - cCondition( int value = 0 ); + Condition( int value = 0 ); /** Default destructor * The Condition is invalidated before destruction */ - ~cCondition(); + ~Condition(); void Lock(); @@ -101,7 +101,7 @@ class EE_API cCondition : NonCopyable { */ void Restore(); protected: - Platform::cConditionImpl * mCondImpl; + Platform::ConditionImpl * mCondImpl; }; }} diff --git a/include/eepp/system/tcontainer.hpp b/include/eepp/system/container.hpp similarity index 79% rename from include/eepp/system/tcontainer.hpp rename to include/eepp/system/container.hpp index 166eed0d4..4a29ee203 100644 --- a/include/eepp/system/tcontainer.hpp +++ b/include/eepp/system/container.hpp @@ -8,11 +8,11 @@ namespace EE { namespace System { /** @brief A simple resource container template, to keep track of the resources loaded. */ template -class tContainer { +class Container { public: - tContainer(); + Container(); - virtual ~tContainer(); + virtual ~Container(); /** @brief Add to the list the resource. */ T * Add( T * Resource ); @@ -27,17 +27,17 @@ class tContainer { }; template -tContainer::tContainer() +Container::Container() { } template -tContainer::~tContainer() +Container::~Container() { } template -T * tContainer::Add( T * Resource ) { +T * Container::Add( T * Resource ) { if ( NULL != Resource ) { mResources.push_back( Resource ); @@ -48,7 +48,7 @@ T * tContainer::Add( T * Resource ) { } template -bool tContainer::Remove( T * Resource ) { +bool Container::Remove( T * Resource ) { if ( NULL != Resource ) { mResources.remove( Resource ); @@ -59,7 +59,7 @@ bool tContainer::Remove( T * Resource ) { } template -Uint32 tContainer::Count() { +Uint32 Container::Count() { return mResources.size(); } diff --git a/include/eepp/system/cinifile.hpp b/include/eepp/system/inifile.hpp similarity index 95% rename from include/eepp/system/cinifile.hpp rename to include/eepp/system/inifile.hpp index 3b5166900..26266e557 100755 --- a/include/eepp/system/cinifile.hpp +++ b/include/eepp/system/inifile.hpp @@ -1,4 +1,4 @@ -// IniFile.cpp: Implementation of the cIniFile class. +// IniFile.cpp: Implementation of the IniFile class. // Written by: Adam Clauss // Email: cabadam@tamu.edu // You may use this class/code as you wish in your programs. Feel free to distribute it, and @@ -24,22 +24,22 @@ namespace EE { namespace System { -class cPack; +class Pack; -class EE_API cIniFile { +class EE_API IniFile { public: enum errors { noID = -1 }; /** Initialize and load the ini file from path */ - cIniFile ( std::string const iniPath = "", const bool& readFile = true ); + IniFile ( std::string const iniPath = "", const bool& readFile = true ); /** Initialize and load the ini file from memory */ - cIniFile ( const Uint8* RAWData, const Uint32& size, const bool& readFile = true ); + IniFile ( const Uint8* RAWData, const Uint32& size, const bool& readFile = true ); /** Initialize and load the ini file from a pack file */ - cIniFile ( cPack * Pack, std::string iniPackPath, const bool& readFile = true ); + IniFile ( Pack * Pack, std::string iniPackPath, const bool& readFile = true ); - virtual ~cIniFile() {} + virtual ~IniFile() {} /** Loads an ini file from path */ bool LoadFromFile( const std::string& iniPath ); @@ -48,7 +48,7 @@ class EE_API cIniFile { bool LoadFromMemory( const Uint8* RAWData, const Uint32& size ); /** Loads an ini file from a pack file */ - bool LoadFromPack( cPack * Pack, std::string iniPackPath ); + bool LoadFromPack( Pack * Pack, std::string iniPackPath ); /** Sets whether or not keynames and valuenames should be case sensitive. ** The default is case insensitive. */ @@ -200,7 +200,7 @@ class EE_API cIniFile { ** Key comments are those comments within a key. Any comments ** defined within value Names will be added to this list. Therefore, ** these comments will be moved to the top of the key definition when - ** the cIniFile::WriteFile() is called. + ** the IniFile::WriteFile() is called. ** Number of key comments. */ unsigned GetNumKeyComments ( unsigned const keyID ) const; unsigned GetNumKeyComments ( std::string const keyname ) const; diff --git a/include/eepp/system/ciostream.hpp b/include/eepp/system/iostream.hpp similarity index 96% rename from include/eepp/system/ciostream.hpp rename to include/eepp/system/iostream.hpp index 82e6a68b7..ca32ef0eb 100644 --- a/include/eepp/system/ciostream.hpp +++ b/include/eepp/system/iostream.hpp @@ -10,9 +10,9 @@ namespace EE { namespace EE { namespace System { /** @brief An abstraction for custom input/output stream files. */ -class EE_API cIOStream { +class EE_API IOStream { public: - virtual ~cIOStream() {} + virtual ~IOStream() {} /** @brief Read data from the stream ** @param data Buffer where to copy the read data diff --git a/include/eepp/system/ciostreamfile.hpp b/include/eepp/system/iostreamfile.hpp similarity index 80% rename from include/eepp/system/ciostreamfile.hpp rename to include/eepp/system/iostreamfile.hpp index f3a5beb2c..9b60099ac 100644 --- a/include/eepp/system/ciostreamfile.hpp +++ b/include/eepp/system/iostreamfile.hpp @@ -1,22 +1,22 @@ #ifndef EE_SYSTEMCIOSTREAMFILE_HPP #define EE_SYSTEMCIOSTREAMFILE_HPP -#include +#include #include #include namespace EE { namespace System { /** @brief An implementation for a file system file steam */ -class EE_API cIOStreamFile : public cIOStream { +class EE_API IOStreamFile : public IOStream { public: /** @brief Open a file from the file system ** @param path File to open from path ** @param mode The open mode that it will be used for the file ( default read-binary ) **/ - cIOStreamFile( const std::string& path, std::ios_base::openmode mode = std::ios::in | std::ios::binary ); + IOStreamFile( const std::string& path, std::ios_base::openmode mode = std::ios::in | std::ios::binary ); - virtual ~cIOStreamFile(); + virtual ~IOStreamFile(); ios_size Read( char * data, ios_size size ); diff --git a/include/eepp/system/ciostreammemory.hpp b/include/eepp/system/iostreammemory.hpp similarity index 77% rename from include/eepp/system/ciostreammemory.hpp rename to include/eepp/system/iostreammemory.hpp index 3bf1e0f93..5d208f1ea 100644 --- a/include/eepp/system/ciostreammemory.hpp +++ b/include/eepp/system/iostreammemory.hpp @@ -1,26 +1,26 @@ #ifndef EE_SYSTEMCIOSTREAMMEMORY_HPP #define EE_SYSTEMCIOSTREAMMEMORY_HPP -#include +#include namespace EE { namespace System { /** @brief Implementation of a memory stream file */ -class EE_API cIOStreamMemory : public cIOStream { +class EE_API IOStreamMemory : public IOStream { public: /** @brief Use the data buffer for reading ** @param data The buffer to read from ** @param size The size of the buffer */ - cIOStreamMemory( const char * data, ios_size size ); + IOStreamMemory( const char * data, ios_size size ); /** @brief Use the data buffer for writing ** @param data The buffer to write to ** @param size The size of the buffer */ - cIOStreamMemory( char * data, ios_size size ); + IOStreamMemory( char * data, ios_size size ); - virtual ~cIOStreamMemory(); + virtual ~IOStreamMemory(); ios_size Read( char * data, ios_size size ); diff --git a/include/eepp/system/lock.hpp b/include/eepp/system/lock.hpp new file mode 100644 index 000000000..8b187eafd --- /dev/null +++ b/include/eepp/system/lock.hpp @@ -0,0 +1,28 @@ +#ifndef EE_SYSTEM_CLOCK_HPP +#define EE_SYSTEM_CLOCK_HPP + +#include +#include + +namespace EE { namespace System { + +class Mutex; + +/** @brief Automatic wrapper for locking and unlocking mutexes */ +class EE_API Lock : NonCopyable { + public : + /** @brief Construct the lock with a target mutex + * The mutex passed to cLock is automatically locked. + * @param mutex Mutex to lock */ + explicit Lock( Mutex& mutex ); + + /** @brief Destructor + * The destructor of cLock automatically unlocks its mutex. */ + ~Lock(); + private : + Mutex& mMutex; ///< Mutex to lock / unlock +}; + +}} + +#endif diff --git a/include/eepp/system/clog.hpp b/include/eepp/system/log.hpp similarity index 82% rename from include/eepp/system/clog.hpp rename to include/eepp/system/log.hpp index 84466e665..85e619fd3 100755 --- a/include/eepp/system/clog.hpp +++ b/include/eepp/system/log.hpp @@ -3,22 +3,22 @@ #include #include -#include -#include -#include +#include +#include +#include #include namespace EE { namespace System { /** @brief The reader interface is useful if you want to keep track of what is write in the log, for example for a console. */ -class iLogReader { +class LogReaderInterface { public: virtual void WriteLog( const std::string& Text ) = 0; }; /** @brief Global log file. The engine will log everything in this file. */ -class EE_API cLog : protected cMutex { - SINGLETON_DECLARE_HEADERS(cLog) +class EE_API Log : protected Mutex { + SINGLETON_DECLARE_HEADERS(Log) public: /** @brief Indicates that the log must be writed to a file when the Log instance is closed. @@ -53,22 +53,22 @@ class EE_API cLog : protected cMutex { /** @brief Adds a reader interface. ** The reader interface is used to the informed for every writed text to the log. */ - void AddLogReader( iLogReader * reader ); + void AddLogReader( LogReaderInterface * reader ); /** @brief Removes the reader interface */ - void RemoveLogReader( iLogReader * reader ); + void RemoveLogReader( LogReaderInterface * reader ); - ~cLog(); + ~Log(); protected: - cLog(); + Log(); std::string mData; std::string mFilePath; bool mSave; bool mConsoleOutput; bool mLiveWrite; - cIOStreamFile * mFS; - std::list mReaders; + IOStreamFile * mFS; + std::list mReaders; void OpenFS(); diff --git a/include/eepp/system/cmutex.hpp b/include/eepp/system/mutex.hpp similarity index 80% rename from include/eepp/system/cmutex.hpp rename to include/eepp/system/mutex.hpp index bb9e266a3..ca0aa8e92 100755 --- a/include/eepp/system/cmutex.hpp +++ b/include/eepp/system/mutex.hpp @@ -6,14 +6,14 @@ namespace EE { namespace System { -namespace Platform { class cMutexImpl; } +namespace Platform { class MutexImpl; } /** @brief Blocks concurrent access to shared resources from multiple threads */ -class EE_API cMutex : NonCopyable { +class EE_API Mutex : NonCopyable { public: - cMutex(); + Mutex(); - ~cMutex(); + ~Mutex(); /** @brief Lock the mutex ** If the mutex is already locked in another thread, @@ -27,7 +27,7 @@ class EE_API cMutex : NonCopyable { /** @brief Tries to lock de mutex if possible */ int TryLock(); private: - Platform::cMutexImpl * mMutexImpl; + Platform::MutexImpl * mMutexImpl; }; }} diff --git a/include/eepp/system/cobjectloader.hpp b/include/eepp/system/objectloader.hpp similarity index 90% rename from include/eepp/system/cobjectloader.hpp rename to include/eepp/system/objectloader.hpp index d82b8985d..fd3a7104b 100644 --- a/include/eepp/system/cobjectloader.hpp +++ b/include/eepp/system/objectloader.hpp @@ -2,15 +2,15 @@ #define EE_SYSTEMCOBJECTLOADER #include -#include +#include #include namespace EE { namespace System { /** @brief Base class that defines resources to be loaded in synchronous or asynchronous mode. */ -class EE_API cObjectLoader : protected cThread { +class EE_API ObjectLoader : protected Thread { public: - typedef cb::Callback1 ObjLoadCallback; + typedef cb::Callback1 ObjLoadCallback; /** @brief LoaderType Definition of the Object Loaders implemented by the engine. */ enum ObjLoaderType { @@ -22,9 +22,9 @@ class EE_API cObjectLoader : protected cThread { }; /** Creates an instance of an object loader of the type defined */ - cObjectLoader( Uint32 ObjType ); + ObjectLoader( Uint32 ObjType ); - virtual ~cObjectLoader(); + virtual ~ObjectLoader(); /** @brief Starts loading the resource */ void Load(); diff --git a/include/eepp/system/cpack.hpp b/include/eepp/system/pack.hpp similarity index 96% rename from include/eepp/system/cpack.hpp rename to include/eepp/system/pack.hpp index 2285fd2b2..b9bfc93d7 100755 --- a/include/eepp/system/cpack.hpp +++ b/include/eepp/system/pack.hpp @@ -2,17 +2,17 @@ #define EE_SYSTEMCPACK_HPP #include -#include +#include #include namespace EE { namespace System { /** @brief Base class for all packing classes */ -class EE_API cPack : protected cMutex { +class EE_API Pack : protected Mutex { public: - cPack(); + Pack(); - virtual ~cPack(); + virtual ~Pack(); /** Creates a new pack file */ virtual bool Create( const std::string& path ) = 0; diff --git a/include/eepp/system/cpackmanager.hpp b/include/eepp/system/packmanager.hpp similarity index 81% rename from include/eepp/system/cpackmanager.hpp rename to include/eepp/system/packmanager.hpp index 5214a18de..36cfd574b 100644 --- a/include/eepp/system/cpackmanager.hpp +++ b/include/eepp/system/packmanager.hpp @@ -1,29 +1,29 @@ #ifndef EE_SYSTEMCPACKMANAGER_HPP #define EE_SYSTEMCPACKMANAGER_HPP -#include -#include -#include +#include +#include +#include namespace EE { namespace System { /** @brief The Pack Manager keep track of the instanciated Packs. It's used to find files from any open pack. */ -class EE_API cPackManager : public tContainer { - SINGLETON_DECLARE_HEADERS(cPackManager) +class EE_API PackManager : public Container { + SINGLETON_DECLARE_HEADERS(PackManager) public: - virtual ~cPackManager(); + virtual ~PackManager(); /** @brief Searchs for the filepath in the packs, if the file is found it will return the pack that belongs to. ** @return The pack where the file exists. If the file is not found, returns NULL. ** @param path The file path to search. */ - cPack * Exists( std::string& path ); + Pack * Exists( std::string& path ); /** @brief Search for a pack by its path. ** @return The pack instance if found, otherwise returns NULL. */ - cPack * GetPackByPath( std::string path ); + Pack * GetPackByPath( std::string path ); /** @returns If the packs opened are being used as a fallback in case of a file wasn't found in the file system path. */ const bool& FallbackToPacks() const; @@ -38,7 +38,7 @@ class EE_API cPackManager : public tContainer { protected: bool mFallback; - cPackManager(); + PackManager(); }; }} diff --git a/include/eepp/system/cpak.hpp b/include/eepp/system/pak.hpp similarity index 95% rename from include/eepp/system/cpak.hpp rename to include/eepp/system/pak.hpp index 3815eab9a..bca9fa1cc 100755 --- a/include/eepp/system/cpak.hpp +++ b/include/eepp/system/pak.hpp @@ -2,16 +2,16 @@ #define EE_SYSTEMCPAK_HPP #include -#include -#include +#include +#include namespace EE { namespace System { /** @brief Quake 2 PAK handler */ -class EE_API cPak : public cPack { +class EE_API Pak : public Pack { public: - cPak(); - ~cPak(); + Pak(); + ~Pak(); /** Creates a new pakFile */ bool Create( const std::string& path ); @@ -83,7 +83,7 @@ class EE_API cPak : public cPack { } pakEntry; //! The stored file info typedef struct pakfile_t { - cIOStreamFile * fs; + IOStreamFile * fs; pakHeader header; Uint32 pakFilesNum; std::string pakPath; diff --git a/include/eepp/system/crc4.hpp b/include/eepp/system/rc4.hpp similarity index 97% rename from include/eepp/system/crc4.hpp rename to include/eepp/system/rc4.hpp index de8ccb77d..b2c2e8b47 100755 --- a/include/eepp/system/crc4.hpp +++ b/include/eepp/system/rc4.hpp @@ -6,11 +6,11 @@ namespace EE { namespace System { /** @brief RC4 Encryption Class. For more information check Wikipedia: http://en.wikipedia.org/wiki/RC4. */ -class EE_API cRC4 { +class EE_API RC4 { public: - cRC4(); + RC4(); - ~cRC4(); + ~RC4(); /** @brief Set the encryption Key. ** @param key the key data diff --git a/include/eepp/system/cresourceloader.hpp b/include/eepp/system/resourceloader.hpp similarity index 86% rename from include/eepp/system/cresourceloader.hpp rename to include/eepp/system/resourceloader.hpp index 6c5c6c39f..a9b8a3c95 100644 --- a/include/eepp/system/cresourceloader.hpp +++ b/include/eepp/system/resourceloader.hpp @@ -2,28 +2,28 @@ #define EE_SYSTEMCRESOURCELOADER #include -#include +#include namespace EE { namespace System { #define THREADS_AUTO (eeINDEX_NOT_FOUND) /** @brief A simple resource loader that can load a batch of resources synchronously or asynchronously */ -class EE_API cResourceLoader { +class EE_API ResourceLoader { public: - typedef cb::Callback1 ResLoadCallback; + typedef cb::Callback1 ResLoadCallback; /** @param MaxThreads Set the maximun simultaneous threads to load resources, THREADS_AUTO will use the cpu number of cores. */ - cResourceLoader( const Uint32& MaxThreads = THREADS_AUTO ); + ResourceLoader( const Uint32& MaxThreads = THREADS_AUTO ); - virtual ~cResourceLoader(); + virtual ~ResourceLoader(); /** @brief Adds a resource to load. ** Must be called before the loading starts. ** Once an object loader is added to the resource loader, the instance of that object will be managed and released by the loader. ** @param Object The instance object loader to load */ - void Add( cObjectLoader * Object ); + void Add( ObjectLoader * Object ); /** @brief Starts loading the resources. ** @param Cb A callback that is called when the resources finished loading. */ @@ -67,8 +67,8 @@ class EE_API cResourceLoader { Uint32 mThreads; std::list mLoadCbs; - std::list mObjs; - std::list mObjsLoaded; + std::list mObjs; + std::list mObjsLoaded; void SetThreads(); diff --git a/include/eepp/system/tresourcemanager.hpp b/include/eepp/system/resourcemanager.hpp similarity index 82% rename from include/eepp/system/tresourcemanager.hpp rename to include/eepp/system/resourcemanager.hpp index 0343f4f17..007db95b9 100644 --- a/include/eepp/system/tresourcemanager.hpp +++ b/include/eepp/system/resourcemanager.hpp @@ -9,13 +9,13 @@ namespace EE { namespace System { /** @brief A simple resource manager. It keeps a list of the resources, and free the instances of the resources when the manager is closed. ** Resources must have Id() and Name() properties. Id() is the string hash of Name(). */ template -class tResourceManager { +class ResourceManager { public: /** @param UniqueId Indicates if the resources id must be unique */ - tResourceManager( bool UniqueId = true ); + ResourceManager( bool UniqueId = true ); /** @brief The destructor will call Destroy() and destroy all the resources added to the manager */ - virtual ~tResourceManager(); + virtual ~ResourceManager(); /** @brief Add the resource to the resource manager ** @param Resource The resource to be managed by the manager */ @@ -73,24 +73,24 @@ class tResourceManager { }; template -tResourceManager::tResourceManager( bool UniqueId ) : +ResourceManager::ResourceManager( bool UniqueId ) : mUniqueId( UniqueId ), mIsDestroying( false ) { } template -const bool& tResourceManager::IsDestroying() const { +const bool& ResourceManager::IsDestroying() const { return mIsDestroying; } template -tResourceManager::~tResourceManager() { +ResourceManager::~ResourceManager() { Destroy(); } template -void tResourceManager::Destroy() { +void ResourceManager::Destroy() { typename std::list::iterator it; mIsDestroying = true; @@ -105,12 +105,12 @@ void tResourceManager::Destroy() { } template -std::list& tResourceManager::GetResources() { +std::list& ResourceManager::GetResources() { return mResources; } template -T * tResourceManager::Add( T * Resource ) { +T * ResourceManager::Add( T * Resource ) { if ( NULL != Resource ) { if ( mUniqueId ) { Uint32 c = Count( Resource->Id() ); @@ -140,7 +140,7 @@ T * tResourceManager::Add( T * Resource ) { } template -bool tResourceManager::Remove( T * Resource, bool Delete ) { +bool ResourceManager::Remove( T * Resource, bool Delete ) { if ( NULL != Resource ) { mResources.remove( Resource ); @@ -154,22 +154,22 @@ bool tResourceManager::Remove( T * Resource, bool Delete ) { } template -bool tResourceManager::RemoveById( const Uint32& Id, bool Delete ) { +bool ResourceManager::RemoveById( const Uint32& Id, bool Delete ) { return Remove( GetById( Id ), Delete ); } template -bool tResourceManager::RemoveByName( const std::string& Name, bool Delete ) { +bool ResourceManager::RemoveByName( const std::string& Name, bool Delete ) { return Remove( GetByName( Name ), Delete ); } template -bool tResourceManager::Exists( const std::string& Name ) { +bool ResourceManager::Exists( const std::string& Name ) { return ExistsId( String::Hash( Name ) ); } template -bool tResourceManager::ExistsId( const Uint32& Id ) { +bool ResourceManager::ExistsId( const Uint32& Id ) { typename std::list::iterator it; for ( it = mResources.begin() ; it != mResources.end(); it++ ) @@ -180,12 +180,12 @@ bool tResourceManager::ExistsId( const Uint32& Id ) { } template -T * tResourceManager::GetByName( const std::string& Name ) { +T * ResourceManager::GetByName( const std::string& Name ) { return GetById( String::Hash( Name ) ); } template -T * tResourceManager::GetById( const Uint32& id ) { +T * ResourceManager::GetById( const Uint32& id ) { typename std::list::reverse_iterator it; T * sp = NULL; @@ -201,7 +201,7 @@ T * tResourceManager::GetById( const Uint32& id ) { } template -void tResourceManager::PrintNames() { +void ResourceManager::PrintNames() { typename std::list::reverse_iterator it; T * sp = NULL; @@ -214,12 +214,12 @@ void tResourceManager::PrintNames() { } template -Uint32 tResourceManager::Count() { +Uint32 ResourceManager::Count() { return (Uint32)mResources.size(); } template -Uint32 tResourceManager::Count( const Uint32& Id ) { +Uint32 ResourceManager::Count( const Uint32& Id ) { typename std::list::iterator it; Uint32 Count = 0; @@ -231,7 +231,7 @@ Uint32 tResourceManager::Count( const Uint32& Id ) { } template -Uint32 tResourceManager::Count( const std::string& Name ) { +Uint32 ResourceManager::Count( const std::string& Name ) { return Count( String::Hash( Name ) ); } diff --git a/include/eepp/system/tsingleton.hpp b/include/eepp/system/singleton.hpp similarity index 93% rename from include/eepp/system/tsingleton.hpp rename to include/eepp/system/singleton.hpp index 9a1f95992..0fdca6c8d 100755 --- a/include/eepp/system/tsingleton.hpp +++ b/include/eepp/system/singleton.hpp @@ -44,7 +44,7 @@ namespace EE { namespace System { /** @brief Template class for only one instance classes. */ template -class tSingleton { +class Singleton { protected: static T* ms_singleton; diff --git a/include/eepp/system/sys.hpp b/include/eepp/system/sys.hpp index b852cec2c..90a6ef80d 100644 --- a/include/eepp/system/sys.hpp +++ b/include/eepp/system/sys.hpp @@ -2,7 +2,7 @@ #define EE_SYSTEM_SYSTEM_HPP #include -#include +#include namespace EE { namespace System { @@ -24,7 +24,7 @@ class EE_API Sys { static void Sleep( const Uint32& ms ); /** Wait the time defined before returning. */ - static void Sleep( const cTime& time ); + static void Sleep( const Time& time ); /** @return The application path ( the executable path ) */ static std::string GetProcessPath(); diff --git a/include/eepp/system/cthread.hpp b/include/eepp/system/thread.hpp similarity index 89% rename from include/eepp/system/cthread.hpp rename to include/eepp/system/thread.hpp index 6c85d7337..85c4ef1df 100755 --- a/include/eepp/system/cthread.hpp +++ b/include/eepp/system/thread.hpp @@ -6,11 +6,11 @@ namespace EE { namespace System { -namespace Platform { class cThreadImpl; } +namespace Platform { class ThreadImpl; } namespace Private { struct ThreadFunc; } /** @brief Thread manager class */ -class EE_API cThread : NonCopyable { +class EE_API Thread : NonCopyable { public: typedef void (*FuncType)(void*); @@ -35,7 +35,7 @@ class EE_API cThread : NonCopyable { @param function Functor or free function to use as the entry point of the thread */ template - cThread( F function ); + Thread( F function ); /** @brief Construct the thread from a functor with an argument ** This constructor works for function objects, as well @@ -57,7 +57,7 @@ class EE_API cThread : NonCopyable { ** @param function Functor or free function to use as the entry point of the thread ** @param argument argument to forward to the function */ template - cThread( F function, A argument ); + Thread( F function, A argument ); /** @brief Construct the thread from a member function and an object ** This constructor is template, which means that you can @@ -74,12 +74,12 @@ class EE_API cThread : NonCopyable { ** @param function Entry point of the thread ** @param object Pointer to the object to use **/ template - cThread( void(C::*function)(), C* object ); + Thread( void(C::*function)(), C* object ); /** @brief Destructor ** This destructor calls Wait(), so that the internal thread - ** cannot survive after its cThread instance is destroyed. */ - virtual ~cThread(); + ** cannot survive after its Thread instance is destroyed. */ + virtual ~Thread(); /** @brief Run the thread ** This function starts the entry point passed to the @@ -109,14 +109,14 @@ class EE_API cThread : NonCopyable { /** @return The id of the thread */ Uint32 Id(); protected: - cThread(); + Thread(); private: - friend class Platform::cThreadImpl; + friend class Platform::ThreadImpl; /** The virtual function to run in the thread */ virtual void Run(); - Platform::cThreadImpl * mThreadImpl; ///< OS-specific implementation of the thread + Platform::ThreadImpl * mThreadImpl; ///< OS-specific implementation of the thread Private::ThreadFunc * mEntryPoint; ///< Abstraction of the function to run }; @@ -162,21 +162,21 @@ struct ThreadMemberFunc : ThreadFunc } template -cThread::cThread(F functor) : +Thread::Thread(F functor) : mThreadImpl(NULL), mEntryPoint( new Private::ThreadFunctor(functor) ) { } template -cThread::cThread(F function, A argument) : +Thread::Thread(F function, A argument) : mThreadImpl(NULL), mEntryPoint( new Private::ThreadFunctorWithArg (function, argument) ) { } template -cThread::cThread(void(C::*function)(), C* object) : +Thread::Thread(void(C::*function)(), C* object) : mThreadImpl(NULL), mEntryPoint( new Private::ThreadMemberFunc (function, object) ) { diff --git a/include/eepp/system/cthreadlocal.hpp b/include/eepp/system/threadlocal.hpp similarity index 77% rename from include/eepp/system/cthreadlocal.hpp rename to include/eepp/system/threadlocal.hpp index 118daad5b..6b3c9be44 100644 --- a/include/eepp/system/cthreadlocal.hpp +++ b/include/eepp/system/threadlocal.hpp @@ -5,19 +5,19 @@ #include namespace EE { namespace System { namespace Private { -class cThreadLocalImpl; +class ThreadLocalImpl; }}} namespace EE { namespace System { /** @brief Defines variables with thread-local storage */ -class EE_API cThreadLocal : NonCopyable { +class EE_API ThreadLocal : NonCopyable { public: /** @brief Default constructor ** @param value Optional value to initalize the variable */ - cThreadLocal(void* value = NULL); + ThreadLocal(void* value = NULL); - ~cThreadLocal(); + ~ThreadLocal(); /** @brief Set the thread-specific value of the variable ** @param value Value of the variable for the current thread */ @@ -27,7 +27,7 @@ class EE_API cThreadLocal : NonCopyable { ** @return Value of the variable for the current thread */ void* Value() const; private : - Private::cThreadLocalImpl* mImpl; ///< Pointer to the OS specific implementation + Private::ThreadLocalImpl* mImpl; ///< Pointer to the OS specific implementation }; }} diff --git a/include/eepp/system/tthreadlocalptr.hpp b/include/eepp/system/threadlocalptr.hpp similarity index 66% rename from include/eepp/system/tthreadlocalptr.hpp rename to include/eepp/system/threadlocalptr.hpp index e98d899e5..585a88818 100644 --- a/include/eepp/system/tthreadlocalptr.hpp +++ b/include/eepp/system/threadlocalptr.hpp @@ -1,18 +1,18 @@ #ifndef EE_SYSTEMCTHREADLOCALPTR_HPP #define EE_SYSTEMCTHREADLOCALPTR_HPP -#include +#include namespace EE { namespace System { /** @brief Pointer to a thread-local variable */ template -class tThreadLocalPtr : private cThreadLocal +class ThreadLocalPtr : private ThreadLocal { public : /** @brief Default constructor ** @param value Optional value to initalize the variable */ - tThreadLocalPtr(T* value = NULL); + ThreadLocalPtr(T* value = NULL); /** @brief Overload of unary operator * ** Like raw pointers, applying the * operator returns a @@ -33,43 +33,43 @@ class tThreadLocalPtr : private cThreadLocal /** @brief Assignment operator for a raw pointer parameter ** @param value Pointer to assign ** @return Reference to self */ - tThreadLocalPtr& operator =(T* value); + ThreadLocalPtr& operator =(T* value); - /** @brief Assignment operator for a tThreadLocalPtr parameter - ** @param right tThreadLocalPtr to assign + /** @brief Assignment operator for a ThreadLocalPtr parameter + ** @param right ThreadLocalPtr to assign ** @return Reference to self */ - tThreadLocalPtr& operator =(const tThreadLocalPtr& right); + ThreadLocalPtr& operator =(const ThreadLocalPtr& right); }; template -tThreadLocalPtr::tThreadLocalPtr(T* value) : - cThreadLocal(value) +ThreadLocalPtr::ThreadLocalPtr(T* value) : + ThreadLocal(value) { } template -T& tThreadLocalPtr::operator *() const { +T& ThreadLocalPtr::operator *() const { return *static_cast(Value()); } template -T* tThreadLocalPtr::operator ->() const { +T* ThreadLocalPtr::operator ->() const { return static_cast(Value()); } template -tThreadLocalPtr::operator T*() const { +ThreadLocalPtr::operator T*() const { return static_cast(Value()); } template -tThreadLocalPtr& tThreadLocalPtr::operator =(T* value) { +ThreadLocalPtr& ThreadLocalPtr::operator =(T* value) { Value(value); return *this; } template -tThreadLocalPtr& tThreadLocalPtr::operator =(const tThreadLocalPtr& right) { +ThreadLocalPtr& ThreadLocalPtr::operator =(const ThreadLocalPtr& right) { Value(right.Value()); return *this; } @@ -79,10 +79,10 @@ tThreadLocalPtr& tThreadLocalPtr::operator =(const tThreadLocalPtr& rig #endif /** -@class tThreadLocalPtr +@class ThreadLocalPtr @ingroup System -tThreadLocalPtr is a type-safe wrapper for storing +ThreadLocalPtr is a type-safe wrapper for storing pointers to thread-local variables. A thread-local variable holds a different value for each different thread, unlike normal variable that are shared. @@ -94,7 +94,7 @@ Usage example: @code MyClass object1; MyClass object2; -tThreadLocalPtr objectPtr; +ThreadLocalPtr objectPtr; void thread1() { @@ -111,8 +111,8 @@ void thread2() int main() { // Create and launch the two threads - cThread t1(&thread1); - cThread t2(&thread2); + Thread t1(&thread1); + Thread t2(&thread2); t1.launch(); t2.launch(); diff --git a/include/eepp/system/ctime.hpp b/include/eepp/system/time.hpp similarity index 71% rename from include/eepp/system/ctime.hpp rename to include/eepp/system/time.hpp index e39e8e8cb..89bb9a18a 100644 --- a/include/eepp/system/ctime.hpp +++ b/include/eepp/system/time.hpp @@ -8,255 +8,255 @@ namespace EE { namespace System { /** @brief Represents a time value ** Based on the SFML2 implementation ( not the same, this version uses doubles for seconds and milliseconds ) */ -class EE_API cTime +class EE_API Time { public : /** @brief Default constructor ** Sets the time value to zero. */ - cTime(); + Time(); /** @brief Return the time value as a number of seconds - ** @return cTime in seconds + ** @return Time in seconds ** @see AsMilliseconds, AsMicroseconds */ double AsSeconds() const; /** @brief Return the time value as a number of milliseconds - ** @return cTime in milliseconds + ** @return Time in milliseconds ** @see AsSeconds, AsMicroseconds */ double AsMilliseconds() const; /** @brief Return the time value as a number of microseconds - ** @return cTime in microseconds + ** @return Time in microseconds ** @see asSeconds, asMilliseconds */ Int64 AsMicroseconds() const; - static const cTime Zero; ///< Predefined "zero" time value + static const Time Zero; ///< Predefined "zero" time value private : - friend EE_API cTime Seconds(double); - friend EE_API cTime Milliseconds(double); - friend EE_API cTime Microseconds(Int64); + friend EE_API Time Seconds(double); + friend EE_API Time Milliseconds(double); + friend EE_API Time Microseconds(Int64); /** @brief Construct from a number of microseconds ** This function is internal. To construct time values, ** use Seconds, Milliseconds or Microseconds instead. ** @param microseconds Number of microseconds */ - explicit cTime(Int64 microseconds); + explicit Time(Int64 microseconds); - Int64 mMicroseconds; ///< cTime value stored as microseconds + Int64 mMicroseconds; ///< Time value stored as microseconds }; -/// @relates cTime +/// @relates Time /// @brief Construct a time value from a number of seconds /// @param amount Number of seconds -/// @return cTime value constructed from the amount of seconds +/// @return Time value constructed from the amount of seconds /// @see Milliseconds, Microseconds -EE_API cTime Seconds(double amount); +EE_API Time Seconds(double amount); -/// @relates cTime +/// @relates Time /// @brief Construct a time value from a number of milliseconds /// @param amount Number of milliseconds -/// @return cTime value constructed from the amount of milliseconds +/// @return Time value constructed from the amount of milliseconds /// @see Seconds, Microseconds -EE_API cTime Milliseconds(double amount); +EE_API Time Milliseconds(double amount); -/// @relates cTime +/// @relates Time /// @brief Construct a time value from a number of microseconds /// @param amount Number of microseconds -/// @return cTime value constructed from the amount of microseconds +/// @return Time value constructed from the amount of microseconds /// @see Seconds, Milliseconds -EE_API cTime Microseconds(Int64 amount); +EE_API Time Microseconds(Int64 amount); -/// @relates cTime +/// @relates Time /// @brief Overload of == operator to compare two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return True if both time values are equal -EE_API bool operator ==(cTime left, cTime right); +EE_API bool operator ==(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of != operator to compare two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return True if both time values are different -EE_API bool operator !=(cTime left, cTime right); +EE_API bool operator !=(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of < operator to compare two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return True if @a left is lesser than @a right -EE_API bool operator <(cTime left, cTime right); +EE_API bool operator <(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of > operator to compare two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return True if @a left is greater than @a right -EE_API bool operator >(cTime left, cTime right); +EE_API bool operator >(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of <= operator to compare two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return True if @a left is lesser or equal than @a right -EE_API bool operator <=(cTime left, cTime right); +EE_API bool operator <=(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of >= operator to compare two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return True if @a left is greater or equal than @a right -EE_API bool operator >=(cTime left, cTime right); +EE_API bool operator >=(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of unary - operator to negate a time value /// @param right Right operand (a time) /// @return Opposite of the time value -EE_API cTime operator -(cTime right); +EE_API Time operator -(Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary + operator to add two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return Sum of the two times values -EE_API cTime operator +(cTime left, cTime right); +EE_API Time operator +(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary += operator to add/assign two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return Sum of the two times values -EE_API cTime& operator +=(cTime& left, cTime right); +EE_API Time& operator +=(Time& left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary - operator to subtract two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return Difference of the two times values -EE_API cTime operator -(cTime left, cTime right); +EE_API Time operator -(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary -= operator to subtract/assign two time values /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return Difference of the two times values -EE_API cTime& operator -=(cTime& left, cTime right); +EE_API Time& operator -=(Time& left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary * operator to scale a time value /// @param left Left operand (a time) /// @param right Right operand (a number) /// @return @a left multiplied by @a right -EE_API cTime operator *(cTime left, cTime right); +EE_API Time operator *(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary * operator to scale a time value /// @param left Left operand (a time) /// @param right Right operand (a number) /// @return @a left multiplied by @a right -EE_API cTime operator *(cTime left, double right); +EE_API Time operator *(Time left, double right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary * operator to scale a time value /// @param left Left operand (a number) /// @param right Right operand (a time) /// @return @a left multiplied by @a right -EE_API cTime operator *(double left, cTime right); +EE_API Time operator *(double left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary * operator to scale a time value /// @param left Left operand (a number) /// @param right Right operand (a time) /// @return @a left multiplied by @a right -EE_API cTime operator *(Int64 left, cTime right); +EE_API Time operator *(Int64 left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary * operator to scale a time value /// @param left Left operand (a time) /// @param right Right operand (a number) /// @return @a left multiplied by @a right -EE_API cTime operator *(cTime left, Int64 right); +EE_API Time operator *(Time left, Int64 right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary *= operator to scale/assign a time value /// @param left Left operand (a time) /// @param right Right operand (a number) /// @return @a left multiplied by @a right -EE_API cTime& operator *=(cTime& left, double right); +EE_API Time& operator *=(Time& left, double right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary *= operator to scale/assign a time value /// @param left Left operand (a time) /// @param right Right operand (a number) /// @return @a left multiplied by @a right -EE_API cTime& operator *=(cTime& left, Int64 right); +EE_API Time& operator *=(Time& left, Int64 right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary *= operator to scale/assign a time value /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return @a left multiplied by @a right -EE_API cTime& operator *=(cTime& left, cTime right); +EE_API Time& operator *=(Time& left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary / operator to scale a time value /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return @a left divided by @a right -EE_API cTime operator /(cTime left, cTime right); +EE_API Time operator /(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary / operator to scale a time value /// @param left Left operand (a time) /// @param right Right operand (a number) /// @return @a left divided by @a right -EE_API cTime operator /(cTime left, double right); +EE_API Time operator /(Time left, double right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary / operator to scale a time value /// @param left Left operand (a time) /// @param right Right operand (a number) /// @return @a left divided by @a right -EE_API cTime operator /(cTime left, Int64 right); +EE_API Time operator /(Time left, Int64 right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary /= operator to scale/assign a time value /// @param left Left operand (a time) /// @param right Right operand (a number) /// @return @a left divided by @a right -EE_API cTime& operator /=(cTime& left, Int64 right); +EE_API Time& operator /=(Time& left, Int64 right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary /= operator to scale/assign a time value /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return @a left divided by @a right -EE_API cTime& operator /=(cTime& left, cTime right); +EE_API Time& operator /=(Time& left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary % operator to compute remainder of a time value /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return @a left modulo @a right -EE_API cTime operator %(cTime left, cTime right); +EE_API Time operator %(Time left, Time right); -/// @relates cTime +/// @relates Time /// @brief Overload of binary %= operator to compute/assign remainder of a time value /// @param left Left operand (a time) /// @param right Right operand (a time) /// @return @a left modulo @a right -EE_API cTime& operator %=(cTime& left, cTime right); +EE_API Time& operator %=(Time& left, Time right); }} #endif /** -@class cTime +@class Time @ingroup System -EE::Systen::cTime encapsulates a time value in a flexible way. +EE::Systen::Time encapsulates a time value in a flexible way. It allows to define a time value either as a number of seconds, milliseconds or microseconds. It also works the other way round: you can read a time value as either @@ -266,7 +266,7 @@ By using such a flexible interface, the API doesn't impose any fixed type or resolution for time values, and let the user choose its own favorite representation. -cTime values support the usual mathematical operations: +Time values support the usual mathematical operations: you can add or subtract two times, multiply or divide a time by a number, compare two times, etc. @@ -275,18 +275,18 @@ value, times can also be negative. Usage example: @code -cTime t1 = Seconds(0.1f); +Time t1 = Seconds(0.1f); double milli = t1.AsMilliseconds(); // 100 -cTime t2 = Milliseconds(30); +Time t2 = Milliseconds(30); Int64 micro = t2.AsMicroseconds(); // 30000 -cTime t3 = Microseconds(-800000); +Time t3 = Microseconds(-800000); double sec = t3.AsSeconds(); // -0.8 @endcode @code -void update(cTime elapsed) +void update(Time elapsed) { position += speed * elapsed; } @@ -294,5 +294,5 @@ void update(cTime elapsed) update(Milliseconds(100)); @endcode -@see cClock +@see Clock */ diff --git a/include/eepp/system/czip.hpp b/include/eepp/system/zip.hpp similarity index 96% rename from include/eepp/system/czip.hpp rename to include/eepp/system/zip.hpp index 66236e945..398a03d5f 100644 --- a/include/eepp/system/czip.hpp +++ b/include/eepp/system/zip.hpp @@ -2,18 +2,18 @@ #define EE_SYSTEMCZIP_HPP #include -#include +#include struct zip; namespace EE { namespace System { /** @brief Zip files package manager. */ -class EE_API cZip : public cPack { +class EE_API Zip : public Pack { public: - cZip(); + Zip(); - ~cZip(); + ~Zip(); /** Creates a new pack file */ bool Create( const std::string& path ); diff --git a/include/eepp/ui/base.hpp b/include/eepp/ui/base.hpp index decc0df46..ffdece26b 100644 --- a/include/eepp/ui/base.hpp +++ b/include/eepp/ui/base.hpp @@ -14,7 +14,7 @@ using namespace EE::Math; #include #include -#include +#include #include using namespace EE::System; diff --git a/include/eepp/ui/cuicontrol.hpp b/include/eepp/ui/cuicontrol.hpp index bdd61405f..40bcb2d35 100644 --- a/include/eepp/ui/cuicontrol.hpp +++ b/include/eepp/ui/cuicontrol.hpp @@ -374,7 +374,7 @@ class EE_API cUIControl { void SendParentSizeChange( const eeVector2i& SizeChange ); - cTime Elapsed(); + Time Elapsed(); eeRecti MakePadding( bool PadLeft = true, bool PadRight = true, bool PadTop = true, bool PadBottom = true, bool SkipFlags = false ); diff --git a/include/eepp/ui/cuicontrolanim.hpp b/include/eepp/ui/cuicontrolanim.hpp index c90f4ca3e..bbc956902 100644 --- a/include/eepp/ui/cuicontrolanim.hpp +++ b/include/eepp/ui/cuicontrolanim.hpp @@ -37,23 +37,23 @@ class EE_API cUIControlAnim : public cUIDragable { bool Animating(); - void StartAlphaAnim( const Float& From, const Float& To, const cTime& TotalTime, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear, cInterpolation::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); + void StartAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear, cInterpolation::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); - void StartScaleAnim( const eeVector2f& From, const eeVector2f& To, const cTime& TotalTime, const Ease::Interpolation& Type = Ease::Linear, cInterpolation::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); + void StartScaleAnim( const eeVector2f& From, const eeVector2f& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, cInterpolation::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); - void StartScaleAnim( const Float& From, const Float& To, const cTime& TotalTime, const Ease::Interpolation& Type = Ease::Linear, cInterpolation::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); + void StartScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, cInterpolation::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); - void StartMovement( const eeVector2i& From, const eeVector2i& To, const cTime& TotalTime, const Ease::Interpolation& Type = Ease::Linear, cWaypoints::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); + void StartMovement( const eeVector2i& From, const eeVector2i& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, cWaypoints::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); - void StartRotation( const Float& From, const Float& To, const cTime& TotalTime, const Ease::Interpolation& Type = Ease::Linear, cInterpolation::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); + void StartRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type = Ease::Linear, cInterpolation::OnPathEndCallback PathEndCallback = cInterpolation::OnPathEndCallback() ); - void CreateFadeIn( const cTime& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear ); + void CreateFadeIn( const Time& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear ); - void CreateFadeOut( const cTime& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear ); + void CreateFadeOut( const Time& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear ); - void CloseFadeOut( const cTime& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear ); + void CloseFadeOut( const Time& Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear ); - void DisableFadeOut( const cTime & Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear ); + void DisableFadeOut( const Time & Time, const bool& AlphaChilds = true, const Ease::Interpolation& Type = Ease::Linear ); cInterpolation * RotationInterpolation(); diff --git a/include/eepp/ui/cuimanager.hpp b/include/eepp/ui/cuimanager.hpp index 67966322c..4777c2451 100644 --- a/include/eepp/ui/cuimanager.hpp +++ b/include/eepp/ui/cuimanager.hpp @@ -35,7 +35,7 @@ class EE_API cUIManager { void Draw(); - const cTime& Elapsed() const; + const Time& Elapsed() const; void ResizeControl( cWindow * win ); @@ -115,7 +115,7 @@ class EE_API cUIManager { std::list mWindowsList; std::list mCloseList; - cTime mElapsed; + Time mElapsed; Int32 mCbId; Uint32 mResizeCb; diff --git a/include/eepp/ui/cuipopupmenu.hpp b/include/eepp/ui/cuipopupmenu.hpp index dbc2412e7..2b6ae835a 100644 --- a/include/eepp/ui/cuipopupmenu.hpp +++ b/include/eepp/ui/cuipopupmenu.hpp @@ -26,7 +26,7 @@ class EE_API cUIPopUpMenu : public cUIMenu { virtual Uint32 OnMessage( const cUIMessage * Msg ); #ifdef EE_PLATFORM_TOUCH - cClock mTE; + Clock mTE; #endif }; diff --git a/include/eepp/ui/cuitabwidget.hpp b/include/eepp/ui/cuitabwidget.hpp index 13b3a9733..c92781a32 100644 --- a/include/eepp/ui/cuitabwidget.hpp +++ b/include/eepp/ui/cuitabwidget.hpp @@ -141,7 +141,7 @@ class EE_API cUITabWidget : public cUIComplexControl { void SetTabContainerSize(); - void SetContainerSize(); + void SeContainerSize(); void PosTabs(); diff --git a/include/eepp/ui/cuitheme.hpp b/include/eepp/ui/cuitheme.hpp index 65671cd67..2b3f794e4 100644 --- a/include/eepp/ui/cuitheme.hpp +++ b/include/eepp/ui/cuitheme.hpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include namespace EE { namespace Graphics { class cSprite; @@ -41,12 +41,12 @@ class cUICommonDialog; class cUIMessageBox; class cUITabWidget; -class EE_API cUITheme : protected tResourceManager { +class EE_API cUITheme : protected ResourceManager { public: - using tResourceManager::GetById; - using tResourceManager::GetByName; - using tResourceManager::Exists; - using tResourceManager::ExistsId; + using ResourceManager::GetById; + using ResourceManager::GetByName; + using ResourceManager::Exists; + using ResourceManager::ExistsId; static cUITheme * LoadFromTextureAtlas( cUITheme * tTheme, cTextureAtlas * TextureAtlas ); diff --git a/include/eepp/ui/cuithememanager.hpp b/include/eepp/ui/cuithememanager.hpp index e6d5b7c06..5b46d3599 100644 --- a/include/eepp/ui/cuithememanager.hpp +++ b/include/eepp/ui/cuithememanager.hpp @@ -8,7 +8,7 @@ namespace EE { namespace UI { class cUIControl; -class EE_API cUIThemeManager : public tResourceManager { +class EE_API cUIThemeManager : public ResourceManager { SINGLETON_DECLARE_HEADERS(cUIThemeManager) public: @@ -38,17 +38,17 @@ class EE_API cUIThemeManager : public tResourceManager { const bool& DefaultEffectsEnabled() const; - const cTime& ControlsFadeInTime() const; + const Time& ControlsFadeInTime() const; - void ControlsFadeInTime( const cTime & Time ); + void ControlsFadeInTime( const Time & Time ); - const cTime& ControlsFadeOutTime() const; + const Time& ControlsFadeOutTime() const; - void ControlsFadeOutTime( const cTime& Time ); + void ControlsFadeOutTime( const Time& Time ); - void TooltipTimeToShow( const cTime & Time ); + void TooltipTimeToShow( const Time & Time ); - const cTime& TooltipTimeToShow() const; + const Time& TooltipTimeToShow() const; void TooltipFollowMouse( const bool& Follow ); @@ -63,10 +63,10 @@ class EE_API cUIThemeManager : public tResourceManager { bool mAutoApplyDefaultTheme; bool mEnableDefaultEffects; - cTime mFadeInTime; - cTime mFadeOutTime; + Time mFadeInTime; + Time mFadeOutTime; - cTime mTooltipTimeToShow; + Time mTooltipTimeToShow; bool mTooltipFollowMouse; eeSize mCursorSize; diff --git a/include/eepp/ui/cuitooltip.hpp b/include/eepp/ui/cuitooltip.hpp index ce5f19624..09ba87451 100644 --- a/include/eepp/ui/cuitooltip.hpp +++ b/include/eepp/ui/cuitooltip.hpp @@ -91,18 +91,18 @@ class EE_API cUITooltip : public cUIControlAnim { const eeVector2f& AlignOffset() const; - void TooltipTime( const cTime& Time ); + void TooltipTime( const Time& Time ); - void TooltipTimeAdd( const cTime & Time ); + void TooltipTimeAdd( const Time & Time ); - const cTime & TooltipTime() const; + const Time & TooltipTime() const; protected: cTextCache * mTextCache; eeColorA mFontColor; eeColorA mFontShadowColor; eeVector2f mAlignOffset; eeRecti mPadding; - cTime mTooltipTime; + Time mTooltipTime; cUIControl * mTooltipOf; virtual void OnSizeChange(); diff --git a/include/eepp/window/base.hpp b/include/eepp/window/base.hpp index 084907637..08a8ab47b 100644 --- a/include/eepp/window/base.hpp +++ b/include/eepp/window/base.hpp @@ -9,9 +9,9 @@ using namespace EE::Math; #include #include -#include -#include -#include +#include +#include +#include using namespace EE::System; #include diff --git a/include/eepp/window/cengine.hpp b/include/eepp/window/cengine.hpp index 29806e33a..e1413428c 100755 --- a/include/eepp/window/cengine.hpp +++ b/include/eepp/window/cengine.hpp @@ -5,7 +5,7 @@ #include #include -namespace EE { namespace System { class cIniFile; } } +namespace EE { namespace System { class IniFile; } } namespace EE { namespace Window { namespace Backend { class cBackend; } } } namespace EE { namespace Window { @@ -40,7 +40,7 @@ class EE_API cEngine { bool Running() const; /** @return The current window elapsed time. */ - cTime Elapsed() const; + Time Elapsed() const; /** @return The current window width. */ const Uint32& GetWidth() const; @@ -81,7 +81,7 @@ class EE_API cEngine { @param ini The ini file instance @param iniKeyName The ini key name to search the properties */ - WindowSettings CreateWindowSettings( cIniFile * ini, std::string iniKeyName = "EEPP" ); + WindowSettings CreateWindowSettings( IniFile * ini, std::string iniKeyName = "EEPP" ); /** Constructs ContextSettings from an ini file\n It will search for the following properties: @@ -107,7 +107,7 @@ class EE_API cEngine { @param ini The ini file instance @param iniKeyName The ini key name to search the properties */ - ContextSettings CreateContextSettings( cIniFile * ini, std::string iniKeyName = "EEPP" ); + ContextSettings CreateContextSettings( IniFile * ini, std::string iniKeyName = "EEPP" ); /** Enabling Shared GL Context allows asynchronous OpenGL resource loading ( only if is supported by the backend and the OS, SDL 2 backend is the only one supported ). ** If the cTextureLoader is threaded, will upload the texture in another thread to the GPU. So, it will not block the main rendering thread. diff --git a/include/eepp/window/cwindow.hpp b/include/eepp/window/cwindow.hpp index 03d3d0df7..d904b8755 100644 --- a/include/eepp/window/cwindow.hpp +++ b/include/eepp/window/cwindow.hpp @@ -238,7 +238,7 @@ class EE_API cWindow { virtual void Display( bool clear = false ); /** @return The elapsed time for the last frame rendered */ - virtual cTime Elapsed() const; + virtual Time Elapsed() const; /** @return The current frames per second of the screen */ virtual Uint32 FPS() const; @@ -481,8 +481,8 @@ class EE_API cWindow { }; cFPSData FPS; - cClock * FrameElapsed; - cTime ElapsedTime; + Clock * FrameElapsed; + Time ElapsedTime; cFrameData(); diff --git a/projects/linux/ee.files b/projects/linux/ee.files index 69c55e111..ed96333fe 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -28,52 +28,52 @@ ../../src/eepp/core/string.cpp ../../src/eepp/core/memorymanager.cpp ../../src/eepp/core/debug.cpp -../../include/eepp/system/tsingleton.hpp -../../include/eepp/system/tresourcemanager.hpp -../../include/eepp/system/tcontainer.hpp -../../include/eepp/system/czip.hpp -../../include/eepp/system/cclock.hpp -../../include/eepp/system/cthread.hpp -../../include/eepp/system/cresourceloader.hpp -../../include/eepp/system/crc4.hpp -../../include/eepp/system/cpak.hpp -../../include/eepp/system/cpackmanager.hpp -../../include/eepp/system/cpack.hpp -../../include/eepp/system/cobjectloader.hpp -../../include/eepp/system/cmutex.hpp -../../include/eepp/system/clog.hpp -../../include/eepp/system/ciostreammemory.hpp -../../include/eepp/system/ciostreamfile.hpp -../../include/eepp/system/ciostream.hpp -../../include/eepp/system/cinifile.hpp +../../include/eepp/system/singleton.hpp +../../include/eepp/system/resourcemanager.hpp +../../include/eepp/system/container.hpp +../../include/eepp/system/zip.hpp +../../include/eepp/system/lock.hpp +../../include/eepp/system/thread.hpp +../../include/eepp/system/resourceloader.hpp +../../include/eepp/system/rc4.hpp +../../include/eepp/system/pak.hpp +../../include/eepp/system/packmanager.hpp +../../include/eepp/system/pack.hpp +../../include/eepp/system/objectloader.hpp +../../include/eepp/system/mutex.hpp +../../include/eepp/system/log.hpp +../../include/eepp/system/iostreammemory.hpp +../../include/eepp/system/iostreamfile.hpp +../../include/eepp/system/iostream.hpp +../../include/eepp/system/inifile.hpp ../../include/eepp/system/base.hpp -../../src/eepp/system/czip.cpp -../../src/eepp/system/cclock.cpp -../../src/eepp/system/cthread.cpp -../../src/eepp/system/cresourceloader.cpp -../../src/eepp/system/crc4.cpp -../../src/eepp/system/cpak.cpp -../../src/eepp/system/cpackmanager.cpp -../../src/eepp/system/cpack.cpp -../../src/eepp/system/cobjectloader.cpp -../../src/eepp/system/cmutex.cpp -../../src/eepp/system/clog.cpp -../../src/eepp/system/ciostreammemory.cpp -../../src/eepp/system/ciostreamfile.cpp -../../src/eepp/system/cinifile.cpp +../../src/eepp/system/zip.cpp +../../src/eepp/system/clock.cpp +../../src/eepp/system/thread.cpp +../../src/eepp/system/resourceloader.cpp +../../src/eepp/system/rc4.cpp +../../src/eepp/system/pak.cpp +../../src/eepp/system/packmanager.cpp +../../src/eepp/system/pack.cpp +../../src/eepp/system/objectloader.cpp +../../src/eepp/system/mutex.cpp +../../src/eepp/system/log.cpp +../../src/eepp/system/iostreammemory.cpp +../../src/eepp/system/iostreamfile.cpp +../../src/eepp/system/inifile.cpp ../../src/eepp/system/platform/platformimpl.hpp -../../src/eepp/system/platform/posix/cclockimpl.hpp -../../src/eepp/system/platform/posix/cthreadimpl.hpp -../../src/eepp/system/platform/posix/cmuteximpl.hpp -../../src/eepp/system/platform/posix/cclockimpl.cpp -../../src/eepp/system/platform/posix/cthreadimpl.cpp -../../src/eepp/system/platform/posix/cmuteximpl.cpp -../../src/eepp/system/platform/win/cclockimpl.hpp -../../src/eepp/system/platform/win/cthreadimpl.hpp -../../src/eepp/system/platform/win/cmuteximpl.hpp -../../src/eepp/system/platform/win/cclockimpl.cpp -../../src/eepp/system/platform/win/cthreadimpl.cpp -../../src/eepp/system/platform/win/cmuteximpl.cpp +../../src/eepp/system/platform/posix/clockimpl.hpp +../../src/eepp/system/platform/posix/threadimpl.hpp +../../src/eepp/system/platform/posix/muteximpl.hpp +../../src/eepp/system/platform/posix/clockimpl.cpp +../../src/eepp/system/platform/posix/threadimpl.cpp +../../src/eepp/system/platform/posix/muteximpl.cpp +../../src/eepp/system/platform/win/clockimpl.hpp +../../src/eepp/system/platform/win/threadimpl.hpp +../../src/eepp/system/platform/win/muteximpl.hpp +../../src/eepp/system/platform/win/clockimpl.cpp +../../src/eepp/system/platform/win/threadimpl.cpp +../../src/eepp/system/platform/win/muteximpl.cpp ../../include/eepp/gaming/maphelper.hpp ../../include/eepp/gaming/ctilelayer.hpp ../../include/eepp/gaming/cobjectlayer.hpp @@ -573,7 +573,7 @@ ../../src/eepp/gaming/mapeditor/cobjectproperties.cpp ../../include/eepp/core/noncopyable.hpp ../../include/eepp/system/clock.hpp -../../src/eepp/system/clock.cpp +../../src/eepp/system/lock.cpp ../../src/eepp/ui/cuidefaulttheme.cpp ../../include/eepp/ui/cuidefaulttheme.hpp ../../src/eepp/helper/SOIL2/src/SOIL2/stbi_pvr_c.h @@ -609,15 +609,15 @@ ../../src/eepp/physics/cshapepoint.cpp ../../include/eepp/physics/cshapepoint.hpp ../../include/eepp/math/originpoint.hpp -../../include/eepp/system/ccondition.hpp -../../src/eepp/system/ccondition.cpp -../../src/eepp/system/platform/win/cconditionimpl.hpp -../../src/eepp/system/platform/win/cconditionimpl.cpp -../../src/eepp/system/platform/posix/cconditionimpl.hpp -../../src/eepp/system/platform/posix/cconditionimpl.cpp +../../include/eepp/system/condition.hpp +../../src/eepp/system/condition.cpp +../../src/eepp/system/platform/win/conditionimpl.hpp +../../src/eepp/system/platform/win/conditionimpl.cpp +../../src/eepp/system/platform/posix/conditionimpl.hpp +../../src/eepp/system/platform/posix/conditionimpl.cpp ../../include/eepp/graphics/opengl.hpp -../../src/eepp/system/ctime.cpp -../../include/eepp/system/ctime.hpp +../../src/eepp/system/time.cpp +../../include/eepp/system/time.hpp ../../src/eepp/graphics/ctexturesaver.hpp ../../src/eepp/graphics/ctexturesaver.cpp ../../include/eepp/network/udpsocket.hpp @@ -649,13 +649,13 @@ ../../Makefile.base ../../Makefile ../../src/examples/http_request/http_request.cpp -../../include/eepp/system/cthreadlocal.hpp -../../src/eepp/system/cthreadlocal.cpp -../../src/eepp/system/platform/win/cthreadlocalimpl.hpp -../../src/eepp/system/platform/win/cthreadlocalimpl.cpp -../../src/eepp/system/platform/posix/cthreadlocalimpl.hpp -../../src/eepp/system/platform/posix/cthreadlocalimpl.cpp -../../include/eepp/system/tthreadlocalptr.hpp +../../include/eepp/system/threadlocal.hpp +../../src/eepp/system/threadlocal.cpp +../../src/eepp/system/platform/win/threadlocalimpl.hpp +../../src/eepp/system/platform/win/threadlocalimpl.cpp +../../src/eepp/system/platform/posix/threadlocalimpl.hpp +../../src/eepp/system/platform/posix/threadlocalimpl.cpp +../../include/eepp/system/threadlocalptr.hpp ../../external_projects.lua ../../src/eepp/ui/cuitextinputpassword.cpp ../../include/eepp/ui/cuitextinputpassword.hpp @@ -676,3 +676,5 @@ ../../src/eepp/core/memorymanager.cpp ../../src/eepp/core/string.cpp ../../src/eepp/core/version.cpp +../../include/eepp/system/clock.hpp +../../include/eepp/system/clock.hpp diff --git a/src/eepp/audio/music.cpp b/src/eepp/audio/music.cpp index f31914c25..10c466f96 100755 --- a/src/eepp/audio/music.cpp +++ b/src/eepp/audio/music.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include namespace EE { namespace Audio { @@ -16,7 +16,7 @@ Music::~Music() { eeSAFE_DELETE( mFile ); } -bool Music::OpenFromPack( cPack* Pack, const std::string& FilePackPath ) { +bool Music::OpenFromPack( Pack* Pack, const std::string& FilePackPath ) { if ( Pack->IsOpen() && Pack->ExtractFileToMemory( FilePackPath, mData ) ) return OpenFromMemory( reinterpret_cast ( mData.Data ), mData.DataSize ); @@ -25,10 +25,10 @@ bool Music::OpenFromPack( cPack* Pack, const std::string& FilePackPath ) { bool Music::OpenFromFile( const std::string& Filename ) { if ( !FileSystem::FileExists( Filename ) ) { - if ( cPackManager::instance()->FallbackToPacks() ) { + if ( PackManager::instance()->FallbackToPacks() ) { std::string tPath( Filename ); - cPack * tPack = cPackManager::instance()->Exists( tPath ); + Pack * tPack = PackManager::instance()->Exists( tPath ); if ( NULL != tPack ) { return OpenFromPack( tPack, tPath ); @@ -98,11 +98,11 @@ bool Music::OnGetData( SoundStream::Chunk& Data ) { return false; } -cTime Music::GetDuration() const { +Time Music::GetDuration() const { return Seconds( mDuration ); } -void Music::OnSeek( cTime timeOffset ) { +void Music::OnSeek( Time timeOffset ) { if ( NULL != mFile ) { mFile->Seek( timeOffset ); } diff --git a/src/eepp/audio/sound.cpp b/src/eepp/audio/sound.cpp index 57ee7bbfb..27971c86f 100755 --- a/src/eepp/audio/sound.cpp +++ b/src/eepp/audio/sound.cpp @@ -167,7 +167,7 @@ Sound::Status Sound::GetState() const { return Sound::Stopped; } -cTime Sound::PlayingOffset() const { +Time Sound::PlayingOffset() const { float secs = 0.f; ALCheck( alGetSourcef( mSource, AL_SEC_OFFSET, &secs ) ); @@ -175,7 +175,7 @@ cTime Sound::PlayingOffset() const { return Seconds( secs ); } -void Sound::PlayingOffset( const cTime &TimeOffset ) { +void Sound::PlayingOffset( const Time &TimeOffset ) { ALCheck( alSourcef( mSource, AL_SEC_OFFSET, TimeOffset.AsSeconds() ) ); } diff --git a/src/eepp/audio/soundbuffer.cpp b/src/eepp/audio/soundbuffer.cpp index f8fe48cf8..8e4672b44 100755 --- a/src/eepp/audio/soundbuffer.cpp +++ b/src/eepp/audio/soundbuffer.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include @@ -39,10 +39,10 @@ SoundBuffer::~SoundBuffer() { bool SoundBuffer::LoadFromFile(const std::string& Filename) { if ( !FileSystem::FileExists( Filename ) ) { - if ( cPackManager::instance()->FallbackToPacks() ) { + if ( PackManager::instance()->FallbackToPacks() ) { std::string tPath( Filename ); - cPack * tPack = cPackManager::instance()->Exists( tPath ); + Pack * tPack = PackManager::instance()->Exists( tPath ); if ( NULL != tPack ) { return LoadFromPack( tPack, tPath ); @@ -87,7 +87,7 @@ bool SoundBuffer::LoadFromFile(const std::string& Filename) { } } -bool SoundBuffer::LoadFromPack( cPack* Pack, const std::string& FilePackPath ) { +bool SoundBuffer::LoadFromPack( Pack* Pack, const std::string& FilePackPath ) { bool Ret = false; SafeDataPointer PData; @@ -182,7 +182,7 @@ unsigned int SoundBuffer::GetChannelCount() const { return ChannelCount; } -cTime SoundBuffer::GetDuration() const { +Time SoundBuffer::GetDuration() const { return mDuration; } diff --git a/src/eepp/audio/soundfile.cpp b/src/eepp/audio/soundfile.cpp index a3610d00d..c087117d6 100755 --- a/src/eepp/audio/soundfile.cpp +++ b/src/eepp/audio/soundfile.cpp @@ -156,7 +156,7 @@ void SoundFile::Write(const Int16*, std::size_t) { eePRINTL( "Failed to write to sound file (not supported)" ); } -void SoundFile::Seek( cTime timeOffset ) { +void SoundFile::Seek( Time timeOffset ) { eePRINTL( "Trying to seek a file that doesn't support seeking." ); } diff --git a/src/eepp/audio/soundfile.hpp b/src/eepp/audio/soundfile.hpp index 70a69538b..82285753c 100755 --- a/src/eepp/audio/soundfile.hpp +++ b/src/eepp/audio/soundfile.hpp @@ -48,7 +48,7 @@ class EE_API SoundFile { /** @brief Change the current read position in the file ** @param timeOffset New playing position, from the beginning of the file */ - virtual void Seek( cTime timeOffset ); + virtual void Seek( Time timeOffset ); protected : SoundFile(); diff --git a/src/eepp/audio/soundfiledefault.cpp b/src/eepp/audio/soundfiledefault.cpp index aea406045..f8e71413d 100755 --- a/src/eepp/audio/soundfiledefault.cpp +++ b/src/eepp/audio/soundfiledefault.cpp @@ -150,7 +150,7 @@ void SoundFileDefault::Write( const Int16 * Data, std::size_t SamplesCount ) { sf_write_short( mFile, Data, SamplesCount ); } -void SoundFileDefault::Seek( cTime timeOffset ) { +void SoundFileDefault::Seek( Time timeOffset ) { if ( NULL != mFile ) { sf_count_t frameOffset = static_cast( timeOffset.AsSeconds() * mSampleRate / 1000 ); sf_seek( mFile, frameOffset, SEEK_SET ); diff --git a/src/eepp/audio/soundfiledefault.hpp b/src/eepp/audio/soundfiledefault.hpp index 73c342420..388004339 100755 --- a/src/eepp/audio/soundfiledefault.hpp +++ b/src/eepp/audio/soundfiledefault.hpp @@ -26,7 +26,7 @@ class EE_API SoundFileDefault : public SoundFile { virtual void Write(const Int16* Data, std::size_t SamplesCount); - virtual void Seek( cTime timeOffset ); + virtual void Seek( Time timeOffset ); private : virtual bool OpenRead( const std::string& Filename, std::size_t& SamplesCount, unsigned int& ChannelCount, unsigned int& SampleRate ); diff --git a/src/eepp/audio/soundfileogg.cpp b/src/eepp/audio/soundfileogg.cpp index f72f2dc99..2b6e833a9 100755 --- a/src/eepp/audio/soundfileogg.cpp +++ b/src/eepp/audio/soundfileogg.cpp @@ -101,7 +101,7 @@ std::size_t SoundFileOgg::Read( Int16 * Data, std::size_t SamplesCount ) { return 0; } -void SoundFileOgg::Seek( cTime timeOffset ) { +void SoundFileOgg::Seek( Time timeOffset ) { if ( NULL != mStream ) { Uint32 frameOffset = static_cast( timeOffset.AsSeconds() * mSampleRate / 1000 ); stb_vorbis_seek( mStream, frameOffset ); diff --git a/src/eepp/audio/soundfileogg.hpp b/src/eepp/audio/soundfileogg.hpp index 0bc9354d7..45fb267e5 100755 --- a/src/eepp/audio/soundfileogg.hpp +++ b/src/eepp/audio/soundfileogg.hpp @@ -21,7 +21,7 @@ class EE_API SoundFileOgg : public SoundFile { virtual std::size_t Read(Int16* Data, std::size_t SamplesCount); - virtual void Seek( cTime timeOffset ); + virtual void Seek( Time timeOffset ); private : virtual bool OpenRead(const std::string& Filename, std::size_t& SamplesCount, unsigned int& ChannelCount, unsigned int& SampleRate); diff --git a/src/eepp/audio/soundstream.cpp b/src/eepp/audio/soundstream.cpp index 52c588c6a..dacd78384 100755 --- a/src/eepp/audio/soundstream.cpp +++ b/src/eepp/audio/soundstream.cpp @@ -45,7 +45,7 @@ void SoundStream::Play() { return; } - OnSeek( cTime::Zero ); + OnSeek( Time::Zero ); mSamplesProcessed = 0; mIsStreaming = true; // Start updating the stream in a separate thread to avoid blocking the application @@ -78,7 +78,7 @@ Sound::Status SoundStream::GetState() const { return status; } -cTime SoundStream::PlayingOffset() const { +Time SoundStream::PlayingOffset() const { if ( mSampleRate && mChannelCount ) { float secs = 0.f; @@ -87,10 +87,10 @@ cTime SoundStream::PlayingOffset() const { return Seconds( secs + (float)mSamplesProcessed / (float)mSampleRate / (float)mChannelCount ); } - return cTime::Zero; + return Time::Zero; } -void SoundStream::PlayingOffset( const cTime &timeOffset ) { +void SoundStream::PlayingOffset( const Time &timeOffset ) { Status oldStatus = State(); // Stop the stream @@ -211,7 +211,7 @@ bool SoundStream::FillAndPushBuffer( const unsigned int& Buffer ) { // Check if the stream must loop or stop if ( mLoop ) { // Return to the beginning of the stream source - OnSeek( cTime::Zero ); + OnSeek( Time::Zero ); // If we previously had no data, try to fill the buffer once again if ( !Data.Samples || ( Data.SamplesCount == 0 ) ) { diff --git a/src/eepp/core/debug.cpp b/src/eepp/core/debug.cpp index f2316d6ff..eca679944 100644 --- a/src/eepp/core/debug.cpp +++ b/src/eepp/core/debug.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -29,9 +29,9 @@ void eeREPORT_ASSERT( const char * File, int Line, const char * Exp ) { #else if ( PrintDebugInLog ) { - cLog::instance()->Writef( "ASSERT: %s file:%s line:%d", Exp, File, Line ); + Log::instance()->Writef( "ASSERT: %s file:%s line:%d", Exp, File, Line ); - if ( !cLog::instance()->ConsoleOutput() ) + if ( !Log::instance()->ConsoleOutput() ) printf( "ASSERT: %s file:%s line:%d", Exp, File, Line ); } else { printf( "ASSERT: %s file:%s line:%d", Exp, File, Line ); @@ -57,8 +57,8 @@ static void print_buffer( std::string& buf, bool newLine ) { #ifdef EE_COMPILER_MSVC OutputDebugStringA( buf.c_str() ); #else - if ( PrintDebugInLog && cLog::instance()->ConsoleOutput() ) { - cLog::instance()->Write( buf, false ); + if ( PrintDebugInLog && Log::instance()->ConsoleOutput() ) { + Log::instance()->Write( buf, false ); return; } else { printf("%s", buf.c_str() ); @@ -66,7 +66,7 @@ static void print_buffer( std::string& buf, bool newLine ) { #endif if ( PrintDebugInLog ) - cLog::instance()->Write( buf, false ); + Log::instance()->Write( buf, false ); } void eePRINT( const char * format, ... ) { diff --git a/src/eepp/core/memorymanager.cpp b/src/eepp/core/memorymanager.cpp index 9181a9e4c..2f4b43d65 100644 --- a/src/eepp/core/memorymanager.cpp +++ b/src/eepp/core/memorymanager.cpp @@ -2,10 +2,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include using namespace EE::System; @@ -15,7 +15,7 @@ static AllocatedPointerMap sMapPointers; static size_t sTotalMemoryUsage = 0; static size_t sPeakMemoryUsage = 0; static AllocatedPointer sBiggestAllocation = AllocatedPointer( NULL, "", 0, 0 ); -static cMutex sAllocMutex; +static Mutex sAlloMutex; AllocatedPointer::AllocatedPointer( void * Data, const std::string& File, int Line, size_t Memory ) { mData = Data; @@ -35,7 +35,7 @@ void * MemoryManager::AddPointerInPlace( void * Place, const AllocatedPointer& a } void * MemoryManager::AddPointer( const AllocatedPointer& aAllocatedPointer ) { - cLock l( sAllocMutex ); + Lock l( sAlloMutex ); sMapPointers.insert( AllocatedPointerMap::value_type( aAllocatedPointer.mData, aAllocatedPointer ) ); @@ -53,7 +53,7 @@ void * MemoryManager::AddPointer( const AllocatedPointer& aAllocatedPointer ) { } bool MemoryManager::RemovePointer( void * Data ) { - cLock l( sAllocMutex ); + Lock l( sAlloMutex ); AllocatedPointerMapIt it = sMapPointers.find( Data ); @@ -86,7 +86,7 @@ void MemoryManager::ShowResults() { #ifdef EE_MEMORY_MANAGER if ( EE::PrintDebugInLog ) { - cLog::DestroySingleton(); + Log::DestroySingleton(); EE::PrintDebugInLog = false; } diff --git a/src/eepp/gaming/cmap.cpp b/src/eepp/gaming/cmap.cpp index c7909bf36..b2201a17c 100644 --- a/src/eepp/gaming/cmap.cpp +++ b/src/eepp/gaming/cmap.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include @@ -792,7 +792,7 @@ void cMap::SetCreateGameObjectCallback( const CreateGOCb& Cb ) { mCreateGOCb = Cb; } -bool cMap::LoadFromStream( cIOStream& IOS ) { +bool cMap::LoadFromStream( IOStream& IOS ) { sMapHdr MapHdr; Uint32 i, z; @@ -1039,12 +1039,12 @@ bool cMap::Load( const std::string& path ) { if ( FileSystem::FileExists( path ) ) { mPath = path; - cIOStreamFile IOS( mPath, std::ios::in | std::ios::binary ); + IOStreamFile IOS( mPath, std::ios::in | std::ios::binary ); return LoadFromStream( IOS ); - } else if ( cPackManager::instance()->FallbackToPacks() ) { + } else if ( PackManager::instance()->FallbackToPacks() ) { std::string tPath( path ); - cPack * tPack = cPackManager::instance()->Exists( tPath ) ; + Pack * tPack = PackManager::instance()->Exists( tPath ) ; if ( NULL != tPack ) { mPath = tPath; @@ -1055,7 +1055,7 @@ bool cMap::Load( const std::string& path ) { return false; } -bool cMap::LoadFromPack( cPack * Pack, const std::string& FilePackPath ) { +bool cMap::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( FilePackPath ) ) { SafeDataPointer PData; @@ -1068,12 +1068,12 @@ bool cMap::LoadFromPack( cPack * Pack, const std::string& FilePackPath ) { } bool cMap::LoadFromMemory( const char * Data, const Uint32& DataSize ) { - cIOStreamMemory IOS( Data, DataSize ); + IOStreamMemory IOS( Data, DataSize ); return LoadFromStream( IOS ); } -void cMap::SaveToStream( cIOStream& IOS ) { +void cMap::SaveToStream( IOStream& IOS ) { Uint32 i; sMapHdr MapHdr; cLayer * tLayer; @@ -1360,7 +1360,7 @@ void cMap::SaveToStream( cIOStream& IOS ) { void cMap::Save( const std::string& path ) { if ( !FileSystem::IsDirectory( path ) ) { - cIOStreamFile IOS( path, std::ios::out | std::ios::binary ); + IOStreamFile IOS( path, std::ios::out | std::ios::binary ); SaveToStream( IOS ); diff --git a/src/eepp/gaming/mapeditor/cmapeditor.cpp b/src/eepp/gaming/mapeditor/cmapeditor.cpp index 12b1e3795..cd00216b6 100644 --- a/src/eepp/gaming/mapeditor/cmapeditor.cpp +++ b/src/eepp/gaming/mapeditor/cmapeditor.cpp @@ -190,7 +190,7 @@ void cMapEditor::CreateETGMenu() { mTabWidget->AddEventListener( cUIEvent::EventOnTabSelected, cb::Make1( this, &cMapEditor::OnTabSelected ) ); CreateTabs(); - CreateLightContainer(); + CreateLighContainer(); CreateSubTextureContainer( Width ); @@ -334,7 +334,7 @@ void cMapEditor::CreateSubTextureContainer( Int32 Width ) { FillSGCombo(); } -void cMapEditor::CreateLightContainer() { +void cMapEditor::CreateLighContainer() { cUIPushButton * NewLightBut = mTheme->CreatePushButton( mLightCont, eeSize( mLightCont->Size().Width() - TAB_CONT_X_DIST * 2, 22 ), eeVector2i( TAB_CONT_X_DIST, 0 ) ); NewLightBut->Text( "New Light" ); NewLightBut->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cMapEditor::OnNewLight ) ); diff --git a/src/eepp/graphics/cconsole.cpp b/src/eepp/graphics/cconsole.cpp index cc243f91a..e8365a61b 100755 --- a/src/eepp/graphics/cconsole.cpp +++ b/src/eepp/graphics/cconsole.cpp @@ -94,8 +94,8 @@ cConsole::~cConsole() { eeSAFE_DELETE( mTBuf ); - if ( cLog::ExistsSingleton() ) { - cLog::instance()->RemoveLogReader( this ); + if ( Log::ExistsSingleton() ) { + Log::instance()->RemoveLogReader( this ); } } @@ -144,7 +144,7 @@ void cConsole::Create( cFont* Font, const bool& MakeDefaultCommands, const bool& CmdGetLog(); if ( AttachToLog ) { - cLog::instance()->AddLogReader( this ); + Log::instance()->AddLogReader( this ); } } @@ -682,7 +682,7 @@ void cConsole::CmdFrameLimit ( const std::vector < String >& params ) { } void cConsole::CmdGetLog() { - std::vector < String > tvec = String::Split( String( String::ToStr( cLog::instance()->Buffer() ) ) ); + std::vector < String > tvec = String::Split( String( String::ToStr( Log::instance()->Buffer() ) ) ); if ( tvec.size() > 0 ) { for ( unsigned int i = 0; i < tvec.size(); i++ ) PrivPushText( tvec[i] ); diff --git a/src/eepp/graphics/cfontmanager.cpp b/src/eepp/graphics/cfontmanager.cpp index 25e94858f..ef3981b7a 100644 --- a/src/eepp/graphics/cfontmanager.cpp +++ b/src/eepp/graphics/cfontmanager.cpp @@ -12,7 +12,7 @@ cFontManager::~cFontManager() { cFont * cFontManager::Add( cFont * Font ) { eeASSERT( NULL != Font ); - return tResourceManager::Add( Font ); + return ResourceManager::Add( Font ); } }} diff --git a/src/eepp/graphics/cframebuffermanager.hpp b/src/eepp/graphics/cframebuffermanager.hpp index e8869a789..540032599 100644 --- a/src/eepp/graphics/cframebuffermanager.hpp +++ b/src/eepp/graphics/cframebuffermanager.hpp @@ -6,7 +6,7 @@ namespace EE { namespace Graphics { namespace Private { -class EE_API cFrameBufferManager : public tContainer { +class EE_API cFrameBufferManager : public Container { SINGLETON_DECLARE_HEADERS(cFrameBufferManager) public: diff --git a/src/eepp/graphics/cimage.cpp b/src/eepp/graphics/cimage.cpp index 9c49e7bd2..94cc51857 100644 --- a/src/eepp/graphics/cimage.cpp +++ b/src/eepp/graphics/cimage.cpp @@ -1,8 +1,8 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -203,9 +203,9 @@ EE_PIXEL_FORMAT cImage::ChannelsToPixelFormat( const Uint32& channels ) { bool cImage::GetInfo( const std::string& path, int * width, int * height, int * channels ) { bool res = stbi_info( path.c_str(), width, height, channels ) != 0; - if ( !res && cPackManager::instance()->FallbackToPacks() ) { + if ( !res && PackManager::instance()->FallbackToPacks() ) { std::string npath( path ); - cPack * tPack = cPackManager::instance()->Exists( npath ); + Pack * tPack = PackManager::instance()->Exists( npath ); if ( NULL != tPack ) { SafeDataPointer PData; @@ -295,7 +295,7 @@ cImage::cImage( std::string Path, const unsigned int& forceChannels ) : mLoadedFromStbi(false) { int w, h, c; - cPack * tPack = NULL; + Pack * tPack = NULL; Uint8 * data = stbi_load( Path.c_str(), &w, &h, &c, mChannels ); if ( NULL == data ) { @@ -313,7 +313,7 @@ cImage::cImage( std::string Path, const unsigned int& forceChannels ) : mSize = mWidth * mHeight * mChannels; mLoadedFromStbi = true; - } else if ( cPackManager::instance()->FallbackToPacks() && NULL != ( tPack = cPackManager::instance()->Exists( Path ) ) ) { + } else if ( PackManager::instance()->FallbackToPacks() && NULL != ( tPack = PackManager::instance()->Exists( Path ) ) ) { LoadFromPack( tPack, Path ); } else { std::string reason = "."; @@ -326,7 +326,7 @@ cImage::cImage( std::string Path, const unsigned int& forceChannels ) : } } -cImage::cImage( cPack * Pack, std::string FilePackPath, const unsigned int& forceChannels ) : +cImage::cImage( Pack * Pack, std::string FilePackPath, const unsigned int& forceChannels ) : mPixels(NULL), mWidth(0), mHeight(0), @@ -343,7 +343,7 @@ cImage::~cImage() { ClearCache(); } -void cImage::LoadFromPack( cPack * Pack, const std::string& FilePackPath ) { +void cImage::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( FilePackPath ) ) { SafeDataPointer PData; diff --git a/src/eepp/graphics/cparticlesystem.cpp b/src/eepp/graphics/cparticlesystem.cpp index 159da2ae3..cd00b2b87 100755 --- a/src/eepp/graphics/cparticlesystem.cpp +++ b/src/eepp/graphics/cparticlesystem.cpp @@ -366,7 +366,7 @@ void cParticleSystem::Update() { Update( cEngine::instance()->Elapsed() ); } -void cParticleSystem::Update( const cTime& Time ) { +void cParticleSystem::Update( const System::Time& time ) { if ( !mUsed ) return; @@ -376,7 +376,7 @@ void cParticleSystem::Update( const cTime& Time ) { P = &mParticle[i]; if ( P->Used() || P->A() > 0.f ) { - P->Update( Time.AsMilliseconds() * mTime ); + P->Update( time.AsMilliseconds() * mTime ); // If not alive if ( P->A() <= 0.f ) { diff --git a/src/eepp/graphics/cshader.cpp b/src/eepp/graphics/cshader.cpp index f95c6140c..1d00fb06a 100644 --- a/src/eepp/graphics/cshader.cpp +++ b/src/eepp/graphics/cshader.cpp @@ -34,9 +34,9 @@ cShader::cShader( const Uint32& Type, const std::string& Filename ) { SetSource( (const char*)PData.Data, PData.DataSize ); } else { std::string tPath = Filename; - cPack * tPack = NULL; + Pack * tPack = NULL; - if ( cPackManager::instance()->FallbackToPacks() && NULL != ( tPack = cPackManager::instance()->Exists( tPath ) ) ) { + if ( PackManager::instance()->FallbackToPacks() && NULL != ( tPack = PackManager::instance()->Exists( tPath ) ) ) { SafeDataPointer PData; tPack->ExtractFileToMemory( tPath, PData ); @@ -58,7 +58,7 @@ cShader::cShader( const Uint32& Type, const char * Data, const Uint32& DataSize Compile(); } -cShader::cShader( const Uint32& Type, cPack * Pack, const std::string& Filename ) { +cShader::cShader( const Uint32& Type, Pack * Pack, const std::string& Filename ) { SafeDataPointer PData; Init( Type ); @@ -290,7 +290,7 @@ cVertexShader::cVertexShader( const char * Data, const Uint32& DataSize ) : { } -cVertexShader::cVertexShader( cPack * Pack, const std::string& Filename ) : +cVertexShader::cVertexShader( Pack * Pack, const std::string& Filename ) : cShader( GL_VERTEX_SHADER, Pack, Filename ) { } @@ -315,7 +315,7 @@ cFragmentShader::cFragmentShader( const char * Data, const Uint32& DataSize ) : { } -cFragmentShader::cFragmentShader( cPack * Pack, const std::string& Filename ) : +cFragmentShader::cFragmentShader( Pack * Pack, const std::string& Filename ) : cShader( GL_FRAGMENT_SHADER, Pack, Filename ) { } diff --git a/src/eepp/graphics/cshaderprogram.cpp b/src/eepp/graphics/cshaderprogram.cpp index 38d3049d6..75cceef1f 100644 --- a/src/eepp/graphics/cshaderprogram.cpp +++ b/src/eepp/graphics/cshaderprogram.cpp @@ -22,7 +22,7 @@ cShaderProgram * cShaderProgram::New( const char * VertexShaderData, const Uint3 return eeNew( cShaderProgram, ( VertexShaderData, VertexShaderDataSize, FragmentShaderData, FragmentShaderDataSize, name ) ); } -cShaderProgram * cShaderProgram::New( cPack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name ) { +cShaderProgram * cShaderProgram::New( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name ) { return eeNew( cShaderProgram, ( Pack, VertexShaderPath, FragmentShaderPath, name ) ); } @@ -72,7 +72,7 @@ cShaderProgram::cShaderProgram( const std::string& VertexShaderFile, const std:: Link(); } -cShaderProgram::cShaderProgram( cPack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name ) : +cShaderProgram::cShaderProgram( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name ) : mHandler(0), mId(0) { diff --git a/src/eepp/graphics/csprite.cpp b/src/eepp/graphics/csprite.cpp index 500239463..04c1096b1 100755 --- a/src/eepp/graphics/csprite.cpp +++ b/src/eepp/graphics/csprite.cpp @@ -484,8 +484,8 @@ void cSprite::Update() { Update( cEngine::instance()->Elapsed() ); } -void cSprite::Update( const cTime& ElapsedTime ) { - if ( mFrames.size() > 1 && !SPR_FGET( SPRITE_FLAG_ANIM_PAUSED ) && cTime::Zero != ElapsedTime ) { +void cSprite::Update( const Time& ElapsedTime ) { + if ( mFrames.size() > 1 && !SPR_FGET( SPRITE_FLAG_ANIM_PAUSED ) && Time::Zero != ElapsedTime ) { unsigned int Size = (unsigned int)mFrames.size() - 1; if ( mRepeations == 0 ) diff --git a/src/eepp/graphics/ctextureatlas.cpp b/src/eepp/graphics/ctextureatlas.cpp index 5e1ff64f3..d34b70afe 100644 --- a/src/eepp/graphics/ctextureatlas.cpp +++ b/src/eepp/graphics/ctextureatlas.cpp @@ -3,7 +3,7 @@ namespace EE { namespace Graphics { cTextureAtlas::cTextureAtlas( const std::string& name ) : - tResourceManager ( true ) + ResourceManager ( true ) { Name( name ); } @@ -33,7 +33,7 @@ const Uint32& cTextureAtlas::Id() const { } cSubTexture * cTextureAtlas::Add( cSubTexture * subTexture ) { - return tResourceManager::Add( subTexture ); + return ResourceManager::Add( subTexture ); } cSubTexture * cTextureAtlas::Add( const Uint32& TexId, const std::string& Name ) { @@ -53,7 +53,7 @@ cSubTexture * cTextureAtlas::Add( const Uint32& TexId, const eeRecti& SrcRect, c } Uint32 cTextureAtlas::Count() { - return tResourceManager::Count(); + return ResourceManager::Count(); } void cTextureAtlas::SetTextures( std::vector textures ) { diff --git a/src/eepp/graphics/ctextureatlasloader.cpp b/src/eepp/graphics/ctextureatlasloader.cpp index 81b80d0e8..7533c5b98 100644 --- a/src/eepp/graphics/ctextureatlasloader.cpp +++ b/src/eepp/graphics/ctextureatlasloader.cpp @@ -3,8 +3,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -48,7 +48,7 @@ cTextureAtlasLoader::cTextureAtlasLoader( const Uint8* Data, const Uint32& DataS LoadFromMemory( Data, DataSize, TextureAtlasName ); } -cTextureAtlasLoader::cTextureAtlasLoader( cPack * Pack, const std::string& FilePackPath, const bool& Threaded, GLLoadCallback LoadCallback ) : +cTextureAtlasLoader::cTextureAtlasLoader( Pack * Pack, const std::string& FilePackPath, const bool& Threaded, GLLoadCallback LoadCallback ) : mTextureAtlasPath( FilePackPath ), mThreaded( Threaded ), mLoaded(false), @@ -61,7 +61,7 @@ cTextureAtlasLoader::cTextureAtlasLoader( cPack * Pack, const std::string& FileP LoadFromPack( Pack, FilePackPath ); } -cTextureAtlasLoader::cTextureAtlasLoader( cIOStream& IOS, const bool& Threaded, GLLoadCallback LoadCallback ) : +cTextureAtlasLoader::cTextureAtlasLoader( IOStream& IOS, const bool& Threaded, GLLoadCallback LoadCallback ) : mThreaded( Threaded ), mLoaded(false), mPack(NULL), @@ -88,7 +88,7 @@ void cTextureAtlasLoader::Update() { CreateSubTextures(); } -void cTextureAtlasLoader::LoadFromStream( cIOStream& IOS ) { +void cTextureAtlasLoader::LoadFromStream( IOStream& IOS ) { mRL.Threaded( mThreaded ); if ( IOS.IsOpen() ) { @@ -139,13 +139,13 @@ void cTextureAtlasLoader::Load( const std::string& TextureAtlasPath ) { mTextureAtlasPath = TextureAtlasPath; if ( FileSystem::FileExists( mTextureAtlasPath ) ) { - cIOStreamFile IOS( mTextureAtlasPath, std::ios::in | std::ios::binary ); + IOStreamFile IOS( mTextureAtlasPath, std::ios::in | std::ios::binary ); LoadFromStream( IOS ); - } else if ( cPackManager::instance()->FallbackToPacks() ) { + } else if ( PackManager::instance()->FallbackToPacks() ) { std::string tgPath( mTextureAtlasPath ); - cPack * tPack = cPackManager::instance()->Exists( tgPath ); + Pack * tPack = PackManager::instance()->Exists( tgPath ); if ( NULL != tPack ) { LoadFromPack( tPack, tgPath ); @@ -153,7 +153,7 @@ void cTextureAtlasLoader::Load( const std::string& TextureAtlasPath ) { } } -void cTextureAtlasLoader::LoadFromPack( cPack * Pack, const std::string& FilePackPath ) { +void cTextureAtlasLoader::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( FilePackPath ) ) { mPack = Pack; @@ -169,7 +169,7 @@ void cTextureAtlasLoader::LoadFromMemory( const Uint8* Data, const Uint32& DataS if ( TextureAtlasName.size() ) mTextureAtlasPath = TextureAtlasName; - cIOStreamMemory IOS( (const char*)Data, DataSize ); + IOStreamMemory IOS( (const char*)Data, DataSize ); LoadFromStream( IOS ); } @@ -305,7 +305,7 @@ bool cTextureAtlasLoader::UpdateTextureAtlas() { } } - cIOStreamFile fs( mTextureAtlasPath, std::ios::out | std::ios::binary ); + IOStreamFile fs( mTextureAtlasPath, std::ios::out | std::ios::binary ); if ( fs.IsOpen() ) { fs.Write( reinterpret_cast (&mTexGrHdr), sizeof(sTextureAtlasHdr) ); @@ -443,7 +443,7 @@ bool cTextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std: } else if ( 1 == NeedUpdate ) { std::string etapath = FileSystem::FileRemoveExtension( tapath ) + EE_TEXTURE_ATLAS_EXTENSION; - cIOStreamFile fs( etapath , std::ios::out | std::ios::binary ); + IOStreamFile fs( etapath , std::ios::out | std::ios::binary ); if ( !fs.IsOpen() ) return false; diff --git a/src/eepp/graphics/ctextureatlasmanager.cpp b/src/eepp/graphics/ctextureatlasmanager.cpp index 1a9796018..a660b02b5 100644 --- a/src/eepp/graphics/ctextureatlasmanager.cpp +++ b/src/eepp/graphics/ctextureatlasmanager.cpp @@ -6,7 +6,7 @@ namespace EE { namespace Graphics { SINGLETON_DECLARE_IMPLEMENTATION(cTextureAtlasManager) cTextureAtlasManager::cTextureAtlasManager() : - tResourceManager( false ), + ResourceManager( false ), mWarnings( false ) { Add( cGlobalTextureAtlas::instance() ); @@ -21,7 +21,7 @@ cTextureAtlas * cTextureAtlasManager::Load( const std::string& TextureAtlasPath return loader.GetTextureAtlas(); } -cTextureAtlas * cTextureAtlasManager::LoadFromStream( cIOStream& IOS ) { +cTextureAtlas * cTextureAtlasManager::LoadFromStream( IOStream& IOS ) { cTextureAtlasLoader loader( IOS ); return loader.GetTextureAtlas(); @@ -33,7 +33,7 @@ cTextureAtlas * cTextureAtlasManager::LoadFromMemory( const Uint8* Data, const U return loader.GetTextureAtlas(); } -cTextureAtlas * cTextureAtlasManager::LoadFromPack( cPack * Pack, const std::string& FilePackPath ) { +cTextureAtlas * cTextureAtlasManager::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { cTextureAtlasLoader loader( Pack, FilePackPath ); return loader.GetTextureAtlas(); diff --git a/src/eepp/graphics/ctexturefactory.cpp b/src/eepp/graphics/ctexturefactory.cpp index 7c07f4d5a..b3e2e76fc 100755 --- a/src/eepp/graphics/ctexturefactory.cpp +++ b/src/eepp/graphics/ctexturefactory.cpp @@ -37,7 +37,7 @@ Uint32 cTextureFactory::LoadFromPixels( const unsigned char * Pixels, const unsi return myTex.Id(); } -Uint32 cTextureFactory::LoadFromPack( cPack* Pack, const std::string& FilePackPath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { +Uint32 cTextureFactory::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { cTextureLoader myTex( Pack, FilePackPath, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); myTex.Load(); return myTex.Id(); @@ -49,7 +49,7 @@ Uint32 cTextureFactory::LoadFromMemory( const unsigned char * ImagePtr, const un return myTex.Id(); } -Uint32 cTextureFactory::LoadFromStream( cIOStream& Stream, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { +Uint32 cTextureFactory::LoadFromStream( IOStream& Stream, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { cTextureLoader myTex( Stream, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); myTex.Load(); return myTex.Id(); diff --git a/src/eepp/graphics/ctexturefont.cpp b/src/eepp/graphics/ctexturefont.cpp index 9cad9e66e..b45fb53b2 100755 --- a/src/eepp/graphics/ctexturefont.cpp +++ b/src/eepp/graphics/ctexturefont.cpp @@ -1,7 +1,7 @@ #include #include -#include -#include +#include +#include namespace EE { namespace Graphics { @@ -144,13 +144,13 @@ void cTextureFont::BuildFromGlyphs() { bool cTextureFont::Load( const Uint32& TexId, const std::string& CoordinatesDatPath ) { if ( FileSystem::FileExists( CoordinatesDatPath ) ) { - cIOStreamFile IOS( CoordinatesDatPath, std::ios::in | std::ios::binary ); + IOStreamFile IOS( CoordinatesDatPath, std::ios::in | std::ios::binary ); return LoadFromStream( TexId, IOS ); - } else if ( cPackManager::instance()->FallbackToPacks() ) { + } else if ( PackManager::instance()->FallbackToPacks() ) { std::string tPath( CoordinatesDatPath ); - cPack * tPack = cPackManager::instance()->Exists( tPath ); + Pack * tPack = PackManager::instance()->Exists( tPath ); if ( NULL != tPack ) { return LoadFromPack( TexId, tPack, tPath ); @@ -160,7 +160,7 @@ bool cTextureFont::Load( const Uint32& TexId, const std::string& CoordinatesDatP return false; } -bool cTextureFont::LoadFromPack( const Uint32& TexId, cPack* Pack, const std::string& FilePackPath ) { +bool cTextureFont::LoadFromPack( const Uint32& TexId, Pack* Pack, const std::string& FilePackPath ) { if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( FilePackPath ) ) { SafeDataPointer PData; @@ -173,12 +173,12 @@ bool cTextureFont::LoadFromPack( const Uint32& TexId, cPack* Pack, const std::st } bool cTextureFont::LoadFromMemory( const Uint32& TexId, const char* CoordData, const Uint32& CoordDataSize ) { - cIOStreamMemory IOS( CoordData, CoordDataSize ); + IOStreamMemory IOS( CoordData, CoordDataSize ); return LoadFromStream( TexId, IOS ); } -bool cTextureFont::LoadFromStream( const Uint32& TexId, cIOStream& IOS ) { +bool cTextureFont::LoadFromStream( const Uint32& TexId, IOStream& IOS ) { mTexId = TexId; if ( mTexId > 0 ) { diff --git a/src/eepp/graphics/ctexturefontloader.cpp b/src/eepp/graphics/ctexturefontloader.cpp index d70666464..9b5433ddf 100644 --- a/src/eepp/graphics/ctexturefontloader.cpp +++ b/src/eepp/graphics/ctexturefontloader.cpp @@ -4,7 +4,7 @@ namespace EE { namespace Graphics { cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const unsigned int& StartChar, const unsigned int& Spacing, const unsigned int& TexColumns, const unsigned int& TexRows, const Uint16& NumChars ) : - cObjectLoader( FontTexLoader ), + ObjectLoader( FontTexLoader ), mLoadType( TEF_LT_TEX ), mFontName( FontName ), mStartChar( StartChar ), @@ -19,7 +19,7 @@ cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoad } cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const std::string& CoordinatesDatPath ) : - cObjectLoader( FontTexLoader ), + ObjectLoader( FontTexLoader ), mLoadType( TEF_LT_PATH ), mFontName( FontName ), mFilepath( CoordinatesDatPath ), @@ -29,8 +29,8 @@ cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoad mTexLoader = TexLoader; } -cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, cPack * Pack, const std::string& FilePackPath ) : - cObjectLoader( FontTexLoader ), +cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, Pack * Pack, const std::string& FilePackPath ) : + ObjectLoader( FontTexLoader ), mLoadType( TEF_LT_PACK ), mFontName( FontName ), mFilepath( FilePackPath ), @@ -42,7 +42,7 @@ cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoad } cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const char* CoordData, const Uint32& CoordDataSize ) : - cObjectLoader( FontTexLoader ), + ObjectLoader( FontTexLoader ), mLoadType( TEF_LT_MEM ), mFontName( FontName ), mData( CoordData ), @@ -58,7 +58,7 @@ cTextureFontLoader::~cTextureFontLoader() { } void cTextureFontLoader::Start() { - cObjectLoader::Start(); + ObjectLoader::Start(); mTexLoader->Threaded( false ); @@ -137,7 +137,7 @@ void cTextureFontLoader::Unload() { } void cTextureFontLoader::Reset() { - cObjectLoader::Reset(); + ObjectLoader::Reset(); mFont = NULL; mTexLoaded = false; diff --git a/src/eepp/graphics/ctextureloader.cpp b/src/eepp/graphics/ctextureloader.cpp index 2702ccecb..da2b038d3 100644 --- a/src/eepp/graphics/ctextureloader.cpp +++ b/src/eepp/graphics/ctextureloader.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include @@ -20,22 +20,22 @@ namespace EE { namespace Graphics { namespace IOCb { - // stb_image callbacks that operate on a cIOStream + // stb_image callbacks that operate on a IOStream int read(void* user, char* data, int size) { - cIOStream * stream = static_cast(user); + IOStream * stream = static_cast(user); return static_cast(stream->Read(data, size)); } void skip(void* user, unsigned int size) { - cIOStream * stream = static_cast(user); + IOStream * stream = static_cast(user); stream->Seek(stream->Tell() + size); } int eof(void* user) { - cIOStream* stream = static_cast(user); + IOStream* stream = static_cast(user); return stream->Tell() >= stream->GetSize(); } } @@ -44,9 +44,9 @@ namespace jpeg { class jpeg_decoder_stream_steam : public jpgd::jpeg_decoder_stream { public: - cIOStream * mStream; + IOStream * mStream; - jpeg_decoder_stream_steam( cIOStream * stream ) : + jpeg_decoder_stream_steam( IOStream * stream ) : mStream( stream ) {} @@ -58,12 +58,12 @@ namespace jpeg }; } -cTextureLoader::cTextureLoader( cIOStream& Stream, +cTextureLoader::cTextureLoader( IOStream& Stream, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy -) : cObjectLoader( cObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoader ), mLoadType(TEX_LT_STREAM), mPixels(NULL), mTexId(0), @@ -94,7 +94,7 @@ cTextureLoader::cTextureLoader( const std::string& Filepath, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy -) : cObjectLoader( cObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoader ), mLoadType(TEX_LT_PATH), mPixels(NULL), mTexId(0), @@ -126,7 +126,7 @@ cTextureLoader::cTextureLoader( const unsigned char * ImagePtr, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy -) : cObjectLoader( cObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoader ), mLoadType(TEX_LT_MEM), mPixels(NULL), mTexId(0), @@ -152,13 +152,13 @@ cTextureLoader::cTextureLoader( const unsigned char * ImagePtr, { } -cTextureLoader::cTextureLoader( cPack * Pack, +cTextureLoader::cTextureLoader( Pack * Pack, const std::string& FilePackPath, const bool& Mipmap , const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy -) : cObjectLoader( cObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoader ), mLoadType(TEX_LT_PACK), mPixels(NULL), mTexId(0), @@ -193,7 +193,7 @@ cTextureLoader::cTextureLoader( const unsigned char * Pixels, const bool& CompressTexture, const bool& KeepLocalCopy, const std::string& FileName -) : cObjectLoader( cObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoader ), mLoadType(TEX_LT_PIXELS), mPixels( const_cast ( Pixels ) ), mTexId(0), @@ -227,7 +227,7 @@ cTextureLoader::~cTextureLoader() { } void cTextureLoader::Start() { - cObjectLoader::Start(); + ObjectLoader::Start(); mTE.Restart(); @@ -248,7 +248,7 @@ void cTextureLoader::Start() { } void cTextureLoader::LoadFile() { - cIOStreamFile fs( mFilepath , std::ios::in | std::ios::binary ); + IOStreamFile fs( mFilepath , std::ios::in | std::ios::binary ); mSize = FileSystem::FileSize( mFilepath ); mPixels = (Uint8*) eeMalloc( mSize ); @@ -294,8 +294,8 @@ void cTextureLoader::LoadFromPath() { } } } - } else if ( cPackManager::instance()->FallbackToPacks() ) { - mPack = cPackManager::instance()->Exists( mFilepath ); + } else if ( PackManager::instance()->FallbackToPacks() ) { + mPack = PackManager::instance()->Exists( mFilepath ); if ( NULL != mPack ) { mLoadType = TEX_LT_PACK; @@ -424,7 +424,7 @@ void cTextureLoader::LoadFromPixels() { flags = ( mClampMode == CLAMP_REPEAT) ? (flags | SOIL_FLAG_TEXTURE_REPEATS) : flags; flags = ( mCompressTexture ) ? ( flags | SOIL_FLAG_COMPRESS_TO_DXT ) : flags; - bool ForceGLThreaded = cThread::GetCurrentThreadId() != cEngine::instance()->GetMainThreadId(); + bool ForceGLThreaded = Thread::GetCurrentThreadId() != cEngine::instance()->GetMainThreadId(); if ( ( mThreaded || ForceGLThreaded ) && ( ForceGLThreaded || cEngine::instance()->IsSharedGLContextEnabled() ) && @@ -561,7 +561,7 @@ void cTextureLoader::Unload() { } void cTextureLoader::Reset() { - cObjectLoader::Reset(); + ObjectLoader::Reset(); mPixels = NULL; mTexId = 0; diff --git a/src/eepp/graphics/ctexturepacker.cpp b/src/eepp/graphics/ctexturepacker.cpp index 13565b30f..f9edc3f6d 100644 --- a/src/eepp/graphics/ctexturepacker.cpp +++ b/src/eepp/graphics/ctexturepacker.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include @@ -627,7 +627,7 @@ void cTexturePacker::SaveSubTextures() { std::vector tSubTexturesHdr; std::string path = FileSystem::FileRemoveExtension( mFilepath ) + EE_TEXTURE_ATLAS_EXTENSION; - cIOStreamFile fs ( path , std::ios::out | std::ios::binary ); + IOStreamFile fs ( path , std::ios::out | std::ios::binary ); if ( fs.IsOpen() ) { fs.Write( reinterpret_cast (&TexGrHdr), sizeof(sTextureAtlasHdr) ); diff --git a/src/eepp/graphics/cttffont.cpp b/src/eepp/graphics/cttffont.cpp index 442e887f2..0222ba78a 100755 --- a/src/eepp/graphics/cttffont.cpp +++ b/src/eepp/graphics/cttffont.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include using namespace HaikuTTF; @@ -26,7 +26,7 @@ cTTFFont::~cTTFFont() { hkFontManager::instance()->Destroy(); } -bool cTTFFont::LoadFromPack( cPack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) { +bool cTTFFont::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) { bool Ret = false; SafeDataPointer PData; @@ -69,8 +69,8 @@ bool cTTFFont::Load( const std::string& Filepath, const unsigned int& Size, EE_T } return iLoad( Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); - } else if ( cPackManager::instance()->FallbackToPacks() ) { - cPack * tPack = cPackManager::instance()->Exists( mFilepath ); + } else if ( PackManager::instance()->FallbackToPacks() ) { + Pack * tPack = PackManager::instance()->Exists( mFilepath ); if ( NULL != tPack ) { return LoadFromPack( tPack, mFilepath, Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); @@ -378,7 +378,7 @@ bool cTTFFont::SaveTexture( const std::string& Filepath, const EE_SAVE_TYPE& For } bool cTTFFont::SaveCoordinates( const std::string& Filepath ) { - cIOStreamFile fs( Filepath, std::ios::out | std::ios::binary ); + IOStreamFile fs( Filepath, std::ios::out | std::ios::binary ); if ( fs.IsOpen() ) { sFntHdr FntHdr; diff --git a/src/eepp/graphics/cttffontloader.cpp b/src/eepp/graphics/cttffontloader.cpp index 8a1e35710..58c84deeb 100644 --- a/src/eepp/graphics/cttffontloader.cpp +++ b/src/eepp/graphics/cttffontloader.cpp @@ -5,7 +5,7 @@ namespace EE { namespace Graphics { cTTFFontLoader::cTTFFontLoader( const std::string& FontName, const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) : - cObjectLoader( FontTTFLoader ), + ObjectLoader( FontTTFLoader ), mLoadType( TTF_LT_PATH ), mFontName( FontName ), mFilepath( Filepath ), @@ -21,8 +21,8 @@ cTTFFontLoader::cTTFFontLoader( const std::string& FontName, const std::string& Create(); } -cTTFFontLoader::cTTFFontLoader( const std::string& FontName, cPack * Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) : - cObjectLoader( FontTTFLoader ), +cTTFFontLoader::cTTFFontLoader( const std::string& FontName, Pack * Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) : + ObjectLoader( FontTTFLoader ), mLoadType( TTF_LT_PACK ), mFontName( FontName ), mFilepath( FilePackPath ), @@ -40,7 +40,7 @@ cTTFFontLoader::cTTFFontLoader( const std::string& FontName, cPack * Pack, const } cTTFFontLoader::cTTFFontLoader( const std::string& FontName, Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const eeColor& FontColor, const Uint8& OutlineSize, const eeColor& OutlineColor, const bool& AddPixelSeparator ) : - cObjectLoader( FontTTFLoader ), + ObjectLoader( FontTTFLoader ), mLoadType( TTF_LT_MEM ), mFontName( FontName ), mSize( Size ), @@ -65,7 +65,7 @@ void cTTFFontLoader::Create() { } void cTTFFontLoader::Start() { - cObjectLoader::Start(); + ObjectLoader::Start(); mFont->ThreadedLoading( mThreaded ); @@ -121,7 +121,7 @@ void cTTFFontLoader::Unload() { } void cTTFFontLoader::Reset() { - cObjectLoader::Reset(); + ObjectLoader::Reset(); mFontLoaded = false; } diff --git a/src/eepp/graphics/cvertexbuffermanager.hpp b/src/eepp/graphics/cvertexbuffermanager.hpp index eb6efe04d..2f17c2b71 100644 --- a/src/eepp/graphics/cvertexbuffermanager.hpp +++ b/src/eepp/graphics/cvertexbuffermanager.hpp @@ -6,7 +6,7 @@ namespace EE { namespace Graphics { namespace Private { -class EE_API cVertexBufferManager : public tContainer { +class EE_API cVertexBufferManager : public Container { SINGLETON_DECLARE_HEADERS(cVertexBufferManager) public: diff --git a/src/eepp/graphics/renderer/crenderergl3cp.cpp b/src/eepp/graphics/renderer/crenderergl3cp.cpp index 11d768046..c114ebda3 100644 --- a/src/eepp/graphics/renderer/crenderergl3cp.cpp +++ b/src/eepp/graphics/renderer/crenderergl3cp.cpp @@ -92,7 +92,7 @@ cRendererGL3CP::~cRendererGL3CP() { eeSAFE_DELETE( mStack ); #ifdef EE_DEBUG - cLog::instance()->Write( "Biggest VBO allocation on GL3 Renderer: " + FileSystem::SizeToString( mBiggestAlloc ) ); + Log::instance()->Write( "Biggest VBO allocation on GL3 Renderer: " + FileSystem::SizeToString( mBiggestAlloc ) ); #endif } @@ -752,7 +752,7 @@ void cRendererGL3CP::BindGlobalVAO() { void cRendererGL3CP::AllocateBuffers( const Uint32& size ) { if ( mVBOSizeAlloc != size ) - cLog::instance()->Write( "Allocating new VBO buffers size: " + String::ToStr( size ) ); + Log::instance()->Write( "Allocating new VBO buffers size: " + String::ToStr( size ) ); mVBOSizeAlloc = size; diff --git a/src/eepp/math/cinterpolation.cpp b/src/eepp/math/cinterpolation.cpp index 8dac9ff1c..fbefbb558 100644 --- a/src/eepp/math/cinterpolation.cpp +++ b/src/eepp/math/cinterpolation.cpp @@ -127,7 +127,7 @@ const Float& cInterpolation::GetRealPos() const { return mCurPos; } -void cInterpolation::Update( const cTime& Elapsed ) { +void cInterpolation::Update( const Time& Elapsed ) { if ( mEnable && mPoints.size() > 1 && mCurPoint != mPoints.size() ) { if ( mUpdate ) { mCurTime = 0; @@ -178,7 +178,7 @@ void cInterpolation::Update( const cTime& Elapsed ) { } } -void cInterpolation::SetTotalTime( const cTime & TotTime ) { +void cInterpolation::SetTotalTime( const Time & TotTime ) { Float tdist = mTotDist; if ( tdist == 0.0f ) { diff --git a/src/eepp/math/cwaypoints.cpp b/src/eepp/math/cwaypoints.cpp index d453835a4..bb7de70fe 100755 --- a/src/eepp/math/cwaypoints.cpp +++ b/src/eepp/math/cwaypoints.cpp @@ -143,7 +143,7 @@ const eeVector2f& cWaypoints::GetPos() { return mCurPos; } -void cWaypoints::Update( const cTime& Elapsed ) { +void cWaypoints::Update( const Time& Elapsed ) { if ( mEnable && mPoints.size() > 1 && mCurPoint != mPoints.size() ) { if ( mUpdate ) { mCurTime = 0; @@ -195,7 +195,7 @@ void cWaypoints::Update( const cTime& Elapsed ) { } } -void cWaypoints::SetTotalTime( const cTime& TotTime ) { +void cWaypoints::SetTotalTime( const Time& TotTime ) { unsigned int i; Float tdist = mTotDist; diff --git a/src/eepp/network/ftp.cpp b/src/eepp/network/ftp.cpp index 322fe40ba..aca8fbd28 100644 --- a/src/eepp/network/ftp.cpp +++ b/src/eepp/network/ftp.cpp @@ -79,7 +79,7 @@ Ftp::~Ftp() { Disconnect(); } -Ftp::Response Ftp::Connect(const IpAddress& server, unsigned short port, cTime timeout) { +Ftp::Response Ftp::Connect(const IpAddress& server, unsigned short port, Time timeout) { // Connect to the server if (mCommandSocket.Connect(server, port, timeout) != Socket::Done) return Response(Response::ConnectionFailed); diff --git a/src/eepp/network/http.cpp b/src/eepp/network/http.cpp index 2818ef9e4..d3965c011 100644 --- a/src/eepp/network/http.cpp +++ b/src/eepp/network/http.cpp @@ -297,7 +297,7 @@ void Http::SetHost(const std::string& host, unsigned short port, bool useSSL) { mHost = IpAddress(mHostName); } -Http::Response Http::SendRequest(const Http::Request& request, cTime timeout) { +Http::Response Http::SendRequest(const Http::Request& request, Time timeout) { if ( NULL == mConnection ) { TcpSocket * Conn = mIsSSL ? eeNew( SSLSocket, ( mHostName, request.ValidateCertificate(), request.ValidateHostname() ) ) : eeNew( TcpSocket, () ); mConnection = Conn; @@ -364,7 +364,7 @@ Http::Response Http::SendRequest(const Http::Request& request, cTime timeout) { return received; } -Http::cAsyncRequest::cAsyncRequest(Http *http, AsyncResponseCallback cb, Http::Request request, cTime timeout) : +Http::cAsyncRequest::cAsyncRequest(Http *http, AsyncResponseCallback cb, Http::Request request, Time timeout) : mHttp( http ), mCb( cb ), mRequest( request ), @@ -409,13 +409,13 @@ void Http::RemoveOldThreads() { } } -void Http::SendAsyncRequest( AsyncResponseCallback cb, const Http::Request& request, cTime timeout ) { +void Http::SendAsyncRequest( AsyncResponseCallback cb, const Http::Request& request, Time timeout ) { cAsyncRequest * thread = eeNew( cAsyncRequest, ( this, cb, request, timeout ) ); thread->Launch(); // Clean old threads - cLock l( mThreadsMutex ); + Lock l( mThreadsMutex ); RemoveOldThreads(); diff --git a/src/eepp/network/ipaddress.cpp b/src/eepp/network/ipaddress.cpp index d92be13bb..4c71aefdd 100644 --- a/src/eepp/network/ipaddress.cpp +++ b/src/eepp/network/ipaddress.cpp @@ -116,7 +116,7 @@ IpAddress IpAddress::GetLocalAddress() { return localAddress; } -IpAddress IpAddress::GetPublicAddress(cTime timeout) { +IpAddress IpAddress::GetPublicAddress(Time timeout) { // The trick here is more complicated, because the only way // to get our public IP address is to get it from a distant computer. // Here we get the web page from http://www.sfml-dev.org/ip-provider.php diff --git a/src/eepp/network/socketselector.cpp b/src/eepp/network/socketselector.cpp index c15e9fde3..4d138e859 100644 --- a/src/eepp/network/socketselector.cpp +++ b/src/eepp/network/socketselector.cpp @@ -54,7 +54,7 @@ void SocketSelector::Clear() { mImpl->MaxSocket = 0; } -bool SocketSelector::Wait(cTime timeout) { +bool SocketSelector::Wait(Time timeout) { // Setup the timeout timeval time; time.tv_sec = static_cast(timeout.AsMicroseconds() / 1000000); @@ -64,7 +64,7 @@ bool SocketSelector::Wait(cTime timeout) { mImpl->SocketsReady = mImpl->AllSockets; // Wait until one of the sockets is ready for reading, or timeout is reached - int count = select(mImpl->MaxSocket + 1, &mImpl->SocketsReady, NULL, NULL, timeout != cTime::Zero ? &time : NULL); + int count = select(mImpl->MaxSocket + 1, &mImpl->SocketsReady, NULL, NULL, timeout != Time::Zero ? &time : NULL); return count > 0; } diff --git a/src/eepp/network/ssl/backend/openssl/opensslsocket.cpp b/src/eepp/network/ssl/backend/openssl/opensslsocket.cpp index 4848e99ae..29a64c784 100644 --- a/src/eepp/network/ssl/backend/openssl/opensslsocket.cpp +++ b/src/eepp/network/ssl/backend/openssl/opensslsocket.cpp @@ -195,7 +195,7 @@ OpenSSLSocket::~OpenSSLSocket() { Disconnect(); } -Socket::Status OpenSSLSocket::Connect( const IpAddress& remoteAddress, unsigned short remotePort, cTime timeout ) { +Socket::Status OpenSSLSocket::Connect( const IpAddress& remoteAddress, unsigned short remotePort, Time timeout ) { if ( mConnected ) { Disconnect(); } diff --git a/src/eepp/network/ssl/backend/openssl/opensslsocket.hpp b/src/eepp/network/ssl/backend/openssl/opensslsocket.hpp index 4e40785a8..0e7883dcf 100644 --- a/src/eepp/network/ssl/backend/openssl/opensslsocket.hpp +++ b/src/eepp/network/ssl/backend/openssl/opensslsocket.hpp @@ -33,7 +33,7 @@ class OpenSSLSocket : public SSLSocketImpl { ~OpenSSLSocket(); - Socket::Status Connect(const IpAddress& remoteAddress, unsigned short remotePort, cTime timeout = cTime::Zero); + Socket::Status Connect(const IpAddress& remoteAddress, unsigned short remotePort, Time timeout = Time::Zero); void Disconnect(); diff --git a/src/eepp/network/ssl/sslsocket.cpp b/src/eepp/network/ssl/sslsocket.cpp index d8dfa259c..5b963b866 100644 --- a/src/eepp/network/ssl/sslsocket.cpp +++ b/src/eepp/network/ssl/sslsocket.cpp @@ -95,7 +95,7 @@ SSLSocket::~SSLSocket() { eeSAFE_DELETE( mImpl ); } -Socket::Status SSLSocket::Connect( const IpAddress& remoteAddress, unsigned short remotePort, cTime timeout ) { +Socket::Status SSLSocket::Connect( const IpAddress& remoteAddress, unsigned short remotePort, Time timeout ) { Status status = Socket::Disconnected; if ( ( status = TcpSocket::Connect( remoteAddress, remotePort, timeout ) ) == Socket::Done ) { diff --git a/src/eepp/network/ssl/sslsocketimpl.hpp b/src/eepp/network/ssl/sslsocketimpl.hpp index a49e86678..496688e8e 100644 --- a/src/eepp/network/ssl/sslsocketimpl.hpp +++ b/src/eepp/network/ssl/sslsocketimpl.hpp @@ -13,7 +13,7 @@ class SSLSocketImpl { virtual ~SSLSocketImpl() {} - virtual Socket::Status Connect(const IpAddress& remoteAddress, unsigned short remotePort, cTime timeout = cTime::Zero) = 0; + virtual Socket::Status Connect(const IpAddress& remoteAddress, unsigned short remotePort, Time timeout = Time::Zero) = 0; virtual void Disconnect() = 0; diff --git a/src/eepp/network/tcpsocket.cpp b/src/eepp/network/tcpsocket.cpp index b719c7c37..12ee37d61 100644 --- a/src/eepp/network/tcpsocket.cpp +++ b/src/eepp/network/tcpsocket.cpp @@ -68,14 +68,14 @@ unsigned short TcpSocket::GetRemotePort() const { return 0; } -Socket::Status TcpSocket::Connect(const IpAddress& remoteAddress, unsigned short remotePort, cTime timeout) { +Socket::Status TcpSocket::Connect(const IpAddress& remoteAddress, unsigned short remotePort, Time timeout) { // Create the internal socket if it doesn't exist Create(); // Create the remote address sockaddr_in address = Private::SocketImpl::CreateAddress(remoteAddress.ToInteger(), remotePort); - if (timeout <= cTime::Zero) { + if (timeout <= Time::Zero) { // ----- We're not using a timeout: just try to connect ----- // Connect the socket diff --git a/src/eepp/system/cclock.cpp b/src/eepp/system/cclock.cpp deleted file mode 100755 index e58e85f21..000000000 --- a/src/eepp/system/cclock.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include - -namespace EE { namespace System { - -cClock::cClock() : - mClockImpl( new Platform::cClockImpl() ) -{ - Restart(); -} - -cClock::~cClock() { - delete mClockImpl; -} - -void cClock::Restart() { - mClockImpl->Restart(); -} - -cTime cClock::GetElapsedTime() const { - return Microseconds( mClockImpl->GetElapsedTime() ); -} - -cTime cClock::Elapsed() { - cTime r = GetElapsedTime(); - Restart(); - return r; -} - -}} diff --git a/src/eepp/system/clock.cpp b/src/eepp/system/clock.cpp old mode 100644 new mode 100755 index 8e22311f5..f13d60b5e --- a/src/eepp/system/clock.cpp +++ b/src/eepp/system/clock.cpp @@ -1,16 +1,30 @@ -#include -#include +#include +#include namespace EE { namespace System { -cLock::cLock( cMutex& mutex ) : - mMutex( mutex ) +Clock::Clock() : + mClockImpl( new Platform::ClockImpl() ) { - mMutex.Lock(); + Restart(); } -cLock::~cLock() { - mMutex.Unlock(); +Clock::~Clock() { + delete mClockImpl; +} + +void Clock::Restart() { + mClockImpl->Restart(); +} + +Time Clock::GetElapsedTime() const { + return Microseconds( mClockImpl->GetElapsedTime() ); +} + +Time Clock::Elapsed() { + Time r = GetElapsedTime(); + Restart(); + return r; } }} diff --git a/src/eepp/system/ccondition.cpp b/src/eepp/system/condition.cpp similarity index 53% rename from src/eepp/system/ccondition.cpp rename to src/eepp/system/condition.cpp index ef946e4ea..4d90a6b9b 100644 --- a/src/eepp/system/ccondition.cpp +++ b/src/eepp/system/condition.cpp @@ -1,24 +1,24 @@ -#include +#include #include using namespace EE::System::Platform; namespace EE { namespace System { -cCondition::cCondition( int value ) : - mCondImpl( new cConditionImpl( value ) ) +Condition::Condition( int value ) : + mCondImpl( new ConditionImpl( value ) ) { } -cCondition::~cCondition() { +Condition::~Condition() { delete mCondImpl; } -void cCondition::Lock() { +void Condition::Lock() { mCondImpl->Lock(); } -bool cCondition::WaitAndLock( int awaitedValue, int autorelease ) { +bool Condition::WaitAndLock( int awaitedValue, int autorelease ) { bool flag = mCondImpl->WaitAndRetain( awaitedValue ); if ( autorelease ) { @@ -28,32 +28,32 @@ bool cCondition::WaitAndLock( int awaitedValue, int autorelease ) { return flag; } -void cCondition::Unlock( int value ) { +void Condition::Unlock( int value ) { mCondImpl->Release(value); } -void cCondition::Unlock() { +void Condition::Unlock() { mCondImpl->Unlock(); } -int cCondition::operator=( int value ) { +int Condition::operator=( int value ) { mCondImpl->SetValue( value ); return value; } -int cCondition::Value() const { +int Condition::Value() const { return mCondImpl->Value(); } -void cCondition::Signal() { +void Condition::Signal() { mCondImpl->Signal(); } -void cCondition::Invalidate() { +void Condition::Invalidate() { mCondImpl->Invalidate(); } -void cCondition::Restore() { +void Condition::Restore() { mCondImpl->Restore(); } diff --git a/src/eepp/system/cpack.cpp b/src/eepp/system/cpack.cpp deleted file mode 100644 index 9e47d2d17..000000000 --- a/src/eepp/system/cpack.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include - -namespace EE { namespace System { - -cPack::cPack() : - cMutex(), - mIsOpen(false) -{ - cPackManager::instance()->Add( this ); -} - -cPack::~cPack() { - cPackManager::instance()->Remove( this ); -} - -bool cPack::IsOpen() const { - return mIsOpen; -} - -}} diff --git a/src/eepp/system/cthreadlocal.cpp b/src/eepp/system/cthreadlocal.cpp deleted file mode 100644 index b2aec82f0..000000000 --- a/src/eepp/system/cthreadlocal.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include - -namespace EE { namespace System { - -cThreadLocal::cThreadLocal(void* value) : - mImpl( eeNew( Private::cThreadLocalImpl, () ) ) -{ - Value( value ); -} - -cThreadLocal::~cThreadLocal() { - eeSAFE_DELETE( mImpl ); -} - -void cThreadLocal::Value(void* value) { - mImpl->Value(value); -} - -void* cThreadLocal::Value() const { - return mImpl->Value(); -} - -}} diff --git a/src/eepp/system/ctime.cpp b/src/eepp/system/ctime.cpp deleted file mode 100644 index 7d5d0c72b..000000000 --- a/src/eepp/system/ctime.cpp +++ /dev/null @@ -1,145 +0,0 @@ -#include - -namespace EE { namespace System { - -const cTime cTime::Zero; - -cTime::cTime() : - mMicroseconds(0) -{ -} - -double cTime::AsSeconds() const { - return mMicroseconds / 1000000.0; -} - -double cTime::AsMilliseconds() const { - return mMicroseconds / 1000.0; -} - -Int64 cTime::AsMicroseconds() const { - return mMicroseconds; -} - -cTime::cTime(Int64 Microseconds) : - mMicroseconds(Microseconds) -{ -} - -cTime Seconds(double amount) { - return cTime(static_cast(amount * 1000000)); -} - -cTime Milliseconds(double amount) { - return cTime(static_cast(amount) * 1000); -} - -cTime Microseconds(Int64 amount) { - return cTime(amount); -} - -bool operator ==(cTime left, cTime right) { - return left.AsMicroseconds() == right.AsMicroseconds(); -} - -bool operator !=(cTime left, cTime right) { - return left.AsMicroseconds() != right.AsMicroseconds(); -} - -bool operator <(cTime left, cTime right) { - return left.AsMicroseconds() < right.AsMicroseconds(); -} - -bool operator >(cTime left, cTime right) { - return left.AsMicroseconds() > right.AsMicroseconds(); -} - -bool operator <=(cTime left, cTime right) { - return left.AsMicroseconds() <= right.AsMicroseconds(); -} - -bool operator >=(cTime left, cTime right) { - return left.AsMicroseconds() >= right.AsMicroseconds(); -} - -cTime operator -(cTime right) { - return Microseconds(-right.AsMicroseconds()); -} - -cTime operator +(cTime left, cTime right) { - return Microseconds(left.AsMicroseconds() + right.AsMicroseconds()); -} - -cTime& operator +=(cTime& left, cTime right) { - return left = left + right; -} - -cTime operator -(cTime left, cTime right) { - return Microseconds(left.AsMicroseconds() - right.AsMicroseconds()); -} - -cTime& operator -=(cTime& left, cTime right) { - return left = left - right; -} - -cTime operator *(cTime left, cTime right) { - return Microseconds(left.AsMicroseconds() * right.AsMicroseconds()); -} - -cTime operator *(cTime left, double right) { - return Seconds(left.AsSeconds() * right); -} - -cTime operator *(double left, cTime right) { - return right * left; -} - -cTime operator *(cTime left, Int64 right) { - return Microseconds(left.AsMicroseconds() * right); -} - -cTime operator *(Int64 left, cTime right) { - return right * left; -} - -cTime& operator *=(cTime& left, cTime right) { - return left = left * right; -} - -cTime& operator *=(cTime& left, double right) { - return left = left * right; -} - -cTime& operator *=(cTime& left, Int64 right) { - return left = left * right; -} - -cTime operator /(cTime left, cTime right) { - return Microseconds(left.AsMicroseconds() / right.AsMicroseconds()); -} - -cTime operator /(cTime left, double right) { - return Seconds(left.AsSeconds() / right); -} - -cTime operator /(cTime left, Int64 right) { - return Microseconds(left.AsMicroseconds() / right); -} - -cTime& operator /=(cTime& left, cTime right) { - return left = left / right; -} - -cTime& operator /=(cTime& left, Int64 right) { - return left = left / right; -} - -cTime operator %(cTime left, cTime right) { - return Microseconds(left.AsMicroseconds() % right.AsMicroseconds()); -} - -cTime& operator %=(cTime& left, cTime right) { - return left = left % right; -} - -}} diff --git a/src/eepp/system/filesystem.cpp b/src/eepp/system/filesystem.cpp index 7e8bbc695..6cf0b467c 100644 --- a/src/eepp/system/filesystem.cpp +++ b/src/eepp/system/filesystem.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -36,7 +36,7 @@ std::string FileSystem::GetOSlash() { bool FileSystem::FileGet( const std::string& path, SafeDataPointer& data ) { if ( FileExists( path ) ) { - cIOStreamFile fs ( path , std::ios::in | std::ios::binary ); + IOStreamFile fs ( path , std::ios::in | std::ios::binary ); eeSAFE_DELETE( data.Data ); @@ -53,7 +53,7 @@ bool FileSystem::FileGet( const std::string& path, SafeDataPointer& data ) { bool FileSystem::FileGet( const std::string& path, std::vector& data ) { if ( FileExists( path ) ) { - cIOStreamFile fs ( path, std::ios::in | std::ios::binary ); + IOStreamFile fs ( path, std::ios::in | std::ios::binary ); Uint32 fsize = FileSize( path ); data.clear(); @@ -80,8 +80,8 @@ bool FileSystem::FileCopy( const std::string& src, const std::string& dst ) { data.Data = eeNewArray( Uint8, ( data.DataSize ) ); char * buff = (char*)data.Data; - cIOStreamFile in( src, std::ios::binary | std::ios::in ); - cIOStreamFile out( dst, std::ios::binary | std::ios::out ); + IOStreamFile in( src, std::ios::binary | std::ios::in ); + IOStreamFile out( dst, std::ios::binary | std::ios::out ); if ( in.IsOpen() && out.IsOpen() && size > 0 ) { do { @@ -136,7 +136,7 @@ void FileSystem::FilePathRemoveProcessPath( std::string& path ) { bool FileSystem::FileWrite( const std::string& filepath, const Uint8* data, const Uint32& dataSize ) { - cIOStreamFile fs( filepath, std::ios::out | std::ios::binary ); + IOStreamFile fs( filepath, std::ios::out | std::ios::binary ); if ( fs.IsOpen() ) { if ( dataSize ) { diff --git a/src/eepp/system/cinifile.cpp b/src/eepp/system/inifile.cpp similarity index 74% rename from src/eepp/system/cinifile.cpp rename to src/eepp/system/inifile.cpp index 0581d1e96..7887932d0 100755 --- a/src/eepp/system/cinifile.cpp +++ b/src/eepp/system/inifile.cpp @@ -1,8 +1,8 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -14,7 +14,7 @@ namespace EE { namespace System { #define iniEOL '\r' << std::endl #endif -cIniFile::cIniFile ( std::string const iniPath, const bool& readFile ) : +IniFile::IniFile ( std::string const iniPath, const bool& readFile ) : mCaseInsensitive( true ), mIniReaded( false ) { @@ -24,7 +24,7 @@ cIniFile::cIniFile ( std::string const iniPath, const bool& readFile ) : ReadFile(); } -cIniFile::cIniFile ( const Uint8* RAWData, const Uint32& size, const bool& readFile ) : +IniFile::IniFile ( const Uint8* RAWData, const Uint32& size, const bool& readFile ) : mCaseInsensitive( true ), mIniReaded( false ) { @@ -34,7 +34,7 @@ cIniFile::cIniFile ( const Uint8* RAWData, const Uint32& size, const bool& readF ReadFile(); } -cIniFile::cIniFile( cPack * Pack, std::string iniPackPath, const bool& readFile ) : +IniFile::IniFile( Pack * Pack, std::string iniPackPath, const bool& readFile ) : mCaseInsensitive( true ), mIniReaded( false ) { @@ -44,7 +44,7 @@ cIniFile::cIniFile( cPack * Pack, std::string iniPackPath, const bool& readFile ReadFile(); } -bool cIniFile::LoadFromPack( cPack * Pack, std::string iniPackPath ) { +bool IniFile::LoadFromPack( Pack * Pack, std::string iniPackPath ) { if ( NULL != Pack && Pack->IsOpen() && Pack->Exists( iniPackPath ) ) { SafeDataPointer PData; @@ -56,7 +56,7 @@ bool cIniFile::LoadFromPack( cPack * Pack, std::string iniPackPath ) { return false; } -bool cIniFile::LoadFromMemory( const Uint8* RAWData, const Uint32& size ) { +bool IniFile::LoadFromMemory( const Uint8* RAWData, const Uint32& size ) { std::string myfile; myfile.assign( reinterpret_cast (RAWData), size ); @@ -68,11 +68,11 @@ bool cIniFile::LoadFromMemory( const Uint8* RAWData, const Uint32& size ) { return true; } -bool cIniFile::LoadFromFile( const std::string& iniPath ) { +bool IniFile::LoadFromFile( const std::string& iniPath ) { Path ( iniPath ); if ( FileSystem::FileExists( iniPath ) ) { - cIOStreamFile f( mPath, std::ios::in ); + IOStreamFile f( mPath, std::ios::in ); if ( !f.IsOpen() ) return false; @@ -87,10 +87,10 @@ bool cIniFile::LoadFromFile( const std::string& iniPath ) { mIniReaded = false; return true; - } else if ( cPackManager::instance()->FallbackToPacks() ) { + } else if ( PackManager::instance()->FallbackToPacks() ) { std::string tPath( iniPath ); - cPack * tPack = cPackManager::instance()->Exists( tPath ); + Pack * tPack = PackManager::instance()->Exists( tPath ); if ( NULL != tPack ) { return LoadFromPack( tPack, tPath ); @@ -100,7 +100,7 @@ bool cIniFile::LoadFromFile( const std::string& iniPath ) { return false; } -bool cIniFile::ReadFile() { +bool IniFile::ReadFile() { std::string line; std::string keyname, valuename, value; std::string::size_type pLeft, pRight; @@ -126,7 +126,7 @@ bool cIniFile::ReadFile() { // Check that the user hasn't openned a binary file by checking the first // character of each line! if ( !isprint ( line[0] ) ) { - eePRINT ( "cIniFile::ReadFile(): Failing on char %d\n", line[0] ); + eePRINT ( "IniFile::ReadFile(): Failing on char %d\n", line[0] ); return false; } @@ -165,10 +165,10 @@ bool cIniFile::ReadFile() { return false; } -bool cIniFile::WriteFile() { +bool IniFile::WriteFile() { unsigned commentID, keyID, valueID; - cIOStreamFile f( mPath, std::ios::out ); + IOStreamFile f( mPath, std::ios::out ); if ( !f.IsOpen() ) return false; @@ -216,14 +216,14 @@ bool cIniFile::WriteFile() { return true; } -long cIniFile::FindKey ( std::string const keyname ) const { +long IniFile::FindKey ( std::string const keyname ) const { for ( unsigned keyID = 0; keyID < mNames.size(); ++keyID ) if ( CheckCase ( mNames[keyID] ) == CheckCase ( keyname ) ) return long ( keyID ); return noID; } -long cIniFile::FindValue ( unsigned const keyID, std::string const valuename ) const { +long IniFile::FindValue ( unsigned const keyID, std::string const valuename ) const { if ( !mKeys.size() || keyID >= mKeys.size() ) return noID; @@ -233,53 +233,53 @@ long cIniFile::FindValue ( unsigned const keyID, std::string const valuename ) c return noID; } -unsigned cIniFile::AddKeyName ( std::string const keyname ) { +unsigned IniFile::AddKeyName ( std::string const keyname ) { mNames.resize ( mNames.size() + 1, keyname ); mKeys.resize ( mKeys.size() + 1 ); return (unsigned int)(mNames.size() - 1); } -std::string cIniFile::GetKeyName ( unsigned const keyID ) const { +std::string IniFile::GetKeyName ( unsigned const keyID ) const { if ( keyID < mNames.size() ) return mNames[keyID]; else return ""; } -unsigned cIniFile::GetNumValues ( unsigned const keyID ) { +unsigned IniFile::GetNumValues ( unsigned const keyID ) { if ( keyID < mKeys.size() ) return (unsigned int)mKeys[keyID].names.size(); return 0; } -unsigned cIniFile::GetNumValues ( std::string const keyname ) { +unsigned IniFile::GetNumValues ( std::string const keyname ) { long keyID = FindKey ( keyname ); if ( keyID == noID ) return 0; return (unsigned int)mKeys[keyID].names.size(); } -std::string cIniFile::GetValueName ( unsigned const keyID, unsigned const valueID ) const { +std::string IniFile::GetValueName ( unsigned const keyID, unsigned const valueID ) const { if ( keyID < mKeys.size() && valueID < mKeys[keyID].names.size() ) return mKeys[keyID].names[valueID]; return ""; } -std::string cIniFile::GetValueName ( std::string const keyname, unsigned const valueID ) const { +std::string IniFile::GetValueName ( std::string const keyname, unsigned const valueID ) const { long keyID = FindKey ( keyname ); if ( keyID == noID ) return ""; return GetValueName ( keyID, valueID ); } -bool cIniFile::SetValue ( unsigned const keyID, unsigned const valueID, std::string const value ) { +bool IniFile::SetValue ( unsigned const keyID, unsigned const valueID, std::string const value ) { if ( keyID < mKeys.size() && valueID < mKeys[keyID].names.size() ) mKeys[keyID].values[valueID] = value; return false; } -bool cIniFile::SetValue ( std::string const keyname, std::string const valuename, std::string const value, bool create ) { +bool IniFile::SetValue ( std::string const keyname, std::string const valuename, std::string const value, bool create ) { long keyID = FindKey ( keyname ); if ( keyID == noID ) { if ( create ) @@ -300,21 +300,21 @@ bool cIniFile::SetValue ( std::string const keyname, std::string const valuename return true; } -bool cIniFile::SetValueI ( std::string const keyname, std::string const valuename, int const value, bool create ) { +bool IniFile::SetValueI ( std::string const keyname, std::string const valuename, int const value, bool create ) { char svalue[MAX_VALUEDATA]; String::StrFormat( svalue, MAX_VALUEDATA, "%d", value ); return SetValue ( keyname, valuename, svalue, create ); } -bool cIniFile::SetValueF ( std::string const keyname, std::string const valuename, double const value, bool create ) { +bool IniFile::SetValueF ( std::string const keyname, std::string const valuename, double const value, bool create ) { char svalue[MAX_VALUEDATA]; String::StrFormat ( svalue, MAX_VALUEDATA, "%f", value ); return SetValue ( keyname, valuename, svalue, create ); } -bool cIniFile::SetValueV ( std::string const keyname, std::string const valuename, char *format, ... ) { +bool IniFile::SetValueV ( std::string const keyname, std::string const valuename, char *format, ... ) { va_list args; char value[MAX_VALUEDATA]; @@ -328,13 +328,13 @@ bool cIniFile::SetValueV ( std::string const keyname, std::string const valuenam return SetValue ( keyname, valuename, value ); } -std::string cIniFile::GetValue ( unsigned const keyID, unsigned const valueID, std::string const defValue ) const { +std::string IniFile::GetValue ( unsigned const keyID, unsigned const valueID, std::string const defValue ) const { if ( keyID < mKeys.size() && valueID < mKeys[keyID].names.size() ) return mKeys[keyID].values[valueID]; return defValue; } -std::string cIniFile::GetValue ( std::string const keyname, std::string const valuename, std::string const defValue ) const { +std::string IniFile::GetValue ( std::string const keyname, std::string const valuename, std::string const defValue ) const { long keyID = FindKey ( keyname ); if ( keyID == noID ) return defValue; @@ -346,14 +346,14 @@ std::string cIniFile::GetValue ( std::string const keyname, std::string const va return mKeys[keyID].values[valueID]; } -int cIniFile::GetValueI ( std::string const keyname, std::string const valuename, int const defValue ) const { +int IniFile::GetValueI ( std::string const keyname, std::string const valuename, int const defValue ) const { char svalue[MAX_VALUEDATA]; String::StrFormat ( svalue, MAX_VALUEDATA, "%d", defValue ); return atoi ( GetValue ( keyname, valuename, svalue ).c_str() ); } -double cIniFile::GetValueF ( std::string const keyname, std::string const valuename, double const defValue ) const { +double IniFile::GetValueF ( std::string const keyname, std::string const valuename, double const defValue ) const { char svalue[MAX_VALUEDATA]; String::StrFormat ( svalue, MAX_VALUEDATA, "%f", defValue ); @@ -361,7 +361,7 @@ double cIniFile::GetValueF ( std::string const keyname, std::string const valuen } // 16 variables may be a bit of over kill, but hey, it's only code. -unsigned cIniFile::GetValueV ( std::string const keyname, std::string const valuename, char *format, +unsigned IniFile::GetValueV ( std::string const keyname, std::string const valuename, char *format, void *v1, void *v2, void *v3, void *v4, void *v5, void *v6, void *v7, void *v8, void *v9, void *v10, void *v11, void *v12, @@ -392,7 +392,7 @@ unsigned cIniFile::GetValueV ( std::string const keyname, std::string const valu return nVals; } -bool cIniFile::DeleteValue ( std::string const keyname, std::string const valuename ) { +bool IniFile::DeleteValue ( std::string const keyname, std::string const valuename ) { long keyID = FindKey ( keyname ); if ( keyID == noID ) return false; @@ -410,7 +410,7 @@ bool cIniFile::DeleteValue ( std::string const keyname, std::string const valuen return true; } -bool cIniFile::DeleteKey ( std::string const keyname ) { +bool IniFile::DeleteKey ( std::string const keyname ) { long keyID = FindKey ( keyname ); if ( keyID == noID ) return false; @@ -430,7 +430,7 @@ bool cIniFile::DeleteKey ( std::string const keyname ) { return true; } -void cIniFile::Clear() { +void IniFile::Clear() { // This loop not needed. The vector<> destructor seems to do // all the work itself. memleak_test.cpp shows this. //for ( unsigned i = 0; i < mKeys.size(); ++i) { @@ -442,17 +442,17 @@ void cIniFile::Clear() { mComments.clear(); } -void cIniFile::AddHeaderComment ( std::string const comment ) { +void IniFile::AddHeaderComment ( std::string const comment ) { mComments.resize ( mComments.size() + 1, comment ); } -std::string cIniFile::GetHeaderComment ( unsigned const commentID ) const { +std::string IniFile::GetHeaderComment ( unsigned const commentID ) const { if ( commentID < mComments.size() ) return mComments[commentID]; return ""; } -bool cIniFile::DeleteHeaderComment ( unsigned commentID ) { +bool IniFile::DeleteHeaderComment ( unsigned commentID ) { if ( commentID < mComments.size() ) { std::vector::iterator cpos = mComments.begin() + commentID; mComments.erase ( cpos, cpos + 1 ); @@ -461,20 +461,20 @@ bool cIniFile::DeleteHeaderComment ( unsigned commentID ) { return false; } -unsigned cIniFile::GetNumKeyComments ( unsigned const keyID ) const { +unsigned IniFile::GetNumKeyComments ( unsigned const keyID ) const { if ( keyID < mKeys.size() ) return (unsigned int)mKeys[keyID].comments.size(); return 0; } -unsigned cIniFile::GetNumKeyComments ( std::string const keyname ) const { +unsigned IniFile::GetNumKeyComments ( std::string const keyname ) const { long keyID = FindKey ( keyname ); if ( keyID == noID ) return 0; return (unsigned int)mKeys[keyID].comments.size(); } -bool cIniFile::AddKeyComment ( unsigned const keyID, std::string const comment ) { +bool IniFile::AddKeyComment ( unsigned const keyID, std::string const comment ) { if ( keyID < mKeys.size() ) { mKeys[keyID].comments.resize ( mKeys[keyID].comments.size() + 1, comment ); return true; @@ -482,27 +482,27 @@ bool cIniFile::AddKeyComment ( unsigned const keyID, std::string const comment ) return false; } -bool cIniFile::AddKeyComment ( std::string const keyname, std::string const comment ) { +bool IniFile::AddKeyComment ( std::string const keyname, std::string const comment ) { long keyID = FindKey ( keyname ); if ( keyID == noID ) return false; return AddKeyComment ( unsigned ( keyID ), comment ); } -std::string cIniFile::GetKeyComment ( unsigned const keyID, unsigned const commentID ) const { +std::string IniFile::GetKeyComment ( unsigned const keyID, unsigned const commentID ) const { if ( keyID < mKeys.size() && commentID < mKeys[keyID].comments.size() ) return mKeys[keyID].comments[commentID]; return ""; } -std::string cIniFile::GetKeyComment ( std::string const keyname, unsigned const commentID ) const { +std::string IniFile::GetKeyComment ( std::string const keyname, unsigned const commentID ) const { long keyID = FindKey ( keyname ); if ( keyID == noID ) return ""; return GetKeyComment ( unsigned ( keyID ), commentID ); } -bool cIniFile::DeleteKeyComment ( unsigned const keyID, unsigned const commentID ) { +bool IniFile::DeleteKeyComment ( unsigned const keyID, unsigned const commentID ) { if ( keyID < mKeys.size() && commentID < mKeys[keyID].comments.size() ) { std::vector::iterator cpos = mKeys[keyID].comments.begin() + commentID; mKeys[keyID].comments.erase ( cpos, cpos + 1 ); @@ -511,14 +511,14 @@ bool cIniFile::DeleteKeyComment ( unsigned const keyID, unsigned const commentID return false; } -bool cIniFile::DeleteKeyComment ( std::string const keyname, unsigned const commentID ) { +bool IniFile::DeleteKeyComment ( std::string const keyname, unsigned const commentID ) { long keyID = FindKey ( keyname ); if ( keyID == noID ) return false; return DeleteKeyComment ( unsigned ( keyID ), commentID ); } -bool cIniFile::DeleteKeyComments ( unsigned const keyID ) { +bool IniFile::DeleteKeyComments ( unsigned const keyID ) { if ( keyID < mKeys.size() ) { mKeys[keyID].comments.clear(); return true; @@ -526,14 +526,14 @@ bool cIniFile::DeleteKeyComments ( unsigned const keyID ) { return false; } -bool cIniFile::DeleteKeyComments ( std::string const keyname ) { +bool IniFile::DeleteKeyComments ( std::string const keyname ) { long keyID = FindKey ( keyname ); if ( keyID == noID ) return false; return DeleteKeyComments ( unsigned ( keyID ) ); } -std::string cIniFile::CheckCase ( std::string s ) const { +std::string IniFile::CheckCase ( std::string s ) const { if ( mCaseInsensitive ) for ( std::string::size_type i = 0; i < s.length(); ++i ) s[i] = std::tolower ( s[i] ); diff --git a/src/eepp/system/ciostreamfile.cpp b/src/eepp/system/iostreamfile.cpp similarity index 56% rename from src/eepp/system/ciostreamfile.cpp rename to src/eepp/system/iostreamfile.cpp index 8c27a8a16..1e57910a6 100644 --- a/src/eepp/system/ciostreamfile.cpp +++ b/src/eepp/system/iostreamfile.cpp @@ -1,20 +1,20 @@ -#include +#include namespace EE { namespace System { -cIOStreamFile::cIOStreamFile( const std::string& path, std::ios_base::openmode mode ) : +IOStreamFile::IOStreamFile( const std::string& path, std::ios_base::openmode mode ) : mSize(0) { mFS.open( path.c_str(), mode ); } -cIOStreamFile::~cIOStreamFile() { +IOStreamFile::~IOStreamFile() { if ( IsOpen() ) { mFS.close(); } } -ios_size cIOStreamFile::Read( char * data, ios_size size ) { +ios_size IOStreamFile::Read( char * data, ios_size size ) { if ( IsOpen() ) { mFS.read( data, size ); } @@ -22,7 +22,7 @@ ios_size cIOStreamFile::Read( char * data, ios_size size ) { return size; } -ios_size cIOStreamFile::Write( const char * data, ios_size size ) { +ios_size IOStreamFile::Write( const char * data, ios_size size ) { if ( IsOpen() ) { mFS.write( data, size ); } @@ -30,7 +30,7 @@ ios_size cIOStreamFile::Write( const char * data, ios_size size ) { return size; } -ios_size cIOStreamFile::Seek( ios_size position ) { +ios_size IOStreamFile::Seek( ios_size position ) { if ( IsOpen() ) { mFS.seekg( position , std::ios::beg ); } @@ -38,11 +38,11 @@ ios_size cIOStreamFile::Seek( ios_size position ) { return position; } -ios_size cIOStreamFile::Tell() { +ios_size IOStreamFile::Tell() { return mFS.tellg(); } -ios_size cIOStreamFile::GetSize() { +ios_size IOStreamFile::GetSize() { if ( IsOpen() ) { if ( 0 == mSize ) { ios_size Pos = Tell(); @@ -60,11 +60,11 @@ ios_size cIOStreamFile::GetSize() { return 0; } -bool cIOStreamFile::IsOpen() { +bool IOStreamFile::IsOpen() { return mFS.is_open(); } -void cIOStreamFile::Flush() { +void IOStreamFile::Flush() { mFS.flush(); } diff --git a/src/eepp/system/ciostreammemory.cpp b/src/eepp/system/iostreammemory.cpp similarity index 58% rename from src/eepp/system/ciostreammemory.cpp rename to src/eepp/system/iostreammemory.cpp index 9818d53c3..19e3f9510 100644 --- a/src/eepp/system/ciostreammemory.cpp +++ b/src/eepp/system/iostreammemory.cpp @@ -1,8 +1,8 @@ -#include +#include namespace EE { namespace System { -cIOStreamMemory::cIOStreamMemory( const char * data, ios_size size ) : +IOStreamMemory::IOStreamMemory( const char * data, ios_size size ) : mReadPtr( data ), mWritePtr( NULL ), mPos( 0 ), @@ -10,7 +10,7 @@ cIOStreamMemory::cIOStreamMemory( const char * data, ios_size size ) : { } -cIOStreamMemory::cIOStreamMemory( char * data, ios_size size ) : +IOStreamMemory::IOStreamMemory( char * data, ios_size size ) : mReadPtr( const_cast( data ) ), mWritePtr( data ), mPos( 0 ), @@ -18,10 +18,10 @@ cIOStreamMemory::cIOStreamMemory( char * data, ios_size size ) : { } -cIOStreamMemory::~cIOStreamMemory() { +IOStreamMemory::~IOStreamMemory() { } -ios_size cIOStreamMemory::Read( char * data, ios_size size ) { +ios_size IOStreamMemory::Read( char * data, ios_size size ) { if ( mPos + size <= mSize ) { memcpy( data, mReadPtr + mPos, size ); @@ -39,7 +39,7 @@ ios_size cIOStreamMemory::Read( char * data, ios_size size ) { return 0; } -ios_size cIOStreamMemory::Write( const char * data, ios_size size ) { +ios_size IOStreamMemory::Write( const char * data, ios_size size ) { if ( NULL != mWritePtr && mPos + size <= mSize ) { memcpy( mWritePtr + mPos, data, size ); @@ -49,22 +49,22 @@ ios_size cIOStreamMemory::Write( const char * data, ios_size size ) { return mPos; } -ios_size cIOStreamMemory::Seek( ios_size position ) { +ios_size IOStreamMemory::Seek( ios_size position ) { if ( position < mSize ) mPos = position; return mPos; } -ios_size cIOStreamMemory::Tell() { +ios_size IOStreamMemory::Tell() { return mPos; } -ios_size cIOStreamMemory::GetSize() { +ios_size IOStreamMemory::GetSize() { return mSize; } -bool cIOStreamMemory::IsOpen() { +bool IOStreamMemory::IsOpen() { return NULL != mReadPtr; } diff --git a/src/eepp/system/lock.cpp b/src/eepp/system/lock.cpp new file mode 100644 index 000000000..20ded7155 --- /dev/null +++ b/src/eepp/system/lock.cpp @@ -0,0 +1,16 @@ +#include +#include + +namespace EE { namespace System { + +Lock::Lock( Mutex& mutex ) : + mMutex( mutex ) +{ + mMutex.Lock(); +} + +Lock::~Lock() { + mMutex.Unlock(); +} + +}} diff --git a/src/eepp/system/clog.cpp b/src/eepp/system/log.cpp similarity index 75% rename from src/eepp/system/clog.cpp rename to src/eepp/system/log.cpp index 8cb7cf2be..c30de4726 100755 --- a/src/eepp/system/clog.cpp +++ b/src/eepp/system/log.cpp @@ -1,4 +1,4 @@ -#include +#include #include #if EE_PLATFORM == EE_PLATFORM_ANDROID @@ -18,9 +18,9 @@ namespace EE { namespace System { -SINGLETON_DECLARE_IMPLEMENTATION(cLog) +SINGLETON_DECLARE_IMPLEMENTATION(Log) -cLog::cLog() : +Log::Log() : mSave( false ), mConsoleOutput( false ), mLiveWrite( false ), @@ -30,7 +30,7 @@ cLog::cLog() : Write( "Loaded on " + Sys::GetDateTimeStr() + "\n" ); } -cLog::~cLog() { +Log::~Log() { Write( "\nUnloaded on " + Sys::GetDateTimeStr() ); Write( "...::: Entropia Engine++ Unloaded :::...\n" ); @@ -43,7 +43,7 @@ cLog::~cLog() { CloseFS(); } -void cLog::Save( const std::string& filepath ) { +void Log::Save( const std::string& filepath ) { if ( filepath.size() ) { mFilePath = filepath; } else { @@ -53,7 +53,7 @@ void cLog::Save( const std::string& filepath ) { mSave = true; } -void cLog::Write( std::string Text, const bool& newLine ) { +void Log::Write( std::string Text, const bool& newLine ) { if ( newLine ) { Text += '\n'; } @@ -81,7 +81,7 @@ void cLog::Write( std::string Text, const bool& newLine ) { } } -void cLog::OpenFS() { +void Log::OpenFS() { if ( mFilePath.empty() ) { mFilePath = Sys::GetProcessPath(); } @@ -89,11 +89,11 @@ void cLog::OpenFS() { if ( NULL == mFS ) { std::string str = mFilePath + "log.log"; - mFS = eeNew( cIOStreamFile, ( str, std::ios::app | std::ios::out | std::ios::binary ) ); + mFS = eeNew( IOStreamFile, ( str, std::ios::app | std::ios::out | std::ios::binary ) ); } } -void cLog::CloseFS() { +void Log::CloseFS() { Lock(); eeSAFE_DELETE( mFS ); @@ -101,7 +101,7 @@ void cLog::CloseFS() { Unlock(); } -void cLog::Writef( const char* format, ... ) { +void Log::Writef( const char* format, ... ) { int n, size = 256; std::string tstr( size, '\0' ); @@ -152,15 +152,15 @@ void cLog::Writef( const char* format, ... ) { } } -std::string cLog::Buffer() const { +std::string Log::Buffer() const { return mData; } -const bool& cLog::ConsoleOutput() const { +const bool& Log::ConsoleOutput() const { return mConsoleOutput; } -void cLog::ConsoleOutput( const bool& output ) { +void Log::ConsoleOutput( const bool& output ) { bool OldOutput = mConsoleOutput; mConsoleOutput = output; @@ -173,24 +173,24 @@ void cLog::ConsoleOutput( const bool& output ) { } -const bool& cLog::LiveWrite() const { +const bool& Log::LiveWrite() const { return mLiveWrite; } -void cLog::LiveWrite( const bool& lw ) { +void Log::LiveWrite( const bool& lw ) { mLiveWrite = lw; } -void cLog::AddLogReader( iLogReader * reader ) { +void Log::AddLogReader( LogReaderInterface * reader ) { mReaders.push_back( reader ); } -void cLog::RemoveLogReader( iLogReader * reader ) { +void Log::RemoveLogReader( LogReaderInterface * reader ) { mReaders.remove( reader ); } -void cLog::WriteToReaders( std::string& text ) { - for ( std::list::iterator it = mReaders.begin(); it != mReaders.end(); it++ ) { +void Log::WriteToReaders( std::string& text ) { + for ( std::list::iterator it = mReaders.begin(); it != mReaders.end(); it++ ) { (*it)->WriteLog( text ); } } diff --git a/src/eepp/system/cmutex.cpp b/src/eepp/system/mutex.cpp similarity index 51% rename from src/eepp/system/cmutex.cpp rename to src/eepp/system/mutex.cpp index 09acf5b71..d52707d78 100755 --- a/src/eepp/system/cmutex.cpp +++ b/src/eepp/system/mutex.cpp @@ -1,26 +1,26 @@ -#include +#include #include namespace EE { namespace System { -cMutex::cMutex() : - mMutexImpl( new Platform::cMutexImpl() ) +Mutex::Mutex() : + mMutexImpl( new Platform::MutexImpl() ) { } -cMutex::~cMutex() { +Mutex::~Mutex() { delete mMutexImpl; } -void cMutex::Lock() { +void Mutex::Lock() { mMutexImpl->Lock(); } -void cMutex::Unlock() { +void Mutex::Unlock() { mMutexImpl->Unlock(); } -int cMutex::TryLock() { +int Mutex::TryLock() { return mMutexImpl->TryLock(); } diff --git a/src/eepp/system/cobjectloader.cpp b/src/eepp/system/objectloader.cpp similarity index 53% rename from src/eepp/system/cobjectloader.cpp rename to src/eepp/system/objectloader.cpp index 5a061d4e5..13ef8b3bb 100644 --- a/src/eepp/system/cobjectloader.cpp +++ b/src/eepp/system/objectloader.cpp @@ -1,8 +1,8 @@ -#include +#include namespace EE { namespace System { -cObjectLoader::cObjectLoader( Uint32 ObjType ): +ObjectLoader::ObjectLoader( Uint32 ObjType ): mObjType(ObjType), mLoaded(false), mLoading(false), @@ -10,11 +10,11 @@ cObjectLoader::cObjectLoader( Uint32 ObjType ): { } -cObjectLoader::~cObjectLoader() +ObjectLoader::~ObjectLoader() { } -void cObjectLoader::Load() { +void ObjectLoader::Load() { if ( mLoaded ) { SetLoaded(); } @@ -22,7 +22,7 @@ void cObjectLoader::Load() { Launch(); } -void cObjectLoader::Load( ObjLoadCallback Cb ) { +void ObjectLoader::Load( ObjLoadCallback Cb ) { if ( Cb.IsSet() ) { mLoadCbs.push_back( Cb ); } @@ -30,43 +30,43 @@ void cObjectLoader::Load( ObjLoadCallback Cb ) { Load(); } -void cObjectLoader::Launch() { +void ObjectLoader::Launch() { if ( mThreaded ) { - cThread::Launch(); + Thread::Launch(); } else { Run(); } } -void cObjectLoader::Start() { +void ObjectLoader::Start() { mLoading = true; } -void cObjectLoader::Update() { +void ObjectLoader::Update() { } -bool cObjectLoader::IsLoaded() { +bool ObjectLoader::IsLoaded() { return mLoaded; } -bool cObjectLoader::IsLoading() { +bool ObjectLoader::IsLoading() { return mLoading; } -bool cObjectLoader::Threaded() const { +bool ObjectLoader::Threaded() const { return mThreaded; } -void cObjectLoader::Threaded( const bool& threaded ) { +void ObjectLoader::Threaded( const bool& threaded ) { mThreaded = threaded; } -void cObjectLoader::Run() { +void ObjectLoader::Run() { Start(); } -void cObjectLoader::SetLoaded() { +void ObjectLoader::SetLoaded() { mLoaded = true; mLoading = false; @@ -81,11 +81,11 @@ void cObjectLoader::SetLoaded() { } } -const Uint32& cObjectLoader::Type() const { +const Uint32& ObjectLoader::Type() const { return mObjType; } -void cObjectLoader::Reset() { +void ObjectLoader::Reset() { mLoaded = false; mLoading = false; } diff --git a/src/eepp/system/pack.cpp b/src/eepp/system/pack.cpp new file mode 100644 index 000000000..85ca68105 --- /dev/null +++ b/src/eepp/system/pack.cpp @@ -0,0 +1,21 @@ +#include +#include + +namespace EE { namespace System { + +Pack::Pack() : + Mutex(), + mIsOpen(false) +{ + PackManager::instance()->Add( this ); +} + +Pack::~Pack() { + PackManager::instance()->Remove( this ); +} + +bool Pack::IsOpen() const { + return mIsOpen; +} + +}} diff --git a/src/eepp/system/cpackmanager.cpp b/src/eepp/system/packmanager.cpp similarity index 55% rename from src/eepp/system/cpackmanager.cpp rename to src/eepp/system/packmanager.cpp index 639736814..ceeb6db30 100644 --- a/src/eepp/system/cpackmanager.cpp +++ b/src/eepp/system/packmanager.cpp @@ -1,25 +1,25 @@ -#include +#include #include -#include +#include namespace EE { namespace System { -SINGLETON_DECLARE_IMPLEMENTATION(cPackManager) +SINGLETON_DECLARE_IMPLEMENTATION(PackManager) -cPackManager::cPackManager() : +PackManager::PackManager() : mFallback( true ) { } -cPackManager::~cPackManager() { +PackManager::~PackManager() { } -cPack * cPackManager::Exists( std::string& path ) { +Pack * PackManager::Exists( std::string& path ) { std::string tpath( path ); FileSystem::FilePathRemoveProcessPath( tpath ); - std::list::iterator it; + std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) { if ( -1 != (*it)->Exists( tpath ) ) { @@ -34,8 +34,8 @@ cPack * cPackManager::Exists( std::string& path ) { return NULL; } -cPack * cPackManager::GetPackByPath( std::string path ) { - std::list::iterator it; +Pack * PackManager::GetPackByPath( std::string path ) { + std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) { if ( path == (*it)->GetPackPath() ) { @@ -46,11 +46,11 @@ cPack * cPackManager::GetPackByPath( std::string path ) { return NULL; } -const bool& cPackManager::FallbackToPacks() const { +const bool& PackManager::FallbackToPacks() const { return mFallback; } -void cPackManager::FallbackToPacks( const bool& fallback ) { +void PackManager::FallbackToPacks( const bool& fallback ) { mFallback = fallback; } diff --git a/src/eepp/system/cpak.cpp b/src/eepp/system/pak.cpp similarity index 85% rename from src/eepp/system/cpak.cpp rename to src/eepp/system/pak.cpp index bd809a429..597bc6ecb 100755 --- a/src/eepp/system/cpak.cpp +++ b/src/eepp/system/pak.cpp @@ -1,20 +1,20 @@ -#include +#include #include -#include +#include namespace EE { namespace System { -cPak::cPak() : - cPack() +Pak::Pak() : + Pack() { mPak.fs = NULL; } -cPak::~cPak() { +Pak::~Pak() { Close(); } -bool cPak::Create( const std::string& path ) { +bool Pak::Create( const std::string& path ) { if ( !FileSystem::FileExists(path) ) { pakFile Pak; @@ -28,7 +28,7 @@ bool cPak::Create( const std::string& path ) { eeSAFE_DELETE( mPak.fs ); - mPak.fs = eeNew( cIOStreamFile, ( path , std::ios::out | std::ios::binary ) ); // Open the PAK file + mPak.fs = eeNew( IOStreamFile, ( path , std::ios::out | std::ios::binary ) ); // Open the PAK file mPak.fs->Write( reinterpret_cast (&Pak.header), sizeof(Pak.header) ); @@ -44,13 +44,13 @@ bool cPak::Create( const std::string& path ) { return false; } -bool cPak::Open( const std::string& path ) { +bool Pak::Open( const std::string& path ) { if ( FileSystem::FileExists(path) ) { mPak.pakPath = path; eeSAFE_DELETE( mPak.fs ); - mPak.fs = eeNew( cIOStreamFile, ( path , std::ios::in | std::ios::out | std::ios::binary ) ); // Open the PAK file + mPak.fs = eeNew( IOStreamFile, ( path , std::ios::in | std::ios::out | std::ios::binary ) ); // Open the PAK file mPak.fs->Read( reinterpret_cast (&mPak.header), sizeof(pakHeader) ); // Read the PAK header @@ -76,7 +76,7 @@ bool cPak::Open( const std::string& path ) { return false; } -bool cPak::Close() { +bool Pak::Close() { if ( mIsOpen ) { eeSAFE_DELETE( mPak.fs ); @@ -90,7 +90,7 @@ bool cPak::Close() { return false; } -Int8 cPak::CheckPack() { +Int8 Pak::CheckPack() { if ( NULL != mPak.fs && mPak.fs->IsOpen() ) { if ( mPak.header.head[0] != 'P' || mPak.header.head[1] != 'A' || mPak.header.head[2] != 'C' || mPak.header.head[3] != 'K') return -1; // Ident corrupt @@ -102,7 +102,7 @@ Int8 cPak::CheckPack() { return 0; } -Int32 cPak::Exists( const std::string& path ) { +Int32 Pak::Exists( const std::string& path ) { if ( IsOpen() ) { for ( Uint32 i = 0; i < mPakFiles.size(); i++ ) if ( strcmp( path.c_str(), mPakFiles[i].filename ) == 0 ) @@ -112,7 +112,7 @@ Int32 cPak::Exists( const std::string& path ) { return -1; } -bool cPak::ExtractFile( const std::string& path , const std::string& dest ) { +bool Pak::ExtractFile( const std::string& path , const std::string& dest ) { if ( NULL == mPak.fs || !mPak.fs->IsOpen() ) { return false; } @@ -138,7 +138,7 @@ bool cPak::ExtractFile( const std::string& path , const std::string& dest ) { return Ret; } -bool cPak::ExtractFileToMemory( const std::string& path, std::vector& data ) { +bool Pak::ExtractFileToMemory( const std::string& path, std::vector& data ) { if ( NULL == mPak.fs || !mPak.fs->IsOpen() ) { return false; } @@ -164,7 +164,7 @@ bool cPak::ExtractFileToMemory( const std::string& path, std::vector& dat return Ret; } -bool cPak::ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) { +bool Pak::ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) { if ( NULL == mPak.fs || !mPak.fs->IsOpen() ) { return false; } @@ -190,7 +190,7 @@ bool cPak::ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) return Ret; } -bool cPak::AddFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ) { +bool Pak::AddFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ) { if ( dataSize < 1 ) return false; @@ -262,11 +262,11 @@ bool cPak::AddFile( const Uint8 * data, const Uint32& dataSize, const std::strin return false; } -bool cPak::AddFile( std::vector& data, const std::string& inpack ) { +bool Pak::AddFile( std::vector& data, const std::string& inpack ) { return AddFile( reinterpret_cast ( &data[0] ), (Uint32)data.size(), inpack ); } -bool cPak::AddFile( const std::string& path, const std::string& inpack ) { +bool Pak::AddFile( const std::string& path, const std::string& inpack ) { if ( path.size() > 56 ) return false; @@ -277,21 +277,21 @@ bool cPak::AddFile( const std::string& path, const std::string& inpack ) { return AddFile( file.Data, file.DataSize, inpack ); } -bool cPak::AddFiles( std::map paths ) { +bool Pak::AddFiles( std::map paths ) { for( std::map::iterator itr = paths.begin(); itr != paths.end(); itr++) if ( !AddFile( itr->first, itr->second ) ) return false; return true; } -bool cPak::EraseFile( const std::string& path ) { +bool Pak::EraseFile( const std::string& path ) { std::vector tmpv; tmpv.push_back( path ); return EraseFiles( tmpv ); } -bool cPak::EraseFiles( const std::vector& paths ) { +bool Pak::EraseFiles( const std::vector& paths ) { std::vector files; Int32 Ex; Uint32 total_offset = 0, i = 0; @@ -309,7 +309,7 @@ bool cPak::EraseFiles( const std::vector& paths ) { nPf.pakPath = std::string ( mPak.pakPath + ".new" ); - nPf.fs = eeNew( cIOStreamFile, ( nPf.pakPath.c_str() , std::ios::out | std::ios::binary ) ); + nPf.fs = eeNew( IOStreamFile, ( nPf.pakPath.c_str() , std::ios::out | std::ios::binary ) ); for ( i = 0; i < mPakFiles.size(); i++ ) { Remove = false; @@ -355,7 +355,7 @@ bool cPak::EraseFiles( const std::vector& paths ) { } -std::vector cPak::GetFileList() { +std::vector Pak::GetFileList() { std::vector tmpv; tmpv.resize( mPakFiles.size() ); @@ -366,11 +366,11 @@ std::vector cPak::GetFileList() { return tmpv; } -bool cPak::IsOpen() const { +bool Pak::IsOpen() const { return mIsOpen; } -std::string cPak::GetPackPath() { +std::string Pak::GetPackPath() { return mPak.pakPath; } diff --git a/src/eepp/system/platform/platformimpl.hpp b/src/eepp/system/platform/platformimpl.hpp index 034933e2e..c53b384e9 100644 --- a/src/eepp/system/platform/platformimpl.hpp +++ b/src/eepp/system/platform/platformimpl.hpp @@ -4,17 +4,17 @@ #include #if defined( EE_PLATFORM_POSIX ) - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include #elif EE_PLATFORM == EE_PLATFORM_WIN - #include - #include - #include - #include - #include + #include + #include + #include + #include + #include #else #error Threads, mutexes, conditions, timers and thread local storage not implemented for this platform. #endif diff --git a/src/eepp/system/platform/posix/cclockimpl.cpp b/src/eepp/system/platform/posix/clockimpl.cpp similarity index 76% rename from src/eepp/system/platform/posix/cclockimpl.cpp rename to src/eepp/system/platform/posix/clockimpl.cpp index 0b5e3fd52..2dc7fa3b8 100644 --- a/src/eepp/system/platform/posix/cclockimpl.cpp +++ b/src/eepp/system/platform/posix/clockimpl.cpp @@ -1,16 +1,16 @@ -#include +#include #if defined( EE_PLATFORM_POSIX ) namespace EE { namespace System { namespace Platform { -cClockImpl::cClockImpl() { +ClockImpl::ClockImpl() { } -cClockImpl::~cClockImpl() { +ClockImpl::~ClockImpl() { } -void cClockImpl::Restart() { +void ClockImpl::Restart() { #ifdef EE_HAVE_CLOCK_GETTIME clock_gettime( CLOCK_MONOTONIC, &mStart ); #else @@ -18,7 +18,7 @@ void cClockImpl::Restart() { #endif } -unsigned long cClockImpl::GetElapsedTime() { +unsigned long ClockImpl::GetElapsedTime() { #ifdef EE_HAVE_CLOCK_GETTIME timespec time; clock_gettime( CLOCK_MONOTONIC, &time ); diff --git a/src/eepp/system/platform/posix/cclockimpl.hpp b/src/eepp/system/platform/posix/clockimpl.hpp similarity index 90% rename from src/eepp/system/platform/posix/cclockimpl.hpp rename to src/eepp/system/platform/posix/clockimpl.hpp index 9a7aff402..a391ad477 100644 --- a/src/eepp/system/platform/posix/cclockimpl.hpp +++ b/src/eepp/system/platform/posix/clockimpl.hpp @@ -13,11 +13,11 @@ namespace EE { namespace System { namespace Platform { -class cClockImpl { +class ClockImpl { public: - cClockImpl(); + ClockImpl(); - ~cClockImpl(); + ~ClockImpl(); void Restart(); diff --git a/src/eepp/system/platform/posix/cconditionimpl.cpp b/src/eepp/system/platform/posix/conditionimpl.cpp similarity index 55% rename from src/eepp/system/platform/posix/cconditionimpl.cpp rename to src/eepp/system/platform/posix/conditionimpl.cpp index f8eeb29b0..192b861a4 100755 --- a/src/eepp/system/platform/posix/cconditionimpl.cpp +++ b/src/eepp/system/platform/posix/conditionimpl.cpp @@ -1,4 +1,4 @@ -#include +#include #if defined( EE_PLATFORM_POSIX ) @@ -6,36 +6,36 @@ namespace EE { namespace System { namespace Platform { -cConditionImpl::cConditionImpl( int var ) : +ConditionImpl::ConditionImpl( int var ) : mIsInvalid( true ), mConditionnedVar( var ), mCond(), mMutex() { if ( 0 != pthread_cond_init( &mCond, NULL ) ) - std::cerr << "cConditionImpl::cConditionImpl(): pthread_cond_init() error\n"; + std::cerr << "ConditionImpl::ConditionImpl(): pthread_cond_init() error\n"; if ( 0 != pthread_mutex_init( &mMutex, NULL ) ) - std::cerr << "cConditionImpl::cConditionImpl(): pthread_mutex_init() error\n"; + std::cerr << "ConditionImpl::ConditionImpl(): pthread_mutex_init() error\n"; } -cConditionImpl::~cConditionImpl() { +ConditionImpl::~ConditionImpl() { if ( 0 != pthread_cond_destroy( &mCond ) ) - std::cerr << "cConditionImpl::~cConditionImpl(): pthread_cond_destroy() error\n"; + std::cerr << "ConditionImpl::~ConditionImpl(): pthread_cond_destroy() error\n"; if ( 0 != pthread_mutex_destroy( &mMutex ) ) - std::cerr << "cConditionImpl::~cConditionImpl(): pthread_mutex_destroy() error\n"; + std::cerr << "ConditionImpl::~ConditionImpl(): pthread_mutex_destroy() error\n"; } -void cConditionImpl::Lock() { +void ConditionImpl::Lock() { pthread_mutex_lock( &mMutex ); } -void cConditionImpl::Unlock() { +void ConditionImpl::Unlock() { pthread_mutex_unlock( &mMutex ); } -bool cConditionImpl::WaitAndRetain( int value ) { +bool ConditionImpl::WaitAndRetain( int value ) { pthread_mutex_lock(&mMutex); while ( mConditionnedVar != value && mIsInvalid ) { @@ -51,7 +51,7 @@ bool cConditionImpl::WaitAndRetain( int value ) { return false; } -void cConditionImpl::Release( int value ) { +void ConditionImpl::Release( int value ) { mConditionnedVar = value; pthread_mutex_unlock( &mMutex ); @@ -59,7 +59,7 @@ void cConditionImpl::Release( int value ) { Signal(); } -void cConditionImpl::SetValue( int value ) { +void ConditionImpl::SetValue( int value ) { // Make sure the Condition's value is not modified while retained pthread_mutex_lock( &mMutex ); @@ -70,22 +70,22 @@ void cConditionImpl::SetValue( int value ) { Signal(); } -int cConditionImpl::Value() const { +int ConditionImpl::Value() const { return mConditionnedVar; } -void cConditionImpl::Signal() { +void ConditionImpl::Signal() { pthread_cond_signal( &mCond ); } -void cConditionImpl::Invalidate() { +void ConditionImpl::Invalidate() { if (mIsInvalid) { mIsInvalid = false; Signal(); } } -void cConditionImpl::Restore() { +void ConditionImpl::Restore() { if ( !mIsInvalid ) { mIsInvalid = true; } diff --git a/src/eepp/system/platform/posix/cconditionimpl.hpp b/src/eepp/system/platform/posix/conditionimpl.hpp similarity index 83% rename from src/eepp/system/platform/posix/cconditionimpl.hpp rename to src/eepp/system/platform/posix/conditionimpl.hpp index dad292801..b1c9840b8 100755 --- a/src/eepp/system/platform/posix/cconditionimpl.hpp +++ b/src/eepp/system/platform/posix/conditionimpl.hpp @@ -9,11 +9,11 @@ namespace EE { namespace System { namespace Platform { -class cConditionImpl { +class ConditionImpl { public: - cConditionImpl( int var ); + ConditionImpl( int var ); - ~cConditionImpl(); + ~ConditionImpl(); void Lock(); diff --git a/src/eepp/system/platform/posix/cthreadlocalimpl.cpp b/src/eepp/system/platform/posix/cthreadlocalimpl.cpp deleted file mode 100644 index 4f46865ae..000000000 --- a/src/eepp/system/platform/posix/cthreadlocalimpl.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include - -#if defined( EE_PLATFORM_POSIX ) - -namespace EE { namespace System { namespace Private { - -cThreadLocalImpl::cThreadLocalImpl() { - pthread_key_create(&mKey, NULL); -} - -cThreadLocalImpl::~cThreadLocalImpl() { - pthread_key_delete(mKey); -} - -void cThreadLocalImpl::Value(void* value) { - pthread_setspecific(mKey, value); -} - -void* cThreadLocalImpl::Value() const { - return pthread_getspecific(mKey); -} - -}}} - -#endif diff --git a/src/eepp/system/platform/posix/cmuteximpl.cpp b/src/eepp/system/platform/posix/muteximpl.cpp similarity index 58% rename from src/eepp/system/platform/posix/cmuteximpl.cpp rename to src/eepp/system/platform/posix/muteximpl.cpp index 1592ac21d..037242570 100644 --- a/src/eepp/system/platform/posix/cmuteximpl.cpp +++ b/src/eepp/system/platform/posix/muteximpl.cpp @@ -1,4 +1,4 @@ -#include +#include #if defined( EE_PLATFORM_POSIX ) @@ -6,28 +6,28 @@ namespace EE { namespace System { namespace Platform { -cMutexImpl::cMutexImpl() { +MutexImpl::MutexImpl() { pthread_mutexattr_t attributes; pthread_mutexattr_init(&attributes); pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_RECURSIVE); if ( 0 != pthread_mutex_init(&mMutex, &attributes) ) - std::cerr << "cMutexImpl::cMutexImpl(): pthread_mutex_init() error\n"; + std::cerr << "MutexImpl::MutexImpl(): pthread_mutex_init() error\n"; } -cMutexImpl::~cMutexImpl() { +MutexImpl::~MutexImpl() { if ( 0 != pthread_mutex_destroy( &mMutex ) ) - std::cerr << "cMutexImpl::~cMutexImpl(): pthread_mutex_destroy() error\n"; + std::cerr << "MutexImpl::~MutexImpl(): pthread_mutex_destroy() error\n"; } -void cMutexImpl::Lock() { +void MutexImpl::Lock() { pthread_mutex_lock(&mMutex); } -void cMutexImpl::Unlock() { +void MutexImpl::Unlock() { pthread_mutex_unlock(&mMutex); } -int cMutexImpl::TryLock() { +int MutexImpl::TryLock() { return pthread_mutex_trylock(&mMutex); } diff --git a/src/eepp/system/platform/posix/cmuteximpl.hpp b/src/eepp/system/platform/posix/muteximpl.hpp similarity index 86% rename from src/eepp/system/platform/posix/cmuteximpl.hpp rename to src/eepp/system/platform/posix/muteximpl.hpp index e0289a322..955e104d1 100644 --- a/src/eepp/system/platform/posix/cmuteximpl.hpp +++ b/src/eepp/system/platform/posix/muteximpl.hpp @@ -9,11 +9,11 @@ namespace EE { namespace System { namespace Platform { -class cMutexImpl { +class MutexImpl { public: - cMutexImpl(); + MutexImpl(); - ~cMutexImpl(); + ~MutexImpl(); void Lock(); diff --git a/src/eepp/system/platform/posix/cthreadimpl.cpp b/src/eepp/system/platform/posix/threadimpl.cpp similarity index 67% rename from src/eepp/system/platform/posix/cthreadimpl.cpp rename to src/eepp/system/platform/posix/threadimpl.cpp index 27e4fb16b..2c5315c65 100644 --- a/src/eepp/system/platform/posix/cthreadimpl.cpp +++ b/src/eepp/system/platform/posix/threadimpl.cpp @@ -1,25 +1,25 @@ -#include -#include +#include +#include #include namespace EE { namespace System { namespace Platform { #if defined( EE_PLATFORM_POSIX ) -UintPtr cThreadImpl::GetCurrentThreadId() { +UintPtr ThreadImpl::GetCurrentThreadId() { return (UintPtr)pthread_self(); } -cThreadImpl::cThreadImpl( cThread * owner ) : +ThreadImpl::ThreadImpl( Thread * owner ) : mIsActive(false) { - mIsActive = pthread_create( &mThread, NULL, &cThreadImpl::EntryPoint, owner ) == 0; + mIsActive = pthread_create( &mThread, NULL, &ThreadImpl::EntryPoint, owner ) == 0; if ( !mIsActive ) std::cerr << "Failed to create thread" << std::endl; } -void cThreadImpl::Wait() { +void ThreadImpl::Wait() { if ( mIsActive ) { // Wait for the thread to finish, no timeout eeASSERT( pthread_equal( pthread_self(), mThread ) == 0 ); @@ -30,7 +30,7 @@ void cThreadImpl::Wait() { } } -void cThreadImpl::Terminate() { +void ThreadImpl::Terminate() { if ( mIsActive ) { #if EE_PLATFORM != EE_PLATFORM_ANDROID pthread_cancel( mThread ); @@ -42,13 +42,13 @@ void cThreadImpl::Terminate() { } } -UintPtr cThreadImpl::Id() { +UintPtr ThreadImpl::Id() { return (UintPtr)mThread; } -void * cThreadImpl::EntryPoint( void * userData ) { +void * ThreadImpl::EntryPoint( void * userData ) { // The Thread instance is stored in the user data - cThread * owner = static_cast( userData ); + Thread * owner = static_cast( userData ); // Tell the thread to handle cancel requests immediatly #ifdef PTHREAD_CANCEL_ASYNCHRONOUS diff --git a/src/eepp/system/platform/posix/cthreadimpl.hpp b/src/eepp/system/platform/posix/threadimpl.hpp similarity index 86% rename from src/eepp/system/platform/posix/cthreadimpl.hpp rename to src/eepp/system/platform/posix/threadimpl.hpp index 9b83f4441..f161e496e 100644 --- a/src/eepp/system/platform/posix/cthreadimpl.hpp +++ b/src/eepp/system/platform/posix/threadimpl.hpp @@ -9,15 +9,15 @@ namespace EE { namespace System { -class cThread; +class Thread; namespace Platform { -class cThreadImpl { +class ThreadImpl { public: static UintPtr GetCurrentThreadId(); - cThreadImpl( cThread * owner ); + ThreadImpl( Thread * owner ); void Wait(); diff --git a/src/eepp/system/platform/posix/threadlocalimpl.cpp b/src/eepp/system/platform/posix/threadlocalimpl.cpp new file mode 100644 index 000000000..e3ceed834 --- /dev/null +++ b/src/eepp/system/platform/posix/threadlocalimpl.cpp @@ -0,0 +1,25 @@ +#include + +#if defined( EE_PLATFORM_POSIX ) + +namespace EE { namespace System { namespace Private { + +ThreadLocalImpl::ThreadLocalImpl() { + pthread_key_create(&mKey, NULL); +} + +ThreadLocalImpl::~ThreadLocalImpl() { + pthread_key_delete(mKey); +} + +void ThreadLocalImpl::Value(void* value) { + pthread_setspecific(mKey, value); +} + +void* ThreadLocalImpl::Value() const { + return pthread_getspecific(mKey); +} + +}}} + +#endif diff --git a/src/eepp/system/platform/posix/cthreadlocalimpl.hpp b/src/eepp/system/platform/posix/threadlocalimpl.hpp similarity index 76% rename from src/eepp/system/platform/posix/cthreadlocalimpl.hpp rename to src/eepp/system/platform/posix/threadlocalimpl.hpp index 461a0b054..e27817a7e 100644 --- a/src/eepp/system/platform/posix/cthreadlocalimpl.hpp +++ b/src/eepp/system/platform/posix/threadlocalimpl.hpp @@ -10,11 +10,11 @@ namespace EE { namespace System { namespace Private { -class cThreadLocalImpl : NonCopyable { +class ThreadLocalImpl : NonCopyable { public: - cThreadLocalImpl(); + ThreadLocalImpl(); - ~cThreadLocalImpl(); + ~ThreadLocalImpl(); void Value(void* value); diff --git a/src/eepp/system/platform/win/cclockimpl.cpp b/src/eepp/system/platform/win/clockimpl.cpp similarity index 90% rename from src/eepp/system/platform/win/cclockimpl.cpp rename to src/eepp/system/platform/win/clockimpl.cpp index 879b47580..629c1605b 100644 --- a/src/eepp/system/platform/win/cclockimpl.cpp +++ b/src/eepp/system/platform/win/clockimpl.cpp @@ -1,18 +1,18 @@ -#include +#include #if EE_PLATFORM == EE_PLATFORM_WIN namespace EE { namespace System { namespace Platform { -cClockImpl::cClockImpl() : +ClockImpl::ClockImpl() : mTimerMask( 0 ) { } -cClockImpl::~cClockImpl() { +ClockImpl::~ClockImpl() { } -void cClockImpl::Restart() { +void ClockImpl::Restart() { // Get the current process core mask DWORD procMask; DWORD sysMask; @@ -51,7 +51,7 @@ void cClockImpl::Restart() { mLastTime = 0; } -unsigned long cClockImpl::GetElapsedTime() { +unsigned long ClockImpl::GetElapsedTime() { LARGE_INTEGER curTime; HANDLE thread = GetCurrentThread(); @@ -90,7 +90,7 @@ unsigned long cClockImpl::GetElapsedTime() { return newMicro; } -bool cClockImpl::isPO2( Uint32 n ) { +bool ClockImpl::isPO2( Uint32 n ) { return (n & (n-1)) == 0; } diff --git a/src/eepp/system/platform/win/cclockimpl.hpp b/src/eepp/system/platform/win/clockimpl.hpp similarity index 91% rename from src/eepp/system/platform/win/cclockimpl.hpp rename to src/eepp/system/platform/win/clockimpl.hpp index fdef04125..54e82fe78 100644 --- a/src/eepp/system/platform/win/cclockimpl.hpp +++ b/src/eepp/system/platform/win/clockimpl.hpp @@ -17,11 +17,11 @@ namespace EE { namespace System { namespace Platform { -class cClockImpl { +class ClockImpl { public: - cClockImpl(); + ClockImpl(); - ~cClockImpl(); + ~ClockImpl(); void Restart(); diff --git a/src/eepp/system/platform/win/cconditionimpl.cpp b/src/eepp/system/platform/win/conditionimpl.cpp similarity index 63% rename from src/eepp/system/platform/win/cconditionimpl.cpp rename to src/eepp/system/platform/win/conditionimpl.cpp index c01371c43..f99843f9e 100755 --- a/src/eepp/system/platform/win/cconditionimpl.cpp +++ b/src/eepp/system/platform/win/conditionimpl.cpp @@ -1,4 +1,4 @@ -#include +#include #if EE_PLATFORM == EE_PLATFORM_WIN @@ -6,7 +6,7 @@ namespace EE { namespace System { namespace Platform { -cConditionImpl::cConditionImpl(int var) : +ConditionImpl::ConditionImpl(int var) : mIsValid( true ), mConditionnedVar( var ), mMutex() @@ -17,19 +17,19 @@ cConditionImpl::cConditionImpl(int var) : std::cerr << "ConditionImpl() - CreateEvent() error\n"; } -cConditionImpl::~cConditionImpl() { +ConditionImpl::~ConditionImpl() { CloseHandle( mCond ); } -void cConditionImpl::Lock() { +void ConditionImpl::Lock() { mMutex.Lock(); } -void cConditionImpl::Unlock() { +void ConditionImpl::Unlock() { mMutex.Unlock(); } -bool cConditionImpl::WaitAndRetain(int value) { +bool ConditionImpl::WaitAndRetain(int value) { mMutex.Lock(); while ( mConditionnedVar != value && mIsValid ) { @@ -48,14 +48,14 @@ bool cConditionImpl::WaitAndRetain(int value) { return false; } -void cConditionImpl::Release( int value ) { +void ConditionImpl::Release( int value ) { mConditionnedVar = value; mMutex.Unlock(); Signal(); } -void cConditionImpl::SetValue( int value ) { +void ConditionImpl::SetValue( int value ) { // Make sure the Condition's value is not modified while retained mMutex.Lock(); mConditionnedVar = value; @@ -64,15 +64,15 @@ void cConditionImpl::SetValue( int value ) { Signal(); } -int cConditionImpl::Value() const { +int ConditionImpl::Value() const { return mConditionnedVar; } -void cConditionImpl::Signal() { +void ConditionImpl::Signal() { SetEvent( mCond ); } -void cConditionImpl::Invalidate() { +void ConditionImpl::Invalidate() { if ( mIsValid ) { mIsValid = false; @@ -80,7 +80,7 @@ void cConditionImpl::Invalidate() { } } -void cConditionImpl::Restore() { +void ConditionImpl::Restore() { if ( !mIsValid ) { mIsValid = true; } diff --git a/src/eepp/system/platform/win/cconditionimpl.hpp b/src/eepp/system/platform/win/conditionimpl.hpp similarity index 73% rename from src/eepp/system/platform/win/cconditionimpl.hpp rename to src/eepp/system/platform/win/conditionimpl.hpp index 7c73cb09c..bfe2fd374 100755 --- a/src/eepp/system/platform/win/cconditionimpl.hpp +++ b/src/eepp/system/platform/win/conditionimpl.hpp @@ -5,16 +5,16 @@ #if EE_PLATFORM == EE_PLATFORM_WIN -#include +#include namespace EE { namespace System { namespace Platform { -class cConditionImpl { +class ConditionImpl { public: - cConditionImpl( int var ); + ConditionImpl( int var ); - ~cConditionImpl(); + ~ConditionImpl(); void Lock(); @@ -38,7 +38,7 @@ class cConditionImpl { int mConditionnedVar; HANDLE mCond; - cMutexImpl mMutex; + MutexImpl mMutex; }; }}} diff --git a/src/eepp/system/platform/win/cthreadlocalimpl.cpp b/src/eepp/system/platform/win/cthreadlocalimpl.cpp deleted file mode 100644 index d128633e5..000000000 --- a/src/eepp/system/platform/win/cthreadlocalimpl.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include - -#if EE_PLATFORM == EE_PLATFORM_WIN - -namespace EE { namespace System { namespace Private { - -cThreadLocalImpl::cThreadLocalImpl() { - mIndex = TlsAlloc(); -} - -cThreadLocalImpl::~cThreadLocalImpl() { - TlsFree(mIndex); -} - -void cThreadLocalImpl::Value(void* value) { - TlsSetValue(mIndex, value); -} - -void* cThreadLocalImpl::Value() const { - return TlsGetValue(mIndex); -} - -}}} - -#endif diff --git a/src/eepp/system/platform/win/cmuteximpl.cpp b/src/eepp/system/platform/win/muteximpl.cpp similarity index 61% rename from src/eepp/system/platform/win/cmuteximpl.cpp rename to src/eepp/system/platform/win/muteximpl.cpp index 711013c37..52734c7eb 100644 --- a/src/eepp/system/platform/win/cmuteximpl.cpp +++ b/src/eepp/system/platform/win/muteximpl.cpp @@ -1,26 +1,26 @@ -#include +#include #if EE_PLATFORM == EE_PLATFORM_WIN namespace EE { namespace System { namespace Platform { -cMutexImpl::cMutexImpl() { +MutexImpl::MutexImpl() { InitializeCriticalSection(&mMutex); } -cMutexImpl::~cMutexImpl() { +MutexImpl::~MutexImpl() { DeleteCriticalSection(&mMutex); } -void cMutexImpl::Lock() { +void MutexImpl::Lock() { EnterCriticalSection(&mMutex); } -void cMutexImpl::Unlock() { +void MutexImpl::Unlock() { LeaveCriticalSection(&mMutex); } -int cMutexImpl::TryLock() { +int MutexImpl::TryLock() { return TryEnterCriticalSection(&mMutex); } diff --git a/src/eepp/system/platform/win/cmuteximpl.hpp b/src/eepp/system/platform/win/muteximpl.hpp similarity index 89% rename from src/eepp/system/platform/win/cmuteximpl.hpp rename to src/eepp/system/platform/win/muteximpl.hpp index 16f5eac05..add1406a6 100644 --- a/src/eepp/system/platform/win/cmuteximpl.hpp +++ b/src/eepp/system/platform/win/muteximpl.hpp @@ -15,11 +15,11 @@ namespace EE { namespace System { namespace Platform { -class cMutexImpl { +class MutexImpl { public: - cMutexImpl(); + MutexImpl(); - ~cMutexImpl(); + ~MutexImpl(); void Lock(); diff --git a/src/eepp/system/platform/win/cthreadimpl.cpp b/src/eepp/system/platform/win/threadimpl.cpp similarity index 58% rename from src/eepp/system/platform/win/cthreadimpl.cpp rename to src/eepp/system/platform/win/threadimpl.cpp index 6fd5af02a..9a5ecba8f 100644 --- a/src/eepp/system/platform/win/cthreadimpl.cpp +++ b/src/eepp/system/platform/win/threadimpl.cpp @@ -1,23 +1,23 @@ -#include -#include +#include +#include #include namespace EE { namespace System { namespace Platform { #if EE_PLATFORM == EE_PLATFORM_WIN -UintPtr cThreadImpl::GetCurrentThreadId() { +UintPtr ThreadImpl::GetCurrentThreadId() { return (UintPtr)::GetCurrentThreadId(); } -cThreadImpl::cThreadImpl( cThread * owner ) { - mThread = reinterpret_cast( _beginthreadex( NULL, 0, &cThreadImpl::EntryPoint, owner, 0, &mThreadId ) ); +ThreadImpl::ThreadImpl( Thread * owner ) { + mThread = reinterpret_cast( _beginthreadex( NULL, 0, &ThreadImpl::EntryPoint, owner, 0, &mThreadId ) ); if ( !mThread ) std::cerr << "Failed to create thread" << std::endl; } -void cThreadImpl::Wait() { +void ThreadImpl::Wait() { if ( mThread ) { // Wait for the thread to finish, no timeout eeASSERT( mThreadId != GetCurrentThreadId() ); // A thread cannot wait for itself! @@ -26,19 +26,19 @@ void cThreadImpl::Wait() { } } -void cThreadImpl::Terminate() { +void ThreadImpl::Terminate() { if ( mThread ) { TerminateThread( mThread, 0 ); } } -UintPtr cThreadImpl::Id() { +UintPtr ThreadImpl::Id() { return (UintPtr)mThreadId; } -unsigned int __stdcall cThreadImpl::EntryPoint( void * userData ) { +unsigned int __stdcall ThreadImpl::EntryPoint( void * userData ) { // The Thread instance is stored in the user data - cThread * owner = static_cast( userData ); + Thread * owner = static_cast( userData ); // Forward to the owner owner->Run(); diff --git a/src/eepp/system/platform/win/cthreadimpl.hpp b/src/eepp/system/platform/win/threadimpl.hpp similarity index 88% rename from src/eepp/system/platform/win/cthreadimpl.hpp rename to src/eepp/system/platform/win/threadimpl.hpp index a325a729c..bfb0327da 100644 --- a/src/eepp/system/platform/win/cthreadimpl.hpp +++ b/src/eepp/system/platform/win/threadimpl.hpp @@ -12,15 +12,15 @@ #include namespace EE { namespace System { -class cThread; +class Thread; namespace Platform { -class cThreadImpl { +class ThreadImpl { public: static UintPtr GetCurrentThreadId(); - cThreadImpl( cThread * owner ); + ThreadImpl( Thread * owner ); void Wait(); diff --git a/src/eepp/system/platform/win/threadlocalimpl.cpp b/src/eepp/system/platform/win/threadlocalimpl.cpp new file mode 100644 index 000000000..ed28691a9 --- /dev/null +++ b/src/eepp/system/platform/win/threadlocalimpl.cpp @@ -0,0 +1,25 @@ +#include + +#if EE_PLATFORM == EE_PLATFORM_WIN + +namespace EE { namespace System { namespace Private { + +ThreadLocalImpl::ThreadLocalImpl() { + mIndex = TlsAlloc(); +} + +ThreadLocalImpl::~ThreadLocalImpl() { + TlsFree(mIndex); +} + +void ThreadLocalImpl::Value(void* value) { + TlsSetValue(mIndex, value); +} + +void* ThreadLocalImpl::Value() const { + return TlsGetValue(mIndex); +} + +}}} + +#endif diff --git a/src/eepp/system/platform/win/cthreadlocalimpl.hpp b/src/eepp/system/platform/win/threadlocalimpl.hpp similarity index 79% rename from src/eepp/system/platform/win/cthreadlocalimpl.hpp rename to src/eepp/system/platform/win/threadlocalimpl.hpp index f7e2641e7..2eaea7235 100644 --- a/src/eepp/system/platform/win/cthreadlocalimpl.hpp +++ b/src/eepp/system/platform/win/threadlocalimpl.hpp @@ -16,11 +16,11 @@ namespace EE { namespace System { namespace Private { -class cThreadLocalImpl : NonCopyable { +class ThreadLocalImpl : NonCopyable { public: - cThreadLocalImpl(); + ThreadLocalImpl(); - ~cThreadLocalImpl(); + ~ThreadLocalImpl(); void Value(void* value); diff --git a/src/eepp/system/crc4.cpp b/src/eepp/system/rc4.cpp similarity index 64% rename from src/eepp/system/crc4.cpp rename to src/eepp/system/rc4.cpp index 64608cfc3..fe737ee80 100644 --- a/src/eepp/system/crc4.cpp +++ b/src/eepp/system/rc4.cpp @@ -1,23 +1,23 @@ -#include -#include +#include +#include #include namespace EE { namespace System { -cRC4::cRC4() +RC4::RC4() {} -cRC4::~cRC4() +RC4::~RC4() {} -void cRC4::Swap( Uint8& a, Uint8& b ) { +void RC4::Swap( Uint8& a, Uint8& b ) { Uint8 tmpb; tmpb = a; a = b; b = tmpb; } -void cRC4::SetKey( const Uint8 * key, Uint32 size ) { +void RC4::SetKey( const Uint8 * key, Uint32 size ) { Uint8 a = 0; int i; @@ -31,15 +31,15 @@ void cRC4::SetKey( const Uint8 * key, Uint32 size ) { } } -void cRC4::SetKey( const std::vector& Key ) { +void RC4::SetKey( const std::vector& Key ) { SetKey( reinterpret_cast( &Key[0] ), Key.size() ); } -void cRC4::SetKey( const std::string& Key ) { +void RC4::SetKey( const std::string& Key ) { SetKey( reinterpret_cast( &Key[0] ), Key.size() ); } -void cRC4::EncryptByte( Uint8 * data, Uint32 size ) { +void RC4::EncryptByte( Uint8 * data, Uint32 size ) { Uint8 x = 0; Uint8 y = 0; Uint8 xorIndex; @@ -60,15 +60,15 @@ void cRC4::EncryptByte( Uint8 * data, Uint32 size ) { } } -void cRC4::EncryptByte( std::vector& buffer ) { +void RC4::EncryptByte( std::vector& buffer ) { EncryptByte( reinterpret_cast( &buffer[0] ), buffer.size() ); } -void cRC4::EncryptString( std::string& buffer ) { +void RC4::EncryptString( std::string& buffer ) { EncryptByte( reinterpret_cast( &buffer[0] ), buffer.size() ); } -bool cRC4::EncryptFile( const std::string& SourceFile, const std::string& DestFile ) { +bool RC4::EncryptFile( const std::string& SourceFile, const std::string& DestFile ) { if ( !FileSystem::FileExists( SourceFile ) ) return false; @@ -83,15 +83,15 @@ bool cRC4::EncryptFile( const std::string& SourceFile, const std::string& DestFi return true; } -void cRC4::DecryptByte( std::vector& buffer ) { +void RC4::DecryptByte( std::vector& buffer ) { EncryptByte( buffer ); } -void cRC4::DecryptString( std::string& buffer ) { +void RC4::DecryptString( std::string& buffer ) { EncryptString( buffer ); } -bool cRC4::DecryptFile( const std::string& SourceFile, const std::string& DestFile ) { +bool RC4::DecryptFile( const std::string& SourceFile, const std::string& DestFile ) { return EncryptFile( SourceFile, DestFile ); } diff --git a/src/eepp/system/cresourceloader.cpp b/src/eepp/system/resourceloader.cpp similarity index 69% rename from src/eepp/system/cresourceloader.cpp rename to src/eepp/system/resourceloader.cpp index 07f880f3e..ce52fb3c4 100644 --- a/src/eepp/system/cresourceloader.cpp +++ b/src/eepp/system/resourceloader.cpp @@ -1,9 +1,9 @@ -#include +#include #include namespace EE { namespace System { -cResourceLoader::cResourceLoader( const Uint32& MaxThreads ) : +ResourceLoader::ResourceLoader( const Uint32& MaxThreads ) : mLoaded(false), mLoading(false), mThreaded(true), @@ -12,11 +12,11 @@ cResourceLoader::cResourceLoader( const Uint32& MaxThreads ) : SetThreads(); } -cResourceLoader::~cResourceLoader() { +ResourceLoader::~ResourceLoader() { Clear(); } -void cResourceLoader::SetThreads() { +void ResourceLoader::SetThreads() { if ( THREADS_AUTO == mThreads ) { mThreads = Sys::GetCPUCount(); @@ -26,30 +26,30 @@ void cResourceLoader::SetThreads() { } } -bool cResourceLoader::Threaded() const { +bool ResourceLoader::Threaded() const { return mThreaded; } -Uint32 cResourceLoader::Count() const { +Uint32 ResourceLoader::Count() const { return mObjs.size(); } -void cResourceLoader::Threaded( const bool& threaded ) { +void ResourceLoader::Threaded( const bool& threaded ) { if ( !mLoading ) { mThreaded = threaded; } } -void cResourceLoader::Add( cObjectLoader * Object ) { +void ResourceLoader::Add( ObjectLoader * Object ) { mObjs.push_front( Object ); } -bool cResourceLoader::Clear( const bool& ClearObjectsLoaded ) { +bool ResourceLoader::Clear( const bool& ClearObjectsLoaded ) { if ( !mLoading ) { mLoaded = false; mLoading = false; - std::list::iterator it; + std::list::iterator it; for ( it = mObjs.begin(); it != mObjs.end(); it++ ) eeSAFE_DELETE( *it ); @@ -69,14 +69,14 @@ bool cResourceLoader::Clear( const bool& ClearObjectsLoaded ) { return false; } -void cResourceLoader::Load( ResLoadCallback Cb ) { +void ResourceLoader::Load( ResLoadCallback Cb ) { if ( Cb.IsSet() ) mLoadCbs.push_back( Cb ); Load(); } -void cResourceLoader::Load() { +void ResourceLoader::Load() { if ( mLoaded ) return; @@ -84,9 +84,9 @@ void cResourceLoader::Load() { bool AllLoaded = true; - cObjectLoader * Obj = NULL; - std::list::iterator it; - std::list ObjsErase; + ObjectLoader * Obj = NULL; + std::list::iterator it; + std::list ObjsErase; Uint32 count = 0; @@ -132,13 +132,13 @@ void cResourceLoader::Load() { } } -void cResourceLoader::Update() { +void ResourceLoader::Update() { Load(); } -void cResourceLoader::Unload() { +void ResourceLoader::Unload() { if ( mLoaded ) { - std::list::iterator it; + std::list::iterator it; for ( it = mObjs.begin(); it != mObjs.end(); it++ ) { (*it)->Unload(); @@ -148,15 +148,15 @@ void cResourceLoader::Unload() { } } -bool cResourceLoader::IsLoaded() { +bool ResourceLoader::IsLoaded() { return mLoaded; } -bool cResourceLoader::IsLoading() { +bool ResourceLoader::IsLoading() { return mLoading; } -void cResourceLoader::SetLoaded() { +void ResourceLoader::SetLoaded() { mLoaded = true; mLoading = false; @@ -171,7 +171,7 @@ void cResourceLoader::SetLoaded() { } } -Float cResourceLoader::Progress() { +Float ResourceLoader::Progress() { return ( (Float)mObjsLoaded.size() / (Float)( mObjs.size() + mObjsLoaded.size() ) ) * 100.f; } diff --git a/src/eepp/system/sys.cpp b/src/eepp/system/sys.cpp index 770c3e7d6..ca0a47a76 100644 --- a/src/eepp/system/sys.cpp +++ b/src/eepp/system/sys.cpp @@ -327,7 +327,7 @@ void Sys::Sleep( const Uint32& ms ) { Sleep( Milliseconds( ms ) ); } -void Sys::Sleep( const cTime& time ) { +void Sys::Sleep( const Time& time ) { #if EE_PLATFORM == EE_PLATFORM_WIN TIMECAPS tc; timeGetDevCaps(&tc, sizeof(TIMECAPS)); diff --git a/src/eepp/system/cthread.cpp b/src/eepp/system/thread.cpp similarity index 55% rename from src/eepp/system/cthread.cpp rename to src/eepp/system/thread.cpp index 7280eb102..5266dcd05 100755 --- a/src/eepp/system/cthread.cpp +++ b/src/eepp/system/thread.cpp @@ -1,32 +1,32 @@ -#include +#include #include namespace EE { namespace System { -Uint32 cThread::GetCurrentThreadId() { - return Platform::cThreadImpl::GetCurrentThreadId(); +Uint32 Thread::GetCurrentThreadId() { + return Platform::ThreadImpl::GetCurrentThreadId(); } -cThread::cThread() : +Thread::Thread() : mThreadImpl(NULL), mEntryPoint(NULL) { } -cThread::~cThread() { +Thread::~Thread() { Wait(); if ( NULL != mEntryPoint ) delete mEntryPoint; } -void cThread::Launch() { +void Thread::Launch() { Wait(); - mThreadImpl = eeNew( Platform::cThreadImpl, ( this ) ); + mThreadImpl = eeNew( Platform::ThreadImpl, ( this ) ); } -void cThread::Wait() { +void Thread::Wait() { if ( mThreadImpl ) { mThreadImpl->Wait(); @@ -34,7 +34,7 @@ void cThread::Wait() { } } -void cThread::Terminate() { +void Thread::Terminate() { if ( mThreadImpl ) { mThreadImpl->Terminate(); @@ -42,11 +42,11 @@ void cThread::Terminate() { } } -Uint32 cThread::Id() { +Uint32 Thread::Id() { return mThreadImpl->Id(); } -void cThread::Run() { +void Thread::Run() { mEntryPoint->Run(); } diff --git a/src/eepp/system/threadlocal.cpp b/src/eepp/system/threadlocal.cpp new file mode 100644 index 000000000..db8686132 --- /dev/null +++ b/src/eepp/system/threadlocal.cpp @@ -0,0 +1,24 @@ +#include +#include + +namespace EE { namespace System { + +ThreadLocal::ThreadLocal(void* value) : + mImpl( eeNew( Private::ThreadLocalImpl, () ) ) +{ + Value( value ); +} + +ThreadLocal::~ThreadLocal() { + eeSAFE_DELETE( mImpl ); +} + +void ThreadLocal::Value(void* value) { + mImpl->Value(value); +} + +void* ThreadLocal::Value() const { + return mImpl->Value(); +} + +}} diff --git a/src/eepp/system/time.cpp b/src/eepp/system/time.cpp new file mode 100644 index 000000000..35fe76365 --- /dev/null +++ b/src/eepp/system/time.cpp @@ -0,0 +1,145 @@ +#include + +namespace EE { namespace System { + +const Time Time::Zero; + +Time::Time() : + mMicroseconds(0) +{ +} + +double Time::AsSeconds() const { + return mMicroseconds / 1000000.0; +} + +double Time::AsMilliseconds() const { + return mMicroseconds / 1000.0; +} + +Int64 Time::AsMicroseconds() const { + return mMicroseconds; +} + +Time::Time(Int64 Microseconds) : + mMicroseconds(Microseconds) +{ +} + +Time Seconds(double amount) { + return Time(static_cast(amount * 1000000)); +} + +Time Milliseconds(double amount) { + return Time(static_cast(amount) * 1000); +} + +Time Microseconds(Int64 amount) { + return Time(amount); +} + +bool operator ==(Time left, Time right) { + return left.AsMicroseconds() == right.AsMicroseconds(); +} + +bool operator !=(Time left, Time right) { + return left.AsMicroseconds() != right.AsMicroseconds(); +} + +bool operator <(Time left, Time right) { + return left.AsMicroseconds() < right.AsMicroseconds(); +} + +bool operator >(Time left, Time right) { + return left.AsMicroseconds() > right.AsMicroseconds(); +} + +bool operator <=(Time left, Time right) { + return left.AsMicroseconds() <= right.AsMicroseconds(); +} + +bool operator >=(Time left, Time right) { + return left.AsMicroseconds() >= right.AsMicroseconds(); +} + +Time operator -(Time right) { + return Microseconds(-right.AsMicroseconds()); +} + +Time operator +(Time left, Time right) { + return Microseconds(left.AsMicroseconds() + right.AsMicroseconds()); +} + +Time& operator +=(Time& left, Time right) { + return left = left + right; +} + +Time operator -(Time left, Time right) { + return Microseconds(left.AsMicroseconds() - right.AsMicroseconds()); +} + +Time& operator -=(Time& left, Time right) { + return left = left - right; +} + +Time operator *(Time left, Time right) { + return Microseconds(left.AsMicroseconds() * right.AsMicroseconds()); +} + +Time operator *(Time left, double right) { + return Seconds(left.AsSeconds() * right); +} + +Time operator *(double left, Time right) { + return right * left; +} + +Time operator *(Time left, Int64 right) { + return Microseconds(left.AsMicroseconds() * right); +} + +Time operator *(Int64 left, Time right) { + return right * left; +} + +Time& operator *=(Time& left, Time right) { + return left = left * right; +} + +Time& operator *=(Time& left, double right) { + return left = left * right; +} + +Time& operator *=(Time& left, Int64 right) { + return left = left * right; +} + +Time operator /(Time left, Time right) { + return Microseconds(left.AsMicroseconds() / right.AsMicroseconds()); +} + +Time operator /(Time left, double right) { + return Seconds(left.AsSeconds() / right); +} + +Time operator /(Time left, Int64 right) { + return Microseconds(left.AsMicroseconds() / right); +} + +Time& operator /=(Time& left, Time right) { + return left = left / right; +} + +Time& operator /=(Time& left, Int64 right) { + return left = left / right; +} + +Time operator %(Time left, Time right) { + return Microseconds(left.AsMicroseconds() % right.AsMicroseconds()); +} + +Time& operator %=(Time& left, Time right) { + return left = left % right; +} + +}} diff --git a/src/eepp/system/czip.cpp b/src/eepp/system/zip.cpp similarity index 78% rename from src/eepp/system/czip.cpp rename to src/eepp/system/zip.cpp index f696b4bd3..6604f1fb6 100644 --- a/src/eepp/system/czip.cpp +++ b/src/eepp/system/zip.cpp @@ -1,20 +1,20 @@ -#include +#include #include #include #include namespace EE { namespace System { -cZip::cZip() : +Zip::Zip() : mZip(NULL) { } -cZip::~cZip() { +Zip::~Zip() { Close(); } -bool cZip::Create( const std::string& path ) { +bool Zip::Create( const std::string& path ) { if ( !FileSystem::FileExists(path) ) { int err; mZip = zip_open( path.c_str(), ZIP_CREATE, &err ); @@ -33,7 +33,7 @@ bool cZip::Create( const std::string& path ) { return false; } -bool cZip::Open( const std::string& path ) { +bool Zip::Open( const std::string& path ) { if ( FileSystem::FileExists( path ) ) { int err; mZip = zip_open( path.c_str(), 0, &err ); @@ -52,7 +52,7 @@ bool cZip::Open( const std::string& path ) { return false; } -bool cZip::Close() { +bool Zip::Close() { if ( 0 == CheckPack() ) { zip_close( mZip ); @@ -68,7 +68,7 @@ bool cZip::Close() { return false; } -bool cZip::AddFile( const std::string& path, const std::string& inpack ) { +bool Zip::AddFile( const std::string& path, const std::string& inpack ) { SafeDataPointer file; FileSystem::FileGet( path, file ); @@ -76,7 +76,7 @@ bool cZip::AddFile( const std::string& path, const std::string& inpack ) { return AddFile( file.Data, file.DataSize, inpack ); } -bool cZip::AddFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ) { +bool Zip::AddFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ) { if ( 0 == CheckPack() ) { struct zip_source * zs = zip_source_buffer( mZip, (const void*)data, dataSize, 0 ); @@ -96,25 +96,25 @@ bool cZip::AddFile( const Uint8 * data, const Uint32& dataSize, const std::strin return false; } -bool cZip::AddFile( std::vector& data, const std::string& inpack ) { +bool Zip::AddFile( std::vector& data, const std::string& inpack ) { return AddFile( reinterpret_cast ( &data[0] ), (Uint32)data.size(), inpack ); } -bool cZip::AddFiles( std::map paths ) { +bool Zip::AddFiles( std::map paths ) { for( std::map::iterator itr = paths.begin(); itr != paths.end(); itr++) if ( !AddFile( itr->first, itr->second ) ) return false; return true; } -bool cZip::EraseFile( const std::string& path ) { +bool Zip::EraseFile( const std::string& path ) { std::vector tmpv; tmpv.push_back( path ); return EraseFiles( tmpv ); } -bool cZip::EraseFiles( const std::vector& paths ) { +bool Zip::EraseFiles( const std::vector& paths ) { Int32 Ex; Uint32 i = 0; @@ -132,7 +132,7 @@ bool cZip::EraseFiles( const std::vector& paths ) { return false; } -bool cZip::ExtractFile( const std::string& path , const std::string& dest ) { +bool Zip::ExtractFile( const std::string& path , const std::string& dest ) { Lock(); bool Ret = false; @@ -149,7 +149,7 @@ bool cZip::ExtractFile( const std::string& path , const std::string& dest ) { return Ret; } -bool cZip::ExtractFileToMemory( const std::string& path, std::vector& data ) { +bool Zip::ExtractFileToMemory( const std::string& path, std::vector& data ) { Lock(); bool Ret = false; @@ -183,7 +183,7 @@ bool cZip::ExtractFileToMemory( const std::string& path, std::vector& dat return Ret; } -bool cZip::ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) { +bool Zip::ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) { Lock(); bool Ret = false; @@ -217,18 +217,18 @@ bool cZip::ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) return Ret; } -Int32 cZip::Exists( const std::string& path ) { +Int32 Zip::Exists( const std::string& path ) { if ( IsOpen() ) return zip_name_locate( mZip, path.c_str(), 0 ); return -1; } -Int8 cZip::CheckPack() { +Int8 Zip::CheckPack() { return NULL != mZip ? 0 : -1; } -std::vector cZip::GetFileList() { +std::vector Zip::GetFileList() { std::vector tmpv; Int32 numfiles = zip_get_num_files( mZip ); @@ -246,7 +246,7 @@ std::vector cZip::GetFileList() { } /** @return The file path of the opened package */ -std::string cZip::GetPackPath() { +std::string Zip::GetPackPath() { return mZipPath; } diff --git a/src/eepp/ui/cuicomplexcontrol.cpp b/src/eepp/ui/cuicomplexcontrol.cpp index 35f481d20..3f02cf130 100644 --- a/src/eepp/ui/cuicomplexcontrol.cpp +++ b/src/eepp/ui/cuicomplexcontrol.cpp @@ -48,7 +48,7 @@ void cUIComplexControl::Update() { Pos.y = cUIManager::instance()->GetMousePos().y - mTooltip->Size().Height(); } - if ( cTime::Zero == cUIThemeManager::instance()->TooltipTimeToShow() ) { + if ( Time::Zero == cUIThemeManager::instance()->TooltipTimeToShow() ) { if ( !mTooltip->Visible() || cUIThemeManager::instance()->TooltipFollowMouse() ) mTooltip->Pos( Pos ); diff --git a/src/eepp/ui/cuicontrol.cpp b/src/eepp/ui/cuicontrol.cpp index 5d655f0a7..58405f4f7 100644 --- a/src/eepp/ui/cuicontrol.cpp +++ b/src/eepp/ui/cuicontrol.cpp @@ -888,7 +888,7 @@ void cUIControl::UpdateQuad() { }; } -cTime cUIControl::Elapsed() { +Time cUIControl::Elapsed() { return cUIManager::instance()->Elapsed(); } diff --git a/src/eepp/ui/cuicontrolanim.cpp b/src/eepp/ui/cuicontrolanim.cpp index 6d35b3329..8d1c11229 100644 --- a/src/eepp/ui/cuicontrolanim.cpp +++ b/src/eepp/ui/cuicontrolanim.cpp @@ -183,7 +183,7 @@ bool cUIControlAnim::Animating() { return ( NULL != mAlphaAnim && mAlphaAnim->Enabled() ) || ( NULL != mAngleAnim && mAngleAnim->Enabled() ) || ( NULL != mScaleAnim && mScaleAnim->Enabled() ) || ( NULL != mMoveAnim && mMoveAnim->Enabled() ); } -void cUIControlAnim::StartAlphaAnim( const Float& From, const Float& To, const cTime& TotalTime, const bool& AlphaChilds, const Ease::Interpolation& Type, cInterpolation::OnPathEndCallback PathEndCallback ) { +void cUIControlAnim::StartAlphaAnim( const Float& From, const Float& To, const Time& TotalTime, const bool& AlphaChilds, const Ease::Interpolation& Type, cInterpolation::OnPathEndCallback PathEndCallback ) { if ( NULL == mAlphaAnim ) mAlphaAnim = eeNew( cInterpolation, () ); @@ -212,7 +212,7 @@ void cUIControlAnim::StartAlphaAnim( const Float& From, const Float& To, const c } } -void cUIControlAnim::StartScaleAnim( const eeVector2f& From, const eeVector2f& To, const cTime& TotalTime, const Ease::Interpolation& Type, cInterpolation::OnPathEndCallback PathEndCallback ) { +void cUIControlAnim::StartScaleAnim( const eeVector2f& From, const eeVector2f& To, const Time& TotalTime, const Ease::Interpolation& Type, cInterpolation::OnPathEndCallback PathEndCallback ) { if ( NULL == mScaleAnim ) mScaleAnim = eeNew( cWaypoints, () ); @@ -226,11 +226,11 @@ void cUIControlAnim::StartScaleAnim( const eeVector2f& From, const eeVector2f& T Scale( From ); } -void cUIControlAnim::StartScaleAnim( const Float& From, const Float& To, const cTime& TotalTime, const Ease::Interpolation& Type, cInterpolation::OnPathEndCallback PathEndCallback ) { +void cUIControlAnim::StartScaleAnim( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type, cInterpolation::OnPathEndCallback PathEndCallback ) { StartScaleAnim( eeVector2f( From, From ), eeVector2f( To, To ), TotalTime, Type, PathEndCallback ); } -void cUIControlAnim::StartMovement( const eeVector2i& From, const eeVector2i& To, const cTime& TotalTime, const Ease::Interpolation& Type, cWaypoints::OnPathEndCallback PathEndCallback ) { +void cUIControlAnim::StartMovement( const eeVector2i& From, const eeVector2i& To, const Time& TotalTime, const Ease::Interpolation& Type, cWaypoints::OnPathEndCallback PathEndCallback ) { if ( NULL == mMoveAnim ) mMoveAnim = eeNew( cWaypoints, () ); @@ -244,7 +244,7 @@ void cUIControlAnim::StartMovement( const eeVector2i& From, const eeVector2i& To Pos( From ); } -void cUIControlAnim::StartRotation( const Float& From, const Float& To, const cTime& TotalTime, const Ease::Interpolation& Type, cInterpolation::OnPathEndCallback PathEndCallback ) { +void cUIControlAnim::StartRotation( const Float& From, const Float& To, const Time& TotalTime, const Ease::Interpolation& Type, cInterpolation::OnPathEndCallback PathEndCallback ) { if ( NULL == mAngleAnim ) mAngleAnim = eeNew( cInterpolation, () ); @@ -258,20 +258,20 @@ void cUIControlAnim::StartRotation( const Float& From, const Float& To, const cT Angle( From ); } -void cUIControlAnim::CreateFadeIn( const cTime& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) { +void cUIControlAnim::CreateFadeIn( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) { StartAlphaAnim( mAlpha, 255.f, Time, AlphaChilds, Type ); } -void cUIControlAnim::CreateFadeOut( const cTime& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) { +void cUIControlAnim::CreateFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) { StartAlphaAnim( 255.f, mAlpha, Time, AlphaChilds, Type ); } -void cUIControlAnim::CloseFadeOut( const cTime& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) { +void cUIControlAnim::CloseFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) { StartAlphaAnim ( mAlpha, 0.f, Time, AlphaChilds, Type ); mControlFlags |= UI_CTRL_FLAG_CLOSE_FO; } -void cUIControlAnim::DisableFadeOut( const cTime& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) { +void cUIControlAnim::DisableFadeOut( const Time& Time, const bool& AlphaChilds, const Ease::Interpolation& Type ) { Enabled( false ); StartAlphaAnim ( mAlpha, 0.f, Time, AlphaChilds, Type ); diff --git a/src/eepp/ui/cuimanager.cpp b/src/eepp/ui/cuimanager.cpp index 2a59bc61a..68520b819 100644 --- a/src/eepp/ui/cuimanager.cpp +++ b/src/eepp/ui/cuimanager.cpp @@ -265,7 +265,7 @@ cUIWindow * cUIManager::MainControl() const { return mControl; } -const cTime& cUIManager::Elapsed() const { +const Time& cUIManager::Elapsed() const { return mElapsed; } diff --git a/src/eepp/ui/cuitabwidget.cpp b/src/eepp/ui/cuitabwidget.cpp index 2178371ad..f95b07229 100644 --- a/src/eepp/ui/cuitabwidget.cpp +++ b/src/eepp/ui/cuitabwidget.cpp @@ -74,7 +74,7 @@ void cUITabWidget::SetTheme( cUITheme * Theme ) { mTabWidgetHeight = eemax( tSize1.Height(), tSize2.Height() ); - SetContainerSize(); + SeContainerSize(); OrderTabs(); } @@ -85,7 +85,7 @@ void cUITabWidget::DoAfterSetTheme() { OnSizeChange(); } -void cUITabWidget::SetContainerSize() { +void cUITabWidget::SeContainerSize() { mTabContainer->Size( mSize.Width(), mTabWidgetHeight ); mCtrlContainer->Pos( 0, mTabWidgetHeight ); mCtrlContainer->Size( mSize.Width(), mSize.Height() - mTabWidgetHeight ); @@ -378,7 +378,7 @@ Uint32 cUITabWidget::GetSelectedTabIndex() const { } void cUITabWidget::OnSizeChange() { - SetContainerSize(); + SeContainerSize(); SetTabContainerSize(); PosTabs(); diff --git a/src/eepp/ui/cuitheme.cpp b/src/eepp/ui/cuitheme.cpp index 0699eeea5..2ebc7b8ef 100644 --- a/src/eepp/ui/cuitheme.cpp +++ b/src/eepp/ui/cuitheme.cpp @@ -130,7 +130,7 @@ cUITheme * cUITheme::LoadFromTextureAtlas( cUITheme * tTheme, cTextureAtlas * Te TextureAtlas->GetTexture( tC )->Filter( TEX_FILTER_NEAREST ); } - cClock TE; + Clock TE; LoadThemeElements( tTheme->mUIElements, tTheme->mUIIcons ); @@ -168,7 +168,7 @@ cUITheme * cUITheme::LoadFromTextureAtlas( cUITheme * tTheme, cTextureAtlas * Te } cUITheme * cUITheme::LoadFromPath( cUITheme * tTheme, const std::string& Path, const std::string ImgExt ) { - cClock TE; + Clock TE; LoadThemeElements( tTheme->mUIElements, tTheme->mUIIcons ); @@ -320,7 +320,7 @@ bool cUITheme::SearchFilesOfElement( cTextureAtlas * SG, const std::string& Path } cUITheme::cUITheme( const std::string& Name, const std::string& Abbr, cFont * DefaultFont ) : - tResourceManager ( false ), + ResourceManager ( false ), mName( Name ), mNameHash( String::Hash( mName ) ), mAbbr( Abbr ), @@ -358,7 +358,7 @@ const std::string& cUITheme::Abbr() const { cUISkin * cUITheme::Add( cUISkin * Resource ) { Resource->Theme( this ); - return tResourceManager::Add( Resource ); + return ResourceManager::Add( Resource ); } void cUITheme::Font( cFont * Font ) { diff --git a/src/eepp/ui/cuithememanager.cpp b/src/eepp/ui/cuithememanager.cpp index f12732c39..4e00b052e 100644 --- a/src/eepp/ui/cuithememanager.cpp +++ b/src/eepp/ui/cuithememanager.cpp @@ -7,7 +7,7 @@ namespace EE { namespace UI { SINGLETON_DECLARE_IMPLEMENTATION(cUIThemeManager) cUIThemeManager::cUIThemeManager() : - tResourceManager( true ), + ResourceManager( true ), mFont( NULL ), mThemeDefault( NULL ), mAutoApplyDefaultTheme( true ), @@ -77,27 +77,27 @@ const bool& cUIThemeManager::DefaultEffectsEnabled() const { return mEnableDefaultEffects; } -const cTime& cUIThemeManager::ControlsFadeInTime() const { +const Time& cUIThemeManager::ControlsFadeInTime() const { return mFadeInTime; } -void cUIThemeManager::ControlsFadeInTime( const cTime& Time ) { +void cUIThemeManager::ControlsFadeInTime( const Time& Time ) { mFadeInTime = Time; } -const cTime& cUIThemeManager::ControlsFadeOutTime() const { +const Time& cUIThemeManager::ControlsFadeOutTime() const { return mFadeOutTime; } -void cUIThemeManager::ControlsFadeOutTime( const cTime& Time ) { +void cUIThemeManager::ControlsFadeOutTime( const Time& Time ) { mFadeOutTime = Time; } -void cUIThemeManager::TooltipTimeToShow( const cTime& Time ) { +void cUIThemeManager::TooltipTimeToShow( const Time& Time ) { mTooltipTimeToShow = Time; } -const cTime& cUIThemeManager::TooltipTimeToShow() const { +const Time& cUIThemeManager::TooltipTimeToShow() const { return mTooltipTimeToShow; } diff --git a/src/eepp/ui/cuitooltip.cpp b/src/eepp/ui/cuitooltip.cpp index 9615c4d6e..6b03b39cc 100644 --- a/src/eepp/ui/cuitooltip.cpp +++ b/src/eepp/ui/cuitooltip.cpp @@ -11,7 +11,7 @@ cUITooltip::cUITooltip( cUITooltip::CreateParams& Params, cUIControl * TooltipOf mFontShadowColor( Params.FontShadowColor ), mAlignOffset( 0.f, 0.f ), mPadding( Params.Padding ), - mTooltipTime( cTime::Zero ), + mTooltipTime( Time::Zero ), mTooltipOf( TooltipOf ) { mTextCache = eeNew( cTextCache, () ); @@ -237,15 +237,15 @@ const eeVector2f& cUITooltip::AlignOffset() const { return mAlignOffset; } -void cUITooltip::TooltipTime( const cTime& Time ) { +void cUITooltip::TooltipTime( const Time& Time ) { mTooltipTime = Time; } -void cUITooltip::TooltipTimeAdd( const cTime& Time ) { +void cUITooltip::TooltipTimeAdd( const Time& Time ) { mTooltipTime += Time; } -const cTime& cUITooltip::TooltipTime() const { +const Time& cUITooltip::TooltipTime() const { return mTooltipTime; } diff --git a/src/eepp/ui/cuiwindow.cpp b/src/eepp/ui/cuiwindow.cpp index 00141e8b2..f880812c2 100644 --- a/src/eepp/ui/cuiwindow.cpp +++ b/src/eepp/ui/cuiwindow.cpp @@ -203,7 +203,7 @@ void cUIWindow::CloseWindow() { mModalCtrl = NULL; } - if ( cTime::Zero != cUIThemeManager::instance()->ControlsFadeOutTime() ) + if ( Time::Zero != cUIThemeManager::instance()->ControlsFadeOutTime() ) CloseFadeOut( cUIThemeManager::instance()->ControlsFadeOutTime() ); else Close(); diff --git a/src/eepp/window/backend/SDL/cwindowsdl.cpp b/src/eepp/window/backend/SDL/cwindowsdl.cpp index 24ed58acb..a5dfe1114 100644 --- a/src/eepp/window/backend/SDL/cwindowsdl.cpp +++ b/src/eepp/window/backend/SDL/cwindowsdl.cpp @@ -367,7 +367,7 @@ void cWindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { #ifdef EE_SUPPORT_EXCEPTIONS } catch (...) { eePRINTL( "Unable to change resolution: %s", SDL_GetError() ); - cLog::instance()->Save(); + Log::instance()->Save(); mWindow.Created = false; } #endif diff --git a/src/eepp/window/backend/SDL2/cwindowsdl2.cpp b/src/eepp/window/backend/SDL2/cwindowsdl2.cpp index 7e5bf8196..ea92a7b8a 100644 --- a/src/eepp/window/backend/SDL2/cwindowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/cwindowsdl2.cpp @@ -28,7 +28,7 @@ #include #if EE_PLATFORM == EE_PLATFORM_ANDROID -#include +#include #include static std::string SDL_AndroidGetApkPath() { @@ -81,7 +81,7 @@ cWindowSDL::cWindowSDL( WindowSettings Settings, ContextSettings Context ) : #endif #if EE_PLATFORM == EE_PLATFORM_ANDROID , - mZip( eeNew( cZip, () ) ) + mZip( eeNew( Zip, () ) ) #endif { Create( Settings, Context ); @@ -446,7 +446,7 @@ void cWindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { #ifdef EE_SUPPORT_EXCEPTIONS } catch (...) { eePRINTL( "Unable to change resolution: %s", SDL_GetError() ); - cLog::instance()->Save(); + Log::instance()->Save(); mWindow.Created = false; } #endif diff --git a/src/eepp/window/backend/SDL2/cwindowsdl2.hpp b/src/eepp/window/backend/SDL2/cwindowsdl2.hpp index 2caf218fe..b33ab46b3 100644 --- a/src/eepp/window/backend/SDL2/cwindowsdl2.hpp +++ b/src/eepp/window/backend/SDL2/cwindowsdl2.hpp @@ -14,7 +14,7 @@ struct SDL_SysWMinfo; #define EE_USE_WMINFO #endif -namespace EE { namespace System { class cZip; } } +namespace EE { namespace System { class Zip; } } namespace EE { namespace Window { namespace Backend { namespace SDL2 { @@ -105,7 +105,7 @@ class EE_API cWindowSDL : public cWindow { #endif #if EE_PLATFORM == EE_PLATFORM_ANDROID - cZip * mZip; + Zip * mZip; #endif eeVector2i mWinPos; diff --git a/src/eepp/window/cengine.cpp b/src/eepp/window/cengine.cpp index 32df78d75..0d82b4f91 100755 --- a/src/eepp/window/cengine.cpp +++ b/src/eepp/window/cengine.cpp @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include #include @@ -69,9 +69,9 @@ cEngine::~cEngine() { cShaderProgramManager::DestroySingleton(); - cPackManager::DestroySingleton(); + PackManager::DestroySingleton(); - cLog::DestroySingleton(); + Log::DestroySingleton(); HaikuTTF::hkFontManager::DestroySingleton(); @@ -171,7 +171,7 @@ cWindow * cEngine::CreateWindow( WindowSettings Settings, ContextSettings Contex if ( NULL != mWindow ) { Settings.Backend = mWindow->GetWindowInfo()->WindowConfig.Backend; } else { - mMainThreadId = cThread::GetCurrentThreadId(); + mMainThreadId = Thread::GetCurrentThreadId(); } switch ( Settings.Backend ) { @@ -240,7 +240,7 @@ bool cEngine::Running() const { return NULL != mWindow; } -cTime cEngine::Elapsed() const { +Time cEngine::Elapsed() const { eeASSERT( Running() ); return mWindow->Elapsed(); @@ -268,7 +268,7 @@ Uint32 cEngine::GetDefaultBackend() const { #endif } -WindowSettings cEngine::CreateWindowSettings( cIniFile * ini, std::string iniKeyName ) { +WindowSettings cEngine::CreateWindowSettings( IniFile * ini, std::string iniKeyName ) { eeASSERT ( NULL != ini ); ini->ReadFile(); @@ -312,12 +312,12 @@ WindowSettings cEngine::CreateWindowSettings( cIniFile * ini, std::string iniKey } WindowSettings cEngine::CreateWindowSettings( std::string iniPath, std::string iniKeyName ) { - cIniFile Ini( iniPath ); + IniFile Ini( iniPath ); return CreateWindowSettings( &Ini, iniKeyName ); } -ContextSettings cEngine::CreateContextSettings( cIniFile * ini, std::string iniKeyName ) { +ContextSettings cEngine::CreateContextSettings( IniFile * ini, std::string iniKeyName ) { eeASSERT ( NULL != ini ); ini->ReadFile(); @@ -346,7 +346,7 @@ ContextSettings cEngine::CreateContextSettings( cIniFile * ini, std::string iniK } ContextSettings cEngine::CreateContextSettings( std::string iniPath, std::string iniKeyName ) { - cIniFile Ini( iniPath ); + IniFile Ini( iniPath ); return CreateContextSettings( &Ini ); } diff --git a/src/eepp/window/cwindow.cpp b/src/eepp/window/cwindow.cpp index ed6da7da2..2361e263a 100644 --- a/src/eepp/window/cwindow.cpp +++ b/src/eepp/window/cwindow.cpp @@ -265,13 +265,13 @@ Uint32 cWindow::FPS() const { return mFrameData.FPS.Current; } -cTime cWindow::Elapsed() const { +Time cWindow::Elapsed() const { return mFrameData.ElapsedTime; } void cWindow::GetElapsedTime() { if ( NULL == mFrameData.FrameElapsed ) { - mFrameData.FrameElapsed = eeNew( cClock, () ); + mFrameData.FrameElapsed = eeNew( Clock, () ); } mFrameData.ElapsedTime = mFrameData.FrameElapsed->Elapsed(); @@ -409,7 +409,7 @@ void cWindow::LogSuccessfulInit(const std::string& BackendName , const std::stri #ifndef EE_SILENT eePRINTL( msg.c_str() ); #else - cLog::instance()->Write( msg ); + Log::instance()->Write( msg ); #endif } diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index 5052082f4..2ba0cc3ec 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -11,8 +11,8 @@ namespace Demo_Test { void cEETest::Init() { EE = cEngine::instance(); - cLog::instance()->LiveWrite( true ); - cLog::instance()->ConsoleOutput( true ); + Log::instance()->LiveWrite( true ); + Log::instance()->ConsoleOutput( true ); DrawBack = false; MultiViewportMode = false; @@ -39,7 +39,7 @@ void cEETest::Init() { MyPath = Sys::GetProcessPath() + "assets/"; - cIniFile Ini( MyPath + "ee.ini" ); + IniFile Ini( MyPath + "ee.ini" ); PartsNum = Ini.GetValueI( "EEPP", "ParticlesNum", 1000 ); mUseShaders = Ini.GetValueB( "EEPP", "UseShaders", false ); @@ -66,7 +66,7 @@ void cEETest::Init() { TF = cTextureFactory::instance(); TF->Allocate(40); - Log = cLog::instance(); + Log = Log::instance(); KM = mWindow->GetInput(); JM = KM->GetJoystickManager(); @@ -178,7 +178,7 @@ void cEETest::LoadFonts() { mFontLoader.Load( cb::Make1( this, &cEETest::OnFontLoaded ) ); } -void cEETest::OnFontLoaded( cResourceLoader * ObjLoaded ) { +void cEETest::OnFontLoaded( ResourceLoader * ObjLoaded ) { FF = cFontManager::instance()->GetByName( "conchars" ); FF2 = cFontManager::instance()->GetByName( "ProggySquareSZ" ); TTF = cFontManager::instance()->GetByName( "arial" ); @@ -248,7 +248,7 @@ void cEETest::OnWindowResize(cWindow * win) { } void cEETest::CreateUI() { - cClock TE; + Clock TE; CreateUIThemeTextureAtlas(); @@ -788,16 +788,16 @@ void cEETest::CmdSetPartsNum ( const std::vector < String >& params ) { } } -void cEETest::OnTextureLoaded( cResourceLoader * ResLoaded ) { +void cEETest::OnTextureLoaded( ResourceLoader * ResLoaded ) { SndMng.Play( "mysound" ); } void cEETest::LoadTextures() { - cClock TE; + Clock TE; Uint32 i; - PakTest = eeNew( cZip, () ); + PakTest = eeNew( Zip, () ); #ifndef EE_GLES @@ -1865,7 +1865,7 @@ void cEETest::End() { eeSAFE_DELETE( mCircleSprite ); eeSAFE_DELETE( PakTest ); - cLog::instance()->Save(); + Log::instance()->Save(); cEngine::DestroySingleton(); } diff --git a/src/test/eetest.hpp b/src/test/eetest.hpp index cf7c2a41a..813cb22a7 100644 --- a/src/test/eetest.hpp +++ b/src/test/eetest.hpp @@ -67,7 +67,7 @@ struct Emitter { cVect position; }; -class cEETest : private cThread { +class cEETest : private Thread { public: typedef cb::Callback0 SceneCb; @@ -85,19 +85,19 @@ class cEETest : private cThread { void LoadTextures(); void CmdSetPartsNum ( const std::vector < String >& params ); - cClock cElapsed; - cTime PSElapsed; + Clock cElapsed; + Time PSElapsed; private: cEngine * EE; Window::cWindow * mWindow; cTextureFactory* TF; - cLog* Log; + System::Log* Log; cInput* KM; cInputTextBuffer InBuf; bool side, aside; Float ang, scale, alpha, Ang; - cTime et; + Time et; Int32 x, y; Uint32 lasttick; @@ -144,7 +144,7 @@ class cEETest : private cThread { void Screen4(); void Screen5(); - cZip * PakTest; + Zip * PakTest; std::vector tmpv; std::vector MySong; @@ -175,16 +175,16 @@ class cEETest : private cThread { String mBuda; - cResourceLoader mResLoad; - void OnTextureLoaded( cResourceLoader * ObjLoaded ); + ResourceLoader mResLoad; + void OnTextureLoaded( ResourceLoader * ObjLoaded ); void CreateUI(); void CreateShaders(); void LoadFonts(); - cResourceLoader mFontLoader; - void OnFontLoaded( cResourceLoader * ObjLoaded ); + ResourceLoader mFontLoader; + void OnFontLoaded( ResourceLoader * ObjLoaded ); cJoystickManager * JM; Float mAxisX; @@ -196,7 +196,7 @@ class cEETest : private cThread { cFrameBuffer * mFBO; cVertexBuffer * mVBO; - cClock mFTE; + Clock mFTE; void CreateCommonDialog(); void ItemClick( const cUIEvent * Event );