From b36dd3324670429c2ccb62399bdffca71c2ad3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Tue, 14 Feb 2017 18:09:25 -0300 Subject: [PATCH] Refactoring WIP. Changing the function naming convention from CamelCase to camelCase. --HG-- branch : dev --- include/eepp/audio/soundloader.hpp | 14 +- include/eepp/audio/soundstream.hpp | 2 +- include/eepp/core/memorymanager.hpp | 36 +-- include/eepp/core/string.hpp | 86 +++---- include/eepp/core/utf.hpp | 86 +++---- include/eepp/core/utf.inl | 152 ++++++------ include/eepp/graphics/fontmanager.hpp | 2 +- include/eepp/graphics/particle.hpp | 8 +- include/eepp/graphics/renderer/gl.hpp | 8 +- include/eepp/graphics/textureatlas.hpp | 12 +- include/eepp/graphics/texturefontloader.hpp | 8 +- include/eepp/graphics/textureloader.hpp | 8 +- include/eepp/graphics/ttffontloader.hpp | 8 +- include/eepp/network/http.hpp | 2 +- include/eepp/system/base64.hpp | 12 +- include/eepp/system/bitop.hpp | 34 +-- include/eepp/system/clock.hpp | 6 +- include/eepp/system/colors.hpp | 34 +-- include/eepp/system/condition.hpp | 16 +- include/eepp/system/container.hpp | 12 +- include/eepp/system/filesystem.hpp | 46 ++-- include/eepp/system/inifile.hpp | 108 ++++----- include/eepp/system/iostream.hpp | 12 +- include/eepp/system/iostreamfile.hpp | 14 +- include/eepp/system/iostreammemory.hpp | 12 +- include/eepp/system/log.hpp | 26 +-- include/eepp/system/md5.hpp | 24 +- include/eepp/system/mutex.hpp | 6 +- include/eepp/system/objectloader.hpp | 28 +-- include/eepp/system/pack.hpp | 34 +-- include/eepp/system/packmanager.hpp | 8 +- include/eepp/system/pak.hpp | 34 +-- include/eepp/system/rc4.hpp | 22 +- include/eepp/system/resourceloader.hpp | 28 +-- include/eepp/system/resourcemanager.hpp | 80 +++---- include/eepp/system/singleton.hpp | 22 +- include/eepp/system/sys.hpp | 30 +-- include/eepp/system/thread.hpp | 10 +- include/eepp/system/threadlocal.hpp | 4 +- include/eepp/system/threadlocalptr.hpp | 12 +- include/eepp/system/time.hpp | 6 +- include/eepp/system/zip.hpp | 32 +-- include/eepp/ui/uicommondialog.hpp | 2 +- include/eepp/ui/uidefaulttheme.hpp | 2 +- include/eepp/ui/uitheme.hpp | 12 +- include/eepp/version.hpp | 10 +- projects/linux/ee.creator.user | 4 +- projects/linux/ee.files | 2 + projects/linux/ee.includes | 2 + src/eepp/audio/music.cpp | 8 +- src/eepp/audio/sound.cpp | 2 +- src/eepp/audio/soundbuffer.cpp | 10 +- src/eepp/audio/soundfileogg.cpp | 2 +- src/eepp/audio/soundstream.cpp | 12 +- src/eepp/core/debug.cpp | 10 +- src/eepp/core/memorymanager.cpp | 26 +-- src/eepp/core/string.cpp | 102 ++++----- src/eepp/core/version.cpp | 16 +- src/eepp/gaming/mapeditor/mapeditor.cpp | 52 ++--- .../gaming/mapeditor/maplayerproperties.cpp | 2 +- .../gaming/mapeditor/mapobjectproperties.cpp | 4 +- .../gaming/mapeditor/tilemapproperties.cpp | 18 +- src/eepp/gaming/mapeditor/uigotypenew.cpp | 2 +- src/eepp/gaming/mapeditor/uimap.cpp | 2 +- src/eepp/gaming/mapeditor/uimaplayernew.cpp | 2 +- src/eepp/gaming/mapeditor/uimapnew.cpp | 22 +- src/eepp/gaming/maplayer.cpp | 4 +- src/eepp/gaming/maplight.cpp | 48 ++-- src/eepp/gaming/maplightmanager.cpp | 14 +- src/eepp/gaming/tilemap.cpp | 128 +++++------ src/eepp/graphics/console.cpp | 86 +++---- src/eepp/graphics/font.cpp | 14 +- src/eepp/graphics/fontmanager.cpp | 4 +- src/eepp/graphics/framebuffer.cpp | 6 +- src/eepp/graphics/image.cpp | 64 +++--- src/eepp/graphics/particlesystem.cpp | 2 +- src/eepp/graphics/pixelperfect.cpp | 4 +- src/eepp/graphics/renderer/gl.cpp | 20 +- src/eepp/graphics/renderer/renderergl3.cpp | 2 +- src/eepp/graphics/renderer/renderergl3cp.cpp | 6 +- src/eepp/graphics/renderer/renderergles2.cpp | 2 +- src/eepp/graphics/scrollparallax.cpp | 2 +- src/eepp/graphics/shader.cpp | 26 +-- src/eepp/graphics/shaderprogram.cpp | 14 +- src/eepp/graphics/sprite.cpp | 6 +- src/eepp/graphics/subtexture.cpp | 34 +-- src/eepp/graphics/texture.cpp | 4 +- src/eepp/graphics/textureatlas.cpp | 26 +-- src/eepp/graphics/textureatlasloader.cpp | 92 ++++---- src/eepp/graphics/textureatlasmanager.cpp | 52 ++--- src/eepp/graphics/texturefactory.cpp | 18 +- src/eepp/graphics/texturefont.cpp | 16 +- src/eepp/graphics/texturefontloader.cpp | 30 +-- src/eepp/graphics/textureloader.cpp | 88 +++---- src/eepp/graphics/texturepacker.cpp | 48 ++-- src/eepp/graphics/ttffont.cpp | 24 +- src/eepp/graphics/ttffontloader.cpp | 20 +- src/eepp/graphics/vertexbuffer.cpp | 12 +- src/eepp/helper/haikuttf/hkfontmanager.cpp | 2 +- src/eepp/helper/haikuttf/hkfontmanager.hpp | 2 +- src/eepp/math/interpolation.cpp | 6 +- src/eepp/math/waypoints.cpp | 6 +- src/eepp/network/http.cpp | 24 +- src/eepp/network/socketselector.cpp | 4 +- .../ssl/backend/openssl/opensslsocket.cpp | 4 +- src/eepp/network/ssl/sslsocket.cpp | 14 +- src/eepp/network/tcpsocket.cpp | 4 +- src/eepp/network/uri.cpp | 16 +- src/eepp/physics/space.cpp | 2 +- src/eepp/system/base64.cpp | 16 +- src/eepp/system/clock.cpp | 16 +- src/eepp/system/condition.cpp | 36 +-- src/eepp/system/filesystem.cpp | 116 +++++----- src/eepp/system/inifile.cpp | 216 +++++++++--------- src/eepp/system/iostreamfile.cpp | 26 +-- src/eepp/system/iostreammemory.cpp | 12 +- src/eepp/system/lock.cpp | 4 +- src/eepp/system/log.cpp | 66 +++--- src/eepp/system/md5.cpp | 54 ++--- src/eepp/system/mutex.cpp | 12 +- src/eepp/system/objectloader.cpp | 38 +-- src/eepp/system/pack.cpp | 6 +- src/eepp/system/packmanager.cpp | 14 +- src/eepp/system/pak.cpp | 154 ++++++------- src/eepp/system/platform/posix/clockimpl.cpp | 4 +- src/eepp/system/platform/posix/clockimpl.hpp | 4 +- .../system/platform/posix/conditionimpl.cpp | 24 +- .../system/platform/posix/conditionimpl.hpp | 18 +- src/eepp/system/platform/posix/muteximpl.cpp | 6 +- src/eepp/system/platform/posix/muteximpl.hpp | 6 +- src/eepp/system/platform/posix/threadimpl.cpp | 14 +- src/eepp/system/platform/posix/threadimpl.hpp | 10 +- .../system/platform/posix/threadlocalimpl.cpp | 6 +- .../system/platform/posix/threadlocalimpl.hpp | 4 +- src/eepp/system/platform/win/clockimpl.cpp | 4 +- src/eepp/system/platform/win/clockimpl.hpp | 4 +- .../system/platform/win/conditionimpl.cpp | 42 ++-- .../system/platform/win/conditionimpl.hpp | 18 +- src/eepp/system/platform/win/muteximpl.cpp | 6 +- src/eepp/system/platform/win/muteximpl.hpp | 6 +- src/eepp/system/platform/win/threadimpl.cpp | 16 +- src/eepp/system/platform/win/threadimpl.hpp | 10 +- .../system/platform/win/threadlocalimpl.cpp | 6 +- .../system/platform/win/threadlocalimpl.hpp | 4 +- src/eepp/system/rc4.cpp | 48 ++-- src/eepp/system/resourceloader.cpp | 56 ++--- src/eepp/system/sys.cpp | 46 ++-- src/eepp/system/thread.cpp | 22 +- src/eepp/system/threadlocal.cpp | 12 +- src/eepp/system/time.cpp | 38 +-- src/eepp/system/zip.cpp | 92 ++++---- src/eepp/ui/tools/textureatlaseditor.cpp | 6 +- src/eepp/ui/tools/textureatlasnew.cpp | 28 +-- src/eepp/ui/uicheckbox.cpp | 4 +- src/eepp/ui/uicommondialog.cpp | 42 ++-- src/eepp/ui/uicomplexcontrol.cpp | 4 +- src/eepp/ui/uicontrol.cpp | 6 +- src/eepp/ui/uicontrolanim.cpp | 2 +- src/eepp/ui/uigenericgrid.cpp | 6 +- src/eepp/ui/uigfx.cpp | 2 +- src/eepp/ui/uilistbox.cpp | 16 +- src/eepp/ui/uimanager.cpp | 8 +- src/eepp/ui/uimenu.cpp | 6 +- src/eepp/ui/uimenucheckbox.cpp | 4 +- src/eepp/ui/uimenusubmenu.cpp | 4 +- src/eepp/ui/uiprogressbar.cpp | 4 +- src/eepp/ui/uiradiobutton.cpp | 4 +- src/eepp/ui/uiskin.cpp | 10 +- src/eepp/ui/uislider.cpp | 10 +- src/eepp/ui/uispinbox.cpp | 8 +- src/eepp/ui/uisprite.cpp | 2 +- src/eepp/ui/uitabwidget.cpp | 2 +- src/eepp/ui/uitextbox.cpp | 2 +- src/eepp/ui/uitextinput.cpp | 2 +- src/eepp/ui/uitheme.cpp | 46 ++-- src/eepp/ui/uithememanager.cpp | 4 +- src/eepp/ui/uitooltip.cpp | 4 +- src/eepp/window/backend/SDL/windowsdl.cpp | 4 +- .../window/backend/SDL2/clipboardsdl2.cpp | 2 +- src/eepp/window/backend/SDL2/inputsdl2.cpp | 2 +- .../backend/SDL2/joystickmanagersdl2.cpp | 2 +- src/eepp/window/backend/SDL2/joysticksdl2.cpp | 2 +- src/eepp/window/backend/SDL2/windowsdl2.cpp | 8 +- src/eepp/window/backend/SFML/joysticksfml.cpp | 2 +- src/eepp/window/backend/SFML/windowsfml.cpp | 4 +- src/eepp/window/cursor.cpp | 6 +- src/eepp/window/cursormanager.cpp | 6 +- src/eepp/window/engine.cpp | 64 +++--- src/eepp/window/input.cpp | 20 +- src/eepp/window/inputhelper.cpp | 2 +- src/eepp/window/inputtextbuffer.cpp | 42 ++-- src/eepp/window/platform/win/cursorwin.cpp | 10 +- src/eepp/window/platform/x11/cursorx11.cpp | 2 +- src/eepp/window/window.cpp | 48 ++-- src/examples/empty_window/empty_window.cpp | 59 ++++- .../external_shader/external_shader.cpp | 8 +- src/examples/fonts/fonts.cpp | 8 +- src/examples/http_request/http_request.cpp | 4 +- src/examples/physics/physics.cpp | 6 +- src/examples/sound/sound.cpp | 12 +- src/examples/sprites/sprites.cpp | 6 +- src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp | 8 +- src/test/eetest.cpp | 176 +++++++------- src/test/eetest.hpp | 12 +- 204 files changed, 2299 insertions(+), 2244 deletions(-) diff --git a/include/eepp/audio/soundloader.hpp b/include/eepp/audio/soundloader.hpp index 65b1e11f4..4fa7c5cb4 100644 --- a/include/eepp/audio/soundloader.hpp +++ b/include/eepp/audio/soundloader.hpp @@ -32,7 +32,7 @@ class tSoundLoader : public ObjectLoader { ~tSoundLoader(); /** Unload the sound if was already loaded. */ - void Unload(); + void unload(); /** @return The sound id */ const T& Id() const; @@ -49,7 +49,7 @@ class tSoundLoader : public ObjectLoader { Uint32 mSampleRate; Pack * mPack; - void Start(); + void start(); private: void LoadFromPath(); void LoadFromMemory(); @@ -119,9 +119,9 @@ tSoundLoader::~tSoundLoader() { } template -void tSoundLoader::Start() { +void tSoundLoader::start() { if ( NULL != mSndMngr ) { - ObjectLoader::Start(); + ObjectLoader::start(); if ( SND_LT_PATH == mLoadType ) LoadFromPath(); @@ -132,7 +132,7 @@ void tSoundLoader::Start() { else if ( SND_LT_SAMPLES == mLoadType ) LoadFromSamples(); - SetLoaded(); + setLoaded(); } } @@ -162,11 +162,11 @@ const T& tSoundLoader::Id() const { } template -void tSoundLoader::Unload() { +void tSoundLoader::unload() { if ( mLoaded ) { mSndMngr->Remove( mId ); - Reset(); + reset(); } } diff --git a/include/eepp/audio/soundstream.hpp b/include/eepp/audio/soundstream.hpp index fd0bf6d63..92b14f395 100755 --- a/include/eepp/audio/soundstream.hpp +++ b/include/eepp/audio/soundstream.hpp @@ -90,7 +90,7 @@ class EE_API SoundStream : private Thread, private Sound { void Initialize(unsigned int ChannelCount, unsigned int SampleRate); private : - virtual void Run(); + virtual void run(); virtual bool OnGetData( Chunk& Data ) = 0; diff --git a/include/eepp/core/memorymanager.hpp b/include/eepp/core/memorymanager.hpp index 3dda9dd37..f61ad8ad1 100644 --- a/include/eepp/core/memorymanager.hpp +++ b/include/eepp/core/memorymanager.hpp @@ -25,66 +25,66 @@ typedef AllocatedPointerMap::iterator AllocatedPointerMapIt; class EE_API MemoryManager { public: - static void * AddPointer( const AllocatedPointer& aAllocatedPointer ); + static void * addPointer( const AllocatedPointer& aAllocatedPointer ); - static void * AddPointerInPlace( void * Place, const AllocatedPointer& aAllocatedPointer ); + static void * addPointerInPlace( void * Place, const AllocatedPointer& aAllocatedPointer ); - static bool RemovePointer( void * Data ); + static bool removePointer( void * Data ); - static void ShowResults(); + static void showResults(); template - static T* Delete( T * Data ) { + static T* deletePtr( T * Data ) { delete Data; return Data; } template - static T* DeleteArray( T * Data ) { + static T* deleteArrayPtr( T * Data ) { delete [] Data; return Data; } template - static T * Free( T * Data ) { + static T * free( T * Data ) { free( Data ); return Data; } - inline static void * Allocate( size_t size ) { + inline static void * allocate( size_t size ) { return malloc( size ); } - static size_t GetPeakMemoryUsage(); + static size_t getPeakMemoryUsage(); - static size_t GetTotalMemoryUsage(); + static size_t getTotalMemoryUsage(); - static const AllocatedPointer& GetBiggestAllocation(); + static const AllocatedPointer& getBiggestAllocation(); }; #ifdef EE_MEMORY_MANAGER #define eeNew( classType, constructor ) \ - ( classType *)EE::MemoryManager::AddPointer( EE::AllocatedPointer( new classType constructor ,__FILE__,__LINE__, sizeof(classType) ) ) + ( classType *)EE::MemoryManager::addPointer( EE::AllocatedPointer( new classType constructor ,__FILE__,__LINE__, sizeof(classType) ) ) #define eeNewInPlace( place, classType, constructor ) \ - ( classType *)EE::MemoryManager::AddPointerInPlace( place, EE::AllocatedPointer( new place classType constructor ,__FILE__,__LINE__, sizeof(classType) ) ) + ( classType *)EE::MemoryManager::addPointerInPlace( place, EE::AllocatedPointer( new place classType constructor ,__FILE__,__LINE__, sizeof(classType) ) ) #define eeNewArray( classType, amount ) \ - ( classType *) EE::MemoryManager::AddPointer( EE::AllocatedPointer( new classType [ amount ], __FILE__, __LINE__, amount * sizeof( classType ) ) ) + ( classType *) EE::MemoryManager::addPointer( EE::AllocatedPointer( new classType [ amount ], __FILE__, __LINE__, amount * sizeof( classType ) ) ) #define eeMalloc(amount) \ - EE::MemoryManager::AddPointer( EE::AllocatedPointer( EE::MemoryManager::Allocate( amount ), __FILE__, __LINE__, amount ) ) + EE::MemoryManager::addPointer( EE::AllocatedPointer( EE::MemoryManager::allocate( amount ), __FILE__, __LINE__, amount ) ) #define eeDelete( data ){ \ - if( EE::MemoryManager::RemovePointer( EE::MemoryManager::Delete( data ) ) == false ) printf( "Deleting at '%s' %d\n", __FILE__, __LINE__ ); \ + if( EE::MemoryManager::removePointer( EE::MemoryManager::deletePtr( data ) ) == false ) printf( "Deleting at '%s' %d\n", __FILE__, __LINE__ ); \ } #define eeDeleteArray( data ){ \ - if ( EE::MemoryManager::RemovePointer( EE::MemoryManager::DeleteArray( data ) ) == false ) printf( "Deleting at '%s' %d\n", __FILE__, __LINE__ ); \ + if ( EE::MemoryManager::removePointer( EE::MemoryManager::deleteArrayPtr( data ) ) == false ) printf( "Deleting at '%s' %d\n", __FILE__, __LINE__ ); \ } #define eeFree( data ){ \ - if( EE::MemoryManager::RemovePointer( EE::MemoryManager::Free( data ) ) == false ) printf( "Deleting at '%s' %d\n", __FILE__, __LINE__ ); \ + if( EE::MemoryManager::removePointer( EE::MemoryManager::free( data ) ) == false ) printf( "Deleting at '%s' %d\n", __FILE__, __LINE__ ); \ } #else #define eeNew( classType, constructor ) \ diff --git a/include/eepp/core/string.hpp b/include/eepp/core/string.hpp index baa929620..3eb87bd17 100644 --- a/include/eepp/core/string.hpp +++ b/include/eepp/core/string.hpp @@ -55,98 +55,98 @@ class EE_API String { static const std::size_t InvalidPos; ///< Represents an invalid position in the string /** @return string hash */ - static Uint32 Hash( const Uint8 * str ); + static Uint32 hash( const Uint8 * str ); /** @return string hash */ - static Uint32 Hash( const char * str ); + static Uint32 hash( const char * str ); /** @return string hash */ - static Uint32 Hash( const std::string& str ); + static Uint32 hash( const std::string& str ); /** @return string hash. Note: String::Hash( std::string( "text" ) ) is != to String::Hash( String( "text" ) ) */ - static Uint32 Hash( const String& str ); + static Uint32 hash( const String& str ); /** @return If the value passed is a character */ - static bool IsCharacter( const int& mValue ); + static bool isCharacter( const int& mValue ); /** @return If the value passed is a number */ - static bool IsNumber( const int& mValue, bool AllowDot = false ); + static bool isNumber( const int& mValue, bool AllowDot = false ); /** @return If the value passed is a letter */ - static bool IsLetter( const int& mValue ); + static bool isLetter( const int& mValue ); /** Split a String and hold it on a vector */ - static std::vector < String > Split( const String& str, const Uint32& splitchar = '\n', const bool& pushEmptyString = false ); + static std::vector < String > split( const String& str, const Uint32& splitchar = '\n', const bool& pushEmptyString = false ); /** Split a string and hold it on a vector */ - static std::vector < std::string > Split( const std::string& str, const Int8& splitchar = '\n', const bool& pushEmptyString = false ); + static std::vector < std::string > split( const std::string& str, const Int8& splitchar = '\n', const bool& pushEmptyString = false ); /** Remove the first space ( or the specified character ) on the string */ - static std::string LTrim( const std::string & str, char character = ' ' ); + static std::string lTrim( const std::string & str, char character = ' ' ); /** Removes all spaces ( or the specified character ) on the string */ - static std::string Trim( const std::string & str, char character = ' ' ); + static std::string trim( const std::string & str, char character = ' ' ); /** Remove the first space ( or the specified character ) on the string */ - static String LTrim(const String & str, char character = ' ' ); + static String lTrim(const String & str, char character = ' ' ); /** Removes all spaces ( or the specified character ) on the string */ - static String Trim( const String & str, char character = ' ' ); + static String trim( const String & str, char character = ' ' ); /** Convert the string into upper case string */ - static void ToUpperInPlace( std::string & str ); + static void toUpperInPlace( std::string & str ); /** Convert a string to lower case */ - static std::string ToUpper( std::string str ); + static std::string toUpper( std::string str ); /** Convert the reference of a string into lower case string */ - static void ToLowerInPlace( std::string & str ); + static void toLowerInPlace( std::string & str ); /** Convert a string to lower case */ - static std::string ToLower( std::string str ); + static std::string toLower( std::string str ); /** Convert the string to an std::vector */ - static std::vector StringToUint8( const std::string& str ); + static std::vector stringToUint8( const std::string& str ); /** Convert the std::vector to an string */ static std::string Uint8ToString( const std::vector & v ); /** Insert a char into String on pos (added this function to avoid a bug on String) */ - static void InsertChar( String& str, const unsigned int& pos, const Uint32& tchar ); + static void insertChar( String& str, const unsigned int& pos, const Uint32& tchar ); /** Copy a string to another * @param Dst Destination String * @param Src Source String * @param DstSize Destination Size */ - static void StrCopy( char * Dst, const char * Src, unsigned int DstSize ); + static void strCopy( char * Dst, const char * Src, unsigned int DstSize ); /** Compare two strings from its beginning. * @param haystack The string to search in. * @param needle The searched string. * @return true if string starts with the substring */ - static bool StartsWith( const std::string& haystack, const std::string& needle ); + static bool startsWith( const std::string& haystack, const std::string& needle ); /** Compare two strings from its beginning. * @param haystack The string to search in. * @param needle The searched string. * @return true if string starts with the substring */ - static bool StartsWith( const String& haystack, const String& needle ); + static bool startsWith( const String& haystack, const String& needle ); /** Replace all occurrences of the search string with the replacement string. */ - static void ReplaceAll( std::string &target, const std::string& that, const std::string& with ); + static void replaceAll( std::string &target, const std::string& that, const std::string& with ); /** Replace the first ocurrence of the search string with the replacement string. */ - static void Replace( std::string& target, const std::string& that, const std::string& with ); + static void replace( std::string& target, const std::string& that, const std::string& with ); /** Removes the numbers at the end of the string */ - static std::string RemoveNumbersAtEnd( std::string txt ); + static std::string removeNumbersAtEnd( std::string txt ); /** Converts from any basic type to std::string */ template - static std::string ToStr(const T& i) { + static std::string toStr(const T& i) { std::ostringstream ss; ss << i; return ss.str(); @@ -154,20 +154,20 @@ class EE_API String { /** Converts from a string to type */ template - static bool FromString(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) { + static bool fromString(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) { std::istringstream iss(s); return !(iss >> f >> t).fail(); } /** Converts from a String to type */ template - static bool FromString(T& t, const String& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) { - std::istringstream iss( s.ToUtf8() ); + static bool fromString(T& t, const String& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) { + std::istringstream iss( s.toUtf8() ); return !(iss >> f >> t).fail(); } /** Returning a std::string from a formated string */ - static std::string StrFormated( const char* format, ... ) + static std::string strFormated( const char* format, ... ) #ifdef __GNUC__ /* This attribute is nice: it even works through gettext invokation. For example, gcc will complain that StrFormat(_("%s"), 42) is ill-formed. */ @@ -176,12 +176,12 @@ class EE_API String { ; /** Format a char buffer */ - static void StrFormat( char * Buffer, int BufferSize, const char * format, ... ); + static void strFormat( char * Buffer, int BufferSize, const char * format, ... ); /** @brief Construct from an UTF-8 string to UTF-32 according ** @param utf8String UTF-8 string to convert **/ - static String FromUtf8( const std::string& utf8String ); + static String fromUtf8( const std::string& utf8String ); /** @brief Default constructor ** This constructor creates an empty string. @@ -271,9 +271,9 @@ class EE_API String { ** @return A String containing the source string ** @see FromUtf16, FromUtf32 */ template - static String FromUtf8(T begin, T end) { + static String fromUtf8(T begin, T end) { String string; - Utf8::ToUtf32(begin, end, std::back_inserter(string.mString)); + Utf8::toUtf32(begin, end, std::back_inserter(string.mString)); return string; } @@ -283,9 +283,9 @@ class EE_API String { ** @return A String containing the source string ** @see FromUtf8, FromUtf32 */ template - static String FromUtf16(T begin, T end) { + static String fromUtf16(T begin, T end) { String string; - Utf16::ToUtf32(begin, end, std::back_inserter(string.mString)); + Utf16::toUtf32(begin, end, std::back_inserter(string.mString)); return string; } @@ -295,9 +295,9 @@ class EE_API String { ** @return A String containing the source string ** @see FromUtf8, FromUtf32 */ template - static String FromUtf32(T begin, T end) { + static String fromUtf32(T begin, T end) { String string; - Utf32::ToUtf32(begin, end, std::back_inserter(string.mString)); + Utf32::toUtf32(begin, end, std::back_inserter(string.mString)); return string; } @@ -324,7 +324,7 @@ class EE_API String { ** @return Converted ANSI string ** @see ToWideString, operator std::string **/ - std::string ToAnsiString( const std::locale& locale = std::locale() ) const; + std::string toAnsiString( const std::locale& locale = std::locale() ) const; #ifndef EE_NO_WIDECHAR /** @brief Convert the unicode string to a wide string @@ -333,17 +333,17 @@ class EE_API String { ** @return Converted wide string ** @see ToAnsiString, operator String **/ - std::wstring ToWideString() const; + std::wstring toWideString() const; #endif /** Convert the string to a UTF-8 string */ - std::string ToUtf8() const; + std::string toUtf8() const; /** Convert the string to a UTF-16 string */ - std::basic_string ToUtf16() const; + std::basic_string toUtf16() const; /** @return The hash code of the String */ - Uint32 GetHash() const; + Uint32 getHash() const; /** @brief Overload of assignment operator ** @param right Instance to assign diff --git a/include/eepp/core/utf.hpp b/include/eepp/core/utf.hpp index f5eccfb39..210de2b6b 100644 --- a/include/eepp/core/utf.hpp +++ b/include/eepp/core/utf.hpp @@ -63,7 +63,7 @@ public : /// //////////////////////////////////////////////////////////// template - static In Decode(In begin, In end, Uint32& output, Uint32 replacement = 0); + static In decode(In begin, In end, Uint32& output, Uint32 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Encode a single UTF-8 character @@ -79,7 +79,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out Encode(Uint32 input, Out output, Uint8 replacement = 0); + static Out encode(Uint32 input, Out output, Uint8 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Advance to the next UTF-8 character @@ -94,7 +94,7 @@ public : /// //////////////////////////////////////////////////////////// template - static In Next(In begin, In end); + static In next(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Count the number of characters of a UTF-8 sequence @@ -110,7 +110,7 @@ public : /// //////////////////////////////////////////////////////////// template - static std::size_t Count(In begin, In end); + static std::size_t count(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Convert an ANSI characters range to UTF-8 @@ -127,7 +127,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out FromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()); + static Out fromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Convert a wide characters range to UTF-8 @@ -140,7 +140,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out FromWide(In begin, In end, Out output); + static Out fromWide(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a latin-1 (ISO-5589-1) characters range to UTF-8 @@ -153,7 +153,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out FromLatin1(In begin, In end, Out output); + static Out fromLatin1(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-8 characters range to ANSI characters @@ -171,7 +171,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); + static Out toAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); #ifndef EE_NO_WIDECHAR //////////////////////////////////////////////////////////// @@ -186,7 +186,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToWide(In begin, In end, Out output, wchar_t replacement = 0); + static Out toWide(In begin, In end, Out output, wchar_t replacement = 0); #endif //////////////////////////////////////////////////////////// @@ -201,7 +201,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToLatin1(In begin, In end, Out output, char replacement = 0); + static Out toLatin1(In begin, In end, Out output, char replacement = 0); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-8 characters range to UTF-8 @@ -219,7 +219,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToUtf8(In begin, In end, Out output); + static Out toUtf8(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-8 characters range to UTF-16 @@ -232,7 +232,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToUtf16(In begin, In end, Out output); + static Out toUtf16(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-8 characters range to UTF-32 @@ -245,7 +245,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToUtf32(In begin, In end, Out output); + static Out toUtf32(In begin, In end, Out output); }; //////////////////////////////////////////////////////////// @@ -272,7 +272,7 @@ public : /// //////////////////////////////////////////////////////////// template - static In Decode(In begin, In end, Uint32& output, Uint32 replacement = 0); + static In decode(In begin, In end, Uint32& output, Uint32 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Encode a single UTF-16 character @@ -288,7 +288,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out Encode(Uint32 input, Out output, Uint16 replacement = 0); + static Out encode(Uint32 input, Out output, Uint16 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Advance to the next UTF-16 character @@ -303,7 +303,7 @@ public : /// //////////////////////////////////////////////////////////// template - static In Next(In begin, In end); + static In next(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Count the number of characters of a UTF-16 sequence @@ -319,7 +319,7 @@ public : /// //////////////////////////////////////////////////////////// template - static std::size_t Count(In begin, In end); + static std::size_t count(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Convert an ANSI characters range to UTF-16 @@ -336,7 +336,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out FromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()); + static Out fromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Convert a wide characters range to UTF-16 @@ -349,7 +349,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out FromWide(In begin, In end, Out output); + static Out fromWide(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a latin-1 (ISO-5589-1) characters range to UTF-16 @@ -362,7 +362,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out FromLatin1(In begin, In end, Out output); + static Out fromLatin1(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-16 characters range to ANSI characters @@ -380,7 +380,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); + static Out toAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); #ifndef EE_NO_WIDECHAR //////////////////////////////////////////////////////////// @@ -395,7 +395,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToWide(In begin, In end, Out output, wchar_t replacement = 0); + static Out toWide(In begin, In end, Out output, wchar_t replacement = 0); #endif //////////////////////////////////////////////////////////// @@ -410,7 +410,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToLatin1(In begin, In end, Out output, char replacement = 0); + static Out toLatin1(In begin, In end, Out output, char replacement = 0); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-16 characters range to UTF-8 @@ -423,7 +423,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToUtf8(In begin, In end, Out output); + static Out toUtf8(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-16 characters range to UTF-16 @@ -441,7 +441,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToUtf16(In begin, In end, Out output); + static Out toUtf16(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-16 characters range to UTF-32 @@ -454,7 +454,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToUtf32(In begin, In end, Out output); + static Out toUtf32(In begin, In end, Out output); }; //////////////////////////////////////////////////////////// @@ -482,7 +482,7 @@ public : /// //////////////////////////////////////////////////////////// template - static In Decode(In begin, In end, Uint32& output, Uint32 replacement = 0); + static In decode(In begin, In end, Uint32& output, Uint32 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Encode a single UTF-32 character @@ -499,7 +499,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out Encode(Uint32 input, Out output, Uint32 replacement = 0); + static Out encode(Uint32 input, Out output, Uint32 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Advance to the next UTF-32 character @@ -514,7 +514,7 @@ public : /// //////////////////////////////////////////////////////////// template - static In Next(In begin, In end); + static In next(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Count the number of characters of a UTF-32 sequence @@ -529,7 +529,7 @@ public : /// //////////////////////////////////////////////////////////// template - static std::size_t Count(In begin, In end); + static std::size_t count(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Convert an ANSI characters range to UTF-32 @@ -546,7 +546,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out FromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()); + static Out fromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Convert a wide characters range to UTF-32 @@ -559,7 +559,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out FromWide(In begin, In end, Out output); + static Out fromWide(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a latin-1 (ISO-5589-1) characters range to UTF-32 @@ -572,7 +572,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out FromLatin1(In begin, In end, Out output); + static Out fromLatin1(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-32 characters range to ANSI characters @@ -590,7 +590,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); + static Out toAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); #ifndef EE_NO_WIDECHAR //////////////////////////////////////////////////////////// @@ -605,7 +605,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToWide(In begin, In end, Out output, wchar_t replacement = 0); + static Out toWide(In begin, In end, Out output, wchar_t replacement = 0); #endif //////////////////////////////////////////////////////////// @@ -620,7 +620,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToLatin1(In begin, In end, Out output, char replacement = 0); + static Out toLatin1(In begin, In end, Out output, char replacement = 0); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-32 characters range to UTF-8 @@ -633,7 +633,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToUtf8(In begin, In end, Out output); + static Out toUtf8(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-32 characters range to UTF-16 @@ -646,7 +646,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToUtf16(In begin, In end, Out output); + static Out toUtf16(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-32 characters range to UTF-32 @@ -664,7 +664,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out ToUtf32(In begin, In end, Out output); + static Out toUtf32(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Decode a single ANSI character to UTF-32 @@ -680,7 +680,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Uint32 DecodeAnsi(In input, const std::locale& locale = std::locale()); + static Uint32 decodeAnsi(In input, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Decode a single wide character to UTF-32 @@ -695,7 +695,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Uint32 DecodeWide(In input); + static Uint32 decodeWide(In input); //////////////////////////////////////////////////////////// /// \brief Encode a single UTF-32 character to ANSI @@ -713,7 +713,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out EncodeAnsi(Uint32 codepoint, Out output, char replacement = 0, const std::locale& locale = std::locale()); + static Out encodeAnsi(Uint32 codepoint, Out output, char replacement = 0, const std::locale& locale = std::locale()); #ifndef EE_NO_WIDECHAR //////////////////////////////////////////////////////////// @@ -731,7 +731,7 @@ public : /// //////////////////////////////////////////////////////////// template - static Out EncodeWide(Uint32 codepoint, Out output, wchar_t replacement = 0); + static Out encodeWide(Uint32 codepoint, Out output, wchar_t replacement = 0); #endif }; diff --git a/include/eepp/core/utf.inl b/include/eepp/core/utf.inl index 6ede2def5..1cbdab10f 100644 --- a/include/eepp/core/utf.inl +++ b/include/eepp/core/utf.inl @@ -6,7 +6,7 @@ //////////////////////////////////////////////////////////// template -In Utf<8>::Decode(In begin, In end, Uint32& output, Uint32 replacement) +In Utf<8>::decode(In begin, In end, Uint32& output, Uint32 replacement) { // Some useful precomputed data static const int trailing[256] = @@ -52,7 +52,7 @@ In Utf<8>::Decode(In begin, In end, Uint32& output, Uint32 replacement) } template -Out Utf<8>::Encode(Uint32 input, Out output, Uint8 replacement) +Out Utf<8>::encode(Uint32 input, Out output, Uint8 replacement) { // Some useful precomputed data static const Uint8 firstBytes[7] = @@ -103,19 +103,19 @@ Out Utf<8>::Encode(Uint32 input, Out output, Uint8 replacement) } template -In Utf<8>::Next(In begin, In end) +In Utf<8>::next(In begin, In end) { Uint32 codepoint; - return Decode(begin, end, codepoint); + return decode(begin, end, codepoint); } template -std::size_t Utf<8>::Count(In begin, In end) +std::size_t Utf<8>::count(In begin, In end) { std::size_t length = 0; while (begin < end) { - begin = Next(begin, end); + begin = next(begin, end); ++length; } @@ -123,48 +123,48 @@ std::size_t Utf<8>::Count(In begin, In end) } template -Out Utf<8>::FromAnsi(In begin, In end, Out output, const std::locale& locale) +Out Utf<8>::fromAnsi(In begin, In end, Out output, const std::locale& locale) { while (begin < end) { - Uint32 codepoint = Utf<32>::DecodeAnsi(*begin++, locale); - output = Encode(codepoint, output); + Uint32 codepoint = Utf<32>::decodeAnsi(*begin++, locale); + output = encode(codepoint, output); } return output; } template -Out Utf<8>::FromWide(In begin, In end, Out output) +Out Utf<8>::fromWide(In begin, In end, Out output) { while (begin < end) { - Uint32 codepoint = Utf<32>::DecodeWide(*begin++); - output = Encode(codepoint, output); + Uint32 codepoint = Utf<32>::decodeWide(*begin++); + output = encode(codepoint, output); } return output; } template -Out Utf<8>::FromLatin1(In begin, In end, Out output) +Out Utf<8>::fromLatin1(In begin, In end, Out output) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 while (begin < end) - output = Encode(*begin++, output); + output = encode(*begin++, output); return output; } template -Out Utf<8>::ToAnsi(In begin, In end, Out output, char replacement, const std::locale& locale) +Out Utf<8>::toAnsi(In begin, In end, Out output, char replacement, const std::locale& locale) { while (begin < end) { Uint32 codepoint; - begin = Decode(begin, end, codepoint); - output = Utf<32>::EncodeAnsi(codepoint, output, replacement, locale); + begin = decode(begin, end, codepoint); + output = Utf<32>::encodeAnsi(codepoint, output, replacement, locale); } return output; @@ -172,13 +172,13 @@ Out Utf<8>::ToAnsi(In begin, In end, Out output, char replacement, const std::lo #ifndef EE_NO_WIDECHAR template -Out Utf<8>::ToWide(In begin, In end, Out output, wchar_t replacement) +Out Utf<8>::toWide(In begin, In end, Out output, wchar_t replacement) { while (begin < end) { Uint32 codepoint; - begin = Decode(begin, end, codepoint); - output = Utf<32>::EncodeWide(codepoint, output, replacement); + begin = decode(begin, end, codepoint); + output = Utf<32>::encodeWide(codepoint, output, replacement); } return output; @@ -186,14 +186,14 @@ Out Utf<8>::ToWide(In begin, In end, Out output, wchar_t replacement) #endif template -Out Utf<8>::ToLatin1(In begin, In end, Out output, char replacement) +Out Utf<8>::toLatin1(In begin, In end, Out output, char replacement) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 while (begin < end) { Uint32 codepoint; - begin = Decode(begin, end, codepoint); + begin = decode(begin, end, codepoint); *output++ = codepoint < 256 ? static_cast(codepoint) : replacement; } @@ -201,7 +201,7 @@ Out Utf<8>::ToLatin1(In begin, In end, Out output, char replacement) } template -Out Utf<8>::ToUtf8(In begin, In end, Out output) +Out Utf<8>::toUtf8(In begin, In end, Out output) { while (begin < end) *output++ = *begin++; @@ -210,25 +210,25 @@ Out Utf<8>::ToUtf8(In begin, In end, Out output) } template -Out Utf<8>::ToUtf16(In begin, In end, Out output) +Out Utf<8>::toUtf16(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint; - begin = Decode(begin, end, codepoint); - output = Utf<16>::Encode(codepoint, output); + begin = decode(begin, end, codepoint); + output = Utf<16>::encode(codepoint, output); } return output; } template -Out Utf<8>::ToUtf32(In begin, In end, Out output) +Out Utf<8>::toUtf32(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint; - begin = Decode(begin, end, codepoint); + begin = decode(begin, end, codepoint); *output++ = codepoint; } @@ -236,7 +236,7 @@ Out Utf<8>::ToUtf32(In begin, In end, Out output) } template -In Utf<16>::Decode(In begin, In end, Uint32& output, Uint32 replacement) +In Utf<16>::decode(In begin, In end, Uint32& output, Uint32 replacement) { Uint16 first = *begin++; @@ -274,7 +274,7 @@ In Utf<16>::Decode(In begin, In end, Uint32& output, Uint32 replacement) } template -Out Utf<16>::Encode(Uint32 input, Out output, Uint16 replacement) +Out Utf<16>::encode(Uint32 input, Out output, Uint16 replacement) { if (input < 0xFFFF) { @@ -309,14 +309,14 @@ Out Utf<16>::Encode(Uint32 input, Out output, Uint16 replacement) } template -In Utf<16>::Next(In begin, In end) +In Utf<16>::next(In begin, In end) { Uint32 codepoint; - return Decode(begin, end, codepoint); + return decode(begin, end, codepoint); } template -std::size_t Utf<16>::Count(In begin, In end) +std::size_t Utf<16>::count(In begin, In end) { std::size_t length = 0; while (begin < end) @@ -329,31 +329,31 @@ std::size_t Utf<16>::Count(In begin, In end) } template -Out Utf<16>::FromAnsi(In begin, In end, Out output, const std::locale& locale) +Out Utf<16>::fromAnsi(In begin, In end, Out output, const std::locale& locale) { while (begin < end) { - Uint32 codepoint = Utf<32>::DecodeAnsi(*begin++, locale); - output = Encode(codepoint, output); + Uint32 codepoint = Utf<32>::decodeAnsi(*begin++, locale); + output = encode(codepoint, output); } return output; } template -Out Utf<16>::FromWide(In begin, In end, Out output) +Out Utf<16>::fromWide(In begin, In end, Out output) { while (begin < end) { - Uint32 codepoint = Utf<32>::DecodeWide(*begin++); - output = Encode(codepoint, output); + Uint32 codepoint = Utf<32>::decodeWide(*begin++); + output = encode(codepoint, output); } return output; } template -Out Utf<16>::FromLatin1(In begin, In end, Out output) +Out Utf<16>::fromLatin1(In begin, In end, Out output) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 @@ -364,13 +364,13 @@ Out Utf<16>::FromLatin1(In begin, In end, Out output) } template -Out Utf<16>::ToAnsi(In begin, In end, Out output, char replacement, const std::locale& locale) +Out Utf<16>::toAnsi(In begin, In end, Out output, char replacement, const std::locale& locale) { while (begin < end) { Uint32 codepoint; - begin = Decode(begin, end, codepoint); - output = Utf<32>::EncodeAnsi(codepoint, output, replacement, locale); + begin = decode(begin, end, codepoint); + output = Utf<32>::encodeAnsi(codepoint, output, replacement, locale); } return output; @@ -378,13 +378,13 @@ Out Utf<16>::ToAnsi(In begin, In end, Out output, char replacement, const std::l #ifndef EE_NO_WIDECHAR template -Out Utf<16>::ToWide(In begin, In end, Out output, wchar_t replacement) +Out Utf<16>::toWide(In begin, In end, Out output, wchar_t replacement) { while (begin < end) { Uint32 codepoint; - begin = Decode(begin, end, codepoint); - output = Utf<32>::EncodeWide(codepoint, output, replacement); + begin = decode(begin, end, codepoint); + output = Utf<32>::encodeWide(codepoint, output, replacement); } return output; @@ -392,7 +392,7 @@ Out Utf<16>::ToWide(In begin, In end, Out output, wchar_t replacement) #endif template -Out Utf<16>::ToLatin1(In begin, In end, Out output, char replacement) +Out Utf<16>::toLatin1(In begin, In end, Out output, char replacement) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 @@ -406,20 +406,20 @@ Out Utf<16>::ToLatin1(In begin, In end, Out output, char replacement) } template -Out Utf<16>::ToUtf8(In begin, In end, Out output) +Out Utf<16>::toUtf8(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint; - begin = Decode(begin, end, codepoint); - output = Utf<8>::Encode(codepoint, output); + begin = decode(begin, end, codepoint); + output = Utf<8>::encode(codepoint, output); } return output; } template -Out Utf<16>::ToUtf16(In begin, In end, Out output) +Out Utf<16>::toUtf16(In begin, In end, Out output) { while (begin < end) *output++ = *begin++; @@ -428,12 +428,12 @@ Out Utf<16>::ToUtf16(In begin, In end, Out output) } template -Out Utf<16>::ToUtf32(In begin, In end, Out output) +Out Utf<16>::toUtf32(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint; - begin = Decode(begin, end, codepoint); + begin = decode(begin, end, codepoint); *output++ = codepoint; } @@ -441,51 +441,51 @@ Out Utf<16>::ToUtf32(In begin, In end, Out output) } template -In Utf<32>::Decode(In begin, In end, Uint32& output, Uint32) +In Utf<32>::decode(In begin, In end, Uint32& output, Uint32) { output = *begin++; return begin; } template -Out Utf<32>::Encode(Uint32 input, Out output, Uint32 replacement) +Out Utf<32>::encode(Uint32 input, Out output, Uint32 replacement) { *output++ = input; return output; } template -In Utf<32>::Next(In begin, In end) +In Utf<32>::next(In begin, In end) { return ++begin; } template -std::size_t Utf<32>::Count(In begin, In end) +std::size_t Utf<32>::count(In begin, In end) { return begin - end; } template -Out Utf<32>::FromAnsi(In begin, In end, Out output, const std::locale& locale) +Out Utf<32>::fromAnsi(In begin, In end, Out output, const std::locale& locale) { while (begin < end) - *output++ = DecodeAnsi(*begin++, locale); + *output++ = decodeAnsi(*begin++, locale); return output; } template -Out Utf<32>::FromWide(In begin, In end, Out output) +Out Utf<32>::fromWide(In begin, In end, Out output) { while (begin < end) - *output++ = DecodeWide(*begin++); + *output++ = decodeWide(*begin++); return output; } template -Out Utf<32>::FromLatin1(In begin, In end, Out output) +Out Utf<32>::fromLatin1(In begin, In end, Out output) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 @@ -496,27 +496,27 @@ Out Utf<32>::FromLatin1(In begin, In end, Out output) } template -Out Utf<32>::ToAnsi(In begin, In end, Out output, char replacement, const std::locale& locale) +Out Utf<32>::toAnsi(In begin, In end, Out output, char replacement, const std::locale& locale) { while (begin < end) - output = EncodeAnsi(*begin++, output, replacement, locale); + output = encodeAnsi(*begin++, output, replacement, locale); return output; } #ifndef EE_NO_WIDECHAR template -Out Utf<32>::ToWide(In begin, In end, Out output, wchar_t replacement) +Out Utf<32>::toWide(In begin, In end, Out output, wchar_t replacement) { while (begin < end) - output = EncodeWide(*begin++, output, replacement); + output = encodeWide(*begin++, output, replacement); return output; } #endif template -Out Utf<32>::ToLatin1(In begin, In end, Out output, char replacement) +Out Utf<32>::toLatin1(In begin, In end, Out output, char replacement) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 @@ -530,25 +530,25 @@ Out Utf<32>::ToLatin1(In begin, In end, Out output, char replacement) } template -Out Utf<32>::ToUtf8(In begin, In end, Out output) +Out Utf<32>::toUtf8(In begin, In end, Out output) { while (begin < end) - output = Utf<8>::Encode(*begin++, output); + output = Utf<8>::encode(*begin++, output); return output; } template -Out Utf<32>::ToUtf16(In begin, In end, Out output) +Out Utf<32>::toUtf16(In begin, In end, Out output) { while (begin < end) - output = Utf<16>::Encode(*begin++, output); + output = Utf<16>::encode(*begin++, output); return output; } template -Out Utf<32>::ToUtf32(In begin, In end, Out output) +Out Utf<32>::toUtf32(In begin, In end, Out output) { while (begin < end) *output++ = *begin++; @@ -557,7 +557,7 @@ Out Utf<32>::ToUtf32(In begin, In end, Out output) } template -Uint32 Utf<32>::DecodeAnsi(In input, const std::locale& locale) +Uint32 Utf<32>::decodeAnsi(In input, const std::locale& locale) { // On Windows, gcc's standard library (glibc++) has almost // no support for Unicode stuff. As a consequence, in this @@ -587,7 +587,7 @@ Uint32 Utf<32>::DecodeAnsi(In input, const std::locale& locale) } template -Uint32 Utf<32>::DecodeWide(In input) +Uint32 Utf<32>::decodeWide(In input) { // The encoding of wide characters is not well defined and is left to the system; // however we can safely assume that it is UCS-2 on Windows and @@ -599,7 +599,7 @@ Uint32 Utf<32>::DecodeWide(In input) } template -Out Utf<32>::EncodeAnsi(Uint32 codepoint, Out output, char replacement, const std::locale& locale) +Out Utf<32>::encodeAnsi(Uint32 codepoint, Out output, char replacement, const std::locale& locale) { // On Windows, gcc's standard library (glibc++) has almost // no support for Unicode stuff. As a consequence, in this @@ -636,7 +636,7 @@ Out Utf<32>::EncodeAnsi(Uint32 codepoint, Out output, char replacement, const st #ifndef EE_NO_WIDECHAR template -Out Utf<32>::EncodeWide(Uint32 codepoint, Out output, wchar_t replacement) +Out Utf<32>::encodeWide(Uint32 codepoint, Out output, wchar_t replacement) { // The encoding of wide characters is not well defined and is left to the system; // however we can safely assume that it is UCS-2 on Windows and diff --git a/include/eepp/graphics/fontmanager.hpp b/include/eepp/graphics/fontmanager.hpp index a65b61517..49a023bad 100644 --- a/include/eepp/graphics/fontmanager.hpp +++ b/include/eepp/graphics/fontmanager.hpp @@ -16,7 +16,7 @@ class EE_API FontManager : public ResourceManager { virtual ~FontManager(); /** @brief Adds a new font to the manager */ - Graphics::Font * Add( Graphics::Font * Font ); + Graphics::Font * add( Graphics::Font * Font ); protected: FontManager(); }; diff --git a/include/eepp/graphics/particle.hpp b/include/eepp/graphics/particle.hpp index 1f2589064..c92b9c4d8 100755 --- a/include/eepp/graphics/particle.hpp +++ b/include/eepp/graphics/particle.hpp @@ -15,10 +15,10 @@ class EE_API Particle{ void Color(ColorAf Color, Float AlphaDecay); ColorAf Color() const { return mColor; } - Float R() { return mColor.R(); } - Float G() { return mColor.G(); } - Float B() { return mColor.B(); } - Float A() { return mColor.A(); } + Float R() { return mColor.r(); } + Float G() { return mColor.g(); } + Float B() { return mColor.b(); } + Float A() { return mColor.a(); } void Reset(const Float &x, const Float &y, const Float &xspeed, const Float &yspeed, const Float &xacc, const Float &yacc, const Float size = 16); void Update(const Float &pTime); diff --git a/include/eepp/graphics/renderer/gl.hpp b/include/eepp/graphics/renderer/gl.hpp index 2eac558dd..b87f0cae2 100644 --- a/include/eepp/graphics/renderer/gl.hpp +++ b/include/eepp/graphics/renderer/gl.hpp @@ -25,15 +25,15 @@ class RendererGLES2; class EE_API cGL { static cGL * ms_singleton; public: - static cGL * CreateSingleton( EEGL_version ver ); + static cGL * createSingleton( EEGL_version ver ); - static cGL * CreateSingleton(); + static cGL * createSingleton(); - static cGL * ExistsSingleton(); + static cGL * existsSingleton(); static cGL * instance(); - static void DestroySingleton(); + static void destroySingleton(); cGL(); diff --git a/include/eepp/graphics/textureatlas.hpp b/include/eepp/graphics/textureatlas.hpp index 31fbd0261..39a764bfd 100644 --- a/include/eepp/graphics/textureatlas.hpp +++ b/include/eepp/graphics/textureatlas.hpp @@ -17,20 +17,20 @@ class EE_API TextureAtlas : public ResourceManager { ~TextureAtlas(); /** Adds a SubTexture to the Texture Atlas */ - SubTexture * Add( SubTexture * subTexture ); + SubTexture * add( SubTexture * subTexture ); /** Creates and add to the texture atlas a SubTexture from a Texture. It will use the full Texture as a SubTexture. * @param TexId The texture id * @param Name The texture name ( if any ) */ - SubTexture * Add( const Uint32& TexId, const std::string& Name = "" ); + SubTexture * add( const Uint32& TexId, const std::string& Name = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id * @param SrcRect The texture part that will be used as the SubTexture. * @param Name The texture name ( if any ) */ - SubTexture * Add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name = "" ); + SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -38,7 +38,7 @@ class EE_API TextureAtlas : public ResourceManager { * @param DestSize The destination size that the SubTexture will have when rendered. * @param Name The texture name ( if any ) */ - SubTexture * Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name = "" ); + SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -47,7 +47,7 @@ class EE_API TextureAtlas : public ResourceManager { * @param Offset The offset that will be added to the position passed when any Draw call is used. * @param Name The texture name ( if any ) */ - SubTexture * Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name = "" ); + SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name = "" ); /** @return The texture atlas name. */ const std::string& Name() const; @@ -65,7 +65,7 @@ class EE_API TextureAtlas : public ResourceManager { const Uint32& Id() const; /** @return The number of SubTextures inside the texture atlas. */ - Uint32 Count(); + Uint32 count(); /** @return The texture that corresponds to the texture atlas. * @param texnum The texture index. A texture atlas can use more than one texture, so it can be 0 to GetTexturesLoadedCount(). Usually a texture atlas corresponds to only one texture, so the texture index is 0. diff --git a/include/eepp/graphics/texturefontloader.hpp b/include/eepp/graphics/texturefontloader.hpp index 92c67c770..74d2add38 100644 --- a/include/eepp/graphics/texturefontloader.hpp +++ b/include/eepp/graphics/texturefontloader.hpp @@ -51,10 +51,10 @@ class EE_API TextureFontLoader : public ObjectLoader { /** Updates the current state of the loading in progress ( must be called from the instancer thread, usually the main thread ). * @see ObjectLoader::Update */ - void Update(); + void update(); /** @brief Releases the font loaded ( if was already loaded ) */ - void Unload(); + void unload(); /** @return The font name */ const std::string& Id() const; @@ -90,9 +90,9 @@ class EE_API TextureFontLoader : public ObjectLoader { const char * mData; Uint32 mDataSize; - void Start(); + void start(); - void Reset(); + void reset(); private: bool mTexLoaded; bool mFontLoaded; diff --git a/include/eepp/graphics/textureloader.hpp b/include/eepp/graphics/textureloader.hpp index 87b35a57f..bc8500aef 100644 --- a/include/eepp/graphics/textureloader.hpp +++ b/include/eepp/graphics/textureloader.hpp @@ -71,10 +71,10 @@ class EE_API TextureLoader : public ObjectLoader { /** 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 ObjectLoader::Update */ - void Update(); + void update(); /** @brief Releases the texture loaded ( if was already loaded ), it will destroy the texture from memory. */ - void Unload(); + void unload(); /** @return The file path to the texture ( if any ) */ const std::string& Filepath() const; @@ -107,9 +107,9 @@ class EE_API TextureLoader : public ObjectLoader { RGB * mColorKey; - void Start(); + void start(); - void Reset(); + void reset(); private: bool mTexLoaded; bool mDirectUpload; diff --git a/include/eepp/graphics/ttffontloader.hpp b/include/eepp/graphics/ttffontloader.hpp index 169460f3a..162de99da 100644 --- a/include/eepp/graphics/ttffontloader.hpp +++ b/include/eepp/graphics/ttffontloader.hpp @@ -59,10 +59,10 @@ class EE_API TTFFontLoader : public ObjectLoader { /** 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 ObjectLoader::Update */ - void Update(); + void update(); /** Releases the Font instance and the texture loaded ( if was already loaded ), it will destroy the font texture from memory */ - void Unload(); + void unload(); /** @return The font name. */ const std::string& Id() const; @@ -94,9 +94,9 @@ class EE_API TTFFontLoader : public ObjectLoader { Uint8 * mData; unsigned int mDataSize; - void Start(); + void start(); - void Reset(); + void reset(); private: bool mFontLoaded; diff --git a/include/eepp/network/http.hpp b/include/eepp/network/http.hpp index ef7b7e775..9ecbe742e 100644 --- a/include/eepp/network/http.hpp +++ b/include/eepp/network/http.hpp @@ -293,7 +293,7 @@ class EE_API Http : NonCopyable { public: AsyncRequest( Http * http, AsyncResponseCallback cb, Http::Request request, Time timeout ); - void Run(); + void run(); protected: friend class Http; Http * mHttp; diff --git a/include/eepp/system/base64.hpp b/include/eepp/system/base64.hpp index bd05a1dc5..2ec680193 100644 --- a/include/eepp/system/base64.hpp +++ b/include/eepp/system/base64.hpp @@ -13,27 +13,27 @@ class EE_API Base64 { public: /** Encode binary data into base64 digits with MIME style === pads ** @return The final length of the output */ - static int Encode( size_t in_len, const unsigned char *in, size_t out_len, char *out ); + static int encode( size_t in_len, const unsigned char *in, size_t out_len, char *out ); /** Decode base64 digits with MIME style === pads into binary data ** @return The final length of the output */ - static int Decode( size_t in_len, const char *in, size_t out_len, unsigned char *out ); + static int decode( size_t in_len, const char *in, size_t out_len, unsigned char *out ); /** Encodes a string into a base64 string ** @return True if encoding was successful */ - static bool Encode( const std::string& in, std::string& out ); + static bool encode( const std::string& in, std::string& out ); /** Decodes a base64 string to a string ** @return True if encoding was successful */ - static bool Decode( const std::string& in, std::string& out ); + static bool decode( const std::string& in, std::string& out ); /** @return A safe encoding output length for an input of the length indicated */ - static inline int EncodeSafeOutLen( size_t in_len ) { + static inline int encodeSafeOutLen( size_t in_len ) { return in_len / 3 * 4 + 4 + 1; } /** @return A safe decoding output length for an input of the length indicated */ - static inline int DecodeSafeOutLen( size_t in_len ) { + static inline int decodeSafeOutLen( size_t in_len ) { return in_len / 4 * 3 + 1; } }; diff --git a/include/eepp/system/bitop.hpp b/include/eepp/system/bitop.hpp index 64b45ada9..968d0b43e 100755 --- a/include/eepp/system/bitop.hpp +++ b/include/eepp/system/bitop.hpp @@ -14,7 +14,7 @@ class BitOp { * @param BitWrite 0 for write 0, any other to write 1. */ template - static inline void WriteBitKey( T * Key, unsigned int Pos, unsigned int BitWrite ) { + static inline void writeBitKey( T * Key, unsigned int Pos, unsigned int BitWrite ) { ( BitWrite ) ? ( * Key ) |= ( 1 << Pos ) : ( * Key ) &= ~( 1 << Pos ); } @@ -24,7 +24,7 @@ class BitOp { * @return True if the bit is 1 */ template - static inline bool ReadBitKey( T * Key, Uint32 Pos ) { + static inline bool readBitKey( T * Key, Uint32 Pos ) { return 0 != ( ( * Key ) & ( 1 << Pos ) ); } @@ -34,46 +34,46 @@ class BitOp { * @param BitWrite 0 to remove, any value to write */ template - static inline void SetBitFlagValue( T * Key, Uint32 Val, Uint32 BitWrite ) { + static inline void setBitFlagValue( T * Key, Uint32 Val, Uint32 BitWrite ) { ( BitWrite ) ? ( * Key ) |= Val : ( * Key ) &= ~Val; } /** Swap the bytes order for a 16 bit value */ - static inline Uint16 Swap16( Uint16 Key ) { + static inline Uint16 swap16( Uint16 Key ) { return static_cast( ( Key << 8 ) | ( Key >> 8 ) ); } /** Swap the bytes order for a 32 bit value */ - static inline Uint32 Swap32( Uint32 Key ) { + static inline Uint32 swap32( Uint32 Key ) { return static_cast( ( Key << 24 ) | ( ( Key << 8 ) & 0x00FF0000 ) | ( ( Key >> 8 ) & 0x0000FF00 ) | ( Key >> 24 ) ); } /** Swap the bytes order for a 64 bit value */ - static inline Uint64 Swap64( Uint64 Key ) { + static inline Uint64 swap64( Uint64 Key ) { Uint32 hi, lo; /* Separate into high and low 32-bit values and swap them */ lo = static_cast ( Key & 0xFFFFFFFF ); Key >>= 32; hi = static_cast( Key & 0xFFFFFFFF ); - Key = Swap32( lo ); + Key = swap32( lo ); Key <<= 32; - Key |= Swap32( hi ); + Key |= swap32( hi ); return Key; } /** Swap little endian 16 bit value to big endian */ - static inline Uint32 SwapBE16( Uint32 Key ) { + static inline Uint32 swapBE16( Uint32 Key ) { #if EE_ENDIAN == EE_LITTLE_ENDIAN - return Swap16( Key ); + return swap16( Key ); #else return Key; #endif } /** Swap big endian 16 bit value to little endian */ - static inline Uint32 SwapLE16( Uint32 Key ) { + static inline Uint32 swapLE16( Uint32 Key ) { #if EE_ENDIAN == EE_BIG_ENDIAN return Swap16( Key ); #else @@ -82,16 +82,16 @@ class BitOp { } /** Swap little endian 32 bit value to big endian */ - static inline Uint32 SwapBE32( Uint32 Key ) { + static inline Uint32 swapBE32( Uint32 Key ) { #if EE_ENDIAN == EE_LITTLE_ENDIAN - return Swap32( Key ); + return swap32( Key ); #else return Key; #endif } /** Swap big endian 32 bit value to little endian */ - static inline Uint32 SwapLE32( Uint32 Key ) { + static inline Uint32 swapLE32( Uint32 Key ) { #if EE_ENDIAN == EE_BIG_ENDIAN return Swap32( Key ); #else @@ -100,16 +100,16 @@ class BitOp { } /** Swap little endian 64 bit value to big endian */ - static inline Uint32 SwapBE64( Uint32 Key ) { + static inline Uint32 swapBE64( Uint32 Key ) { #if EE_ENDIAN == EE_LITTLE_ENDIAN - return Swap64( Key ); + return swap64( Key ); #else return Key; #endif } /** Swap big endian 64 bit value to little endian */ - static inline Uint32 SwapLE64( Uint32 Key ) { + static inline Uint32 swapLE64( Uint32 Key ) { #if EE_ENDIAN == EE_BIG_ENDIAN return Swap64( Key ); #else diff --git a/include/eepp/system/clock.hpp b/include/eepp/system/clock.hpp index f86f9e854..356140df6 100644 --- a/include/eepp/system/clock.hpp +++ b/include/eepp/system/clock.hpp @@ -16,15 +16,15 @@ class EE_API Clock { ~Clock(); /** Restarts the timer */ - void Restart(); + void restart(); /** @returns time since initialisation or last reset */ - Time GetElapsedTime() const; + 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(); + Time elapsed(); private: Platform::ClockImpl * mClockImpl; }; diff --git a/include/eepp/system/colors.hpp b/include/eepp/system/colors.hpp index 9aa8ea601..583f948dd 100755 --- a/include/eepp/system/colors.hpp +++ b/include/eepp/system/colors.hpp @@ -36,22 +36,22 @@ class tColor { /** From 32 bits value with RGB(A) byte order */ tColor( Uint32 Col ) { - Col = BitOp::SwapLE32( Col ); + Col = BitOp::swapLE32( Col ); Red = static_cast( Col >> 16 ); Green = static_cast( Col >> 8 ); Blue = static_cast( Col >> 0 ); } - T R() const { return Red; } //! @return the Red component - T G() const { return Green; } //! @return the Green component - T B() const { return Blue; } //! @return the Blue component + T r() const { return Red; } //! @return the Red component + T g() const { return Green; } //! @return the Green component + T b() const { return Blue; } //! @return the Blue component bool operator==(tColor& Col) { - return ( Red == Col.R() && Green == Col.G() && Blue == Col.B() ); + return ( Red == Col.r() && Green == Col.g() && Blue == Col.b() ); } bool operator!=(tColor& Col) { - return !( Red == Col.R() && Green == Col.G() && Blue == Col.B() ); + return !( Red == Col.r() && Green == Col.g() && Blue == Col.b() ); } }; @@ -124,27 +124,27 @@ class tColorA { /** From a 32 bits value with RGBA byte order */ tColorA( const Uint32& Col ) : - Value( BitOp::SwapBE32( Col ) ) + Value( BitOp::swapBE32( Col ) ) { } - T R() const { return Red; } //! @return the Red component - T G() const { return Green; } //! @return the Green component - T B() const { return Blue; } //! @return the Blue component - T A() const { return Alpha; } //! @return the Alpha component + T r() const { return Red; } //! @return the Red component + T g() const { return Green; } //! @return the Green component + T b() const { return Blue; } //! @return the Blue component + T a() const { return Alpha; } //! @return the Alpha component //! @return The color represented as an Uint32 ( as 0xAABBGGRR for Little Endian ) - Uint32 GetValue() const { + Uint32 getValue() const { return Value; } /** @brief Assign the RGBA colors, from each component. */ - void Assign( T r, T g, T b, T a ) { + void assign( T r, T g, T b, T a ) { Red = r; Green = g; Blue = b; Alpha = a; } /** @brief Assign the color value from other RGBA color. */ - void Assign( const tColorA& Col ) { + void assign( const tColorA& Col ) { Value = Col.Value; } @@ -219,14 +219,14 @@ public: Color( Uint32 Col ) { - Col = BitOp::SwapLE32( Col ); + Col = BitOp::swapLE32( Col ); Red = static_cast( Col >> 16 ); Green = static_cast( Col >> 8 ); Blue = static_cast( Col >> 0 ); } /** Blend a source color to destination color */ - static inline ColorAf Blend( ColorAf srcf, ColorAf dstf ) { + static inline ColorAf blend( ColorAf srcf, ColorAf dstf ) { Float alpha = srcf.Alpha + dstf.Alpha * ( 1.f - srcf.Alpha ); Float red = ( srcf.Red * srcf.Alpha + dstf.Red * dstf.Alpha * ( 1.f - srcf.Alpha ) ) / alpha; Float green = ( srcf.Green * srcf.Alpha + dstf.Green * dstf.Alpha * ( 1.f - srcf.Alpha ) ) / alpha; @@ -238,7 +238,7 @@ public: #define EE_COLOR_BLEND_FTOU8(color) (Uint8)( color == 1.f ? 255 : (color * 255.99f)) /** Blend a source color to destination color */ - static inline ColorA Blend( ColorA src, ColorA dst ) { + static inline ColorA blend( ColorA src, ColorA dst ) { ColorAf srcf( (Float)src.Red / 255.f, (Float)src.Green / 255.f, (Float)src.Blue / 255.f, (Float)src.Alpha / 255.f ); ColorAf dstf( (Float)dst.Red / 255.f, (Float)dst.Green / 255.f, (Float)dst.Blue / 255.f, (Float)dst.Alpha / 255.f ); Float alpha = srcf.Alpha + dstf.Alpha * ( 1.f - srcf.Alpha ); diff --git a/include/eepp/system/condition.hpp b/include/eepp/system/condition.hpp index a81e6791f..14771ee2f 100755 --- a/include/eepp/system/condition.hpp +++ b/include/eepp/system/condition.hpp @@ -28,7 +28,7 @@ class EE_API Condition : NonCopyable { */ ~Condition(); - void Lock(); + void lock(); /** Waits until the Condition's value == awaitedValue and protects the Condition. * You're responsible for unlocking the Condition with Unlock() after @@ -52,7 +52,7 @@ class EE_API Condition : NonCopyable { * reached if the Condition has been disabled through Invalidate(). An * invalidated Condition always returns in an unlocked state. */ - bool WaitAndLock( int awaitedValue, int autoUnlock = false ); + bool waitAndLock( int awaitedValue, int autoUnlock = false ); /** Unlocks a previously locked Condition with value as * internal value. When the condition is unlocked, it is assumed @@ -61,9 +61,9 @@ class EE_API Condition : NonCopyable { * * @param value the value the Condition should have when it is unlocked */ - void Unlock( int value ); + void unlock( int value ); - void Unlock(); + void unlock(); /** Performs an assignement followed by a Signal() call. * The internal Condition value is updated to @value and the Condition is @@ -82,24 +82,24 @@ class EE_API Condition : NonCopyable { * * @return: the current internal state */ - int Value() const; + int value() const; /** Signals that the Condition state has changed and that * threads waiting on this Condition should check * the new internal value. */ - void Signal(); + void signal(); /** Signals the Condition and disables blocking calls, * thus WaitAndLock() does no more wait whatever * the awaitedValue is and waiting calls are unlocked, returning false. */ - void Invalidate(); + void invalidate(); /** Restores the blocking capabilities of the Condition, * possibly previously disabled with Invalidate() */ - void Restore(); + void restore(); protected: Platform::ConditionImpl * mCondImpl; }; diff --git a/include/eepp/system/container.hpp b/include/eepp/system/container.hpp index 4a29ee203..cbf4769a9 100644 --- a/include/eepp/system/container.hpp +++ b/include/eepp/system/container.hpp @@ -15,13 +15,13 @@ class Container { virtual ~Container(); /** @brief Add to the list the resource. */ - T * Add( T * Resource ); + T * add( T * Resource ); /** @brief Remove from the list the resource. */ - bool Remove( T * Resource ); + bool remove( T * Resource ); /** @returns The number of resources added to the container. */ - Uint32 Count(); + Uint32 count(); protected: std::list mResources; }; @@ -37,7 +37,7 @@ Container::~Container() } template -T * Container::Add( T * Resource ) { +T * Container::add( T * Resource ) { if ( NULL != Resource ) { mResources.push_back( Resource ); @@ -48,7 +48,7 @@ T * Container::Add( T * Resource ) { } template -bool Container::Remove( T * Resource ) { +bool Container::remove( T * Resource ) { if ( NULL != Resource ) { mResources.remove( Resource ); @@ -59,7 +59,7 @@ bool Container::Remove( T * Resource ) { } template -Uint32 Container::Count() { +Uint32 Container::count() { return mResources.size(); } diff --git a/include/eepp/system/filesystem.hpp b/include/eepp/system/filesystem.hpp index 9aff865eb..570d53b50 100644 --- a/include/eepp/system/filesystem.hpp +++ b/include/eepp/system/filesystem.hpp @@ -9,90 +9,90 @@ namespace EE { namespace System { class EE_API FileSystem { public: /** @return The default slash path code of the current OS */ - static std::string GetOSlash(); + static std::string getOSlash(); /** @return True if the file exists ( false if is a directory, to know if directory exists use IsDirectory ) */ - static bool FileExists( const std::string& Filepath ); + static bool fileExists( const std::string& Filepath ); /** Copy a file to memory * @param path The file path * @param data The vector to allocate the file in memory * @return True if returned the file to the vector. */ - static bool FileGet( const std::string& path, std::vector& data ); + static bool fileGet( const std::string& path, std::vector& data ); /** Copy a file to memory * @param path The file path * @param data A SafeDataPointer to allocate the data to memory * @return True if returned the file to the SafeDataPointer */ - static bool FileGet( const std::string& path, SafeDataPointer& data ); + static bool fileGet( const std::string& path, SafeDataPointer& data ); /** Copy a file to location. * @param src Source File Path * @param dst Destination File Path * @return If success. */ - static bool FileCopy( const std::string& src, const std::string& dst ); + static bool fileCopy( const std::string& src, const std::string& dst ); /** @return The file extension * @param filepath The file path or name * @param lowerExt Lowercase the extension obtained? ( true by default ) */ - static std::string FileExtension( const std::string& filepath, const bool& lowerExt = true ); + static std::string fileExtension( const std::string& filepath, const bool& lowerExt = true ); /** @return The file name of a file path */ - static std::string FileNameFromPath( const std::string& filepath ); + static std::string fileNameFromPath( const std::string& filepath ); /** @return Removes the file name from a path, and return the path. */ - static std::string FileRemoveFileName( const std::string& filepath ); + static std::string fileRemoveFileName( const std::string& filepath ); /** @return Removes the extension of a filepath */ - static std::string FileRemoveExtension( const std::string& filepath ); + static std::string fileRemoveExtension( const std::string& filepath ); /** Removes the process path to a file path */ - static void FilePathRemoveProcessPath( std::string& path ); + static void filePathRemoveProcessPath( std::string& path ); /** Write a file in binary mode and close it. */ - static bool FileWrite( const std::string& filepath, const Uint8* data, const Uint32& dataSize ); + static bool fileWrite( const std::string& filepath, const Uint8* data, const Uint32& dataSize ); /** Write a file in binary mode and close it. */ - static bool FileWrite( const std::string& filepath, const std::vector& data ); + static bool fileWrite( const std::string& filepath, const std::vector& data ); /** Deletes a file from the file system. */ - static bool FileRemove( const std::string& filepath ); + static bool fileRemove( const std::string& filepath ); /** @return The modification date of the file */ - static Uint32 FileGetModificationDate( const std::string& Filepath ); + static Uint32 fileGetModificationDate( const std::string& Filepath ); /** If the directory path not end with a slash, it will add it. */ - static void DirPathAddSlashAtEnd( std::string& path ); + static void dirPathAddSlashAtEnd( std::string& path ); /** Move up from directory tree */ - static std::string RemoveLastFolderFromPath( std::string path ); + static std::string removeLastFolderFromPath( std::string path ); /** @return The files and sub directories contained by a directory */ - static std::vector FilesGetInPath( const std::string& path, const bool& sortByName = false, const bool& foldersFirst = false ); + static std::vector filesGetInPath( const std::string& path, const bool& sortByName = false, const bool& foldersFirst = false ); /** @return The files and sub directories contained by a directory */ - static std::vector FilesGetInPath( const String& path, const bool& sortByName = false, const bool& foldersFirst = false ); + static std::vector filesGetInPath( const String& path, const bool& sortByName = false, const bool& foldersFirst = false ); /** @return The size of a file */ - static Uint64 FileSize( const std::string& Filepath ); + static Uint64 fileSize( const std::string& Filepath ); /** @return If directory exists, and is a directory */ - static bool IsDirectory( const std::string& path ); + static bool isDirectory( const std::string& path ); /** @return If directory exists, and is a directory */ - static bool IsDirectory( const String& path ); + static bool isDirectory( const String& path ); /** Creates a new directory */ - static bool MakeDir( const std::string& path, const Uint16& mode = 0770 ); + static bool makeDir( const std::string& path, const Uint16& mode = 0770 ); /** Convert a size represented in bytes, to a string converted in byes/kb/mb/tb. * For example 10485760 -> "10.0 MB" */ - static std::string SizeToString(const Int64& Size ); + static std::string sizeToString(const Int64& Size ); }; diff --git a/include/eepp/system/inifile.hpp b/include/eepp/system/inifile.hpp index 26266e557..9850fd6be 100755 --- a/include/eepp/system/inifile.hpp +++ b/include/eepp/system/inifile.hpp @@ -31,98 +31,98 @@ class EE_API IniFile { enum errors { noID = -1 }; /** Initialize and load the ini file from path */ - IniFile ( std::string const iniPath = "", const bool& readFile = true ); + IniFile (std::string const iniPath = "", const bool& shouldReadFile = true ); /** Initialize and load the ini file from memory */ - IniFile ( const Uint8* RAWData, const Uint32& size, const bool& readFile = true ); + IniFile ( const Uint8* RAWData, const Uint32& size, const bool& shouldReadFile = true ); /** Initialize and load the ini file from a pack file */ - IniFile ( Pack * Pack, std::string iniPackPath, const bool& readFile = true ); + IniFile (Pack * Pack, std::string iniPackPath, const bool& shouldReadFile = true ); virtual ~IniFile() {} /** Loads an ini file from path */ - bool LoadFromFile( const std::string& iniPath ); + bool loadFromFile( const std::string& iniPath ); /** Loads an ini file from memory */ - bool LoadFromMemory( const Uint8* RAWData, const Uint32& size ); + bool loadFromMemory( const Uint8* RAWData, const Uint32& size ); /** Loads an ini file from a pack file */ - bool LoadFromPack( Pack * 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. */ - void CaseSensitive() {mCaseInsensitive = false;} + void caseSensitive() {mCaseInsensitive = false;} /** @see CaseSensitive() */ - void CaseInsensitive() {mCaseInsensitive = true;} + void caseInsensitive() {mCaseInsensitive = true;} /** Sets mPath of ini file to read and write from. */ - void Path ( std::string const newPath ) {mPath = newPath;} + void path ( std::string const newPath ) {mPath = newPath;} /** @return The ini file path */ - std::string Path() const {return mPath;} + std::string path() const {return mPath;} /** Reads ini file specified using mPath. * @return true if successful, false otherwise. */ - bool ReadFile(); + bool readFile(); /** Writes data stored in class to ini file. */ - bool WriteFile(); + bool writeFile(); /** Deletes all stored ini data. */ - void Clear(); + void clear(); /** @return index of specified key, or noID if not found. */ - long FindKey ( std::string const keyname ) const; + long findKey ( std::string const keyname ) const; /** @return index of specified value, in the specified key, or noID if not found. */ - long FindValue ( unsigned const keyID, std::string const valuename ) const; + long findValue ( unsigned const keyID, std::string const valuename ) const; /** @return number of Keys currently in the ini. */ - unsigned GetNumKeys() const {return (unsigned int)mNames.size();} + unsigned getNumKeys() const {return (unsigned int)mNames.size();} /** Add a key name. */ - unsigned AddKeyName ( std::string const keyname ); + unsigned addKeyName ( std::string const keyname ); /** @return key Names by index. */ - std::string GetKeyName ( unsigned const keyID ) const; + std::string getKeyName ( unsigned const keyID ) const; /** @return number of values stored for specified key. */ - unsigned GetNumValues ( unsigned const keyID ); + unsigned getNumValues ( unsigned const keyID ); /** @return number of values stored for specified key from its name. */ - unsigned GetNumValues ( std::string const keyname ); + unsigned getNumValues ( std::string const keyname ); /** @return value name by index for a given keyname or keyID. */ - std::string GetValueName ( unsigned const keyID, unsigned const valueID ) const; + std::string getValueName ( unsigned const keyID, unsigned const valueID ) const; /** @return A value name from keyname and valueId */ - std::string GetValueName ( std::string const keyname, unsigned const valueID ) const; + std::string getValueName ( std::string const keyname, unsigned const valueID ) const; /** Gets value of [keyname] valuename =. ** Overloaded to return std::string, int, and double. ** @return defValue if key/value not found otherwise the value obtained. */ - std::string GetValue ( unsigned const keyID, unsigned const valueID, std::string const defValue = "" ) const; + std::string getValue ( unsigned const keyID, unsigned const valueID, std::string const defValue = "" ) const; /** Gets a value from a keyname and valuename */ - std::string GetValue ( std::string const keyname, std::string const valuename, std::string const defValue = "" ) const; + std::string getValue ( std::string const keyname, std::string const valuename, std::string const defValue = "" ) const; /** Gets the value as integer */ - int GetValueI ( std::string const keyname, std::string const valuename, int const defValue = 0 ) const; + int getValueI ( std::string const keyname, std::string const valuename, int const defValue = 0 ) const; /** Gets the value as boolean */ - bool GetValueB ( std::string const keyname, std::string const valuename, bool const defValue = false ) const { - return 0 != ( GetValueI ( keyname, valuename, int ( defValue ) ) ); + bool getValueB ( std::string const keyname, std::string const valuename, bool const defValue = false ) const { + return 0 != ( getValueI ( keyname, valuename, int ( defValue ) ) ); } /** Gets the value as double */ - double GetValueF ( std::string const keyname, std::string const valuename, double const defValue = 0.0 ) const; + double getValueF ( std::string const keyname, std::string const valuename, double const defValue = 0.0 ) const; /** This is a variable length formatted GetValue routine. All these voids ** are required because there is no vsscanf() like there is a vsprintf(). ** Only a maximum of 8 variable can be read. */ - unsigned GetValueV ( std::string const keyname, std::string const valuename, char *format, + unsigned getValueV ( std::string const keyname, std::string const valuename, char *format, void *v1 = 0, void *v2 = 0, void *v3 = 0, void *v4 = 0, void *v5 = 0, void *v6 = 0, void *v7 = 0, void *v8 = 0, void *v9 = 0, void *v10 = 0, void *v11 = 0, void *v12 = 0, @@ -132,7 +132,7 @@ class EE_API IniFile { ** Specify the optional paramter as false (0) if you do not want it to create ** the key if it doesn't exist. @return true if data entered, false otherwise. ** Overloaded to accept std::string, int, and double. */ - bool SetValue ( unsigned const keyID, unsigned const valueID, std::string const value ); + bool setValue ( unsigned const keyID, unsigned const valueID, std::string const value ); /** Sets the value from a keyname and a valuename * @param keyname The key name @@ -140,7 +140,7 @@ class EE_API IniFile { * @param value The value to assign * @param create If true it will create the keyname if doesn't exists */ - bool SetValue ( std::string const keyname, std::string const valuename, std::string const value, bool create = true ); + bool setValue ( std::string const keyname, std::string const valuename, std::string const value, bool create = true ); /** Sets a integer value from a keyname and a valuename * @param keyname The key name @@ -148,7 +148,7 @@ class EE_API IniFile { * @param value The value to assign * @param create If true it will create the keyname if doesn't exists */ - bool SetValueI ( std::string const keyname, std::string const valuename, int const value, bool create = true ); + bool setValueI ( std::string const keyname, std::string const valuename, int const value, bool create = true ); /** Sets a boolean value from a keyname and a valuename * @param keyname The key name @@ -156,8 +156,8 @@ class EE_API IniFile { * @param value The value to assign * @param create If true it will create the keyname if doesn't exists */ - bool SetValueB ( std::string const keyname, std::string const valuename, bool const value, bool create = true ) { - return SetValueI ( keyname, valuename, int ( value ), create ); + bool setValueB ( std::string const keyname, std::string const valuename, bool const value, bool create = true ) { + return setValueI ( keyname, valuename, int ( value ), create ); } /** Sets a double value from a keyname and a valuename @@ -166,60 +166,60 @@ class EE_API IniFile { * @param value The value to assign * @param create If true it will create the keyname if doesn't exists */ - bool SetValueF ( std::string const keyname, std::string const valuename, double const value, bool create = true ); + bool setValueF ( std::string const keyname, std::string const valuename, double const value, bool create = true ); /** Sets a formated value from a keyname and a valuename */ - bool SetValueV ( std::string const keyname, std::string const valuename, char *format, ... ); + bool setValueV ( std::string const keyname, std::string const valuename, char *format, ... ); /** Deletes specified value. ** @return true if value existed and deleted, false otherwise. */ - bool DeleteValue ( std::string const keyname, std::string const valuename ); + bool deleteValue ( std::string const keyname, std::string const valuename ); /** Deletes specified key and all values contained within. ** @return true if key existed and deleted, false otherwise. */ - bool DeleteKey ( std::string keyname ); + bool deleteKey ( std::string keyname ); /** Header comment functions. ** Header comments are those comments before the first key. ** Number of header comments.*/ - unsigned NumHeaderComments() {return (unsigned int)mComments.size();} + unsigned numHeaderComments() {return (unsigned int)mComments.size();} /** Add a header comment. */ - void AddHeaderComment ( std::string const comment ); + void addHeaderComment ( std::string const comment ); /** Return a header comment. */ - std::string GetHeaderComment ( unsigned const commentID ) const; + std::string getHeaderComment ( unsigned const commentID ) const; /** Delete a header comment. */ - bool DeleteHeaderComment ( unsigned commentID ); + bool deleteHeaderComment ( unsigned commentID ); /** Delete all header comments. */ - void DeleteHeaderComments() { mComments.clear();} + void deleteHeaderComments() { mComments.clear();} /** Key comment functions. ** 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 IniFile::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; + unsigned getNumKeyComments ( unsigned const keyID ) const; + unsigned getNumKeyComments ( std::string const keyname ) const; /** Add a key comment.*/ - bool AddKeyComment ( unsigned const keyID, std::string const comment ); - bool AddKeyComment ( std::string const keyname, std::string const comment ); + bool addKeyComment ( unsigned const keyID, std::string const comment ); + bool addKeyComment ( std::string const keyname, std::string const comment ); /** Return a key comment. */ - std::string GetKeyComment ( unsigned const keyID, unsigned const commentID ) const; - std::string GetKeyComment ( std::string const keyname, unsigned const commentID ) const; + std::string getKeyComment ( unsigned const keyID, unsigned const commentID ) const; + std::string getKeyComment ( std::string const keyname, unsigned const commentID ) const; /** Delete a key comment. */ - bool DeleteKeyComment ( unsigned const keyID, unsigned const commentID ); - bool DeleteKeyComment ( std::string const keyname, unsigned const commentID ); + bool deleteKeyComment ( unsigned const keyID, unsigned const commentID ); + bool deleteKeyComment ( std::string const keyname, unsigned const commentID ); /** Delete all comments for a key. */ - bool DeleteKeyComments ( unsigned const keyID ); - bool DeleteKeyComments ( std::string const keyname ); + bool deleteKeyComments ( unsigned const keyID ); + bool deleteKeyComments ( std::string const keyname ); private: bool mCaseInsensitive; bool mIniReaded; diff --git a/include/eepp/system/iostream.hpp b/include/eepp/system/iostream.hpp index ca32ef0eb..64f711fa6 100644 --- a/include/eepp/system/iostream.hpp +++ b/include/eepp/system/iostream.hpp @@ -18,28 +18,28 @@ class EE_API IOStream { ** @param data Buffer where to copy the read data ** @param size Desired number of bytes to read ** @return The number of bytes actually read */ - virtual ios_size Read( char * data, ios_size size ) = 0; + virtual ios_size read( char * data, ios_size size ) = 0; /** @brief Write data to the virtual file ** @param data Data to write in the file ** @param size Size of the data that needs to be writed */ - virtual ios_size Write( const char * data, ios_size size ) = 0; + virtual ios_size write( const char * data, ios_size size ) = 0; /** @brief Change the current reading position ** @param position The position to seek to, from the beginning ** @return The position actually sought to. */ - virtual ios_size Seek( ios_size position ) = 0; + virtual ios_size seek( ios_size position ) = 0; /** @brief Get the current reading position in the stream ** @return The current position, or -1 on error. */ - virtual ios_size Tell() = 0; + virtual ios_size tell() = 0; /** @brief Return the size of the stream ** @return The total number of bytes available in the stream */ - virtual ios_size GetSize() = 0; + virtual ios_size getSize() = 0; /** @return If the virtual stream file is open */ - virtual bool IsOpen() = 0; + virtual bool isOpen() = 0; }; }} diff --git a/include/eepp/system/iostreamfile.hpp b/include/eepp/system/iostreamfile.hpp index 9b60099ac..b64c7cbc1 100644 --- a/include/eepp/system/iostreamfile.hpp +++ b/include/eepp/system/iostreamfile.hpp @@ -18,21 +18,21 @@ class EE_API IOStreamFile : public IOStream { virtual ~IOStreamFile(); - ios_size Read( char * data, ios_size size ); + ios_size read( char * data, ios_size size ); - ios_size Write( const char * data, ios_size size ); + ios_size write( const char * data, ios_size size ); - ios_size Seek( ios_size position ); + ios_size seek( ios_size position ); - ios_size Tell(); + ios_size tell(); - ios_size GetSize(); + ios_size getSize(); - bool IsOpen(); + bool isOpen(); /** @brief Synchronizes the buffer associated with the stream to its controlled output sequence. ** This effectively means that all unwritten characters in the buffer are written to its controlled output sequence as soon as possible. */ - void Flush(); + void flush(); protected: std::fstream mFS; ios_size mSize; diff --git a/include/eepp/system/iostreammemory.hpp b/include/eepp/system/iostreammemory.hpp index 5d208f1ea..2cb3994e1 100644 --- a/include/eepp/system/iostreammemory.hpp +++ b/include/eepp/system/iostreammemory.hpp @@ -22,17 +22,17 @@ class EE_API IOStreamMemory : public IOStream { virtual ~IOStreamMemory(); - ios_size Read( char * data, ios_size size ); + ios_size read( char * data, ios_size size ); - ios_size Write( const char * data, ios_size size ); + ios_size write( const char * data, ios_size size ); - ios_size Seek( ios_size position ); + ios_size seek( ios_size position ); - ios_size Tell(); + ios_size tell(); - ios_size GetSize(); + ios_size getSize(); - bool IsOpen(); + bool isOpen(); protected: const char * mReadPtr; char * mWritePtr; diff --git a/include/eepp/system/log.hpp b/include/eepp/system/log.hpp index 85e619fd3..5a0285657 100755 --- a/include/eepp/system/log.hpp +++ b/include/eepp/system/log.hpp @@ -24,39 +24,39 @@ class EE_API Log : protected Mutex { /** @brief Indicates that the log must be writed to a file when the Log instance is closed. ** @param filepath The path to the file to write the log. */ - void Save( const std::string& filepath = "" ); + void save( const std::string& filepath = "" ); /** @brief Writes the text to the log ** @param Text The text to write ** @param newLine Indicates if a new line character is appended at the end of the text */ - void Write( std::string Text, const bool& newLine = true); + void write( std::string Text, const bool& newLine = true); /** @brief Writes a formated string to the log */ - void Writef( const char* format, ... ); + void writef( const char* format, ... ); /** @returns A copy of the current writed log. */ - std::string Buffer() const; + std::string buffer() const; /** @returns If the log Writes are outputed to the terminal. */ - const bool& ConsoleOutput() const; + const bool& consoleOutput() const; /** @brief Enabled or disables to output the Writes to the terminal. */ - void ConsoleOutput( const bool& output ); + void consoleOutput( const bool& output ); /** @returns If the file is forced to flush the data on every Write call. */ - const bool& LiveWrite() const; + const bool& liveWrite() const; /** @brief Activate or deactivate to flush the writed data to the log on every Write call. */ - void LiveWrite( const bool& lw ); + void liveWrite( const bool& lw ); /** @brief Adds a reader interface. ** The reader interface is used to the informed for every writed text to the log. */ - void AddLogReader( LogReaderInterface * reader ); + void addLogReader( LogReaderInterface * reader ); /** @brief Removes the reader interface */ - void RemoveLogReader( LogReaderInterface * reader ); + void removeLogReader( LogReaderInterface * reader ); ~Log(); protected: @@ -70,11 +70,11 @@ class EE_API Log : protected Mutex { IOStreamFile * mFS; std::list mReaders; - void OpenFS(); + void openFS(); - void CloseFS(); + void closeFS(); - void WriteToReaders( std::string& text ); + void writeToReaders( std::string& text ); }; }} diff --git a/include/eepp/system/md5.hpp b/include/eepp/system/md5.hpp index e26b8d7e3..52ba0e603 100644 --- a/include/eepp/system/md5.hpp +++ b/include/eepp/system/md5.hpp @@ -10,25 +10,25 @@ class MD5 { typedef struct { std::vector digest; - std::string ToHexString() { - return MD5::HexDigest( digest ); + std::string toHexString() { + return MD5::hexDigest( digest ); } } Result; /** @return Calculates the md5 hash from a stream */ - static Result FromStream( IOStream& stream ); + static Result fromStream( IOStream& stream ); /** Calculates the md5 hash from a file */ - static Result FromFile( std::string path ); + static Result fromFile( std::string path ); /** Calculates the md5 hash from memory */ - static Result FromMemory( const Uint8* data, Uint64 size ); + static Result fromMemory( const Uint8* data, Uint64 size ); /** Calculates the md5 hash from a string */ - static Result FromString( const std::string& str ); + static Result fromString( const std::string& str ); /** Calculates the md5 hash from a string */ - static Result FromString( const String& str ); + static Result fromString( const String& str ); protected: typedef unsigned int MD5_u32plus; @@ -39,15 +39,15 @@ class MD5 { MD5_u32plus block[16]; } Context; - static const void * Body( Context *ctx, const void *data, unsigned long size ); + static const void * body( Context *ctx, const void *data, unsigned long size ); - static void Init( Context * ctx ); + static void init( Context * ctx ); - static void Update( Context * ctx, const void *data, unsigned long size ); + static void update( Context * ctx, const void *data, unsigned long size ); - static void Final( unsigned char *result, Context * ctx ); + static void final( unsigned char *result, Context * ctx ); - static std::string HexDigest( std::vector& digest ); + static std::string hexDigest( std::vector& digest ); }; }} diff --git a/include/eepp/system/mutex.hpp b/include/eepp/system/mutex.hpp index ca0aa8e92..5e18d7e06 100755 --- a/include/eepp/system/mutex.hpp +++ b/include/eepp/system/mutex.hpp @@ -19,13 +19,13 @@ class EE_API Mutex : NonCopyable { ** If the mutex is already locked in another thread, ** this call will block the execution until the mutex ** is released. */ - void Lock(); + void lock(); /** @brief Unlock the mutex */ - void Unlock(); + void unlock(); /** @brief Tries to lock de mutex if possible */ - int TryLock(); + int tryLock(); private: Platform::MutexImpl * mMutexImpl; }; diff --git a/include/eepp/system/objectloader.hpp b/include/eepp/system/objectloader.hpp index f1cc2f5bf..a06fc1c93 100644 --- a/include/eepp/system/objectloader.hpp +++ b/include/eepp/system/objectloader.hpp @@ -27,39 +27,39 @@ class EE_API ObjectLoader : protected Thread { virtual ~ObjectLoader(); /** @brief Starts loading the resource */ - void Load(); + void load(); /** @brief Starts loading the resource. ** @param Cb A callback that is called when the resource finished loading. */ - void Load( ObjLoadCallback Cb ); + void load( ObjLoadCallback Cb ); /** @brief Force to unload the resource from memory in case that it was already loaded. */ - virtual void Unload() = 0; + virtual void unload() = 0; /** @brief Update the state of the current loading resource. ** This is needed by some loaders to know if the resource was loaded. ** The loaders that need to load a texture to the GPU, will upload the data to the GPU only from the OpenGL context thread ( the main application thread ) */ - virtual void Update(); + virtual void update(); /** @brief Starts the loading. */ - void Launch(); + void launch(); /** @returns If the resource was loaded. */ - virtual bool IsLoaded(); + virtual bool isLoaded(); /** @returns If the resource is loading. */ - virtual bool IsLoading(); + virtual bool isLoading(); /** @returns If the loader is asynchronous */ - bool Threaded() const; + bool threaded() const; /** @brief Sets if the loader is asynchronous. ** This must be called before the load starts. */ - void Threaded( const bool& threaded ); + void threaded( const bool& threaded ); /** @return The object loader type */ - const Uint32& Type() const; + const Uint32& type() const; protected: Uint32 mObjType; // Texture Loader Object Type bool mLoaded; @@ -68,13 +68,13 @@ class EE_API ObjectLoader : protected Thread { std::list mLoadCbs; - virtual void Start(); + virtual void start(); - virtual void SetLoaded(); + virtual void setLoaded(); - virtual void Reset(); + virtual void reset(); private: - virtual void Run(); + virtual void run(); }; }} diff --git a/include/eepp/system/pack.hpp b/include/eepp/system/pack.hpp index b9bfc93d7..3e57710b9 100755 --- a/include/eepp/system/pack.hpp +++ b/include/eepp/system/pack.hpp @@ -15,59 +15,59 @@ class EE_API Pack : protected Mutex { virtual ~Pack(); /** Creates a new pack file */ - virtual bool Create( const std::string& path ) = 0; + virtual bool create( const std::string& path ) = 0; /** Open a pack file */ - virtual bool Open( const std::string& path ) = 0; + virtual bool open( const std::string& path ) = 0; /** Close the pack file */ - virtual bool Close() = 0; + virtual bool close() = 0; /** Add a file to the pack file * @param path Path to the file in the disk * @param inpack Path that will have the file inside the pak * @return True if success */ - virtual bool AddFile( const std::string& path, const std::string& inpack ) = 0; + virtual bool addFile( const std::string& path, const std::string& inpack ) = 0; /** Add a new file from memory */ - virtual bool AddFile( std::vector& data, const std::string& inpack ) = 0; + virtual bool addFile( std::vector& data, const std::string& inpack ) = 0; /** Add a new file from memory */ - virtual bool AddFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ) = 0; + virtual bool addFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ) = 0; /** Add a map of files to the pack file ( myMap[ myFilepath ] = myInPackFilepath ) */ - virtual bool AddFiles( std::map paths ) = 0; + virtual bool addFiles( std::map paths ) = 0; /** Erase a file from the pack file. ( This will create a new pack file without that file, so, can be slow ) */ - virtual bool EraseFile( const std::string& path ) = 0; + virtual bool eraseFile( const std::string& path ) = 0; /** Erase all passed files from the pack file. ( This will create a new pack file without that file, so, can be slow ) */ - virtual bool EraseFiles( const std::vector& paths ) = 0; + virtual bool eraseFiles( const std::vector& paths ) = 0; /** Extract a file from the pack file */ - virtual bool ExtractFile( const std::string& path , const std::string& dest ) = 0; + virtual bool extractFile( const std::string& path , const std::string& dest ) = 0; /** Extract a file to memory from the pack file */ - virtual bool ExtractFileToMemory( const std::string& path, std::vector& data ) = 0; + virtual bool extractFileToMemory( const std::string& path, std::vector& data ) = 0; /** Extract a file to memory from the pack file */ - virtual bool ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) = 0; + virtual bool extractFileToMemory( const std::string& path, SafeDataPointer& data ) = 0; /** Check if a file exists in the pack file and return the number of the file, otherwise return -1. */ - virtual Int32 Exists( const std::string& path ) = 0; + virtual Int32 exists( const std::string& path ) = 0; /** Check the integrity of the pack file. \n If return 0 integrity OK. -1 wrong indentifier. -2 wrong header. */ - virtual Int8 CheckPack() = 0; + virtual Int8 checkPack() = 0; /** @return a vector with all the files inside the pack file */ - virtual std::vector GetFileList() = 0; + virtual std::vector getFileList() = 0; /** @return If the pack file is open */ - virtual bool IsOpen() const; + virtual bool isOpen() const; /** @return The file path of the opened package */ - virtual std::string GetPackPath() = 0; + virtual std::string getPackPath() = 0; protected: bool mIsOpen; }; diff --git a/include/eepp/system/packmanager.hpp b/include/eepp/system/packmanager.hpp index 9ae8bf88a..20231c0ba 100644 --- a/include/eepp/system/packmanager.hpp +++ b/include/eepp/system/packmanager.hpp @@ -19,14 +19,14 @@ class EE_API PackManager : public Container { /** @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. */ - Pack * 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. */ - Pack * 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; + const bool& fallbackToPacks() const; /** @brief Sets if the files that failed to be loaded from the file system should try to be loaded from the currently open packs. ** For example if you try to load a texture from the file system a fails it will search the same path in the opened packs, and load it from there. @@ -34,7 +34,7 @@ class EE_API PackManager : public Container { ** If the file is not in the file system, it will be searched in the opened packs, and loaded if is found. ** In case that the process path is appended to the path... like Sys::GetProcessPath() + "mytexture.png", the process path will be removed from the file path. */ - void FallbackToPacks( const bool& fallback ); + void fallbackToPacks( const bool& fallback ); protected: bool mFallback; diff --git a/include/eepp/system/pak.hpp b/include/eepp/system/pak.hpp index bca9fa1cc..2d0d633b2 100755 --- a/include/eepp/system/pak.hpp +++ b/include/eepp/system/pak.hpp @@ -14,59 +14,59 @@ class EE_API Pak : public Pack { ~Pak(); /** Creates a new pakFile */ - bool Create( const std::string& path ); + bool create( const std::string& path ); /** Open a pakFile */ - bool Open( const std::string& path ); + bool open( const std::string& path ); /** Close the pakFile */ - bool Close(); + bool close(); /** Add a file to the pakFile * @param path Path to the file in the disk * @param inpack Path that will have the file inside the pak * @return True if success */ - bool AddFile( const std::string& path, const std::string& inpack ); + bool addFile( const std::string& path, const std::string& inpack ); /** Add a new file from memory */ - bool AddFile( std::vector& data, const std::string& inpack ); + bool addFile( std::vector& data, const std::string& inpack ); /** Add a new file from memory */ - bool AddFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ); + bool addFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ); /** Add a map of files to the pakFile ( myMap[ myFilepath ] = myInPakFilepath ) */ - bool AddFiles( std::map paths ); + bool addFiles( std::map paths ); /** Erase a file from the pakFile. ( This will create a new pakFile without that file, so, can be slow ) */ - bool EraseFile( const std::string& path ); + bool eraseFile( const std::string& path ); /** Erase all passed files from the pakFile. ( This will create a new pakFile without that file, so, can be slow ) */ - bool EraseFiles( const std::vector& paths ); + bool eraseFiles( const std::vector& paths ); /** Extract a file from the pakFile */ - bool ExtractFile( const std::string& path , const std::string& dest ); + bool extractFile( const std::string& path , const std::string& dest ); /** Extract a file to memory from the pakFile */ - bool ExtractFileToMemory( const std::string& path, std::vector& data ); + bool extractFileToMemory( const std::string& path, std::vector& data ); /** Extract a file to memory from the pakFile */ - bool ExtractFileToMemory( const std::string& path, SafeDataPointer& data ); + bool extractFileToMemory( const std::string& path, SafeDataPointer& data ); /** Check if a file exists in the pakFile and return the number of the file, otherwise return -1. */ - Int32 Exists( const std::string& path ); + Int32 exists( const std::string& path ); /** Check the integrity of the pakFile. \n If return 0 integrity OK. -1 wrong indentifier. -2 wrong header. */ - Int8 CheckPack(); + Int8 checkPack(); /** @return a vector with all the files inside the pakFile */ - std::vector GetFileList(); + std::vector getFileList(); /** @return If the PAK file is open */ - bool IsOpen() const; + bool isOpen() const; /** @return The file path of the opened package */ - std::string GetPackPath(); + std::string getPackPath(); protected: private: diff --git a/include/eepp/system/rc4.hpp b/include/eepp/system/rc4.hpp index b2c2e8b47..48937d7dd 100755 --- a/include/eepp/system/rc4.hpp +++ b/include/eepp/system/rc4.hpp @@ -16,44 +16,44 @@ class EE_API RC4 { ** @param key the key data ** @param size the key size */ - void SetKey( const Uint8 * key, Uint32 size ); + void setKey( const Uint8 * key, Uint32 size ); /** @brief Set the encryption Key. */ - void SetKey( const std::vector& Key ); + void setKey( const std::vector& Key ); /** @brief Set the encryption Key. */ - void SetKey( const std::string& Key ); + void setKey( const std::string& Key ); /** @brief Encrypt the buffer ( you must set the key first ). ** @param data The buffer to encrypt ** @param size The buffer size */ - void EncryptByte( Uint8 * data, Uint32 size ); + void encryptByte( Uint8 * data, Uint32 size ); /** @brief Encrypt a vector of bytes ( you must set the key first ). */ - void EncryptByte( std::vector& buffer ); + void encryptByte( std::vector& buffer ); /** @brief Decrypt a vector of bytes ( you must set the key first ). */ - void DecryptByte( std::vector& buffer ); + void decryptByte( std::vector& buffer ); /** @brief Encrypt a string ( you must set the key first ). */ - void EncryptString( std::string& buffer ); + void encryptString( std::string& buffer ); /** @brief Decrypt a string ( you must set the key first ). */ - void DecryptString( std::string& buffer ); + void decryptString( std::string& buffer ); /** @brief Encrypt a file ( you must set the key first ). */ - bool EncryptFile( const std::string& SourceFile, const std::string& DestFile ); + bool encryptFile( const std::string& SourceFile, const std::string& DestFile ); /** @brief Decrypt a file ( you must set the key first ). */ - bool DecryptFile( const std::string& SourceFile, const std::string& DestFile ); + bool decryptFile( const std::string& SourceFile, const std::string& DestFile ); private: typedef struct _RC4Key { Uint8 state[256]; } RC4Key; RC4Key mKey; - void Swap( Uint8& a, Uint8& b ); + void swap( Uint8& a, Uint8& b ); }; }} diff --git a/include/eepp/system/resourceloader.hpp b/include/eepp/system/resourceloader.hpp index a9b8a3c95..7902c1f3b 100644 --- a/include/eepp/system/resourceloader.hpp +++ b/include/eepp/system/resourceloader.hpp @@ -23,43 +23,43 @@ class EE_API ResourceLoader { ** 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( ObjectLoader * Object ); + void add( ObjectLoader * Object ); /** @brief Starts loading the resources. ** @param Cb A callback that is called when the resources finished loading. */ - void Load( ResLoadCallback Cb ); + void load( ResLoadCallback Cb ); /** @brief Starts loading the resources. */ - void Load(); + void load(); /** @brief Unload all the resources already loaded. */ - void Unload(); + void unload(); /** @brief Update must be called from the thread that started the loading to update the state of the resource loader. */ - virtual void Update(); + virtual void update(); /** @returns If the resources were loaded. */ - virtual bool IsLoaded(); + virtual bool isLoaded(); /** @returns If the resources are still loading. */ - virtual bool IsLoading(); + virtual bool isLoading(); /** @returns If the resource loader is asynchronous */ - bool Threaded() const; + bool threaded() const; /** @brief Sets if the resource loader is asynchronous. ** This must be called before the load starts. */ - void Threaded( const bool& threaded ); + void threaded( const bool& threaded ); /** @brief Clears the resources added to load that werent loaded, and delete the instances of the loaders. ** @param ClearObjectsLoaded Sets if the objects loader that were already loaded must be also deleted ( it will not unload the loaded resources, but the instance of the object loader ). */ - bool Clear( const bool& ClearObjectsLoaded = true ); + bool clear( const bool& ClearObjectsLoaded = true ); /** @return The aproximate percent of progress ( between 0 and 100 ) */ - Float Progress(); + Float progress(); /** @returns The number of resources added to load. */ - Uint32 Count() const; + Uint32 count() const; protected: bool mLoaded; bool mLoading; @@ -70,9 +70,9 @@ class EE_API ResourceLoader { std::list mObjs; std::list mObjsLoaded; - void SetThreads(); + void setThreads(); - virtual void SetLoaded(); + virtual void setLoaded(); }; }} diff --git a/include/eepp/system/resourcemanager.hpp b/include/eepp/system/resourcemanager.hpp index 007db95b9..b563e0fb8 100644 --- a/include/eepp/system/resourcemanager.hpp +++ b/include/eepp/system/resourcemanager.hpp @@ -19,53 +19,53 @@ class ResourceManager { /** @brief Add the resource to the resource manager ** @param Resource The resource to be managed by the manager */ - virtual T * Add( T * Resource ); + virtual T * add( T * Resource ); /** @brief Removes the resource from the manager ** @param Resource The resource to remove ** @param Delete Indicates if the resource must be destroyed after being removed from the manager */ - bool Remove( T * Resource, bool Delete = true ); + bool remove( T * Resource, bool Delete = true ); /** @brief Removes the resource by its id ** @see Remove */ - bool RemoveById( const Uint32& Id, bool Delete = true ); + bool removeById( const Uint32& Id, bool Delete = true ); /** @brief Removes the resource by its name ** @see Remove */ - bool RemoveByName( const std::string& Name, bool Delete = true ); + bool removeByName( const std::string& Name, bool Delete = true ); /** @returns A resource by its name. If not found returns NULL. */ - T * GetByName( const std::string& Name ); + T * getByName( const std::string& Name ); /** @returns A resource by its id. If not found returns NULL. */ - T * GetById( const Uint32& Id ); + T * getById( const Uint32& Id ); /** @returns The number of resources added */ - Uint32 Count(); + Uint32 count(); /** @returns The number of resources that where added with the indicated name. */ - Uint32 Count( const std::string& Name ); + Uint32 count( const std::string& Name ); /** @returns The number of resources that where added with the indicated id. */ - Uint32 Count( const Uint32& Id ); + Uint32 count( const Uint32& Id ); /** @returns If the resource name exists in the resources list. */ - bool Exists( const std::string& Name ); + bool exists( const std::string& Name ); /** @returns If the resource id exists in the resources list. */ - bool ExistsId( const Uint32& Id ); + bool existsId( const Uint32& Id ); /** @brief Destroy all the resources added ( delete the instances of the resources ) */ - void Destroy(); + void destroy(); /** @brief Prints all the resources names added to the manager. */ - void PrintNames(); + void printNames(); /** @returns A reference to the resources list of the manager. */ - std::list& GetResources(); + std::list& getResources(); /** @brief Indicates if the resource manager is destroy the resources. */ - const bool& IsDestroying() const; + const bool& isDestroying() const; protected: std::list mResources; bool mUniqueId; @@ -80,17 +80,17 @@ ResourceManager::ResourceManager( bool UniqueId ) : } template -const bool& ResourceManager::IsDestroying() const { +const bool& ResourceManager::isDestroying() const { return mIsDestroying; } template ResourceManager::~ResourceManager() { - Destroy(); + destroy(); } template -void ResourceManager::Destroy() { +void ResourceManager::destroy() { typename std::list::iterator it; mIsDestroying = true; @@ -105,15 +105,15 @@ void ResourceManager::Destroy() { } template -std::list& ResourceManager::GetResources() { +std::list& ResourceManager::getResources() { return mResources; } template -T * ResourceManager::Add( T * Resource ) { +T * ResourceManager::add( T * Resource ) { if ( NULL != Resource ) { if ( mUniqueId ) { - Uint32 c = Count( Resource->Id() ); + Uint32 c = count( Resource->Id() ); if ( 0 == c ) { mResources.push_back( Resource ); @@ -122,12 +122,12 @@ T * ResourceManager::Add( T * Resource ) { } else { std::string RealName( Resource->Name() ); - while ( Count( Resource->Id() ) ) { + while ( count( Resource->Id() ) ) { c++; - Resource->Name( RealName + String::ToStr( c ) ); + Resource->Name( RealName + String::toStr( c ) ); } - return Add( Resource ); + return add( Resource ); } } else { mResources.push_back( Resource ); @@ -140,7 +140,7 @@ T * ResourceManager::Add( T * Resource ) { } template -bool ResourceManager::Remove( T * Resource, bool Delete ) { +bool ResourceManager::remove( T * Resource, bool Delete ) { if ( NULL != Resource ) { mResources.remove( Resource ); @@ -154,22 +154,22 @@ bool ResourceManager::Remove( T * Resource, bool Delete ) { } template -bool ResourceManager::RemoveById( const Uint32& Id, bool Delete ) { - return Remove( GetById( Id ), Delete ); +bool ResourceManager::removeById( const Uint32& Id, bool Delete ) { + return remove( getById( Id ), Delete ); } template -bool ResourceManager::RemoveByName( const std::string& Name, bool Delete ) { - return Remove( GetByName( Name ), Delete ); +bool ResourceManager::removeByName( const std::string& Name, bool Delete ) { + return remove( getByName( Name ), Delete ); } template -bool ResourceManager::Exists( const std::string& Name ) { - return ExistsId( String::Hash( Name ) ); +bool ResourceManager::exists( const std::string& Name ) { + return existsId( String::hash( Name ) ); } template -bool ResourceManager::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 ResourceManager::ExistsId( const Uint32& Id ) { } template -T * ResourceManager::GetByName( const std::string& Name ) { - return GetById( String::Hash( Name ) ); +T * ResourceManager::getByName( const std::string& Name ) { + return getById( String::hash( Name ) ); } template -T * ResourceManager::GetById( const Uint32& id ) { +T * ResourceManager::getById( const Uint32& id ) { typename std::list::reverse_iterator it; T * sp = NULL; @@ -201,7 +201,7 @@ T * ResourceManager::GetById( const Uint32& id ) { } template -void ResourceManager::PrintNames() { +void ResourceManager::printNames() { typename std::list::reverse_iterator it; T * sp = NULL; @@ -214,12 +214,12 @@ void ResourceManager::PrintNames() { } template -Uint32 ResourceManager::Count() { +Uint32 ResourceManager::count() { return (Uint32)mResources.size(); } template -Uint32 ResourceManager::Count( const Uint32& Id ) { +Uint32 ResourceManager::count( const Uint32& Id ) { typename std::list::iterator it; Uint32 Count = 0; @@ -231,8 +231,8 @@ Uint32 ResourceManager::Count( const Uint32& Id ) { } template -Uint32 ResourceManager::Count( const std::string& Name ) { - return Count( String::Hash( Name ) ); +Uint32 ResourceManager::count( const std::string& Name ) { + return count( String::hash( Name ) ); } }} diff --git a/include/eepp/system/singleton.hpp b/include/eepp/system/singleton.hpp index 0fdca6c8d..14c11bd91 100755 --- a/include/eepp/system/singleton.hpp +++ b/include/eepp/system/singleton.hpp @@ -8,19 +8,19 @@ #define SINGLETON_DECLARE_HEADERS( T ) \ public: \ \ - static T * CreateSingleton(); \ + static T * createSingleton(); \ \ - static T * ExistsSingleton(); \ + static T * existsSingleton(); \ \ static T * instance(); \ \ - static void DestroySingleton(); + static void destroySingleton(); #define SINGLETON_DECLARE_IMPLEMENTATION( T ) \ \ static T* ms_singleton = NULL; \ \ -T* T::CreateSingleton() { \ +T* T::createSingleton() { \ if ( NULL == ms_singleton ) { \ ms_singleton = eeNew( T, () ); \ } \ @@ -28,15 +28,15 @@ T* T::CreateSingleton() { \ return ms_singleton; \ } \ \ -T * T::ExistsSingleton() { \ +T * T::existsSingleton() { \ return ms_singleton; \ } \ \ T * T::instance() { \ - return CreateSingleton(); \ + return createSingleton(); \ } \ \ -void T::DestroySingleton() { \ +void T::destroySingleton() { \ eeSAFE_DELETE(ms_singleton) ; \ } @@ -50,7 +50,7 @@ class Singleton { public: /** Get the singleton pointer */ - static T* CreateSingleton() { + static T* createSingleton() { if ( NULL == ms_singleton ) { ms_singleton = eeNew( T, () ); } @@ -59,17 +59,17 @@ class Singleton { } /** Get the singleton pointer (without instance verification) */ - static T* ExistsSingleton() { + static T* existsSingleton() { return ms_singleton; } /** Get the singleton pointer */ static T* instance() { - return CreateSingleton(); + return createSingleton(); } /** Destroy the singleton instance */ - static void DestroySingleton() { + static void destroySingleton() { eeSAFE_DELETE(ms_singleton); } }; diff --git a/include/eepp/system/sys.hpp b/include/eepp/system/sys.hpp index 0ad8f512d..a5e436b61 100644 --- a/include/eepp/system/sys.hpp +++ b/include/eepp/system/sys.hpp @@ -9,57 +9,57 @@ namespace EE { namespace System { class EE_API Sys { public: /** Returns the current date time */ - static std::string GetDateTimeStr(); + static std::string getDateTimeStr(); /** @return A storage path for config files for every platform */ - static std::string GetConfigPath( std::string appname ); + static std::string getConfigPath( std::string appname ); /** @return The path of the directory designated for temporary files. */ - static std::string GetTempPath(); + static std::string getTempPath(); /** @return The number of milliseconds since the first call. Note that this value wraps if the program runs for more than ~49 days. */ - static Uint32 GetTicks(); + static Uint32 getTicks(); /** Wait a specified number of milliseconds before returning. */ - static void Sleep( const Uint32& ms ); + static void sleep( const Uint32& ms ); /** Wait the time defined before returning. */ - static void Sleep( const Time& time ); + static void sleep( const Time& time ); /** @return The application path ( the executable path ) */ - static std::string GetProcessPath(); + static std::string getProcessPath(); /** @return The System Time */ - static double GetSystemTime(); + static double getSystemTime(); /** @return The OS Name * @param showReleaseName Instead of returning only the OS Name, it will append the release name or number. For Windows instead of "Windows" it will be "Windows 7", for "Linux" it will be "Linux 3.15" and so on. */ - static std::string GetOSName( bool showReleaseName = false ); + static std::string getOSName( bool showReleaseName = false ); /** @return The OS Architecture */ - static std::string GetOSArchitecture(); + static std::string getOSArchitecture(); /** @return The Number of CPUs of the system. */ - static int GetCPUCount(); + static int getCPUCount(); /** @return Returns free disk space for a given path in bytes */ - static Int64 GetDiskFreeSpace(const std::string& path); + static Int64 getDiskFreeSpace(const std::string& path); /** Dynamically load a shared object and return a pointer to the object handle. ** @param sofile a system dependent name of the object file ** @return The pointer to the object handle or NULL if there was an error */ - static void * LoadObject( const std::string& sofile ); + static void * loadObject( const std::string& sofile ); /** Unloads a shared object from memory. ** @param The object handle of the shared object to unload */ - static void UnloadObject( void * handle ); + static void unloadObject( void * handle ); /** Looks up the address of the named function in the shared object and return it. ** @param handle A valid shared object handle returned by Sys::LoadObject() ** @param name The name of the function to look up ** @return The pointer to the function or NULL if there was an error */ - static void * LoadFunction( void * handle, const std::string& name ); + static void * loadFunction( void * handle, const std::string& name ); }; }} diff --git a/include/eepp/system/thread.hpp b/include/eepp/system/thread.hpp index 417be72e1..d8f1d92ff 100755 --- a/include/eepp/system/thread.hpp +++ b/include/eepp/system/thread.hpp @@ -15,7 +15,7 @@ class EE_API Thread : NonCopyable { typedef void (*FuncType)(void*); /** @return The current thread id */ - static Uint32 GetCurrentThreadId(); + static Uint32 getCurrentThreadId(); /** @brief Construct the thread from a functor with no argument ** This constructor works for function objects, as well @@ -86,7 +86,7 @@ class EE_API Thread : NonCopyable { ** thread's constructor, and returns immediately. ** After this function returns, the thread's function is ** running in parallel to the calling code. */ - virtual void Launch(); + virtual void launch(); /** @brief Wait until the thread finishes. ** This function will block the execution until the @@ -95,7 +95,7 @@ class EE_API Thread : NonCopyable { ** thread will block forever. ** If this function is called from its owner thread, it ** returns without doing anything. */ - void Wait(); + void wait(); /** @brief Terminate the thread ** This function immediately stops the thread, without waiting @@ -104,7 +104,7 @@ class EE_API Thread : NonCopyable { ** and can lead to local variables not being destroyed ** on some operating systems. You should rather try to make ** the thread function terminate by itself. */ - void Terminate(); + void terminate(); /** @return The id of the thread */ Uint32 Id(); @@ -114,7 +114,7 @@ class EE_API Thread : NonCopyable { friend class Platform::ThreadImpl; /** The virtual function to run in the thread */ - virtual void Run(); + virtual void run(); Platform::ThreadImpl * mThreadImpl; ///< OS-specific implementation of the thread Private::ThreadFunc * mEntryPoint; ///< Abstraction of the function to run diff --git a/include/eepp/system/threadlocal.hpp b/include/eepp/system/threadlocal.hpp index 6b3c9be44..d6237a91f 100644 --- a/include/eepp/system/threadlocal.hpp +++ b/include/eepp/system/threadlocal.hpp @@ -21,11 +21,11 @@ class EE_API ThreadLocal : NonCopyable { /** @brief Set the thread-specific value of the variable ** @param value Value of the variable for the current thread */ - void Value(void* value); + void value(void* value); /** @brief Retrieve the thread-specific value of the variable ** @return Value of the variable for the current thread */ - void* Value() const; + void* value() const; private : Private::ThreadLocalImpl* mImpl; ///< Pointer to the OS specific implementation }; diff --git a/include/eepp/system/threadlocalptr.hpp b/include/eepp/system/threadlocalptr.hpp index 585a88818..179ded309 100644 --- a/include/eepp/system/threadlocalptr.hpp +++ b/include/eepp/system/threadlocalptr.hpp @@ -49,28 +49,28 @@ ThreadLocalPtr::ThreadLocalPtr(T* value) : template T& ThreadLocalPtr::operator *() const { - return *static_cast(Value()); + return *static_cast(value()); } template T* ThreadLocalPtr::operator ->() const { - return static_cast(Value()); + return static_cast(value()); } template ThreadLocalPtr::operator T*() const { - return static_cast(Value()); + return static_cast(value()); } template -ThreadLocalPtr& ThreadLocalPtr::operator =(T* value) { - Value(value); +ThreadLocalPtr& ThreadLocalPtr::operator =(T* val) { + value(val); return *this; } template ThreadLocalPtr& ThreadLocalPtr::operator =(const ThreadLocalPtr& right) { - Value(right.Value()); + value(right.value()); return *this; } diff --git a/include/eepp/system/time.hpp b/include/eepp/system/time.hpp index 89bb9a18a..feded1c23 100644 --- a/include/eepp/system/time.hpp +++ b/include/eepp/system/time.hpp @@ -18,17 +18,17 @@ class EE_API Time /** @brief Return the time value as a number of seconds ** @return Time in seconds ** @see AsMilliseconds, AsMicroseconds */ - double AsSeconds() const; + double asSeconds() const; /** @brief Return the time value as a number of milliseconds ** @return Time in milliseconds ** @see AsSeconds, AsMicroseconds */ - double AsMilliseconds() const; + double asMilliseconds() const; /** @brief Return the time value as a number of microseconds ** @return Time in microseconds ** @see asSeconds, asMilliseconds */ - Int64 AsMicroseconds() const; + Int64 asMicroseconds() const; static const Time Zero; ///< Predefined "zero" time value private : diff --git a/include/eepp/system/zip.hpp b/include/eepp/system/zip.hpp index 398a03d5f..eba3f9c3f 100644 --- a/include/eepp/system/zip.hpp +++ b/include/eepp/system/zip.hpp @@ -16,56 +16,56 @@ class EE_API Zip : public Pack { ~Zip(); /** Creates a new pack file */ - bool Create( const std::string& path ); + bool create( const std::string& path ); /** Open a pack file */ - bool Open( const std::string& path ); + bool open( const std::string& path ); /** Close the pack file */ - bool Close(); + bool close(); /** Add a file to the pack file * @param path Path to the file in the disk * @param inpack Path that will have the file inside the pak * @return True if success */ - bool AddFile( const std::string& path, const std::string& inpack ); + bool addFile( const std::string& path, const std::string& inpack ); /** Add a new file from memory */ - bool AddFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ); + bool addFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ); /** Add a map of files to the pack file ( myMap[ myFilepath ] = myInPackFilepath ) */ - bool AddFiles( std::map paths ); + bool addFiles( std::map paths ); /** Erase a file from the pack file. ( This will create a new pack file without that file, so, can be slow ) */ - bool EraseFile( const std::string& path ); + bool eraseFile( const std::string& path ); /** Erase all passed files from the pack file. ( This will create a new pack file without that file, so, can be slow ) */ - bool EraseFiles( const std::vector& paths ); + bool eraseFiles( const std::vector& paths ); /** Extract a file from the pack file */ - bool ExtractFile( const std::string& path , const std::string& dest ); + bool extractFile( const std::string& path , const std::string& dest ); /** Extract a file to memory from the pack file */ - bool ExtractFileToMemory( const std::string& path, std::vector& data ); + bool extractFileToMemory( const std::string& path, std::vector& data ); /** Extract a file to memory from the pakFile */ - bool ExtractFileToMemory( const std::string& path, SafeDataPointer& data ); + bool extractFileToMemory( const std::string& path, SafeDataPointer& data ); /** Check if a file exists in the pack file and return the number of the file, otherwise return -1. */ - Int32 Exists( const std::string& path ); + Int32 exists( const std::string& path ); /** Check the integrity of the pack file. \n If return 0 integrity OK. -1 wrong indentifier. -2 wrong header. */ - Int8 CheckPack(); + Int8 checkPack(); /** @return a vector with all the files inside the pack file */ - std::vector GetFileList(); + std::vector getFileList(); /** Add a new file from memory */ - bool AddFile( std::vector& data, const std::string& inpack ); + bool addFile( std::vector& data, const std::string& inpack ); /** @return The file path of the opened package */ - std::string GetPackPath(); + std::string getPackPath(); protected: struct zip * mZip; diff --git a/include/eepp/ui/uicommondialog.hpp b/include/eepp/ui/uicommondialog.hpp index 1f25035f4..76504a6cf 100644 --- a/include/eepp/ui/uicommondialog.hpp +++ b/include/eepp/ui/uicommondialog.hpp @@ -17,7 +17,7 @@ class EE_API UICommonDialog : public UIWindow { public: inline CreateParams() : UIWindow::CreateParams(), - DefaultDirectory( Sys::GetProcessPath() ), + DefaultDirectory( Sys::getProcessPath() ), DefaultFilePattern( "*" ), CDLFlags( UI_CDL_DEFAULT_FLAGS ) { diff --git a/include/eepp/ui/uidefaulttheme.hpp b/include/eepp/ui/uidefaulttheme.hpp index 94bb1380b..92e16e3b8 100644 --- a/include/eepp/ui/uidefaulttheme.hpp +++ b/include/eepp/ui/uidefaulttheme.hpp @@ -17,7 +17,7 @@ class EE_API UIDefaultTheme : public UITheme { virtual UIWindow * CreateWindow( UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS, Sizei MinWindowSize = Sizei(0,0), Uint8 BaseAlpha = 255 ); - virtual UICommonDialog * CreateCommonDialog( UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON, Sizei MinWindowSize = Sizei(0,0), Uint8 BaseAlpha = 255, Uint32 CDLFlags = UI_CDL_DEFAULT_FLAGS, std::string DefaultFilePattern = "*", std::string DefaultDirectory = Sys::GetProcessPath() ); + virtual UICommonDialog * CreateCommonDialog( UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON, Sizei MinWindowSize = Sizei(0,0), Uint8 BaseAlpha = 255, Uint32 CDLFlags = UI_CDL_DEFAULT_FLAGS, std::string DefaultFilePattern = "*", std::string DefaultDirectory = Sys::getProcessPath() ); virtual UIComboBox * CreateComboBox( UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, Uint32 MinNumVisibleItems = 6, bool PopUpToMainControl = false, UIListBox * ListBox = NULL ); diff --git a/include/eepp/ui/uitheme.hpp b/include/eepp/ui/uitheme.hpp index f111a503c..16147446d 100644 --- a/include/eepp/ui/uitheme.hpp +++ b/include/eepp/ui/uitheme.hpp @@ -43,10 +43,10 @@ class UITabWidget; class EE_API UITheme : protected ResourceManager { public: - using ResourceManager::GetById; - using ResourceManager::GetByName; - using ResourceManager::Exists; - using ResourceManager::ExistsId; + using ResourceManager::getById; + using ResourceManager::getByName; + using ResourceManager::exists; + using ResourceManager::existsId; static UITheme * LoadFromTextureAtlas( UITheme * tTheme, Graphics::TextureAtlas * TextureAtlas ); @@ -72,7 +72,7 @@ class EE_API UITheme : protected ResourceManager { const std::string& Abbr() const; - virtual UISkin * Add( UISkin * Resource ); + virtual UISkin * add( UISkin * Resource ); void Font( Graphics::Font * Font ); @@ -146,7 +146,7 @@ class EE_API UITheme : protected ResourceManager { virtual UIWindow * CreateWindow( UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS, Sizei MinWindowSize = Sizei(0,0), Uint8 BaseAlpha = 255 ); - virtual UICommonDialog * CreateCommonDialog( UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON, Sizei MinWindowSize = Sizei(0,0), Uint8 BaseAlpha = 255, Uint32 CDLFlags = UI_CDL_DEFAULT_FLAGS, std::string DefaultFilePattern = "*", std::string DefaultDirectory = Sys::GetProcessPath() ); + virtual UICommonDialog * CreateCommonDialog( UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON, Sizei MinWindowSize = Sizei(0,0), Uint8 BaseAlpha = 255, Uint32 CDLFlags = UI_CDL_DEFAULT_FLAGS, std::string DefaultFilePattern = "*", std::string DefaultDirectory = Sys::getProcessPath() ); virtual UIMessageBox * CreateMessageBox( UI_MSGBOX_TYPE Type = MSGBOX_OKCANCEL, const String& Message = String(), Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED, Sizei MinWindowSize = Sizei(0,0), Uint8 BaseAlpha = 255 ); diff --git a/include/eepp/version.hpp b/include/eepp/version.hpp index b52719ad5..f8ef418a4 100644 --- a/include/eepp/version.hpp +++ b/include/eepp/version.hpp @@ -32,19 +32,19 @@ class EE_API Version { Uint8 patch; /**< update version */ /** @return The linked version of the library */ - static Version GetVersion(); + static Version getVersion(); /** @return The linked version number of the library */ - static Uint32 GetVersionNum(); + static Uint32 getVersionNum(); /** @return The library version name: "eepp version major.minor.patch" */ - static std::string GetVersionName(); + static std::string getVersionName(); /** @return The version codename */ - static std::string GetCodename(); + static std::string getCodename(); /** @return The build time of the library */ - static std::string GetBuildTime(); + static std::string getBuildTime(); }; } diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index cc4649fa4..c48dde6de 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -61,7 +61,7 @@ Desktop Desktop {388e5431-b31b-42b3-b9ad-9002d279d75d} - 0 + 12 0 0 diff --git a/projects/linux/ee.files b/projects/linux/ee.files index a886e5741..34ba41313 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -682,3 +682,5 @@ ../../src/eepp/system/base64.cpp ../../include/eepp/system/md5.hpp ../../src/eepp/system/md5.cpp +../../src/examples/strobe/strobe.cpp +../../../eeiv/src/capp.hpp diff --git a/projects/linux/ee.includes b/projects/linux/ee.includes index eb8e42b7d..75bde3e90 100644 --- a/projects/linux/ee.includes +++ b/projects/linux/ee.includes @@ -1,2 +1,4 @@ ../../src/ ../../include/ +../../src/examples/strobe +../../../eeiv/src diff --git a/src/eepp/audio/music.cpp b/src/eepp/audio/music.cpp index 10c466f96..068a0c7e7 100755 --- a/src/eepp/audio/music.cpp +++ b/src/eepp/audio/music.cpp @@ -17,18 +17,18 @@ Music::~Music() { } bool Music::OpenFromPack( Pack* Pack, const std::string& FilePackPath ) { - if ( Pack->IsOpen() && Pack->ExtractFileToMemory( FilePackPath, mData ) ) + if ( Pack->isOpen() && Pack->extractFileToMemory( FilePackPath, mData ) ) return OpenFromMemory( reinterpret_cast ( mData.Data ), mData.DataSize ); return false; } bool Music::OpenFromFile( const std::string& Filename ) { - if ( !FileSystem::FileExists( Filename ) ) { - if ( PackManager::instance()->FallbackToPacks() ) { + if ( !FileSystem::fileExists( Filename ) ) { + if ( PackManager::instance()->fallbackToPacks() ) { std::string tPath( Filename ); - Pack * tPack = PackManager::instance()->Exists( tPath ); + Pack * tPack = PackManager::instance()->exists( tPath ); if ( NULL != tPack ) { return OpenFromPack( tPack, tPath ); diff --git a/src/eepp/audio/sound.cpp b/src/eepp/audio/sound.cpp index a8706303d..6c564f78e 100755 --- a/src/eepp/audio/sound.cpp +++ b/src/eepp/audio/sound.cpp @@ -176,7 +176,7 @@ Time Sound::PlayingOffset() const { } void Sound::PlayingOffset( const Time &TimeOffset ) { - ALCheck( alSourcef( mSource, AL_SEC_OFFSET, TimeOffset.AsSeconds() ) ); + ALCheck( alSourcef( mSource, AL_SEC_OFFSET, TimeOffset.asSeconds() ) ); } Sound& Sound::operator =( const Sound& Other ) { diff --git a/src/eepp/audio/soundbuffer.cpp b/src/eepp/audio/soundbuffer.cpp index 8e4672b44..ece09b255 100755 --- a/src/eepp/audio/soundbuffer.cpp +++ b/src/eepp/audio/soundbuffer.cpp @@ -38,11 +38,11 @@ SoundBuffer::~SoundBuffer() { } bool SoundBuffer::LoadFromFile(const std::string& Filename) { - if ( !FileSystem::FileExists( Filename ) ) { - if ( PackManager::instance()->FallbackToPacks() ) { + if ( !FileSystem::fileExists( Filename ) ) { + if ( PackManager::instance()->fallbackToPacks() ) { std::string tPath( Filename ); - Pack * tPack = PackManager::instance()->Exists( tPath ); + Pack * tPack = PackManager::instance()->exists( tPath ); if ( NULL != tPack ) { return LoadFromPack( tPack, tPath ); @@ -91,7 +91,7 @@ bool SoundBuffer::LoadFromPack( Pack* Pack, const std::string& FilePackPath ) { bool Ret = false; SafeDataPointer PData; - if ( Pack->IsOpen() && Pack->ExtractFileToMemory( FilePackPath, PData ) ) + if ( Pack->isOpen() && Pack->extractFileToMemory( FilePackPath, PData ) ) Ret = LoadFromMemory( reinterpret_cast ( PData.Data ), PData.DataSize ); return Ret; @@ -149,7 +149,7 @@ bool SoundBuffer::LoadFromSamples( const Int16 * Samples, std::size_t SamplesCou bool SoundBuffer::SaveToFile(const std::string& Filename) const { // Create the sound file in write mode - std::auto_ptr File( SoundFile::CreateWrite( Filename, GetChannelCount(), GetSampleRate() ) ); + std::unique_ptr File( SoundFile::CreateWrite( Filename, GetChannelCount(), GetSampleRate() ) ); if ( File.get() ) { // Write the samples to the opened file diff --git a/src/eepp/audio/soundfileogg.cpp b/src/eepp/audio/soundfileogg.cpp index 1e3241f06..a492499b8 100755 --- a/src/eepp/audio/soundfileogg.cpp +++ b/src/eepp/audio/soundfileogg.cpp @@ -103,7 +103,7 @@ std::size_t SoundFileOgg::Read( Int16 * Data, std::size_t SamplesCount ) { void SoundFileOgg::Seek( Time timeOffset ) { if ( NULL != mStream ) { - Uint32 frameOffset = static_cast( timeOffset.AsSeconds() * mSampleRate / 1000 ); + Uint32 frameOffset = static_cast( timeOffset.asSeconds() * mSampleRate / 1000 ); stb_vorbis_seek( mStream, frameOffset ); } } diff --git a/src/eepp/audio/soundstream.cpp b/src/eepp/audio/soundstream.cpp index 0f0b87b91..04f5cf085 100755 --- a/src/eepp/audio/soundstream.cpp +++ b/src/eepp/audio/soundstream.cpp @@ -49,7 +49,7 @@ void SoundStream::Play() { mSamplesProcessed = 0; mIsStreaming = true; // Start updating the stream in a separate thread to avoid blocking the application - Launch(); + launch(); } void SoundStream::Pause() { @@ -58,7 +58,7 @@ void SoundStream::Pause() { void SoundStream::Stop() { mIsStreaming = false; // Wait for the thread to terminate - Wait(); + wait(); } unsigned int SoundStream::GetChannelCount() const { @@ -100,11 +100,11 @@ void SoundStream::PlayingOffset( const Time &timeOffset ) { OnSeek( timeOffset ); // Restart streaming - mSamplesProcessed = static_cast( timeOffset.AsSeconds() ) * mSampleRate * mChannelCount; + mSamplesProcessed = static_cast( timeOffset.asSeconds() ) * mSampleRate * mChannelCount; mIsStreaming = true; - Launch(); + launch(); // Recover old status if ( oldStatus == Stopped ) { @@ -122,7 +122,7 @@ bool SoundStream::Loop() const { return mLoop; } -void SoundStream::Run() { +void SoundStream::run() { ALCheck( alGenBuffers( BuffersCount, mBuffers ) ); for ( int i = 0; i < BuffersCount; ++i ) @@ -184,7 +184,7 @@ void SoundStream::Run() { // Leave some time for the other threads if the stream is still playing if ( Sound::GetState() != Sound::Stopped ) - Sys::Sleep(10); + Sys::sleep(10); } // Stop the playback diff --git a/src/eepp/core/debug.cpp b/src/eepp/core/debug.cpp index eca679944..52febfc70 100644 --- a/src/eepp/core/debug.cpp +++ b/src/eepp/core/debug.cpp @@ -29,9 +29,9 @@ void eeREPORT_ASSERT( const char * File, int Line, const char * Exp ) { #else if ( PrintDebugInLog ) { - Log::instance()->Writef( "ASSERT: %s file:%s line:%d", Exp, File, Line ); + Log::instance()->writef( "ASSERT: %s file:%s line:%d", Exp, File, Line ); - if ( !Log::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 && Log::instance()->ConsoleOutput() ) { - Log::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 ) - Log::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 2f4b43d65..ca710cfae 100644 --- a/src/eepp/core/memorymanager.cpp +++ b/src/eepp/core/memorymanager.cpp @@ -24,17 +24,17 @@ AllocatedPointer::AllocatedPointer( void * Data, const std::string& File, int Li mMemory = Memory; } -void * MemoryManager::AddPointerInPlace( void * Place, const AllocatedPointer& aAllocatedPointer ) { +void * MemoryManager::addPointerInPlace( void * Place, const AllocatedPointer& aAllocatedPointer ) { AllocatedPointerMapIt it = sMapPointers.find( Place ); if ( it != sMapPointers.end() ) { - RemovePointer( Place ); + removePointer( Place ); } - return AddPointer( aAllocatedPointer ); + return addPointer( aAllocatedPointer ); } -void * MemoryManager::AddPointer( const AllocatedPointer& aAllocatedPointer ) { +void * MemoryManager::addPointer( const AllocatedPointer& aAllocatedPointer ) { Lock l( sAlloMutex ); sMapPointers.insert( AllocatedPointerMap::value_type( aAllocatedPointer.mData, aAllocatedPointer ) ); @@ -52,7 +52,7 @@ void * MemoryManager::AddPointer( const AllocatedPointer& aAllocatedPointer ) { return aAllocatedPointer.mData; } -bool MemoryManager::RemovePointer( void * Data ) { +bool MemoryManager::removePointer( void * Data ) { Lock l( sAlloMutex ); AllocatedPointerMapIt it = sMapPointers.find( Data ); @@ -70,23 +70,23 @@ bool MemoryManager::RemovePointer( void * Data ) { return true; } -size_t MemoryManager::GetPeakMemoryUsage() { +size_t MemoryManager::getPeakMemoryUsage() { return sPeakMemoryUsage; } -size_t MemoryManager::GetTotalMemoryUsage() { +size_t MemoryManager::getTotalMemoryUsage() { return sTotalMemoryUsage; } -const AllocatedPointer& MemoryManager::GetBiggestAllocation() { +const AllocatedPointer& MemoryManager::getBiggestAllocation() { return sBiggestAllocation; } -void MemoryManager::ShowResults() { +void MemoryManager::showResults() { #ifdef EE_MEMORY_MANAGER if ( EE::PrintDebugInLog ) { - Log::DestroySingleton(); + Log::destroySingleton(); EE::PrintDebugInLog = false; } @@ -135,10 +135,10 @@ void MemoryManager::ShowResults() { } eePRINTL( "|" ); - eePRINTL( "| Memory left: %s", FileSystem::SizeToString( static_cast( sTotalMemoryUsage ) ).c_str() ); + eePRINTL( "| Memory left: %s", FileSystem::sizeToString( static_cast( sTotalMemoryUsage ) ).c_str() ); eePRINTL( "| Biggest allocation:" ); - eePRINTL( "| %s in file: %s at line: %d", FileSystem::SizeToString( sBiggestAllocation.mMemory ).c_str(), sBiggestAllocation.mFile.c_str(), sBiggestAllocation.mLine ); - eePRINTL( "| Peak Memory Usage: %s", FileSystem::SizeToString( sPeakMemoryUsage ).c_str() ); + eePRINTL( "| %s in file: %s at line: %d", FileSystem::sizeToString( sBiggestAllocation.mMemory ).c_str(), sBiggestAllocation.mFile.c_str(), sBiggestAllocation.mLine ); + eePRINTL( "| Peak Memory Usage: %s", FileSystem::sizeToString( sPeakMemoryUsage ).c_str() ); eePRINTL( "|------------------------------------------------------------|\n" ); #endif diff --git a/src/eepp/core/string.cpp b/src/eepp/core/string.cpp index a66ba2dbd..c7667c308 100644 --- a/src/eepp/core/string.cpp +++ b/src/eepp/core/string.cpp @@ -9,7 +9,7 @@ namespace EE { const std::size_t String::InvalidPos = StringType::npos; -Uint32 String::Hash( const Uint8 * str ) { +Uint32 String::hash( const Uint8 * str ) { //! djb2 if ( NULL != str ) { Uint32 hash = 5381; @@ -24,34 +24,34 @@ Uint32 String::Hash( const Uint8 * str ) { return 0; } -Uint32 String::Hash( const char * str ) { - return String::Hash( reinterpret_cast( str ) ); +Uint32 String::hash( const char * str ) { + return String::hash( reinterpret_cast( str ) ); } -Uint32 String::Hash( const std::string& str ) { - return String::Hash( reinterpret_cast( &str[0] ) ); +Uint32 String::hash( const std::string& str ) { + return String::hash( reinterpret_cast( &str[0] ) ); } -Uint32 String::Hash( const String& str ) { - return String::Hash( reinterpret_cast( &(str.mString[0]) ) ); +Uint32 String::hash( const String& str ) { + return String::hash( reinterpret_cast( &(str.mString[0]) ) ); } -bool String::IsCharacter( const int& mValue ) { +bool String::isCharacter( const int& mValue ) { return (mValue >= 32 && mValue <= 126) || (mValue >= 161 && mValue <= 255) || (mValue == 9); } -bool String::IsNumber( const int& mValue, bool AllowDot ) { +bool String::isNumber( const int& mValue, bool AllowDot ) { if ( AllowDot ) return ( mValue >= 48 && mValue <= 57 ) || mValue == 46; return mValue >= 48 && mValue <= 57; } -bool String::IsLetter( const int& mValue ) { +bool String::isLetter( const int& mValue ) { return ( ( (mValue >= 65 && mValue <= 90) || (mValue >= 97 && mValue <= 122) || (mValue >= 192 && mValue <= 255) ) && (mValue != 215) && (mValue != 247) ); } -std::vector < String > String::Split ( const String& str, const Uint32& splitchar, const bool& pushEmptyString ) { +std::vector < String > String::split ( const String& str, const Uint32& splitchar, const bool& pushEmptyString ) { std::vector < String > tmp; String tmpstr; @@ -72,7 +72,7 @@ std::vector < String > String::Split ( const String& str, const Uint32& splitcha return tmp; } -std::vector < std::string > String::Split ( const std::string& str, const Int8& splitchar, const bool& pushEmptyString ) { +std::vector < std::string > String::split ( const std::string& str, const Int8& splitchar, const bool& pushEmptyString ) { std::vector < std::string > tmp; std::string tmpstr; @@ -93,49 +93,49 @@ std::vector < std::string > String::Split ( const std::string& str, const Int8& return tmp; } -std::string String::LTrim(const std::string & str , char character) { +std::string String::lTrim(const std::string & str , char character) { std::string::size_type pos1 = str.find_first_not_of(character); return ( pos1 == std::string::npos ) ? str : str.substr( pos1 ); } -std::string String::Trim(const std::string & str , char character) { +std::string String::trim(const std::string & str , char character) { std::string::size_type pos1 = str.find_first_not_of(character); std::string::size_type pos2 = str.find_last_not_of(character); return str.substr(pos1 == std::string::npos ? 0 : pos1, pos2 == std::string::npos ? str.length() - 1 : pos2 - pos1 + 1); } -String String::LTrim(const String & str , char character) { +String String::lTrim(const String & str , char character) { StringType::size_type pos1 = str.find_first_not_of(character); return ( pos1 == String::InvalidPos ) ? str : str.substr( pos1 ); } -String String::Trim(const String & str , char character) { +String String::trim(const String & str , char character) { StringType::size_type pos1 = str.find_first_not_of(character); StringType::size_type pos2 = str.find_last_not_of(character); return str.substr(pos1 == String::InvalidPos ? 0 : pos1, pos2 == String::InvalidPos ? str.length() - 1 : pos2 - pos1 + 1); } -void String::ToUpperInPlace( std::string & str ) { +void String::toUpperInPlace( std::string & str ) { std::transform(str.begin(), str.end(), str.begin(), (int(*)(int)) std::toupper); } -std::string String::ToUpper( std::string str ) { +std::string String::toUpper( std::string str ) { for (std::string::iterator i = str.begin(); i != str.end(); ++i) *i = static_cast(std::toupper(*i)); return str; } -void String::ToLowerInPlace( std::string & str ) { +void String::toLowerInPlace( std::string & str ) { std::transform(str.begin(), str.end(), str.begin(), (int(*)(int)) std::tolower); } -std::string String::ToLower( std::string str ) { +std::string String::toLower( std::string str ) { for (std::string::iterator i = str.begin(); i != str.end(); ++i) *i = static_cast(std::tolower(*i)); return str; } -std::vector String::StringToUint8( const std::string& str ) { +std::vector String::stringToUint8( const std::string& str ) { return std::vector( str.begin(), str.end() ); } @@ -143,19 +143,19 @@ std::string String::Uint8ToString( const std::vector& v ) { return std::string( v.begin(), v.end() ); } -void String::StrCopy( char * Dst, const char * Src, unsigned int DstSize ) { +void String::strCopy( char * Dst, const char * Src, unsigned int DstSize ) { strncpy( Dst, Src, DstSize ); } -bool String::StartsWith( const std::string& haystack, const std::string & needle ) { +bool String::startsWith( const std::string& haystack, const std::string & needle ) { return needle.length() <= haystack.length() && std::equal(needle.begin(), needle.end(), haystack.begin() ); } -bool String::StartsWith( const String& haystack, const String & needle ) { +bool String::startsWith( const String& haystack, const String & needle ) { return needle.length() <= haystack.length() && std::equal(needle.begin(), needle.end(), haystack.begin() ); } -void String::ReplaceAll( std::string &target, const std::string& that, const std::string& with ) { +void String::replaceAll( std::string &target, const std::string& that, const std::string& with ) { std::string::size_type pos=0; while( ( pos = target.find( that, pos ) ) != std::string::npos ) { @@ -165,7 +165,7 @@ void String::ReplaceAll( std::string &target, const std::string& that, const std } } -void String::Replace( std::string& target, const std::string& that, const std::string& with ) { +void String::replace( std::string& target, const std::string& that, const std::string& with ) { std::size_t start_pos = target.find( that ); if( start_pos == std::string::npos ) @@ -174,7 +174,7 @@ void String::Replace( std::string& target, const std::string& that, const std::s target.replace( start_pos, that.length(), with ); } -std::string String::RemoveNumbersAtEnd( std::string txt ) { +std::string String::removeNumbersAtEnd( std::string txt ) { while ( txt.size() && txt[ txt.size() - 1 ] >= '0' && txt[ txt.size() - 1 ] <= '9' ) { txt.resize( txt.size() - 1 ); } @@ -182,11 +182,11 @@ std::string String::RemoveNumbersAtEnd( std::string txt ) { return txt; } -void String::InsertChar( String& str, const unsigned int& pos, const Uint32& tchar ) { +void String::insertChar( String& str, const unsigned int& pos, const Uint32& tchar ) { str.insert( str.begin() + pos, tchar ); } -void String::StrFormat( char * Buffer, int BufferSize, const char * format, ... ) { +void String::strFormat( char * Buffer, int BufferSize, const char * format, ... ) { va_list args; va_start( args, format ); #ifdef EE_COMPILER_MSVC @@ -197,7 +197,7 @@ void String::StrFormat( char * Buffer, int BufferSize, const char * format, ... va_end( args ); } -std::string String::StrFormated( const char * format, ... ) { +std::string String::strFormated( const char * format, ... ) { int n, size = 256; std::string tstr( size, '\0' ); @@ -231,13 +231,13 @@ String::String() String::String(char ansiChar, const std::locale& locale) { - mString += Utf32::DecodeAnsi(ansiChar, locale); + mString += Utf32::decodeAnsi(ansiChar, locale); } #ifndef EE_NO_WIDECHAR String::String(wchar_t wideChar) { - mString += Utf32::DecodeWide(wideChar); + mString += Utf32::decodeWide(wideChar); } #endif @@ -255,7 +255,7 @@ String::String( const char* uf8String ) { { mString.reserve(length + 1); - Utf8::ToUtf32(uf8String, uf8String + length, std::back_inserter(mString)); + Utf8::toUtf32(uf8String, uf8String + length, std::back_inserter(mString)); } } } @@ -263,7 +263,7 @@ String::String( const char* uf8String ) { String::String( const std::string& utf8String ) { mString.reserve( utf8String.length() + 1 ); - Utf8::ToUtf32( utf8String.begin(), utf8String.end(), std::back_inserter( mString ) ); + Utf8::toUtf32( utf8String.begin(), utf8String.end(), std::back_inserter( mString ) ); } String::String(const char* ansiString, const std::locale& locale) @@ -274,7 +274,7 @@ String::String(const char* ansiString, const std::locale& locale) if (length > 0) { mString.reserve(length + 1); - Utf32::FromAnsi(ansiString, ansiString + length, std::back_inserter(mString), locale); + Utf32::fromAnsi(ansiString, ansiString + length, std::back_inserter(mString), locale); } } } @@ -282,7 +282,7 @@ String::String(const char* ansiString, const std::locale& locale) String::String(const std::string& ansiString, const std::locale& locale) { mString.reserve(ansiString.length() + 1); - Utf32::FromAnsi(ansiString.begin(), ansiString.end(), std::back_inserter(mString), locale); + Utf32::fromAnsi(ansiString.begin(), ansiString.end(), std::back_inserter(mString), locale); } #ifndef EE_NO_WIDECHAR @@ -294,7 +294,7 @@ String::String(const wchar_t* wideString) if (length > 0) { mString.reserve(length + 1); - Utf32::FromWide(wideString, wideString + length, std::back_inserter(mString)); + Utf32::fromWide(wideString, wideString + length, std::back_inserter(mString)); } } } @@ -302,7 +302,7 @@ String::String(const wchar_t* wideString) String::String(const std::wstring& wideString) { mString.reserve(wideString.length() + 1); - Utf32::FromWide(wideString.begin(), wideString.end(), std::back_inserter(mString)); + Utf32::fromWide(wideString.begin(), wideString.end(), std::back_inserter(mString)); } #endif @@ -322,73 +322,73 @@ mString(str.mString) { } -String String::FromUtf8( const std::string& utf8String ) +String String::fromUtf8( const std::string& utf8String ) { String::StringType utf32; utf32.reserve( utf8String.length() + 1 ); - Utf8::ToUtf32( utf8String.begin(), utf8String.end(), std::back_inserter( utf32 ) ); + Utf8::toUtf32( utf8String.begin(), utf8String.end(), std::back_inserter( utf32 ) ); return String( utf32 ); } String::operator std::string() const { - return ToAnsiString(); + return toAnsiString(); } -std::string String::ToAnsiString(const std::locale& locale) const +std::string String::toAnsiString(const std::locale& locale) const { // Prepare the output string std::string output; output.reserve(mString.length() + 1); // Convert - Utf32::ToAnsi(mString.begin(), mString.end(), std::back_inserter(output), 0, locale); + Utf32::toAnsi(mString.begin(), mString.end(), std::back_inserter(output), 0, locale); return output; } #ifndef EE_NO_WIDECHAR -std::wstring String::ToWideString() const +std::wstring String::toWideString() const { // Prepare the output string std::wstring output; output.reserve(mString.length() + 1); // Convert - Utf32::ToWide(mString.begin(), mString.end(), std::back_inserter(output), 0); + Utf32::toWide(mString.begin(), mString.end(), std::back_inserter(output), 0); return output; } #endif -std::string String::ToUtf8() const { +std::string String::toUtf8() const { // Prepare the output string std::string output; output.reserve(mString.length() + 1); // Convert - Utf32::ToUtf8(mString.begin(), mString.end(), std::back_inserter(output) ); + Utf32::toUtf8(mString.begin(), mString.end(), std::back_inserter(output) ); return output; } -std::basic_string String::ToUtf16() const { +std::basic_string String::toUtf16() const { // Prepare the output string std::basic_string output; output.reserve(mString.length()); // Convert - Utf32::ToUtf16(mString.begin(), mString.end(), std::back_inserter(output)); + Utf32::toUtf16(mString.begin(), mString.end(), std::back_inserter(output)); return output; } -Uint32 String::GetHash() const +Uint32 String::getHash() const { - return String::Hash( *this ); + return String::hash( *this ); } String& String::operator =(const String& right) diff --git a/src/eepp/core/version.cpp b/src/eepp/core/version.cpp index 133ee7dd4..49c35c3ce 100644 --- a/src/eepp/core/version.cpp +++ b/src/eepp/core/version.cpp @@ -3,27 +3,27 @@ namespace EE { -Version Version::GetVersion() { +Version Version::getVersion() { Version ver; EEPP_VERSION(&ver); return ver; } -Uint32 Version::GetVersionNum() { - Version ver = GetVersion(); +Uint32 Version::getVersionNum() { + Version ver = getVersion(); return EEPP_VERSIONNUM(ver.major, ver.minor, ver.patch); } -std::string Version::GetVersionName() { - Version ver = GetVersion(); - return String::StrFormated( "eepp version %d.%d.%d", ver.major, ver.minor, ver.patch ); +std::string Version::getVersionName() { + Version ver = getVersion(); + return String::strFormated( "eepp version %d.%d.%d", ver.major, ver.minor, ver.patch ); } -std::string Version::GetCodename() { +std::string Version::getCodename() { return std::string( EEPP_CODENAME ); } -std::string Version::GetBuildTime() { +std::string Version::getBuildTime() { return std::string( __DATE__ ) + " " + std::string( __TIME__ ); } diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index c73284ed7..a0e9f0ecb 100644 --- a/src/eepp/gaming/mapeditor/mapeditor.cpp +++ b/src/eepp/gaming/mapeditor/mapeditor.cpp @@ -282,7 +282,7 @@ void MapEditor::CreateSubTextureContainer( Int32 Width ) { mChkAnim->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickAnimated ) ); mChkRot90 = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkBlocked->Pos().x, mChkBlocked->Pos().y + mChkBlocked->Size().Height() + 4 ), ChkFlags ); - mChkRot90->Text( String::FromUtf8( "Rotate 90º" ) ); + mChkRot90->Text( String::fromUtf8( "Rotate 90º" ) ); mChkRot90->AddEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::ChkClickRot90 ) ); mChkAutoFix = mTheme->CreateCheckBox( mSubTextureCont, Sizei(), Vector2i( mChkAnim->Pos().x, mChkAnim->Pos().y + mChkAnim->Size().Height() + 4 ), ChkFlags ); @@ -359,7 +359,7 @@ void MapEditor::CreateLighContainer() { mUIRedSlider->Value( 255 ); mUIRedSlider->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnRedChange ) ); - mUIRedTxt = mTheme->CreateTextBox( String::ToStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().Width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mTheme->CreateTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().Width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); Txt = mTheme->CreateTextBox( "G:", mLightCont, Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIRedSlider->Pos().y + mUIRedSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIGreenSlider = mTheme->CreateSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); @@ -367,7 +367,7 @@ void MapEditor::CreateLighContainer() { mUIGreenSlider->Value( 255 ); mUIGreenSlider->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnGreenChange ) ); - mUIGreenTxt = mTheme->CreateTextBox( String::ToStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().Width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mTheme->CreateTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().Width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); Txt = mTheme->CreateTextBox( "B:", mLightCont, Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIGreenSlider->Pos().y + mUIGreenSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIBlueSlider = mTheme->CreateSlider( mLightCont, Sizei( 100, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); @@ -375,7 +375,7 @@ void MapEditor::CreateLighContainer() { mUIBlueSlider->Value( 255 ); mUIBlueSlider->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnBlueChange ) ); - mUIBlueTxt = mTheme->CreateTextBox( String::ToStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().Width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mTheme->CreateTextBox( String::toStr( (Uint32)255 ), mLightCont, Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().Width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); Txt = mTheme->CreateTextBox( "Light Radius:", mLightCont, Sizei(), Vector2i( TAB_CONT_X_DIST, mUIBlueTxt->Pos().y + mUIBlueTxt->Size().Height() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); @@ -437,8 +437,8 @@ void MapEditor::OnObjectModeSel( const UIEvent * Event ) { } void MapEditor::CreateUIMap() { - UISkin * HScrollSkin = mTheme->GetByName( mTheme->Abbr() + "_" + "hscrollbar_bg" ); - UISkin * VScrollSkin = mTheme->GetByName( mTheme->Abbr() + "_" + "vscrollbar_bg" ); + UISkin * HScrollSkin = mTheme->getByName( mTheme->Abbr() + "_" + "hscrollbar_bg" ); + UISkin * VScrollSkin = mTheme->getByName( mTheme->Abbr() + "_" + "vscrollbar_bg" ); Float ScrollH = 16; Float ScrollV = 16; @@ -533,9 +533,9 @@ void MapEditor::OnLightRadiusChange( MapLight * Light ) { void MapEditor::OnLightSelect( MapLight * Light ) { ColorA Col( Light->Color() ); - mUIRedSlider->Value( Col.R() ); - mUIGreenSlider->Value( Col.G() ); - mUIBlueSlider->Value( Col.B() ); + mUIRedSlider->Value( Col.r() ); + mUIGreenSlider->Value( Col.g() ); + mUIBlueSlider->Value( Col.b() ); mLightRadius->Value( Light->Radius() ); mLightTypeChk->Active( Light->Type() == LIGHT_ISOMETRIC ? true : false ); } @@ -553,11 +553,11 @@ void MapEditor::OnRedChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->Background()->Color(); Col.Red = (Uint8)mUIRedSlider->Value(); mUIBaseColor->Background()->Color( Col ); - mUIRedTxt->Text( String::ToStr( (Int32)mUIRedSlider->Value() ) ); + mUIRedTxt->Text( String::toStr( (Int32)mUIRedSlider->Value() ) ); if ( NULL != mUIMap->GetSelectedLight() ) { RGB lCol( mUIMap->GetSelectedLight()->Color() ); - lCol.Red = Col.R(); + lCol.Red = Col.r(); mUIMap->GetSelectedLight()->Color( lCol ); } } @@ -566,11 +566,11 @@ void MapEditor::OnGreenChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->Background()->Color(); Col.Green = (Uint8)mUIGreenSlider->Value(); mUIBaseColor->Background()->Color( Col ); - mUIGreenTxt->Text( String::ToStr( (Uint32)mUIGreenSlider->Value() ) ); + mUIGreenTxt->Text( String::toStr( (Uint32)mUIGreenSlider->Value() ) ); if ( NULL != mUIMap->GetSelectedLight() ) { RGB lCol( mUIMap->GetSelectedLight()->Color() ); - lCol.Green = Col.G(); + lCol.Green = Col.g(); mUIMap->GetSelectedLight()->Color( lCol ); } } @@ -579,11 +579,11 @@ void MapEditor::OnBlueChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->Background()->Color(); Col.Blue = (Uint8)mUIBlueSlider->Value(); mUIBaseColor->Background()->Color( Col ); - mUIBlueTxt->Text( String::ToStr( (Uint32)mUIBlueSlider->Value() ) ); + mUIBlueTxt->Text( String::toStr( (Uint32)mUIBlueSlider->Value() ) ); if ( NULL != mUIMap->GetSelectedLight() ) { RGB lCol( mUIMap->GetSelectedLight()->Color() ); - lCol.Blue = Col.B(); + lCol.Blue = Col.b(); mUIMap->GetSelectedLight()->Color( lCol ); } } @@ -652,7 +652,7 @@ void MapEditor::OnTypeChange( const UIEvent * Event ) { else if ( mGOTypeList->Text() == "Sprite" ) mCurGOType = GAMEOBJECT_TYPE_SPRITE; else - mCurGOType = String::Hash( mGOTypeList->Text().ToUtf8() ); + mCurGOType = String::hash( mGOTypeList->Text().toUtf8() ); if ( NULL != mChkAnim && NULL != mGOTypeList && mChkAnim->Active() && mGOTypeList->Text() != "Sprite" ) { if ( mGOTypeList->Text() == "SubTexture" || mGOTypeList->Text() == "SubTextureEx" ) { @@ -712,14 +712,14 @@ void MapEditor::OnNewGOTypeAdded( std::string name, Uint32 hash ) { void MapEditor::FillSGCombo() { TextureAtlasManager * SGM = TextureAtlasManager::instance(); - std::list& Res = SGM->GetResources(); + std::list& Res = SGM->getResources(); mTextureAtlasesList->ListBox()->Clear(); std::vector items; - Uint32 Restricted1 = String::Hash( std::string( "global" ) ); - Uint32 Restricted2 = String::Hash( mTheme->TextureAtlas()->Name() ); + Uint32 Restricted1 = String::hash( std::string( "global" ) ); + Uint32 Restricted2 = String::hash( mTheme->TextureAtlas()->Name() ); for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { if ( (*it)->Id() != Restricted1 && (*it)->Id() != Restricted2 ) @@ -737,8 +737,8 @@ void MapEditor::FillSGCombo() { void MapEditor::FillSubTextureList() { TextureAtlasManager * SGM = TextureAtlasManager::instance(); - mCurSG = SGM->GetByName( mTextureAtlasesList->Text() ); - std::list& Res = mCurSG->GetResources(); + mCurSG = SGM->getByName( mTextureAtlasesList->Text() ); + std::list& Res = mCurSG->getResources(); mSubTextureList->Clear(); @@ -762,7 +762,7 @@ void MapEditor::FillSubTextureList() { void MapEditor::OnSubTextureChange( const UIEvent * Event ) { if ( NULL != mCurSG ) { - SubTexture * tSubTexture = mCurSG->GetByName( mSubTextureList->GetItemSelectedText() ); + SubTexture * tSubTexture = mCurSG->getByName( mSubTextureList->GetItemSelectedText() ); if ( NULL != tSubTexture ) { mGfxPreview->SubTexture( tSubTexture ); @@ -1128,9 +1128,9 @@ void MapEditor::RefreshLayersList() { void MapEditor::TextureAtlasOpen( const UIEvent * Event ) { UICommonDialog * CDL = reinterpret_cast ( Event->Ctrl() ); - std::string sgname = FileSystem::FileRemoveExtension( FileSystem::FileNameFromPath( CDL->GetFullPath() ) ); + std::string sgname = FileSystem::fileRemoveExtension( FileSystem::fileNameFromPath( CDL->GetFullPath() ) ); - TextureAtlas * SG = TextureAtlasManager::instance()->GetByName( sgname ); + TextureAtlas * SG = TextureAtlasManager::instance()->getByName( sgname ); if ( NULL == SG ) { TextureAtlasLoader tgl( CDL->GetFullPath() ); @@ -1195,7 +1195,7 @@ GameObject * MapEditor::CreateGameObject() { if ( mChkAnim->Active() ) { - Sprite * tAnimSprite = eeNew( Sprite, ( String::RemoveNumbersAtEnd( mGfxPreview->SubTexture()->Name() ) ) ); + Sprite * tAnimSprite = eeNew( Sprite, ( String::removeNumbersAtEnd( mGfxPreview->SubTexture()->Name() ) ) ); tObj = eeNew( GameObjectSprite, ( mCurGOFlags, mCurLayer, tAnimSprite ) ); } else { @@ -1208,7 +1208,7 @@ GameObject * MapEditor::CreateGameObject() { //! Creates an empty game object. The client will interpret the GameObject Type, and instanciate the corresponding class. if ( mChkDI->Active() ) - tObj = eeNew( GameObjectVirtual, ( String::Hash( mDataIdInput->Text().ToUtf8() ), mCurLayer, mCurGOFlags, mCurGOType ) ); + tObj = eeNew( GameObjectVirtual, ( String::hash( mDataIdInput->Text().toUtf8() ), mCurLayer, mCurGOFlags, mCurGOType ) ); else tObj = eeNew( GameObjectVirtual, ( mGfxPreview->SubTexture(), mCurLayer, mCurGOFlags, mCurGOType ) ); } diff --git a/src/eepp/gaming/mapeditor/maplayerproperties.cpp b/src/eepp/gaming/mapeditor/maplayerproperties.cpp index b18a5fcb4..6f5be7ce5 100644 --- a/src/eepp/gaming/mapeditor/maplayerproperties.cpp +++ b/src/eepp/gaming/mapeditor/maplayerproperties.cpp @@ -121,7 +121,7 @@ void MapLayerProperties::LoadProperties() { void MapLayerProperties::OKClick( const UIEvent * Event ) { SaveProperties(); - mLayer->Name( mUIInput->Text().ToUtf8() ); + mLayer->Name( mUIInput->Text().toUtf8() ); if ( mRefreshCb.IsSet() ) { mRefreshCb(); diff --git a/src/eepp/gaming/mapeditor/mapobjectproperties.cpp b/src/eepp/gaming/mapeditor/mapobjectproperties.cpp index 0367e43e2..7bfffb086 100644 --- a/src/eepp/gaming/mapeditor/mapobjectproperties.cpp +++ b/src/eepp/gaming/mapeditor/mapobjectproperties.cpp @@ -125,8 +125,8 @@ void MapObjectProperties::LoadProperties() { void MapObjectProperties::OKClick( const UIEvent * Event ) { SaveProperties(); - mObj->Name( mUIInput->Text().ToUtf8() ); - mObj->TypeName( mUIInput2->Text().ToUtf8() ); + mObj->Name( mUIInput->Text().toUtf8() ); + mObj->TypeName( mUIInput2->Text().toUtf8() ); mUIWindow->CloseWindow(); } diff --git a/src/eepp/gaming/mapeditor/tilemapproperties.cpp b/src/eepp/gaming/mapeditor/tilemapproperties.cpp index f783432b0..68cc2fd29 100644 --- a/src/eepp/gaming/mapeditor/tilemapproperties.cpp +++ b/src/eepp/gaming/mapeditor/tilemapproperties.cpp @@ -44,26 +44,26 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : Txt = mUITheme->CreateTextBox( "Red Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIBaseColor->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIRedSlider = mUITheme->CreateSlider( mUIWindow->Container(), Sizei( 255, 20 ), Vector2i( Txt->Pos().x + Txt->Size().Width() + 16, Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIRedSlider->MaxValue( 255 ); - mUIRedSlider->Value( mMap->BaseColor().R() ); + mUIRedSlider->Value( mMap->BaseColor().r() ); mUIRedSlider->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnRedChange ) ); - mUIRedTxt = mUITheme->CreateTextBox( String::ToStr( (Uint32)mMap->BaseColor().R() ), mUIWindow->Container(), Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().Width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mUITheme->CreateTextBox( String::toStr( (Uint32)mMap->BaseColor().r() ), mUIWindow->Container(), Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().Width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); Txt = mUITheme->CreateTextBox( "Green Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIRedSlider->Pos().y + mUIRedSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIGreenSlider = mUITheme->CreateSlider( mUIWindow->Container(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIGreenSlider->MaxValue( 255 ); - mUIGreenSlider->Value( mMap->BaseColor().G() ); + mUIGreenSlider->Value( mMap->BaseColor().g() ); mUIGreenSlider->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnGreenChange ) ); - mUIGreenTxt = mUITheme->CreateTextBox( String::ToStr( (Uint32)mMap->BaseColor().G() ), mUIWindow->Container(), Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().Width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mUITheme->CreateTextBox( String::toStr( (Uint32)mMap->BaseColor().g() ), mUIWindow->Container(), Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().Width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); Txt = mUITheme->CreateTextBox( "Blue Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIGreenSlider->Pos().y + mUIGreenSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIBlueSlider = mUITheme->CreateSlider( mUIWindow->Container(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->Pos().x, Txt->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIBlueSlider->MaxValue( 255 ); - mUIBlueSlider->Value( mMap->BaseColor().B() ); + mUIBlueSlider->Value( mMap->BaseColor().b() ); mUIBlueSlider->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnBlueChange ) ); - mUIBlueTxt = mUITheme->CreateTextBox( String::ToStr( (Uint32)mMap->BaseColor().B() ), mUIWindow->Container(), Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().Width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mUITheme->CreateTextBox( String::toStr( (Uint32)mMap->BaseColor().b() ), mUIWindow->Container(), Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().Width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); } Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER; @@ -125,7 +125,7 @@ void TileMapProperties::OnRedChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->Background()->Color(); Col.Red = (Uint8)mUIRedSlider->Value(); mUIBaseColor->Background()->Color( Col ); - mUIRedTxt->Text( String::ToStr( (Int32)mUIRedSlider->Value() ) ); + mUIRedTxt->Text( String::toStr( (Int32)mUIRedSlider->Value() ) ); ColorA MapCol = mMap->BaseColor(); MapCol.Red = Col.Red; @@ -136,7 +136,7 @@ void TileMapProperties::OnGreenChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->Background()->Color(); Col.Green = (Uint8)mUIGreenSlider->Value(); mUIBaseColor->Background()->Color( Col ); - mUIGreenTxt->Text( String::ToStr( (Uint32)mUIGreenSlider->Value() ) ); + mUIGreenTxt->Text( String::toStr( (Uint32)mUIGreenSlider->Value() ) ); ColorA MapCol = mMap->BaseColor(); MapCol.Green = Col.Green; @@ -147,7 +147,7 @@ void TileMapProperties::OnBlueChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->Background()->Color(); Col.Blue = (Uint8)mUIBlueSlider->Value(); mUIBaseColor->Background()->Color( Col ); - mUIBlueTxt->Text( String::ToStr( (Uint32)mUIBlueSlider->Value() ) ); + mUIBlueTxt->Text( String::toStr( (Uint32)mUIBlueSlider->Value() ) ); ColorA MapCol = mMap->BaseColor(); MapCol.Blue = Col.Blue; diff --git a/src/eepp/gaming/mapeditor/uigotypenew.cpp b/src/eepp/gaming/mapeditor/uigotypenew.cpp index 230d703e6..807376c71 100644 --- a/src/eepp/gaming/mapeditor/uigotypenew.cpp +++ b/src/eepp/gaming/mapeditor/uigotypenew.cpp @@ -49,7 +49,7 @@ UIGOTypeNew::~UIGOTypeNew() { void UIGOTypeNew::OKClick( const UIEvent * Event ) { if ( mUIInput->Text().size() ) { if ( mCb.IsSet() ) - mCb( mUIInput->Text().ToUtf8(), String::Hash( mUIInput->Text().ToUtf8() ) ); + mCb( mUIInput->Text().toUtf8(), String::hash( mUIInput->Text().toUtf8() ) ); } mUIWindow->CloseWindow(); diff --git a/src/eepp/gaming/mapeditor/uimap.cpp b/src/eepp/gaming/mapeditor/uimap.cpp index 08a29934e..1c039b7cb 100644 --- a/src/eepp/gaming/mapeditor/uimap.cpp +++ b/src/eepp/gaming/mapeditor/uimap.cpp @@ -337,7 +337,7 @@ Uint32 UIMap::OnMouseMove( const Vector2i& Pos, const Uint32 Flags ) { if ( mLastMouseTilePos != mp ) { mLastMouseTilePos = mp; - mTileBox->Text( String::ToStr( mp.x ) + "," + String::ToStr( mp.y ) ); + mTileBox->Text( String::toStr( mp.x ) + "," + String::toStr( mp.y ) ); } } diff --git a/src/eepp/gaming/mapeditor/uimaplayernew.cpp b/src/eepp/gaming/mapeditor/uimaplayernew.cpp index c5361f6bc..387d59081 100644 --- a/src/eepp/gaming/mapeditor/uimaplayernew.cpp +++ b/src/eepp/gaming/mapeditor/uimaplayernew.cpp @@ -30,7 +30,7 @@ UIMapLayerNew::UIMapLayerNew( UIMap * Map, EE_LAYER_TYPE Type, NewLayerCb newLay UITextBox * Txt = mTheme->CreateTextBox( "Layer Name", mUIWindow->Container(), Sizei(), Vector2i( 16, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUILayerName = mTheme->CreateTextInput( mUIWindow->Container(), Sizei( 120, 22 ), Vector2i( Txt->Pos().x + DistFromTitle, Txt->Pos().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); - mUILayerName->Text( "Layer " + String::ToStr( mUIMap->Map()->LayerCount() + 1 ) ); + mUILayerName->Text( "Layer " + String::toStr( mUIMap->Map()->LayerCount() + 1 ) ); UIPushButton * OKButton = mTheme->CreatePushButton( mUIWindow->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "add" ) ); OKButton->Pos( mUIWindow->Container()->Size().Width() - OKButton->Size().Width() - 4, mUIWindow->Container()->Size().Height() - OKButton->Size().Height() - 4 ); diff --git a/src/eepp/gaming/mapeditor/uimapnew.cpp b/src/eepp/gaming/mapeditor/uimapnew.cpp index 9992d21ab..fa6f87dac 100644 --- a/src/eepp/gaming/mapeditor/uimapnew.cpp +++ b/src/eepp/gaming/mapeditor/uimapnew.cpp @@ -133,10 +133,10 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIRedSlider->Value( 255 ); mUIRedSlider->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnRedChange ) ); - mUIRedTxt = mTheme->CreateTextBox( String::ToStr( 255 ), mUIWindow->Container(), Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().Width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mTheme->CreateTextBox( String::toStr( 255 ), mUIWindow->Container(), Sizei(), Vector2i( mUIRedSlider->Pos().x + mUIRedSlider->Size().Width() + 4, mUIRedSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { - mUIRedSlider->Value( mUIMap->Map()->BaseColor().R() ); + mUIRedSlider->Value( mUIMap->Map()->BaseColor().r() ); } Txt = mTheme->CreateTextBox( "Green Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIRedSlider->Pos().y + mUIRedSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); @@ -147,10 +147,10 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIGreenSlider->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnGreenChange ) ); - mUIGreenTxt = mTheme->CreateTextBox( String::ToStr( 255 ), mUIWindow->Container(), Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().Width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mTheme->CreateTextBox( String::toStr( 255 ), mUIWindow->Container(), Sizei(), Vector2i( mUIGreenSlider->Pos().x + mUIGreenSlider->Size().Width() + 4, mUIGreenSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { - mUIGreenSlider->Value( mUIMap->Map()->BaseColor().G() ); + mUIGreenSlider->Value( mUIMap->Map()->BaseColor().g() ); } Txt = mTheme->CreateTextBox( "Blue Color:", mUIWindow->Container(), Sizei(), Vector2i( mUIBaseColor->Pos().x + mUIBaseColor->Size().Width() + 4, mUIGreenSlider->Pos().y + mUIGreenSlider->Size().Height() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); @@ -160,10 +160,10 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIBlueSlider->Value( 255 ); mUIBlueSlider->AddEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnBlueChange ) ); - mUIBlueTxt = mTheme->CreateTextBox( String::ToStr( 255 ), mUIWindow->Container(), Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().Width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mTheme->CreateTextBox( String::toStr( 255 ), mUIWindow->Container(), Sizei(), Vector2i( mUIBlueSlider->Pos().x + mUIBlueSlider->Size().Width() + 4, mUIBlueSlider->Pos().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { - mUIBlueSlider->Value( mUIMap->Map()->BaseColor().B() ); + mUIBlueSlider->Value( mUIMap->Map()->BaseColor().b() ); } UIPushButton * OKButton = mTheme->CreatePushButton( mUIWindow->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "ok" ) ); @@ -186,21 +186,21 @@ void UIMapNew::OnRedChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->Background()->Color(); Col.Red = (Uint8)mUIRedSlider->Value(); mUIBaseColor->Background()->Color( Col ); - mUIRedTxt->Text( String::ToStr( (Int32)mUIRedSlider->Value() ) ); + mUIRedTxt->Text( String::toStr( (Int32)mUIRedSlider->Value() ) ); } void UIMapNew::OnGreenChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->Background()->Color(); Col.Green = (Uint8)mUIGreenSlider->Value(); mUIBaseColor->Background()->Color( Col ); - mUIGreenTxt->Text( String::ToStr( (Uint32)mUIGreenSlider->Value() ) ); + mUIGreenTxt->Text( String::toStr( (Uint32)mUIGreenSlider->Value() ) ); } void UIMapNew::OnBlueChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->Background()->Color(); Col.Blue = (Uint8)mUIBlueSlider->Value(); mUIBaseColor->Background()->Color( Col ); - mUIBlueTxt->Text( String::ToStr( (Uint32)mUIBlueSlider->Value() ) ); + mUIBlueTxt->Text( String::toStr( (Uint32)mUIBlueSlider->Value() ) ); } void UIMapNew::OKClick( const UIEvent * Event ) { @@ -230,7 +230,7 @@ void UIMapNew::OKClick( const UIEvent * Event ) { mUIMap->Map()->BaseColor( mUIBaseColor->Background()->Color() ); } else { std::string oldPath( mUIMap->Map()->Path() ); - std::string mapPath( Sys::GetTempPath() + "temp.eepp.map.eem" ); + std::string mapPath( Sys::getTempPath() + "temp.eepp.map.eem" ); mUIMap->Map()->Save( mapPath ); TileMap * Map = eeNew( TileMap, () ); @@ -243,7 +243,7 @@ void UIMapNew::OKClick( const UIEvent * Event ) { mUIMap->ReplaceMap( Map ); - FileSystem::FileRemove( mapPath ); + FileSystem::fileRemove( mapPath ); } if ( mNewMapCb.IsSet() ) diff --git a/src/eepp/gaming/maplayer.cpp b/src/eepp/gaming/maplayer.cpp index 8c15e9921..7e841062e 100644 --- a/src/eepp/gaming/maplayer.cpp +++ b/src/eepp/gaming/maplayer.cpp @@ -8,7 +8,7 @@ MapLayer::MapLayer( TileMap * map, Uint32 type, Uint32 flags, std::string name, mType( type ), mFlags( flags ), mOffset( offset ), - mNameHash( String::Hash( name ) ), + mNameHash( String::hash( name ) ), mName( name ) { } @@ -55,7 +55,7 @@ void MapLayer::Offset( const Vector2f& offset ) { void MapLayer::Name( const std::string& name ) { mName = name; - mNameHash = String::Hash( mName ); + mNameHash = String::hash( mName ); } const std::string& MapLayer::Name() const { diff --git a/src/eepp/gaming/maplight.cpp b/src/eepp/gaming/maplight.cpp index 2ce1fc466..b366f4f51 100755 --- a/src/eepp/gaming/maplight.cpp +++ b/src/eepp/gaming/maplight.cpp @@ -44,21 +44,21 @@ RGB MapLight::ProcessVertex( const Float& PointX, const Float& PointY, const RGB Uint8 TmpColor; Float LightC; - LightC = eeabs( static_cast ( mColor.R() - BaseColor.R() ) ) / mRadius; - TmpColor = Uint8( (Float)mColor.R() - (VertexDist * LightC) ); - TmpRGB.Red = VertexColor.R() + ( TmpColor - VertexColor.R() ); + LightC = eeabs( static_cast ( mColor.r() - BaseColor.r() ) ) / mRadius; + TmpColor = Uint8( (Float)mColor.r() - (VertexDist * LightC) ); + TmpRGB.Red = VertexColor.r() + ( TmpColor - VertexColor.r() ); - LightC = eeabs( static_cast ( mColor.G() - BaseColor.G() ) ) / mRadius; - TmpColor = Uint8( (Float)mColor.G() - (VertexDist * LightC) ); - TmpRGB.Green = VertexColor.G() + ( TmpColor - VertexColor.G() ); + LightC = eeabs( static_cast ( mColor.g() - BaseColor.g() ) ) / mRadius; + TmpColor = Uint8( (Float)mColor.g() - (VertexDist * LightC) ); + TmpRGB.Green = VertexColor.g() + ( TmpColor - VertexColor.g() ); - LightC = eeabs( static_cast ( mColor.B() - BaseColor.B() ) ) / mRadius; - TmpColor = Uint8( (Float)mColor.B() - (VertexDist * LightC) ); - TmpRGB.Blue = VertexColor.B() + ( TmpColor - VertexColor.B() ); + LightC = eeabs( static_cast ( mColor.b() - BaseColor.b() ) ) / mRadius; + TmpColor = Uint8( (Float)mColor.b() - (VertexDist * LightC) ); + TmpRGB.Blue = VertexColor.b() + ( TmpColor - VertexColor.b() ); - if ( TmpRGB.R() < VertexColor.R() ) TmpRGB.Red = VertexColor.R(); - if ( TmpRGB.G() < VertexColor.G() ) TmpRGB.Green = VertexColor.G(); - if ( TmpRGB.B() < VertexColor.B() ) TmpRGB.Blue = VertexColor.B(); + if ( TmpRGB.r() < VertexColor.r() ) TmpRGB.Red = VertexColor.r(); + if ( TmpRGB.g() < VertexColor.g() ) TmpRGB.Green = VertexColor.g(); + if ( TmpRGB.b() < VertexColor.b() ) TmpRGB.Blue = VertexColor.b(); return TmpRGB; } @@ -84,21 +84,21 @@ ColorA MapLight::ProcessVertex( const Float& PointX, const Float& PointY, const Uint8 TmpColor; Float LightC; - LightC = eeabs( static_cast ( mColor.R() - BaseColor.R() ) ) / mRadius; - TmpColor = Uint8( (Float)mColor.R() - (VertexDist * LightC) ); - TmpRGB.Red = VertexColor.R() + ( TmpColor - VertexColor.R() ); + LightC = eeabs( static_cast ( mColor.r() - BaseColor.r() ) ) / mRadius; + TmpColor = Uint8( (Float)mColor.r() - (VertexDist * LightC) ); + TmpRGB.Red = VertexColor.r() + ( TmpColor - VertexColor.r() ); - LightC = eeabs( static_cast ( mColor.G() - BaseColor.G() ) ) / mRadius; - TmpColor = Uint8( (Float)mColor.G() - (VertexDist * LightC) ); - TmpRGB.Green = VertexColor.G() + ( TmpColor - VertexColor.G() ); + LightC = eeabs( static_cast ( mColor.g() - BaseColor.g() ) ) / mRadius; + TmpColor = Uint8( (Float)mColor.g() - (VertexDist * LightC) ); + TmpRGB.Green = VertexColor.g() + ( TmpColor - VertexColor.g() ); - LightC = eeabs( static_cast ( mColor.B() - BaseColor.B() ) ) / mRadius; - TmpColor = Uint8( (Float)mColor.B() - (VertexDist * LightC) ); - TmpRGB.Blue = VertexColor.B() + ( TmpColor - VertexColor.B() ); + LightC = eeabs( static_cast ( mColor.b() - BaseColor.b() ) ) / mRadius; + TmpColor = Uint8( (Float)mColor.b() - (VertexDist * LightC) ); + TmpRGB.Blue = VertexColor.b() + ( TmpColor - VertexColor.b() ); - if ( TmpRGB.R() < VertexColor.R() ) TmpRGB.Red = VertexColor.R(); - if ( TmpRGB.G() < VertexColor.G() ) TmpRGB.Green = VertexColor.G(); - if ( TmpRGB.B() < VertexColor.B() ) TmpRGB.Blue = VertexColor.B(); + if ( TmpRGB.r() < VertexColor.r() ) TmpRGB.Red = VertexColor.r(); + if ( TmpRGB.g() < VertexColor.g() ) TmpRGB.Green = VertexColor.g(); + if ( TmpRGB.b() < VertexColor.b() ) TmpRGB.Blue = VertexColor.b(); return TmpRGB; } diff --git a/src/eepp/gaming/maplightmanager.cpp b/src/eepp/gaming/maplightmanager.cpp index 2e6d6d4cc..136123c72 100644 --- a/src/eepp/gaming/maplightmanager.cpp +++ b/src/eepp/gaming/maplightmanager.cpp @@ -65,18 +65,18 @@ void MapLightManager::UpdateByVertex() { if ( TileAABB.Intersect( Light->GetAABB() ) ) { if ( y > 0 ) - mTileColors[x][y][0]->Assign( *mTileColors[x][y - 1][1] ); + mTileColors[x][y][0]->assign( *mTileColors[x][y - 1][1] ); else - mTileColors[x][y][0]->Assign( Light->ProcessVertex( Pos.x, Pos.y, *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); + mTileColors[x][y][0]->assign( Light->ProcessVertex( Pos.x, Pos.y, *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); - mTileColors[x][y][1]->Assign( Light->ProcessVertex( Pos.x, Pos.y + TileSize.Height(), *(mTileColors[x][y][1]), *(mTileColors[x][y][1]) ) ); + mTileColors[x][y][1]->assign( Light->ProcessVertex( Pos.x, Pos.y + TileSize.Height(), *(mTileColors[x][y][1]), *(mTileColors[x][y][1]) ) ); - mTileColors[x][y][2]->Assign( Light->ProcessVertex( Pos.x + TileSize.Width(), Pos.y + TileSize.Height(), *(mTileColors[x][y][2]), *(mTileColors[x][y][2]) ) ); + mTileColors[x][y][2]->assign( Light->ProcessVertex( Pos.x + TileSize.Width(), Pos.y + TileSize.Height(), *(mTileColors[x][y][2]), *(mTileColors[x][y][2]) ) ); if ( y > 0 ) - mTileColors[x][y][3]->Assign( *mTileColors[x][y - 1][2] ); + mTileColors[x][y][3]->assign( *mTileColors[x][y - 1][2] ); else - mTileColors[x][y][3]->Assign( Light->ProcessVertex( Pos.x + TileSize.Width(), Pos.y, *(mTileColors[x][y][3]), *(mTileColors[x][y][3]) ) ); + mTileColors[x][y][3]->assign( Light->ProcessVertex( Pos.x + TileSize.Width(), Pos.y, *(mTileColors[x][y][3]), *(mTileColors[x][y][3]) ) ); } } } @@ -117,7 +117,7 @@ void MapLightManager::UpdateByTile() { eeAABB TileAABB( Pos.x, Pos.y, Pos.x + TileSize.x, Pos.y + TileSize.y ); if ( TileAABB.Intersect( Light->GetAABB() ) ) { - mTileColors[x][y][0]->Assign( Light->ProcessVertex( Pos.x + HalfTileSize.Width(), Pos.y + HalfTileSize.Height(), *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); + mTileColors[x][y][0]->assign( Light->ProcessVertex( Pos.x + HalfTileSize.Width(), Pos.y + HalfTileSize.Height(), *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); } } } diff --git a/src/eepp/gaming/tilemap.cpp b/src/eepp/gaming/tilemap.cpp index 264f34401..30664c6a7 100644 --- a/src/eepp/gaming/tilemap.cpp +++ b/src/eepp/gaming/tilemap.cpp @@ -119,7 +119,7 @@ void TileMap::CreateEmptyTile() { //! I create a texture representing an empty tile to render instead of rendering with primitives because is a lot faster, at least with NVIDIA GPUs. TextureFactory * TF = TextureFactory::instance(); - std::string tileName( String::StrFormated( "maptile-%dx%d-%ul", mTileSize.Width(), mTileSize.Height(), mGridLinesColor.GetValue() ) ); + std::string tileName( String::strFormated( "maptile-%dx%d-%ul", mTileSize.Width(), mTileSize.Height(), mGridLinesColor.getValue() ) ); Texture * Tex = TF->GetByName( tileName ); @@ -207,7 +207,7 @@ Uint32 TileMap::GetLayerIndex( MapLayer * Layer ) { } MapLayer* TileMap::GetLayer( const std::string& name ) { - return GetLayerByHash( String::Hash( name ) ); + return GetLayerByHash( String::hash( name ) ); } void TileMap::Draw() { @@ -220,9 +220,9 @@ void TileMap::Draw() { if ( DrawBackground() ) { Primitives P; - Uint8 Alpha = static_cast( (Float)mBackColor.A() * ( (Float)mBackAlpha / 255.f ) ); + Uint8 Alpha = static_cast( (Float)mBackColor.a() * ( (Float)mBackAlpha / 255.f ) ); - P.SetColor( ColorA( mBackColor.R(), mBackColor.G(), mBackColor.B(), Alpha ) ); + P.SetColor( ColorA( mBackColor.r(), mBackColor.g(), mBackColor.b(), Alpha ) ); P.DrawRectangle( Rectf( Vector2f( mScreenPos.x, mScreenPos.y ), Sizef( mViewSize.x, mViewSize.y ) ), 0.f, Vector2f::One ); P.SetColor( ColorA( 255, 255, 255, 255 ) ); } @@ -528,7 +528,7 @@ const ColorA& TileMap::BaseColor() const { } void TileMap::DrawGrid( const bool& draw ) { - BitOp::SetBitFlagValue( &mFlags, MAP_FLAG_DRAW_GRID, draw ? 1 : 0 ); + BitOp::setBitFlagValue( &mFlags, MAP_FLAG_DRAW_GRID, draw ? 1 : 0 ); } Uint32 TileMap::DrawGrid() const { @@ -536,11 +536,11 @@ Uint32 TileMap::DrawGrid() const { } void TileMap::DrawBackground( const bool& draw ) { - BitOp::SetBitFlagValue( &mFlags, MAP_FLAG_DRAW_BACKGROUND, draw ? 1 : 0 ); + BitOp::setBitFlagValue( &mFlags, MAP_FLAG_DRAW_BACKGROUND, draw ? 1 : 0 ); } void TileMap::ShowBlocked( const bool& show ) { - BitOp::SetBitFlagValue( &mFlags, MAP_FLAG_SHOW_BLOCKED, show ? 1 : 0 ); + BitOp::setBitFlagValue( &mFlags, MAP_FLAG_SHOW_BLOCKED, show ? 1 : 0 ); } Uint32 TileMap::ShowBlocked() const { @@ -556,7 +556,7 @@ bool TileMap::ClipedArea() const { } void TileMap::ClipedArea( const bool& clip ) { - BitOp::SetBitFlagValue( &mFlags, MAP_FLAG_CLIP_AREA, clip ? 1 : 0 ); + BitOp::setBitFlagValue( &mFlags, MAP_FLAG_CLIP_AREA, clip ? 1 : 0 ); } bool TileMap::ClampBorders() const { @@ -564,7 +564,7 @@ bool TileMap::ClampBorders() const { } void TileMap::ClampBorders( const bool& clamp ) { - BitOp::SetBitFlagValue( &mFlags, MAP_FLAG_CLAMP_BORDERS, clamp ? 1 : 0 ); + BitOp::setBitFlagValue( &mFlags, MAP_FLAG_CLAMP_BORDERS, clamp ? 1 : 0 ); } Uint32 TileMap::DrawTileOver() const { @@ -572,7 +572,7 @@ Uint32 TileMap::DrawTileOver() const { } void TileMap::DrawTileOver( const bool& draw ) { - BitOp::SetBitFlagValue( &mFlags, MAP_FLAG_DRAW_TILE_OVER, draw ? 1 : 0 ); + BitOp::setBitFlagValue( &mFlags, MAP_FLAG_DRAW_TILE_OVER, draw ? 1 : 0 ); } bool TileMap::LightsEnabled() { @@ -580,7 +580,7 @@ bool TileMap::LightsEnabled() { } void TileMap::LightsEnabled( const bool& enabled ) { - BitOp::SetBitFlagValue( &mFlags, MAP_FLAG_LIGHTS_ENABLED, enabled ? 1 : 0 ); + BitOp::setBitFlagValue( &mFlags, MAP_FLAG_LIGHTS_ENABLED, enabled ? 1 : 0 ); } bool TileMap::LightsByVertex() { @@ -796,8 +796,8 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { sMapHdr MapHdr; Uint32 i, z; - if ( IOS.IsOpen() ) { - IOS.Read( (char*)&MapHdr, sizeof(sMapHdr) ); + if ( IOS.isOpen() ) { + IOS.read( (char*)&MapHdr, sizeof(sMapHdr) ); if ( MapHdr.Magic == EE_MAP_MAGIC ) { if ( NULL == mForcedHeaders ) { @@ -812,7 +812,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { if ( MapHdr.PropertyCount ) { sPropertyHdr * tProp = eeNewArray( sPropertyHdr, MapHdr.PropertyCount ); - IOS.Read( (char*)&tProp[0], sizeof(sPropertyHdr) * MapHdr.PropertyCount ); + IOS.read( (char*)&tProp[0], sizeof(sPropertyHdr) * MapHdr.PropertyCount ); for ( i = 0; i < MapHdr.PropertyCount; i++ ) { AddProperty( std::string( tProp[i].Name ), std::string( tProp[i].Value ) ); @@ -825,7 +825,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { if ( MapHdr.TextureAtlasCount ) { sMapTextureAtlas * tSG = eeNewArray( sMapTextureAtlas, MapHdr.TextureAtlasCount ); - IOS.Read( (char*)&tSG[0], sizeof(sMapTextureAtlas) * MapHdr.TextureAtlasCount ); + IOS.read( (char*)&tSG[0], sizeof(sMapTextureAtlas) * MapHdr.TextureAtlasCount ); std::vector TextureAtlases; @@ -835,12 +835,12 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { //! Load the Texture Atlases if needed for ( i = 0; i < TextureAtlases.size(); i++ ) { - std::string sgname = FileSystem::FileRemoveExtension( FileSystem::FileNameFromPath( TextureAtlases[i] ) ); + std::string sgname = FileSystem::fileRemoveExtension( FileSystem::fileNameFromPath( TextureAtlases[i] ) ); - if ( NULL == TextureAtlasManager::instance()->GetByName( sgname ) ) { + if ( NULL == TextureAtlasManager::instance()->getByName( sgname ) ) { TextureAtlasLoader * tgl = eeNew( TextureAtlasLoader, () ); - tgl->Load( Sys::GetProcessPath() + TextureAtlases[i] ); + tgl->Load( Sys::getProcessPath() + TextureAtlases[i] ); eeSAFE_DELETE( tgl ); } @@ -853,7 +853,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { if ( MapHdr.VirtualObjectTypesCount ) { sVirtualObj * tVObj = eeNewArray( sVirtualObj, MapHdr.VirtualObjectTypesCount ); - IOS.Read( (char*)&tVObj[0], sizeof(sVirtualObj) * MapHdr.VirtualObjectTypesCount ); + IOS.read( (char*)&tVObj[0], sizeof(sVirtualObj) * MapHdr.VirtualObjectTypesCount ); for ( i = 0; i < MapHdr.VirtualObjectTypesCount; i++ ) { AddVirtualObjectType( std::string( tVObj[i].Name ) ); @@ -868,7 +868,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { sLayerHdr * tLayerHdr; for ( i = 0; i < MapHdr.LayerCount; i++ ) { - IOS.Read( (char*)&tLayersHdr[i], sizeof(sLayerHdr) ); + IOS.read( (char*)&tLayersHdr[i], sizeof(sLayerHdr) ); tLayerHdr = &(tLayersHdr[i]); @@ -879,7 +879,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { sPropertyHdr * tProps = eeNewArray( sPropertyHdr, tLayerHdr->PropertyCount ); - IOS.Read( (char*)&tProps[0], sizeof(sPropertyHdr) * tLayerHdr->PropertyCount ); + IOS.read( (char*)&tProps[0], sizeof(sPropertyHdr) * tLayerHdr->PropertyCount ); for ( z = 0; z < tLayerHdr->PropertyCount; z++ ) { tLayer->AddProperty( std::string( tProps[z].Name ), std::string( tProps[z].Value ) ); @@ -912,7 +912,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { for ( x = 0; x < mSize.x; x++ ) { //! Read the current tile flags - IOS.Read( (char*)&tReadFlag, sizeof(Uint32) ); + IOS.read( (char*)&tReadFlag, sizeof(Uint32) ); //! Read every game object header corresponding to this tile for ( i = 0; i < mLayerCount; i++ ) { @@ -921,7 +921,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { sMapTileGOHdr tTGOHdr; - IOS.Read( (char*)&tTGOHdr, sizeof(sMapTileGOHdr) ); + IOS.read( (char*)&tTGOHdr, sizeof(sMapTileGOHdr) ); tGO = CreateGameObject( tTGOHdr.Type, tTGOHdr.Flags, mLayers[i], tTGOHdr.Id ); @@ -947,7 +947,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { for ( Uint32 objCount = 0; objCount < tLayerHdr->ObjectCount; objCount++ ) { sMapObjGOHdr tOGOHdr; - IOS.Read( (char*)&tOGOHdr, sizeof(sMapObjGOHdr) ); + IOS.read( (char*)&tOGOHdr, sizeof(sMapObjGOHdr) ); //! For the polygon objects wee need to read the polygon points, the Name, the TypeName and the Properties. if ( tOGOHdr.Type == GAMEOBJECT_TYPE_OBJECT || @@ -959,7 +959,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { //! First we read the poly obj header sMapObjObjHdr tObjObjHdr; - IOS.Read( (char*)&tObjObjHdr, sizeof(sMapObjObjHdr) ); + IOS.read( (char*)&tObjObjHdr, sizeof(sMapObjObjHdr) ); tObjData.Name = std::string( tObjObjHdr.Name ); tObjData.Type = std::string( tObjObjHdr.Type ); @@ -968,7 +968,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { for ( Uint32 iProp = 0; iProp < tObjObjHdr.PropertyCount; iProp++ ) { sPropertyHdr tObjProp; - IOS.Read( (char*)&tObjProp, sizeof(sPropertyHdr) ); + IOS.read( (char*)&tObjProp, sizeof(sPropertyHdr) ); tObjData.Properties[ std::string( tObjProp.Name ) ] = std::string( tObjProp.Value ); } @@ -977,7 +977,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { for ( Uint32 iPoint = 0; iPoint < tObjObjHdr.PointCount; iPoint++ ) { Vector2if p; - IOS.Read( (char*)&p, sizeof(Vector2if) ); + IOS.read( (char*)&p, sizeof(Vector2if) ); tObjData.Poly.PushBack( Vector2f( p.x, p.y ) ); } @@ -1004,7 +1004,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { sMapLightHdr * tLighsHdr = eeNewArray( sMapLightHdr, MapHdr.LightsCount ); sMapLightHdr * tLightHdr; - IOS.Read( (char*)tLighsHdr, sizeof(sMapLightHdr) * MapHdr.LightsCount ); + IOS.read( (char*)tLighsHdr, sizeof(sMapLightHdr) * MapHdr.LightsCount ); for ( i = 0; i < MapHdr.LightsCount; i++ ) { tLightHdr = &( tLighsHdr[ i ] ); @@ -1039,15 +1039,15 @@ const std::string& TileMap::Path() const { } bool TileMap::Load( const std::string& path ) { - if ( FileSystem::FileExists( path ) ) { + if ( FileSystem::fileExists( path ) ) { mPath = path; IOStreamFile IOS( mPath, std::ios::in | std::ios::binary ); return LoadFromStream( IOS ); - } else if ( PackManager::instance()->FallbackToPacks() ) { + } else if ( PackManager::instance()->fallbackToPacks() ) { std::string tPath( path ); - Pack * tPack = PackManager::instance()->Exists( tPath ) ; + Pack * tPack = PackManager::instance()->exists( tPath ) ; if ( NULL != tPack ) { mPath = tPath; @@ -1059,10 +1059,10 @@ bool TileMap::Load( const std::string& path ) { } bool TileMap::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { - if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( FilePackPath ) ) { + if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( FilePackPath ) ) { SafeDataPointer PData; - Pack->ExtractFileToMemory( FilePackPath, PData ); + Pack->extractFileToMemory( FilePackPath, PData ); return LoadFromMemory( reinterpret_cast ( PData.Data ), PData.DataSize ); } @@ -1094,16 +1094,16 @@ void TileMap::SaveToStream( IOStream& IOS ) { MapHdr.PropertyCount = mProperties.size(); MapHdr.TextureAtlasCount = TextureAtlases.size(); MapHdr.VirtualObjectTypesCount = mObjTypes.size(); //! This is only useful for the Map Editor, to auto add on the load the virtual object types that where used to create the map. - MapHdr.BaseColor = mBaseColor.GetValue(); + MapHdr.BaseColor = mBaseColor.getValue(); if ( LightsEnabled() && NULL != mLightManager ) MapHdr.LightsCount = mLightManager->Count(); else MapHdr.LightsCount = 0; - if ( IOS.IsOpen() ) { + if ( IOS.isOpen() ) { //! Writes the map header - IOS.Write( (const char*)&MapHdr, sizeof(sMapHdr) ); + IOS.write( (const char*)&MapHdr, sizeof(sMapHdr) ); //! Writes the properties of the map for ( TileMap::PropertiesMap::iterator it = mProperties.begin(); it != mProperties.end(); it++ ) { @@ -1112,10 +1112,10 @@ void TileMap::SaveToStream( IOStream& IOS ) { memset( tProp.Name, 0, MAP_PROPERTY_SIZE ); memset( tProp.Value, 0, MAP_PROPERTY_SIZE ); - String::StrCopy( tProp.Name, it->first.c_str(), MAP_PROPERTY_SIZE ); - String::StrCopy( tProp.Value, it->second.c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tProp.Name, it->first.c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tProp.Value, it->second.c_str(), MAP_PROPERTY_SIZE ); - IOS.Write( (const char*)&tProp, sizeof(sPropertyHdr) ); + IOS.write( (const char*)&tProp, sizeof(sPropertyHdr) ); } //! Writes the texture atlases that the map will need and load @@ -1124,9 +1124,9 @@ void TileMap::SaveToStream( IOStream& IOS ) { memset( tSG.Path, 0, MAP_TEXTUREATLAS_PATH_SIZE ); - String::StrCopy( tSG.Path, TextureAtlases[i].c_str(), MAP_TEXTUREATLAS_PATH_SIZE ); + String::strCopy( tSG.Path, TextureAtlases[i].c_str(), MAP_TEXTUREATLAS_PATH_SIZE ); - IOS.Write( (const char*)&tSG, sizeof(sMapTextureAtlas) ); + IOS.write( (const char*)&tSG, sizeof(sMapTextureAtlas) ); } //! Writes the names of the virtual object types created in the map editor @@ -1135,9 +1135,9 @@ void TileMap::SaveToStream( IOStream& IOS ) { memset( tVObjH.Name, 0, MAP_PROPERTY_SIZE ); - String::StrCopy( tVObjH.Name, (*votit).c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tVObjH.Name, (*votit).c_str(), MAP_PROPERTY_SIZE ); - IOS.Write( (const char*)&tVObjH, sizeof(sVirtualObj) ); + IOS.write( (const char*)&tVObjH, sizeof(sVirtualObj) ); } //! Writes every layer header @@ -1147,7 +1147,7 @@ void TileMap::SaveToStream( IOStream& IOS ) { memset( tLayerH.Name, 0, LAYER_NAME_SIZE ); - String::StrCopy( tLayerH.Name, tLayer->Name().c_str(), LAYER_NAME_SIZE ); + String::strCopy( tLayerH.Name, tLayer->Name().c_str(), LAYER_NAME_SIZE ); tLayerH.Type = tLayer->Type(); tLayerH.Flags = tLayer->Flags(); @@ -1164,7 +1164,7 @@ void TileMap::SaveToStream( IOStream& IOS ) { tLayerH.PropertyCount = tLayerProp.size(); //! Writes the layer header - IOS.Write( (const char*)&tLayerH, sizeof(sLayerHdr) ); + IOS.write( (const char*)&tLayerH, sizeof(sLayerHdr) ); //! Writes the properties of the current layer for ( MapLayer::PropertiesMap::iterator lit = tLayerProp.begin(); lit != tLayerProp.end(); lit++ ) { @@ -1173,10 +1173,10 @@ void TileMap::SaveToStream( IOStream& IOS ) { memset( tProp.Name, 0, MAP_PROPERTY_SIZE ); memset( tProp.Value, 0, MAP_PROPERTY_SIZE ); - String::StrCopy( tProp.Name, (*lit).first.c_str(), MAP_PROPERTY_SIZE ); - String::StrCopy( tProp.Value, (*lit).second.c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tProp.Name, (*lit).first.c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tProp.Value, (*lit).second.c_str(), MAP_PROPERTY_SIZE ); - IOS.Write( (const char*)&tProp, sizeof(sPropertyHdr) ); + IOS.write( (const char*)&tProp, sizeof(sPropertyHdr) ); } } @@ -1226,7 +1226,7 @@ void TileMap::SaveToStream( IOStream& IOS ) { } //! Writes the current tile flags - IOS.Write( (const char*)&tReadFlag, sizeof(Uint32) ); + IOS.write( (const char*)&tReadFlag, sizeof(Uint32) ); //! Writes every game object header corresponding to this tile for ( i = 0; i < mLayerCount; i++ ) { @@ -1249,7 +1249,7 @@ void TileMap::SaveToStream( IOStream& IOS ) { tTGOHdr.Flags = tObj->Flags(); - IOS.Write( (const char*)&tTGOHdr, sizeof(sMapTileGOHdr) ); + IOS.write( (const char*)&tTGOHdr, sizeof(sMapTileGOHdr) ); } } } @@ -1291,7 +1291,7 @@ void TileMap::SaveToStream( IOStream& IOS ) { tOGOHdr.PosY = (Int32)tObj->Pos().y; - IOS.Write( (const char*)&tOGOHdr, sizeof(sMapObjGOHdr) ); + IOS.write( (const char*)&tOGOHdr, sizeof(sMapObjGOHdr) ); //! For the polygon objects wee need to write the polygon points, the Name, the TypeName and the Properties. if ( tObj->Type() == GAMEOBJECT_TYPE_OBJECT || @@ -1306,14 +1306,14 @@ void TileMap::SaveToStream( IOStream& IOS ) { memset( tObjObjHdr.Name, 0, MAP_PROPERTY_SIZE ); memset( tObjObjHdr.Type, 0, MAP_PROPERTY_SIZE ); - String::StrCopy( tObjObjHdr.Name, tObjObj->Name().c_str(), MAP_PROPERTY_SIZE ); - String::StrCopy( tObjObjHdr.Type, tObjObj->TypeName().c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tObjObjHdr.Name, tObjObj->Name().c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tObjObjHdr.Type, tObjObj->TypeName().c_str(), MAP_PROPERTY_SIZE ); tObjObjHdr.PointCount = tPoly.Size(); tObjObjHdr.PropertyCount = tObjObjProp.size(); //! Writes the ObjObj header - IOS.Write( (const char*)&tObjObjHdr, sizeof(sMapObjObjHdr) ); + IOS.write( (const char*)&tObjObjHdr, sizeof(sMapObjObjHdr) ); //! Writes the properties of the current polygon object for ( GameObjectObject::PropertiesMap::iterator ooit = tObjObjProp.begin(); ooit != tObjObjProp.end(); ooit++ ) { @@ -1322,10 +1322,10 @@ void TileMap::SaveToStream( IOStream& IOS ) { memset( tProp.Name, 0, MAP_PROPERTY_SIZE ); memset( tProp.Value, 0, MAP_PROPERTY_SIZE ); - String::StrCopy( tProp.Name, ooit->first.c_str(), MAP_PROPERTY_SIZE ); - String::StrCopy( tProp.Value, ooit->second.c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tProp.Name, ooit->first.c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tProp.Value, ooit->second.c_str(), MAP_PROPERTY_SIZE ); - IOS.Write( (const char*)&tProp, sizeof(sPropertyHdr) ); + IOS.write( (const char*)&tProp, sizeof(sPropertyHdr) ); } //! Writes the polygon points @@ -1333,7 +1333,7 @@ void TileMap::SaveToStream( IOStream& IOS ) { Vector2f pf( tPoly.GetAt( tPoint ) ); Vector2if p( pf.x, pf.y ); //! Convert it to Int32 - IOS.Write( (const char*)&p, sizeof(Vector2if) ); + IOS.write( (const char*)&p, sizeof(Vector2if) ); } } } @@ -1352,17 +1352,17 @@ void TileMap::SaveToStream( IOStream& IOS ) { tLightHdr.Radius = Light->Radius(); tLightHdr.PosX = (Int32)Light->Position().x; tLightHdr.PosY = (Int32)Light->Position().y; - tLightHdr.Color = ColorA( Light->Color() ).GetValue(); + tLightHdr.Color = ColorA( Light->Color() ).getValue(); tLightHdr.Type = Light->Type(); - IOS.Write( (const char*)&tLightHdr, sizeof(sMapLightHdr) ); + IOS.write( (const char*)&tLightHdr, sizeof(sMapLightHdr) ); } } } } void TileMap::Save( const std::string& path ) { - if ( !FileSystem::IsDirectory( path ) ) { + if ( !FileSystem::isDirectory( path ) ) { IOStreamFile IOS( path, std::ios::out | std::ios::binary ); SaveToStream( IOS ); @@ -1373,13 +1373,13 @@ void TileMap::Save( const std::string& path ) { std::vector TileMap::GetTextureAtlases() { TextureAtlasManager * SGM = TextureAtlasManager::instance(); - std::list& Res = SGM->GetResources(); + std::list& Res = SGM->getResources(); std::vector items; //! Ugly ugly ugly, but i don't see another way - Uint32 Restricted1 = String::Hash( std::string( "global" ) ); - Uint32 Restricted2 = String::Hash( UI::UIThemeManager::instance()->DefaultTheme()->TextureAtlas()->Name() ); + Uint32 Restricted1 = String::hash( std::string( "global" ) ); + Uint32 Restricted2 = String::hash( UI::UIThemeManager::instance()->DefaultTheme()->TextureAtlas()->Name() ); for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { if ( (*it)->Id() != Restricted1 && (*it)->Id() != Restricted2 ) diff --git a/src/eepp/graphics/console.cpp b/src/eepp/graphics/console.cpp index 441f3babc..6cede4ed8 100755 --- a/src/eepp/graphics/console.cpp +++ b/src/eepp/graphics/console.cpp @@ -84,7 +84,7 @@ Console::Console( Font* Font, const bool& MakeDefaultCommands, const bool& Attac Console::~Console() { if ( mMyCallback && - NULL != Engine::ExistsSingleton() && + NULL != Engine::existsSingleton() && Engine::instance()->ExistsWindow( mWindow ) ) { @@ -94,8 +94,8 @@ Console::~Console() { eeSAFE_DELETE( mTBuf ); - if ( Log::ExistsSingleton() ) { - Log::instance()->RemoveLogReader( this ); + if ( Log::existsSingleton() ) { + Log::instance()->removeLogReader( this ); } } @@ -115,7 +115,7 @@ void Console::Create( Font* Font, const bool& MakeDefaultCommands, const bool& A mTexId = TextureId; mMaxLogLines = MaxLogLines; - mMaxAlpha = (Float)mConColor.A(); + mMaxAlpha = (Float)mConColor.a(); mEnabled = true; @@ -126,7 +126,7 @@ void Console::Create( Font* Font, const bool& MakeDefaultCommands, const bool& A mHeight = (Float) mWindow->GetHeight(); mHeightMin = (Float) ( mWindow->GetHeight() / 2 ); - if ( NULL != Engine::ExistsSingleton() && + if ( NULL != Engine::existsSingleton() && Engine::instance()->ExistsWindow( mWindow ) ) { mMyCallback = mWindow->GetInput()->PushCallback( cb::Make1( this, &Console::PrivInputCallback ) ); @@ -144,7 +144,7 @@ void Console::Create( Font* Font, const bool& MakeDefaultCommands, const bool& A CmdGetLog(); if ( AttachToLog ) { - Log::instance()->AddLogReader( this ); + Log::instance()->addLogReader( this ); } } @@ -161,17 +161,17 @@ void Console::Draw() { if ( mY > 0.0f ) { if ( mTexId == 0 ) { - mPri.SetColor( ColorA( mConColor.R(), mConColor.G(), mConColor.B(), static_cast(mA) ) ); + mPri.SetColor( ColorA( mConColor.r(), mConColor.g(), mConColor.b(), static_cast(mA) ) ); mPri.DrawRectangle( Rectf( Vector2f( 0.0f, 0.0f ), Sizef( mWidth, mY ) ) ); } else { - ColorA C( mConColor.R(), mConColor.G(), mConColor.B(), static_cast(mA) ); + ColorA C( mConColor.r(), mConColor.g(), mConColor.b(), static_cast(mA) ); Texture * Tex = TextureFactory::instance()->GetTexture( mTexId ); if ( NULL != Tex ) Tex->DrawEx( 0.0f, 0.0f, mWidth, mY, 0.0f, Vector2f::One, C, C, C, C ); } - mPri.SetColor( ColorA( mConLineColor.R(), mConLineColor.G(), mConLineColor.B(), static_cast(mA) ) ); + mPri.SetColor( ColorA( mConLineColor.r(), mConLineColor.g(), mConLineColor.b(), static_cast(mA) ) ); mPri.DrawRectangle( Rectf( Vector2f( 0.0f, mY ), Sizef( mWidth, 4.0f ) ) ); Int32 linesInScreen = LinesInScreen(); @@ -188,7 +188,7 @@ void Console::Draw() { mCon.ConMin = mEx; mCon.ConMax = (int)mCmdLog.size() - 1; - mFont->Color( ColorA ( mFontColor.R(), mFontColor.G(), mFontColor.B(), static_cast(mA) ) ); + mFont->Color( ColorA ( mFontColor.r(), mFontColor.g(), mFontColor.b(), static_cast(mA) ) ); for (int i = mCon.ConMax - mCon.ConModif; i >= mCon.ConMin - mCon.ConModif; i-- ) { if ( i < static_cast( mCmdLog.size() ) && i >= 0 ) { @@ -202,11 +202,11 @@ void Console::Draw() { CurY = mTempY + mY + mCurHeight - mFontSize - 1; - mFont->Color( ColorA ( mFontLineColor.R(), mFontLineColor.G(), mFontLineColor.B(), static_cast(mA) ) ); + mFont->Color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mA) ) ); mFont->SetText( "> " + mTBuf->Buffer() ); mFont->Draw( mFontSize, CurY ); - mFont->Color( ColorA ( mFontLineColor.R(), mFontLineColor.G(), mFontLineColor.B(), static_cast(mCurAlpha) ) ); + mFont->Color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mCurAlpha) ) ); if ( (unsigned int)mTBuf->CurPos() == mTBuf->Buffer().size() ) { mFont->Draw( "_", mFontSize + mFont->GetTextWidth() , CurY ); @@ -222,7 +222,7 @@ void Console::Draw() { if ( mShowFps && NULL != mFont ) { ColorA OldColor1( mFont->Color() ); mFont->Color( ColorA () ); - mFont->SetText( "FPS: " + String::ToStr( mWindow->FPS() ) ); + mFont->SetText( "FPS: " + String::toStr( mWindow->FPS() ) ); mFont->Draw( mWindow->GetWidth() - mFont->GetTextWidth() - 15, 6 ); mFont->Color( OldColor1 ); } @@ -248,7 +248,7 @@ void Console::FadeOut() { } static std::vector< String > SplitCommandParams( String str ) { - std::vector < String > params = String::Split( str, ' ' ); + std::vector < String > params = String::split( str, ' ' ); std::vector < String > rparams; String tstr; @@ -261,7 +261,7 @@ static std::vector< String > SplitCommandParams( String str ) { } else if ( '"' == tparam[ tparam.size() - 1 ] ) { tstr += " " + tparam; - rparams.push_back( String::Trim( tstr, '"' ) ); + rparams.push_back( String::trim( tstr, '"' ) ); tstr = ""; } else if ( !tstr.empty() ) { @@ -273,7 +273,7 @@ static std::vector< String > SplitCommandParams( String str ) { } if ( !tstr.empty() ) { - rparams.push_back( String::Trim( tstr, '"' ) ); + rparams.push_back( String::trim( tstr, '"' ) ); } return rparams; @@ -310,7 +310,7 @@ void Console::PrivPushText( const String& str ) { void Console::PushText( const String& str ) { if ( std::string::npos != str.find_first_of( '\n' ) ) { - std::vector Strings = String::Split( String( str ) ); + std::vector Strings = String::split( String( str ) ); for ( Uint32 i = 0; i < Strings.size(); i++ ) { PrivPushText( Strings[i] ); @@ -359,13 +359,13 @@ void Console::Toggle() { void Console::Fade() { if (mCurSide) { - mCurAlpha -= 255.f * mWindow->Elapsed().AsMilliseconds() / mFadeSpeed.AsMilliseconds(); + mCurAlpha -= 255.f * mWindow->Elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); if ( mCurAlpha <= 0.0f ) { mCurAlpha = 0.0f; mCurSide = !mCurSide; } } else { - mCurAlpha += 255.f * mWindow->Elapsed().AsMilliseconds() / mFadeSpeed.AsMilliseconds(); + mCurAlpha += 255.f * mWindow->Elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); if ( mCurAlpha >= 255.f ) { mCurAlpha = 255.f; mCurSide = !mCurSide; @@ -379,7 +379,7 @@ void Console::Fade() { if ( mFadeIn ) { mFadeOut = false; - mY += mCurHeight * mWindow->Elapsed().AsMilliseconds() / mFadeSpeed.AsMilliseconds(); + mY += mCurHeight * mWindow->Elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); mA = ( mY * mMaxAlpha / mCurHeight ) ; if ( mY > mCurHeight ) { @@ -391,7 +391,7 @@ void Console::Fade() { if ( mFadeOut ) { mFadeIn = false; - mY -= mCurHeight * mWindow->Elapsed().AsMilliseconds() / mFadeSpeed.AsMilliseconds(); + mY -= mCurHeight * mWindow->Elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); mA = ( mY * mMaxAlpha / mCurHeight ) ; if ( mY <= 0.0f ) { @@ -447,7 +447,7 @@ void Console::PrintCommandsStartingWith( const String& start ) { std::map < String, ConsoleCallback >::iterator it; for ( it = mCallbacks.begin(); it != mCallbacks.end(); it++ ) { - if ( String::StartsWith( it->first, start ) ) { + if ( String::startsWith( it->first, start ) ) { cmds.push_back( it->first ); } } @@ -487,7 +487,7 @@ void Console::PrivVideoResize( EE::Window::Window * win ) { } void Console::GetFilesFrom( std::string txt, const Uint32& curPos ) { - static char OSSlash = FileSystem::GetOSlash().at(0); + static char OSSlash = FileSystem::getOSlash().at(0); size_t pos; if ( std::string::npos != ( pos = txt.find_last_of( OSSlash ) ) && pos <= curPos ) { @@ -496,9 +496,9 @@ void Console::GetFilesFrom( std::string txt, const Uint32& curPos ) { std::string dir( txt.substr( fpos, pos - fpos + 1 ) ); std::string file( txt.substr( pos + 1 ) ); - if ( FileSystem::IsDirectory( dir ) ) { + if ( FileSystem::isDirectory( dir ) ) { size_t count = 0, lasti = 0; - std::vector files = FileSystem::FilesGetInPath( dir, true, true ); + std::vector files = FileSystem::filesGetInPath( dir, true, true ); String res; bool again = false; @@ -509,7 +509,7 @@ void Console::GetFilesFrom( std::string txt, const Uint32& curPos ) { again = false; for ( size_t i = 0; i < files.size(); i++ ) { - if ( !file.size() || String::StartsWith( files[i], file ) ) { + if ( !file.size() || String::startsWith( files[i], file ) ) { res += "\t" + files[i] + "\n"; count++; lasti = i; @@ -536,7 +536,7 @@ void Console::GetFilesFrom( std::string txt, const Uint32& curPos ) { allStartsWith = true; for ( size_t i = 0; i < foundFiles.size(); i++ ) { - if ( !String::StartsWith( foundFiles[i], tfile ) ) { + if ( !String::startsWith( foundFiles[i], tfile ) ) { allStartsWith = false; break; } @@ -554,8 +554,8 @@ void Console::GetFilesFrom( std::string txt, const Uint32& curPos ) { if ( count == 1 ) { std::string slash = ""; - if ( FileSystem::IsDirectory( dir + files[lasti] ) ) { - slash = FileSystem::GetOSlash(); + if ( FileSystem::isDirectory( dir + files[lasti] ) ) { + slash = FileSystem::getOSlash(); } mTBuf->Buffer( mTBuf->Buffer().substr( 0, pos + 1 ) + files[lasti] + slash ); @@ -586,7 +586,7 @@ void Console::PrivInputCallback( InputEvent * Event ) { if ( InputEvent::KeyDown == etype ) { if ( ( KeyCode == KEY_TAB ) && (unsigned int)mTBuf->CurPos() == mTBuf->Buffer().size() ) { PrintCommandsStartingWith( mTBuf->Buffer() ); - GetFilesFrom( mTBuf->Buffer().ToUtf8(), mTBuf->CurPos() ); + GetFilesFrom( mTBuf->Buffer().toUtf8(), mTBuf->CurPos() ); } if ( KeyMod & KEYMOD_SHIFT ) { @@ -716,7 +716,7 @@ void Console::CmdQuit ( const std::vector < String >& params ) { } void Console::CmdGetTextureMemory ( const std::vector < String >& params ) { - PrivPushText( "Total texture memory used: " + FileSystem::SizeToString( TextureFactory::instance()->MemorySize() ) ); + PrivPushText( "Total texture memory used: " + FileSystem::sizeToString( TextureFactory::instance()->MemorySize() ) ); } void Console::CmdCmdList ( const std::vector < String >& params ) { @@ -730,7 +730,7 @@ void Console::CmdShowCursor ( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; - bool Res = String::FromString( tInt, params[1] ); + bool Res = String::fromString( tInt, params[1] ); if ( Res && ( tInt == 0 || tInt == 1 ) ) { mWindow->GetCursorManager()->Visible( 0 != tInt ); @@ -745,7 +745,7 @@ void Console::CmdFrameLimit ( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; - bool Res = String::FromString( tInt, params[1] ); + bool Res = String::fromString( tInt, params[1] ); if ( Res && ( tInt >= 0 && tInt <= 10000 ) ) { mWindow->FrameRateLimit( tInt ); @@ -757,7 +757,7 @@ void Console::CmdFrameLimit ( const std::vector < String >& params ) { } void Console::CmdGetLog() { - std::vector < String > tvec = String::Split( String( String::ToStr( Log::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] ); @@ -769,7 +769,7 @@ void Console::CmdGetLog( const std::vector < String >& params ) { } void Console::CmdGetGpuExtensions() { - std::vector < String > tvec = String::Split( String( GLi->GetExtensions() ), ' ' ); + std::vector < String > tvec = String::split( String( GLi->GetExtensions() ), ' ' ); if ( tvec.size() > 0 ) { for ( unsigned int i = 0; i < tvec.size(); i++ ) PrivPushText( tvec[i] ); @@ -784,7 +784,7 @@ void Console::CmdSetGamma( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Float tFloat = 0.f; - bool Res = String::FromString( tFloat, params[1] ); + bool Res = String::fromString( tFloat, params[1] ); if ( Res && ( tFloat > 0.1f && tFloat <= 10.0f ) ) { mWindow->SetGamma( tFloat, tFloat, tFloat ); @@ -799,7 +799,7 @@ void Console::CmdSetVolume( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Float tFloat = 0.f; - bool Res = String::FromString( tFloat, params[1] ); + bool Res = String::fromString( tFloat, params[1] ); if ( Res && ( tFloat >= 0.0f && tFloat <= 100.0f ) ) { EE::Audio::AudioListener::GlobalVolume( tFloat ); @@ -812,7 +812,7 @@ void Console::CmdSetVolume( const std::vector < String >& params ) { void Console::CmdDir( const std::vector < String >& params ) { if ( params.size() >= 2 ) { - String Slash( FileSystem::GetOSlash() ); + String Slash( FileSystem::getOSlash() ); String myPath = params[1]; String myOrder; @@ -820,10 +820,10 @@ void Console::CmdDir( const std::vector < String >& params ) { myOrder = params[2]; } - if ( FileSystem::IsDirectory( myPath ) ) { + if ( FileSystem::isDirectory( myPath ) ) { unsigned int i; - std::vector mFiles = FileSystem::FilesGetInPath( myPath ); + std::vector mFiles = FileSystem::filesGetInPath( myPath ); std::sort( mFiles.begin(), mFiles.end() ); PrivPushText( "Directory: " + myPath ); @@ -833,7 +833,7 @@ void Console::CmdDir( const std::vector < String >& params ) { std::vector mFile; for ( i = 0; i < mFiles.size(); i++ ) { - if ( FileSystem::IsDirectory( myPath + Slash + mFiles[i] ) ) { + if ( FileSystem::isDirectory( myPath + Slash + mFiles[i] ) ) { mFolders.push_back( mFiles[i] ); } else { mFile.push_back( mFiles[i] ); @@ -871,7 +871,7 @@ void Console::CmdShowFps( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; - bool Res = String::FromString( tInt, params[1] ); + bool Res = String::fromString( tInt, params[1] ); if ( Res && ( tInt == 0 || tInt == 1 ) ) { mShowFps = 0 != tInt; @@ -899,7 +899,7 @@ void Console::ShowFps( const bool& Show ) { } void Console::WriteLog( const std::string& Text ) { - std::vector Strings = String::Split( String( Text ) ); + std::vector Strings = String::split( String( Text ) ); for ( Uint32 i = 0; i < Strings.size(); i++ ) { PrivPushText( Strings[i] ); diff --git a/src/eepp/graphics/font.cpp b/src/eepp/graphics/font.cpp index 8699c0707..ab01f9977 100644 --- a/src/eepp/graphics/font.cpp +++ b/src/eepp/graphics/font.cpp @@ -17,14 +17,14 @@ Font::Font( const Uint32& Type, const std::string& Name ) : mTextCache( this ) { this->Name( Name ); - FontManager::instance()->Add( this ); + FontManager::instance()->add( this ); } Font::~Font() { mGlyphs.clear(); - if ( !FontManager::instance()->IsDestroying() ) { - FontManager::instance()->Remove( this, false ); + if ( !FontManager::instance()->isDestroying() ) { + FontManager::instance()->remove( this, false ); } } @@ -120,10 +120,10 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin SetText( TextCache.Text() ); - if ( Col.A() != 255 ) { + if ( Col.a() != 255 ) { ColorA ShadowColor = TextCache.ShadowColor(); - ShadowColor.Alpha = (Uint8)( (Float)ShadowColor.Alpha * ( (Float)Col.A() / (Float)255 ) ); + ShadowColor.Alpha = (Uint8)( (Float)ShadowColor.Alpha * ( (Float)Col.a() / (Float)255 ) ); Color( ShadowColor ); } else { @@ -438,7 +438,7 @@ Vector2i Font::GetCursorPos( const String& Text, const Uint32& Pos ) { } static bool IsStopSelChar( Uint32 c ) { - return ( !String::IsCharacter( c ) && !String::IsNumber( c ) ) || + return ( !String::isCharacter( c ) && !String::isNumber( c ) ) || ' ' == c || '.' == c || ',' == c || @@ -616,7 +616,7 @@ const std::string& Font::Name() const { void Font::Name( const std::string& name ) { mFontName = name; - mFontHash = String::Hash( mFontName ); + mFontHash = String::hash( mFontName ); } const Uint32& Font::Id() { diff --git a/src/eepp/graphics/fontmanager.cpp b/src/eepp/graphics/fontmanager.cpp index 1dd4c8f52..fe281b21a 100644 --- a/src/eepp/graphics/fontmanager.cpp +++ b/src/eepp/graphics/fontmanager.cpp @@ -10,9 +10,9 @@ FontManager::FontManager() { FontManager::~FontManager() { } -Graphics::Font * FontManager::Add( Graphics::Font * Font ) { +Graphics::Font * FontManager::add( Graphics::Font * Font ) { eeASSERT( NULL != Font ); - return ResourceManager::Add( Font ); + return ResourceManager::add( Font ); } }} diff --git a/src/eepp/graphics/framebuffer.cpp b/src/eepp/graphics/framebuffer.cpp index b082b360a..8a1328dfc 100644 --- a/src/eepp/graphics/framebuffer.cpp +++ b/src/eepp/graphics/framebuffer.cpp @@ -29,7 +29,7 @@ FrameBuffer::FrameBuffer( EE::Window::Window * window ) : mWindow = Engine::instance()->GetCurrentWindow(); } - FrameBufferManager::instance()->Add( this ); + FrameBufferManager::instance()->add( this ); } FrameBuffer::~FrameBuffer() { @@ -37,7 +37,7 @@ FrameBuffer::~FrameBuffer() { eeSAFE_DELETE( mTexture ); } - FrameBufferManager::instance()->Remove( this ); + FrameBufferManager::instance()->remove( this ); } Texture * FrameBuffer::GetTexture() const { @@ -53,7 +53,7 @@ ColorAf FrameBuffer::ClearColor() const { } void FrameBuffer::Clear() { - GLi->ClearColor( mClearColor.R(), mClearColor.G(), mClearColor.B(), mClearColor.A() ); + GLi->ClearColor( mClearColor.r(), mClearColor.g(), mClearColor.b(), mClearColor.a() ); GLi->Clear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); mWindow->BackColor( mWindow->BackColor() ); } diff --git a/src/eepp/graphics/image.cpp b/src/eepp/graphics/image.cpp index e446c4fa6..c3ccbf5d3 100644 --- a/src/eepp/graphics/image.cpp +++ b/src/eepp/graphics/image.cpp @@ -203,14 +203,14 @@ EE_PIXEL_FORMAT Image::ChannelsToPixelFormat( const Uint32& channels ) { bool Image::GetInfo( const std::string& path, int * width, int * height, int * channels ) { bool res = stbi_info( path.c_str(), width, height, channels ) != 0; - if ( !res && PackManager::instance()->FallbackToPacks() ) { + if ( !res && PackManager::instance()->fallbackToPacks() ) { std::string npath( path ); - Pack * tPack = PackManager::instance()->Exists( npath ); + Pack * tPack = PackManager::instance()->exists( npath ); if ( NULL != tPack ) { SafeDataPointer PData; - tPack->ExtractFileToMemory( npath, PData ); + tPack->extractFileToMemory( npath, PData ); res = 0 != stbi_info_from_memory( PData.Data, PData.DataSize, width, height, channels ); } @@ -299,7 +299,7 @@ Image::Image( std::string Path, const unsigned int& forceChannels ) : Uint8 * data = stbi_load( Path.c_str(), &w, &h, &c, mChannels ); if ( NULL == data ) { - data = stbi_load( ( Sys::GetProcessPath() + Path ).c_str(), &w, &h, &c, mChannels ); + data = stbi_load( ( Sys::getProcessPath() + Path ).c_str(), &w, &h, &c, mChannels ); } if ( NULL != data ) { @@ -313,7 +313,7 @@ Image::Image( std::string Path, const unsigned int& forceChannels ) : mSize = mWidth * mHeight * mChannels; mLoadedFromStbi = true; - } else if ( PackManager::instance()->FallbackToPacks() && NULL != ( tPack = PackManager::instance()->Exists( Path ) ) ) { + } else if ( PackManager::instance()->fallbackToPacks() && NULL != ( tPack = PackManager::instance()->exists( Path ) ) ) { LoadFromPack( tPack, Path ); } else { std::string reason = "."; @@ -344,10 +344,10 @@ Image::~Image() { } void Image::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { - if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( FilePackPath ) ) { + if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( FilePackPath ) ) { SafeDataPointer PData; - Pack->ExtractFileToMemory( FilePackPath, PData ); + Pack->extractFileToMemory( FilePackPath, PData ); int w, h, c; Uint8 * data = stbi_load_from_memory( PData.Data, PData.DataSize, &w, &h, &c, mChannels ); @@ -414,7 +414,7 @@ void Image::Allocate( const Uint32& size, ColorA DefaultColor, bool memsetData ) mSize = size; if ( memsetData ) { - memset( mPixels, (int)DefaultColor.GetValue(), size ); + memset( mPixels, (int)DefaultColor.getValue(), size ); } } @@ -462,10 +462,10 @@ unsigned int Image::Channels() const { bool Image::SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ) { bool Res = false; - std::string fpath( FileSystem::FileRemoveFileName( filepath )); + std::string fpath( FileSystem::fileRemoveFileName( filepath )); - if ( !FileSystem::IsDirectory( fpath ) ) - FileSystem::MakeDir( fpath ); + if ( !FileSystem::isDirectory( fpath ) ) + FileSystem::makeDir( fpath ); if ( NULL != mPixels && 0 != mWidth && 0 != mHeight && 0 != mChannels ) { if ( SAVE_TYPE_JPG != Format ) { @@ -492,37 +492,37 @@ void Image::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { Pos = i * mChannels; if ( 4 == mChannels ) { - if ( mPixels[ Pos ] == ColorKey.R() && mPixels[ Pos + 1 ] == ColorKey.G() && mPixels[ Pos + 2 ] == ColorKey.B() && mPixels[ Pos + 3 ] == ColorKey.A() ) { - mPixels[ Pos ] = NewColor.R(); - mPixels[ Pos + 1 ] = NewColor.G(); - mPixels[ Pos + 2 ] = NewColor.B(); - mPixels[ Pos + 3 ] = NewColor.A(); + if ( mPixels[ Pos ] == ColorKey.r() && mPixels[ Pos + 1 ] == ColorKey.g() && mPixels[ Pos + 2 ] == ColorKey.b() && mPixels[ Pos + 3 ] == ColorKey.a() ) { + mPixels[ Pos ] = NewColor.r(); + mPixels[ Pos + 1 ] = NewColor.g(); + mPixels[ Pos + 2 ] = NewColor.b(); + mPixels[ Pos + 3 ] = NewColor.a(); } } else if ( 3 == mChannels ) { - if ( mPixels[ Pos ] == ColorKey.R() && mPixels[ Pos + 1 ] == ColorKey.G() && mPixels[ Pos + 2 ] == ColorKey.B() ) { - mPixels[ Pos ] = NewColor.R(); - mPixels[ Pos + 1 ] = NewColor.G(); - mPixels[ Pos + 2 ] = NewColor.B(); + if ( mPixels[ Pos ] == ColorKey.r() && mPixels[ Pos + 1 ] == ColorKey.g() && mPixels[ Pos + 2 ] == ColorKey.b() ) { + mPixels[ Pos ] = NewColor.r(); + mPixels[ Pos + 1 ] = NewColor.g(); + mPixels[ Pos + 2 ] = NewColor.b(); } } else if ( 2 == mChannels ) { - if ( mPixels[ Pos ] == ColorKey.R() && mPixels[ Pos + 1 ] == ColorKey.G() ) { - mPixels[ Pos ] = NewColor.R(); - mPixels[ Pos + 1 ] = NewColor.G(); + if ( mPixels[ Pos ] == ColorKey.r() && mPixels[ Pos + 1 ] == ColorKey.g() ) { + mPixels[ Pos ] = NewColor.r(); + mPixels[ Pos + 1 ] = NewColor.g(); } } else if ( 1 == mChannels ) { - if ( mPixels[ Pos ] == ColorKey.R() ) { - mPixels[ Pos ] = NewColor.R(); + if ( mPixels[ Pos ] == ColorKey.r() ) { + mPixels[ Pos ] = NewColor.r(); } } } } void Image::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { - ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) ); + ReplaceColor( ColorKey, ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), Alpha ) ); } void Image::CreateMaskFromColor( const RGB& ColorKey, Uint8 Alpha ) { - CreateMaskFromColor( ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), 255 ), Alpha ); + CreateMaskFromColor( ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), 255 ), Alpha ); } void Image::FillWithColor( const ColorA& Color ) { @@ -535,13 +535,13 @@ void Image::FillWithColor( const ColorA& Color ) { for ( unsigned int i = 0; i < size; i += mChannels ) { for ( z = 0; z < mChannels; z++ ) { if ( 0 == z ) - mPixels[ i + z ] = Color.R(); + mPixels[ i + z ] = Color.r(); else if ( 1 == z ) - mPixels[ i + z ] = Color.G(); + mPixels[ i + z ] = Color.g(); else if ( 2 == z ) - mPixels[ i + z ] = Color.B(); + mPixels[ i + z ] = Color.b(); else if ( 3 == z ) - mPixels[ i + z ] = Color.A(); + mPixels[ i + z ] = Color.a(); } } } @@ -662,7 +662,7 @@ void Image::Blit( Graphics::Image * image, const Uint32& x, const Uint32& y ) { ColorA ts( image->GetPixel( tx - x, ty - y ) ); ColorA td( GetPixel( tx, ty ) ); - SetPixel( tx, ty, Color::Blend( ts, td ) ); + SetPixel( tx, ty, Color::blend( ts, td ) ); } } } diff --git a/src/eepp/graphics/particlesystem.cpp b/src/eepp/graphics/particlesystem.cpp index 406eec491..130352598 100755 --- a/src/eepp/graphics/particlesystem.cpp +++ b/src/eepp/graphics/particlesystem.cpp @@ -376,7 +376,7 @@ void ParticleSystem::Update( const System::Time& 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/pixelperfect.cpp b/src/eepp/graphics/pixelperfect.cpp index 9803bf8b6..1cccca1b2 100644 --- a/src/eepp/graphics/pixelperfect.cpp +++ b/src/eepp/graphics/pixelperfect.cpp @@ -52,7 +52,7 @@ bool PixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned else C2 = Tex2->GetPixel( x - x2, y - y2 ); - if ( C1.A() > 0 && C2.A() > 0 ) { + if ( C1.a() > 0 && C2.a() > 0 ) { Collide = true; break; } @@ -91,7 +91,7 @@ bool PixelPerfectCollide( Texture * Tex, const unsigned int& x1, const unsigned else C1 = Tex->GetPixel( x2 - ax1, y2 - ay1 ); - if ( C1.A() > 0 ) + if ( C1.a() > 0 ) Collide = true; Tex->Unlock(true); diff --git a/src/eepp/graphics/renderer/gl.cpp b/src/eepp/graphics/renderer/gl.cpp index 03944f19e..bb718c04f 100644 --- a/src/eepp/graphics/renderer/gl.cpp +++ b/src/eepp/graphics/renderer/gl.cpp @@ -14,7 +14,7 @@ cGL * GLi = NULL; cGL * cGL::ms_singleton = NULL; -cGL * cGL::CreateSingleton( EEGL_version ver ) { +cGL * cGL::createSingleton( EEGL_version ver ) { #if !defined( EE_GLES1 ) && !defined( EE_GLES2 ) if ( GLv_default == ver ) ver = GLv_2; @@ -76,7 +76,7 @@ cGL * cGL::CreateSingleton( EEGL_version ver ) { return ms_singleton; } -cGL * cGL::CreateSingleton() { +cGL * cGL::createSingleton() { if ( ms_singleton == 0 ) { #if defined( EE_GLES_BOTH ) ms_singleton = eeNew( RendererGL, () ); @@ -92,15 +92,15 @@ cGL * cGL::CreateSingleton() { return ms_singleton; } -cGL * cGL::ExistsSingleton() { +cGL * cGL::existsSingleton() { return ms_singleton; } cGL * cGL::instance() { - return CreateSingleton(); + return createSingleton(); } -void cGL::DestroySingleton() { +void cGL::destroySingleton() { if( ms_singleton != 0 ) { eeDelete( ms_singleton ); ms_singleton = 0; @@ -141,7 +141,7 @@ RendererGLES2 * cGL::GetRendererGLES2() { } void cGL::WriteExtension( Uint8 Pos, Uint32 BitWrite ) { - BitOp::WriteBitKey( &mExtensions, Pos, BitWrite ); + BitOp::writeBitKey( &mExtensions, Pos, BitWrite ); } void cGL::Init() { @@ -465,7 +465,7 @@ void cGL::SetShader( ShaderProgram * Shader ) { } bool cGL::IsLineSmooth() { - return BitOp::ReadBitKey( &mStateFlags, GLSF_LINE_SMOOTH ); + return BitOp::readBitKey( &mStateFlags, GLSF_LINE_SMOOTH ); } void cGL::LineSmooth() { @@ -480,7 +480,7 @@ void cGL::LineSmooth( const bool& Enable ) { GLi->Disable( GL_LINE_SMOOTH ); } - BitOp::WriteBitKey( &mStateFlags, GLSF_LINE_SMOOTH, Enable ? 1 : 0 ); + BitOp::writeBitKey( &mStateFlags, GLSF_LINE_SMOOTH, Enable ? 1 : 0 ); #endif } @@ -500,7 +500,7 @@ void cGL::LineWidth(float width) { void cGL::PolygonMode() { EE_FILL_MODE Mode = DRAW_FILL; - if ( BitOp::ReadBitKey( &mStateFlags, GLSF_POLYGON_MODE ) ) + if ( BitOp::readBitKey( &mStateFlags, GLSF_POLYGON_MODE ) ) Mode = DRAW_LINE; PolygonMode( Mode ); @@ -516,7 +516,7 @@ void cGL::PolygonMode( const EE_FILL_MODE& Mode ) { else PolygonMode( GL_FRONT_AND_BACK, GL_LINE ); - BitOp::WriteBitKey( &mStateFlags, GLSF_POLYGON_MODE, Mode == DRAW_LINE ? 1 : 0 ); + BitOp::writeBitKey( &mStateFlags, GLSF_POLYGON_MODE, Mode == DRAW_LINE ? 1 : 0 ); } std::string cGL::GetVendor() { diff --git a/src/eepp/graphics/renderer/renderergl3.cpp b/src/eepp/graphics/renderer/renderergl3.cpp index 71c843d06..2eb038c8b 100644 --- a/src/eepp/graphics/renderer/renderergl3.cpp +++ b/src/eepp/graphics/renderer/renderergl3.cpp @@ -604,7 +604,7 @@ void RendererGL3::ClipPlane( unsigned int plane, const double * equation ) { if ( nplane < EE_MAX_PLANES ) { location = mPlanes[ nplane ]; } else { - std::string planeNum( "dgl_ClipPlane[" + String::ToStr( nplane ) + "]" ); + std::string planeNum( "dgl_ClipPlane[" + String::toStr( nplane ) + "]" ); location = glGetUniformLocation( mCurShader->Handler(), (GLchar*)&planeNum[0] ); } diff --git a/src/eepp/graphics/renderer/renderergl3cp.cpp b/src/eepp/graphics/renderer/renderergl3cp.cpp index af8f5255b..7b7c88468 100644 --- a/src/eepp/graphics/renderer/renderergl3cp.cpp +++ b/src/eepp/graphics/renderer/renderergl3cp.cpp @@ -92,7 +92,7 @@ RendererGL3CP::~RendererGL3CP() { eeSAFE_DELETE( mStack ); #ifdef EE_DEBUG - Log::instance()->Write( "Biggest VBO allocation on GL3 Renderer: " + FileSystem::SizeToString( mBiggestAlloc ) ); + Log::instance()->write( "Biggest VBO allocation on GL3 Renderer: " + FileSystem::sizeToString( mBiggestAlloc ) ); #endif } @@ -677,7 +677,7 @@ void RendererGL3CP::ClipPlane( unsigned int plane, const double * equation ) { if ( nplane < EE_MAX_PLANES ) { location = mPlanes[ nplane ]; } else { - std::string planeNum( "dgl_ClipPlane[" + String::ToStr( nplane ) + "]" ); + std::string planeNum( "dgl_ClipPlane[" + String::toStr( nplane ) + "]" ); location = glGetUniformLocation( mCurShader->Handler(), (GLchar*)&planeNum[0] ); } @@ -752,7 +752,7 @@ void RendererGL3CP::BindGlobalVAO() { void RendererGL3CP::AllocateBuffers( const Uint32& size ) { if ( mVBOSizeAlloc != size ) - Log::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/graphics/renderer/renderergles2.cpp b/src/eepp/graphics/renderer/renderergles2.cpp index 6a778ea45..e5e567052 100644 --- a/src/eepp/graphics/renderer/renderergles2.cpp +++ b/src/eepp/graphics/renderer/renderergles2.cpp @@ -684,7 +684,7 @@ void RendererGLES2::ClipPlane( unsigned int plane, const double * equation ) { if ( nplane < EE_MAX_PLANES ) { location = mPlanes[ nplane ]; } else { - std::string planeNum( "dgl_ClipPlane[" + String::ToStr( nplane ) + "]" ); + std::string planeNum( "dgl_ClipPlane[" + String::toStr( nplane ) + "]" ); location = glGetUniformLocation( mCurShader->Handler(), (GLchar*)&planeNum[0] ); } diff --git a/src/eepp/graphics/scrollparallax.cpp b/src/eepp/graphics/scrollparallax.cpp index 493554d35..8a8175107 100755 --- a/src/eepp/graphics/scrollparallax.cpp +++ b/src/eepp/graphics/scrollparallax.cpp @@ -82,7 +82,7 @@ const Vector2f& ScrollParallax::Position() const { void ScrollParallax::Draw() { if ( NULL != mSubTexture && mAABB.Left != mAABB.Right && mAABB.Top != mAABB.Bottom && 0 != mColor.Alpha ) { - mPos += mSpeed * (Float)mElapsed.Elapsed().AsSeconds(); + mPos += mSpeed * (Float)mElapsed.elapsed().asSeconds(); if ( mPos.x > mAABB.Left + mRealSize.Width() || mPos.x < mAABB.Left - mRealSize.Width() ) mPos.x = mAABB.Left; diff --git a/src/eepp/graphics/shader.cpp b/src/eepp/graphics/shader.cpp index d84342e44..562d73eb0 100644 --- a/src/eepp/graphics/shader.cpp +++ b/src/eepp/graphics/shader.cpp @@ -24,22 +24,22 @@ Shader::Shader( const Uint32& Type ) { Shader::Shader( const Uint32& Type, const std::string& Filename ) { Init( Type ); - mFilename = FileSystem::FileNameFromPath( Filename ); + mFilename = FileSystem::fileNameFromPath( Filename ); - if ( FileSystem::FileExists( Filename ) ) { + if ( FileSystem::fileExists( Filename ) ) { SafeDataPointer PData; - FileSystem::FileGet( Filename, PData ); + FileSystem::fileGet( Filename, PData ); SetSource( (const char*)PData.Data, PData.DataSize ); } else { std::string tPath = Filename; Pack * tPack = NULL; - if ( PackManager::instance()->FallbackToPacks() && NULL != ( tPack = PackManager::instance()->Exists( tPath ) ) ) { + if ( PackManager::instance()->fallbackToPacks() && NULL != ( tPack = PackManager::instance()->exists( tPath ) ) ) { SafeDataPointer PData; - tPack->ExtractFileToMemory( tPath, PData ); + tPack->extractFileToMemory( tPath, PData ); SetSource( reinterpret_cast ( PData.Data ), PData.DataSize ); } else { @@ -63,10 +63,10 @@ Shader::Shader( const Uint32& Type, Pack * Pack, const std::string& Filename ) { Init( Type ); - mFilename = FileSystem::FileNameFromPath( Filename ); + mFilename = FileSystem::fileNameFromPath( Filename ); - if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( Filename ) ) { - Pack->ExtractFileToMemory( Filename, PData ); + if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( Filename ) ) { + Pack->extractFileToMemory( Filename, PData ); SetSource( reinterpret_cast ( PData.Data ), PData.DataSize ); } @@ -115,7 +115,7 @@ std::string Shader::GetName() { if ( mFilename.size() ) { name = mFilename; } else { - name = String::ToStr( mGLId ); + name = String::toStr( mGLId ); } return name; @@ -155,12 +155,12 @@ void Shader::EnsureVersion() { mSource = "#version 330\nin vec4 gl_Color;\nin vec4 gl_TexCoord[ 1 ];\nout vec4 gl_FragColor;\n" + mSource; } - String::ReplaceAll( mSource, "gl_Color" , "dgl_Color" ); - String::ReplaceAll( mSource, "gl_TexCoord" , "dgl_TexCoord" ); + String::replaceAll( mSource, "gl_Color" , "dgl_Color" ); + String::replaceAll( mSource, "gl_TexCoord" , "dgl_TexCoord" ); if ( GLi->Version() == GLv_3CP ) { #ifndef EE_GLES - String::ReplaceAll( mSource, "gl_FragColor" , "dgl_FragColor" ); + String::replaceAll( mSource, "gl_FragColor" , "dgl_FragColor" ); #endif } } @@ -169,7 +169,7 @@ void Shader::EnsureVersion() { if ( GLi->Version() == GLv_3CP ) { #ifndef EE_GLES - String::ReplaceAll( mSource, "texture2D" , "texture" ); + String::replaceAll( mSource, "texture2D" , "texture" ); #endif } #endif diff --git a/src/eepp/graphics/shaderprogram.cpp b/src/eepp/graphics/shaderprogram.cpp index 922a75a73..94cbdb994 100644 --- a/src/eepp/graphics/shaderprogram.cpp +++ b/src/eepp/graphics/shaderprogram.cpp @@ -79,7 +79,7 @@ ShaderProgram::ShaderProgram( Pack * Pack, const std::string& VertexShaderPath, AddToManager( name ); Init(); - if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( VertexShaderPath ) && -1 != Pack->Exists( FragmentShaderPath ) ) { + if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( VertexShaderPath ) && -1 != Pack->exists( FragmentShaderPath ) ) { VertexShader * vs = eeNew( VertexShader, ( Pack, VertexShaderPath ) ); FragmentShader * fs = eeNew( FragmentShader, ( Pack, FragmentShaderPath ) ); @@ -153,7 +153,7 @@ ShaderProgram::~ShaderProgram() { for ( unsigned int i = 0; i < mShaders.size(); i++ ) eeSAFE_DELETE( mShaders[i] ); - if ( !ShaderProgramManager::instance()->IsDestroying() ) { + if ( !ShaderProgramManager::instance()->isDestroying() ) { RemoveFromManager(); } } @@ -161,11 +161,11 @@ ShaderProgram::~ShaderProgram() { void ShaderProgram::AddToManager( const std::string& name ) { Name( name ); - ShaderProgramManager::instance()->Add( this ); + ShaderProgramManager::instance()->add( this ); } void ShaderProgram::RemoveFromManager() { - ShaderProgramManager::instance()->Remove( this, false ); + ShaderProgramManager::instance()->remove( this, false ); } void ShaderProgram::Init() { @@ -451,12 +451,12 @@ const std::string& ShaderProgram::Name() const { void ShaderProgram::Name( const std::string& name ) { mName = name; - mId = String::Hash( mName ); + mId = String::hash( mName ); - Uint32 NameCount = ShaderProgramManager::instance()->Exists( mName ); + Uint32 NameCount = ShaderProgramManager::instance()->exists( mName ); if ( 0 != NameCount || 0 == name.size() ) { - Name( name + String::ToStr( NameCount + 1 ) ); + Name( name + String::toStr( NameCount + 1 ) ); } } diff --git a/src/eepp/graphics/sprite.cpp b/src/eepp/graphics/sprite.cpp index 0a06bc4f7..6476b8eac 100755 --- a/src/eepp/graphics/sprite.cpp +++ b/src/eepp/graphics/sprite.cpp @@ -453,7 +453,7 @@ bool Sprite::AddSubFrame(const Uint32& TexId, const unsigned int& NumFrame, cons return false; Texture * Tex = TextureFactory::instance()->GetTexture( TexId ); - SubTexture * S = GlobalTextureAtlas::instance()->Add( eeNew( SubTexture, () ) ); + SubTexture * S = GlobalTextureAtlas::instance()->add( eeNew( SubTexture, () ) ); S->Texture( TexId ); @@ -492,9 +492,9 @@ void Sprite::Update( const Time& ElapsedTime ) { return; if ( !SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) ) - mfCurrentFrame += mAnimSpeed * ElapsedTime.AsSeconds(); + mfCurrentFrame += mAnimSpeed * ElapsedTime.asSeconds(); else - mfCurrentFrame -= mAnimSpeed * ElapsedTime.AsSeconds(); + mfCurrentFrame -= mAnimSpeed * ElapsedTime.asSeconds(); mCurrentFrame = (unsigned int)mfCurrentFrame; diff --git a/src/eepp/graphics/subtexture.cpp b/src/eepp/graphics/subtexture.cpp index 301a512e6..4aa65683b 100644 --- a/src/eepp/graphics/subtexture.cpp +++ b/src/eepp/graphics/subtexture.cpp @@ -25,7 +25,7 @@ SubTexture::SubTexture( const Uint32& TexId, const std::string& Name ) : mPixels(NULL), mAlpha(NULL), mName( Name ), - mId( String::Hash( mName ) ), + mId( String::hash( mName ) ), mTexId( TexId ), mTexture( TextureFactory::instance()->GetTexture( TexId ) ), mSrcRect( Recti( 0, 0, NULL != mTexture ? mTexture->ImgWidth() : 0, NULL != mTexture ? mTexture->ImgHeight() : 0 ) ), @@ -39,7 +39,7 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const std::st mPixels(NULL), mAlpha(NULL), mName( Name ), - mId( String::Hash( mName ) ), + mId( String::hash( mName ) ), mTexId( TexId ), mTexture( TextureFactory::instance()->GetTexture( TexId ) ), mSrcRect( SrcRect ), @@ -53,7 +53,7 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& mPixels(NULL), mAlpha(NULL), mName( Name ), - mId( String::Hash( mName ) ), + mId( String::hash( mName ) ), mTexId( TexId ), mTexture( TextureFactory::instance()->GetTexture( TexId ) ), mSrcRect(SrcRect), @@ -67,7 +67,7 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& mPixels(NULL), mAlpha(NULL), mName( Name ), - mId( String::Hash( mName ) ), + mId( String::hash( mName ) ), mTexId( TexId ), mTexture( TextureFactory::instance()->GetTexture( TexId ) ), mSrcRect(SrcRect), @@ -96,7 +96,7 @@ const std::string SubTexture::Name() const { void SubTexture::Name( const std::string& name ) { mName = name; - mId = String::Hash( mName ); + mId = String::hash( mName ); } const Uint32& SubTexture::Texture() { @@ -171,11 +171,11 @@ void SubTexture::ReplaceColor( ColorA ColorKey, ColorA NewColor ) { } void SubTexture::CreateMaskFromColor(ColorA ColorKey, Uint8 Alpha) { - ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) ); + ReplaceColor( ColorKey, ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), Alpha ) ); } void SubTexture::CreateMaskFromColor(RGB ColorKey, Uint8 Alpha) { - CreateMaskFromColor( ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), 255 ), Alpha ); + CreateMaskFromColor( ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), 255 ), Alpha ); } void SubTexture::CacheAlphaMask() { @@ -196,7 +196,7 @@ void SubTexture::CacheAlphaMask() { for ( int x = mSrcRect.Left; x < mSrcRect.Right; x++ ) { rX = x - mSrcRect.Left; - mAlpha[ rX + rY * rW ] = mTexture->GetPixel( x, y ).A(); + mAlpha[ rX + rY * rW ] = mTexture->GetPixel( x, y ).a(); } } @@ -229,10 +229,10 @@ void SubTexture::CacheColors() { Pos = ( rX + rY * rW ) * Channels; - if ( Channels >= 1 ) mPixels[ Pos ] = tColor.R(); - if ( Channels >= 2 ) mPixels[ Pos + 1 ] = tColor.G(); - if ( Channels >= 3 ) mPixels[ Pos + 2 ] = tColor.B(); - if ( Channels >= 4 ) mPixels[ Pos + 3 ] = tColor.A(); + if ( Channels >= 1 ) mPixels[ Pos ] = tColor.r(); + if ( Channels >= 2 ) mPixels[ Pos + 1 ] = tColor.g(); + if ( Channels >= 3 ) mPixels[ Pos + 2 ] = tColor.b(); + if ( Channels >= 4 ) mPixels[ Pos + 3 ] = tColor.a(); } } @@ -241,7 +241,7 @@ void SubTexture::CacheColors() { Uint8 SubTexture::GetAlphaAt( const Int32& X, const Int32& Y ) { if ( mTexture->LocalCopy() ) - return mTexture->GetPixel( mSrcRect.Left + X, mSrcRect.Right + Y ).A(); + return mTexture->GetPixel( mSrcRect.Left + X, mSrcRect.Right + Y ).a(); if ( NULL != mAlpha ) return mAlpha[ X + Y * ( mSrcRect.Right - mSrcRect.Left ) ]; @@ -282,10 +282,10 @@ void SubTexture::SetColorAt( const Int32& X, const Int32& Y, const ColorA& Color Uint32 Channels = mTexture->Channels(); unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels; - if ( Channels >= 1 ) mPixels[ Pos ] = Color.R(); - if ( Channels >= 2 ) mPixels[ Pos + 1 ] = Color.G(); - if ( Channels >= 3 ) mPixels[ Pos + 2 ] = Color.B(); - if ( Channels >= 4 ) mPixels[ Pos + 3 ] = Color.A(); + if ( Channels >= 1 ) mPixels[ Pos ] = Color.r(); + if ( Channels >= 2 ) mPixels[ Pos + 1 ] = Color.g(); + if ( Channels >= 3 ) mPixels[ Pos + 2 ] = Color.b(); + if ( Channels >= 4 ) mPixels[ Pos + 3 ] = Color.a(); } else { CacheColors(); SetColorAt( X, Y, Color ); diff --git a/src/eepp/graphics/texture.cpp b/src/eepp/graphics/texture.cpp index 778b76adc..715978f93 100755 --- a/src/eepp/graphics/texture.cpp +++ b/src/eepp/graphics/texture.cpp @@ -73,7 +73,7 @@ Texture::Texture( const Uint32& texture, const unsigned int& width, const unsign void Texture::Create( const Uint32& texture, const unsigned int& width, const unsigned int& height, const unsigned int& imgwidth, const unsigned int& imgheight, const bool& UseMipmap, const unsigned int& Channels, const std::string& filepath, const EE_CLAMP_MODE& ClampMode, const bool& CompressedTexture, const Uint32& MemSize, const Uint8* data ) { mFilepath = filepath; - mId = String::Hash( mFilepath ); + mId = String::hash( mFilepath ); mTexture = texture; mWidth = width; mHeight = height; @@ -250,7 +250,7 @@ void Texture::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { void Texture::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { Lock( true ); - Image::ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) ); + Image::ReplaceColor( ColorKey, ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), Alpha ) ); Unlock( false, true ); } diff --git a/src/eepp/graphics/textureatlas.cpp b/src/eepp/graphics/textureatlas.cpp index ef4c57dec..5025d9559 100644 --- a/src/eepp/graphics/textureatlas.cpp +++ b/src/eepp/graphics/textureatlas.cpp @@ -17,7 +17,7 @@ const std::string& TextureAtlas::Name() const { void TextureAtlas::Name( const std::string& name ) { mName = name; - mId = String::Hash( mName ); + mId = String::hash( mName ); } const std::string& TextureAtlas::Path() const { @@ -32,28 +32,28 @@ const Uint32& TextureAtlas::Id() const { return mId; } -SubTexture * TextureAtlas::Add( SubTexture * subTexture ) { - return ResourceManager::Add( subTexture ); +SubTexture * TextureAtlas::add( SubTexture * subTexture ) { + return ResourceManager::add( subTexture ); } -SubTexture * TextureAtlas::Add( const Uint32& TexId, const std::string& Name ) { - return Add( eeNew( SubTexture, ( TexId, Name ) ) ); +SubTexture * TextureAtlas::add( const Uint32& TexId, const std::string& Name ) { + return add( eeNew( SubTexture, ( TexId, Name ) ) ); } -SubTexture * TextureAtlas::Add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name ) { - return Add( eeNew( SubTexture, ( TexId, SrcRect, Name ) ) ); +SubTexture * TextureAtlas::add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name ) { + return add( eeNew( SubTexture, ( TexId, SrcRect, Name ) ) ); } -SubTexture * TextureAtlas::Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name ) { - return Add( eeNew ( SubTexture, ( TexId, SrcRect, DestSize, Name ) ) ); +SubTexture * TextureAtlas::add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name ) { + return add( eeNew ( SubTexture, ( TexId, SrcRect, DestSize, Name ) ) ); } -SubTexture * TextureAtlas::Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name ) { - return Add( eeNew ( SubTexture, ( TexId, SrcRect, DestSize, Offset, Name ) ) ); +SubTexture * TextureAtlas::add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name ) { + return add( eeNew ( SubTexture, ( TexId, SrcRect, DestSize, Offset, Name ) ) ); } -Uint32 TextureAtlas::Count() { - return ResourceManager::Count(); +Uint32 TextureAtlas::count() { + return ResourceManager::count(); } void TextureAtlas::SetTextures( std::vector textures ) { diff --git a/src/eepp/graphics/textureatlasloader.cpp b/src/eepp/graphics/textureatlasloader.cpp index bd99ca450..dcc7bb287 100644 --- a/src/eepp/graphics/textureatlasloader.cpp +++ b/src/eepp/graphics/textureatlasloader.cpp @@ -82,53 +82,53 @@ void TextureAtlasLoader::SetLoadCallback( GLLoadCallback LoadCallback ) { } void TextureAtlasLoader::Update() { - mRL.Update(); + mRL.update(); - if ( mRL.IsLoaded() && !mLoaded ) + if ( mRL.isLoaded() && !mLoaded ) CreateSubTextures(); } void TextureAtlasLoader::LoadFromStream( IOStream& IOS ) { - mRL.Threaded( mThreaded ); + mRL.threaded( mThreaded ); - if ( IOS.IsOpen() ) { - IOS.Read( (char*)&mTexGrHdr, sizeof(sTextureAtlasHdr) ); + if ( IOS.isOpen() ) { + IOS.read( (char*)&mTexGrHdr, sizeof(sTextureAtlasHdr) ); if ( mTexGrHdr.Magic == EE_TEXTURE_ATLAS_MAGIC || mTexGrHdr.Magic == EE_TEXTURE_ATLAS_MAGIC_OLD ) { for ( Uint32 i = 0; i < mTexGrHdr.TextureCount; i++ ) { sTextureHdr tTextureHdr; sTempTexAtlas tTexAtlas; - IOS.Read( (char*)&tTextureHdr, sizeof(sTextureHdr) ); + IOS.read( (char*)&tTextureHdr, sizeof(sTextureHdr) ); tTexAtlas.Texture = tTextureHdr; tTexAtlas.SubTextures.resize( tTextureHdr.SubTextureCount ); std::string name( &tTextureHdr.Name[0] ); - std::string path( FileSystem::FileRemoveFileName( mTextureAtlasPath ) + name ); + std::string path( FileSystem::fileRemoveFileName( mTextureAtlasPath ) + name ); //! Checks if the texture is already loaded Texture * tTex = TextureFactory::instance()->GetByName( path ); if ( !mSkipResourceLoad && NULL == tTex ) { if ( NULL != mPack ) { - mRL.Add( eeNew( TextureLoader, ( mPack, path ) ) ); + mRL.add( eeNew( TextureLoader, ( mPack, path ) ) ); } else { - mRL.Add( eeNew( TextureLoader, ( path ) ) ); + mRL.add( eeNew( TextureLoader, ( path ) ) ); } } - IOS.Read( (char*)&tTexAtlas.SubTextures[0], sizeof(sSubTextureHdr) * tTextureHdr.SubTextureCount ); + IOS.read( (char*)&tTexAtlas.SubTextures[0], sizeof(sSubTextureHdr) * tTextureHdr.SubTextureCount ); mTempAtlass.push_back( tTexAtlas ); } } - if ( !mSkipResourceLoad || ( !mSkipResourceLoad && 0 == mRL.Count() ) ) { + if ( !mSkipResourceLoad || ( !mSkipResourceLoad && 0 == mRL.count() ) ) { mIsLoading = true; - mRL.Load(); + mRL.load(); - if ( !mThreaded || ( !mSkipResourceLoad && 0 == mRL.Count() ) ) + if ( !mThreaded || ( !mSkipResourceLoad && 0 == mRL.count() ) ) CreateSubTextures(); } } @@ -138,14 +138,14 @@ void TextureAtlasLoader::Load( const std::string& TextureAtlasPath ) { if ( TextureAtlasPath.size() ) mTextureAtlasPath = TextureAtlasPath; - if ( FileSystem::FileExists( mTextureAtlasPath ) ) { + if ( FileSystem::fileExists( mTextureAtlasPath ) ) { IOStreamFile IOS( mTextureAtlasPath, std::ios::in | std::ios::binary ); LoadFromStream( IOS ); - } else if ( PackManager::instance()->FallbackToPacks() ) { + } else if ( PackManager::instance()->fallbackToPacks() ) { std::string tgPath( mTextureAtlasPath ); - Pack * tPack = PackManager::instance()->Exists( tgPath ); + Pack * tPack = PackManager::instance()->exists( tgPath ); if ( NULL != tPack ) { LoadFromPack( tPack, tgPath ); @@ -154,12 +154,12 @@ void TextureAtlasLoader::Load( const std::string& TextureAtlasPath ) { } void TextureAtlasLoader::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { - if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( FilePackPath ) ) { + if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( FilePackPath ) ) { mPack = Pack; SafeDataPointer PData; - Pack->ExtractFileToMemory( FilePackPath, PData ); + Pack->extractFileToMemory( FilePackPath, PData ); LoadFromMemory( reinterpret_cast ( PData.Data ), PData.DataSize, FilePackPath ); } @@ -187,9 +187,9 @@ void TextureAtlasLoader::CreateSubTextures() { sTextureHdr * tTexHdr = &tTexAtlas->Texture; std::string name( &tTexHdr->Name[0] ); - std::string path( FileSystem::FileRemoveFileName( mTextureAtlasPath ) + name ); + std::string path( FileSystem::fileRemoveFileName( mTextureAtlasPath ) + name ); - FileSystem::FilePathRemoveProcessPath( path ); + FileSystem::filePathRemoveProcessPath( path ); Texture * tTex = TextureFactory::instance()->GetByName( path ); @@ -199,11 +199,11 @@ void TextureAtlasLoader::CreateSubTextures() { // Create the Texture Atlas with the name of the real texture, not the Childs ( example load 1.png and not 1_ch1.png ) if ( 0 == z ) { if ( mTexGrHdr.Flags & HDR_TEXTURE_ATLAS_REMOVE_EXTENSION ) - name = FileSystem::FileRemoveExtension( name ); + name = FileSystem::fileRemoveExtension( name ); - std::string etapath = FileSystem::FileRemoveExtension( path ) + EE_TEXTURE_ATLAS_EXTENSION; + std::string etapath = FileSystem::fileRemoveExtension( path ) + EE_TEXTURE_ATLAS_EXTENSION; - TextureAtlas * tTextureAtlas = TextureAtlasManager::instance()->GetByName( name ); + TextureAtlas * tTextureAtlas = TextureAtlasManager::instance()->getByName( name ); if ( NULL != tTextureAtlas && tTextureAtlas->Path() == etapath ) { mTextureAtlas = tTextureAtlas; @@ -214,7 +214,7 @@ void TextureAtlasLoader::CreateSubTextures() { mTextureAtlas->Path( etapath ); - TextureAtlasManager::instance()->Add( mTextureAtlas ); + TextureAtlasManager::instance()->add( mTextureAtlas ); } } @@ -226,7 +226,7 @@ void TextureAtlasLoader::CreateSubTextures() { std::string SubTextureName( &tSh->Name[0] ); if ( mTexGrHdr.Flags & HDR_TEXTURE_ATLAS_REMOVE_EXTENSION ) - SubTextureName = FileSystem::FileRemoveExtension( SubTextureName ); + SubTextureName = FileSystem::fileRemoveExtension( SubTextureName ); Recti tRect( tSh->X, tSh->Y, tSh->X + tSh->Width, tSh->Y + tSh->Height ); @@ -235,7 +235,7 @@ void TextureAtlasLoader::CreateSubTextures() { //if ( tSh->Flags & HDR_SUBTEXTURE_FLAG_FLIPED ) // Should rotate the sub texture, but.. sub texture rotation is not stored. - mTextureAtlas->Add( tSubTexture ); + mTextureAtlas->add( tSubTexture ); } } } else { @@ -294,7 +294,7 @@ bool TextureAtlasLoader::UpdateTextureAtlas() { for ( Int32 i = 0; i < tTexHdr->SubTextureCount; i++ ) { sSubTextureHdr * tSh = &tTexAtlas->SubTextures[i]; - SubTexture * tSubTexture = mTextureAtlas->GetById( tSh->ResourceID ); + SubTexture * tSubTexture = mTextureAtlas->getById( tSh->ResourceID ); if ( NULL != tSubTexture ) { tSh->OffsetX = tSubTexture->Offset().x; @@ -307,16 +307,16 @@ bool TextureAtlasLoader::UpdateTextureAtlas() { IOStreamFile fs( mTextureAtlasPath, std::ios::out | std::ios::binary ); - if ( fs.IsOpen() ) { - fs.Write( reinterpret_cast (&mTexGrHdr), sizeof(sTextureAtlasHdr) ); + if ( fs.isOpen() ) { + fs.write( reinterpret_cast (&mTexGrHdr), sizeof(sTextureAtlasHdr) ); for ( Uint32 z = 0; z < mTempAtlass.size(); z++ ) { sTempTexAtlas * tTexAtlas = &mTempAtlass[z]; sTextureHdr * tTexHdr = &tTexAtlas->Texture; - fs.Write( reinterpret_cast ( tTexHdr ), sizeof(sTextureHdr) ); + fs.write( reinterpret_cast ( tTexHdr ), sizeof(sTextureHdr) ); - fs.Write( reinterpret_cast ( &tTexAtlas->SubTextures[0] ), sizeof(sSubTextureHdr) * (std::streamsize)tTexAtlas->SubTextures.size() ); + fs.write( reinterpret_cast ( &tTexAtlas->SubTextures[0] ), sizeof(sSubTextureHdr) * (std::streamsize)tTexAtlas->SubTextures.size() ); } return true; @@ -326,10 +326,10 @@ bool TextureAtlasLoader::UpdateTextureAtlas() { } static bool IsImage( std::string path ) { - if ( FileSystem::FileSize( path ) ) { + if ( FileSystem::fileSize( path ) ) { std::string File = path.substr( path.find_last_of("/\\") + 1 ); std::string Ext = File.substr( File.find_last_of(".") + 1 ); - String::ToLowerInPlace( Ext ); + String::toLowerInPlace( Ext ); if ( Ext == "png" || Ext == "tga" || @@ -354,7 +354,7 @@ static bool IsImage( std::string path ) { } bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std::string ImagesPath ) { - if ( !TextureAtlasPath.size() || !ImagesPath.size() || !FileSystem::FileExists( TextureAtlasPath ) || !FileSystem::IsDirectory( ImagesPath ) ) + if ( !TextureAtlasPath.size() || !ImagesPath.size() || !FileSystem::fileExists( TextureAtlasPath ) || !FileSystem::isDirectory( ImagesPath ) ) return false; mSkipResourceLoad = true; @@ -368,7 +368,7 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: Int32 NeedUpdate = 0; - FileSystem::DirPathAddSlashAtEnd( ImagesPath ); + FileSystem::dirPathAddSlashAtEnd( ImagesPath ); Uint32 z; @@ -377,7 +377,7 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: totalSubTextures += mTempAtlass[z].Texture.SubTextureCount; Uint32 totalImages = 0; - std::vector PathFiles = FileSystem::FilesGetInPath( ImagesPath ); + std::vector PathFiles = FileSystem::filesGetInPath( ImagesPath ); for ( z = 0; z < PathFiles.size(); z++ ) { std::string realpath( ImagesPath + PathFiles[z] ); @@ -400,8 +400,8 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: std::string path( ImagesPath + tSh->Name ); - if ( FileSystem::FileSize( path ) ) { - if ( tSh->Date != FileSystem::FileGetModificationDate( path ) ) { + if ( FileSystem::fileSize( path ) ) { + if ( tSh->Date != FileSystem::fileGetModificationDate( path ) ) { if ( stbi_info( path.c_str(), &x, &y, &c ) ) { if ( ( !( tSh->Flags & HDR_SUBTEXTURE_FLAG_FLIPED ) && tSh->Width == x && tSh->Height == y ) || // If size or channels changed, the image need update ( ( tSh->Flags & HDR_SUBTEXTURE_FLAG_FLIPED ) && tSh->Width == y && tSh->Height == x ) || @@ -430,7 +430,7 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: } if ( NeedUpdate ) { - std::string tapath( FileSystem::FileRemoveExtension( TextureAtlasPath ) + "." + Image::SaveTypeToExtension( mTexGrHdr.Format ) ); + std::string tapath( FileSystem::fileRemoveExtension( TextureAtlasPath ) + "." + Image::SaveTypeToExtension( mTexGrHdr.Format ) ); if ( 2 == NeedUpdate ) { TexturePacker tp( mTexGrHdr.Width, mTexGrHdr.Height, 0 != ( mTexGrHdr.Flags & HDR_TEXTURE_ATLAS_POW_OF_TWO ), mTexGrHdr.PixelBorder, mTexGrHdr.Flags & HDR_TEXTURE_ATLAS_ALLOW_FLIPPING ); @@ -441,18 +441,18 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: tp.Save( tapath, (EE_SAVE_TYPE)mTexGrHdr.Format ); } else if ( 1 == NeedUpdate ) { - std::string etapath = FileSystem::FileRemoveExtension( tapath ) + EE_TEXTURE_ATLAS_EXTENSION; + std::string etapath = FileSystem::fileRemoveExtension( tapath ) + EE_TEXTURE_ATLAS_EXTENSION; IOStreamFile fs( etapath , std::ios::out | std::ios::binary ); - if ( !fs.IsOpen() ) + if ( !fs.isOpen() ) return false; - fs.Write( reinterpret_cast (&mTexGrHdr), sizeof(sTextureAtlasHdr) ); + fs.write( reinterpret_cast (&mTexGrHdr), sizeof(sTextureAtlasHdr) ); for ( Uint32 z = 0; z < mTempAtlass.size(); z++ ) { if ( z != 0 ) { - tapath = FileSystem::FileRemoveExtension( TextureAtlasPath ) + "_ch" + String::ToStr( z ) + "." + Image::SaveTypeToExtension( mTexGrHdr.Format ); + tapath = FileSystem::fileRemoveExtension( TextureAtlasPath ) + "_ch" + String::toStr( z ) + "." + Image::SaveTypeToExtension( mTexGrHdr.Format ); } unsigned char * imgPtr = stbi_load( tapath.c_str(), &x, &y, &c, 0 ); @@ -464,14 +464,14 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: sTempTexAtlas * tTexAtlas = &mTempAtlass[z]; sTextureHdr * tTexHdr = &tTexAtlas->Texture; - fs.Write( reinterpret_cast (tTexHdr), sizeof(sTextureHdr) ); + fs.write( reinterpret_cast (tTexHdr), sizeof(sTextureHdr) ); for ( Int32 i = 0; i < tTexHdr->SubTextureCount; i++ ) { sSubTextureHdr * tSh = &tTexAtlas->SubTextures[i]; std::string imgcopypath( ImagesPath + tSh->Name ); - Uint32 ModifDate = FileSystem::FileGetModificationDate( imgcopypath ); + Uint32 ModifDate = FileSystem::fileGetModificationDate( imgcopypath ); if ( tSh->Date != ModifDate ) { tSh->Date = ModifDate; // Update the sub texture hdr @@ -491,7 +491,7 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: } } - fs.Write( reinterpret_cast (&tTexAtlas->SubTextures[0]), sizeof(sSubTextureHdr) * tTexHdr->SubTextureCount ); + fs.write( reinterpret_cast (&tTexAtlas->SubTextures[0]), sizeof(sSubTextureHdr) * tTexHdr->SubTextureCount ); Img.SaveToFile( tapath, (EE_SAVE_TYPE)mTexGrHdr.Format ); diff --git a/src/eepp/graphics/textureatlasmanager.cpp b/src/eepp/graphics/textureatlasmanager.cpp index 8770cffa2..305da8bc3 100644 --- a/src/eepp/graphics/textureatlasmanager.cpp +++ b/src/eepp/graphics/textureatlasmanager.cpp @@ -9,7 +9,7 @@ TextureAtlasManager::TextureAtlasManager() : ResourceManager( false ), mWarnings( false ) { - Add( GlobalTextureAtlas::instance() ); + add( GlobalTextureAtlas::instance() ); } TextureAtlasManager::~TextureAtlasManager() { @@ -40,7 +40,7 @@ TextureAtlas * TextureAtlasManager::LoadFromPack( Pack * Pack, const std::string } SubTexture * TextureAtlasManager::GetSubTextureByName( const std::string& Name ) { - SubTexture * tSubTexture = GetSubTextureById( String::Hash( Name ) ); + SubTexture * tSubTexture = GetSubTextureById( String::hash( Name ) ); if ( mWarnings ) { eePRINTC( NULL == tSubTexture, "TextureAtlasManager::GetSubTextureByName SubTexture '%s' not found\n", Name.c_str() ); @@ -58,7 +58,7 @@ SubTexture * TextureAtlasManager::GetSubTextureById( const Uint32& Id ) { for ( it = mResources.begin(); it != mResources.end(); it++ ) { tSG = (*it); - tSubTexture = tSG->GetById( Id ); + tSubTexture = tSG->getById( Id ); if ( NULL != tSubTexture ) return tSubTexture; @@ -71,7 +71,7 @@ void TextureAtlasManager::PrintResources() { std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) - (*it)->PrintNames(); + (*it)->printNames(); } std::vector TextureAtlasManager::GetSubTexturesByPatternId( const Uint32& SubTextureId, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { @@ -81,15 +81,15 @@ std::vector TextureAtlasManager::GetSubTexturesByPatternId( const U if ( NULL == SearchInTextureAtlas ) tSubTexture = GetSubTextureById( SubTextureId ); else - tSubTexture = SearchInTextureAtlas->GetById( SubTextureId ); + tSubTexture = SearchInTextureAtlas->getById( SubTextureId ); if ( NULL != tSubTexture ) { if ( extension.size() ) - tName = String::RemoveNumbersAtEnd( FileSystem::FileRemoveExtension( tSubTexture->Name() ) ) + extension; + tName = String::removeNumbersAtEnd( FileSystem::fileRemoveExtension( tSubTexture->Name() ) ) + extension; else tName = tSubTexture->Name(); - return GetSubTexturesByPattern( String::RemoveNumbersAtEnd( tSubTexture->Name() ), "", SearchInTextureAtlas ); + return GetSubTexturesByPattern( String::removeNumbersAtEnd( tSubTexture->Name() ), "", SearchInTextureAtlas ); } return std::vector(); @@ -118,12 +118,12 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std // Test if name starts with 0 - 1 for ( i = 0; i < 2; i++ ) { - search = String::StrFormated( "%s%d%s", name.c_str(), i, realext.c_str() ); + search = String::strFormated( "%s%d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) tSubTexture = GetSubTextureByName( search ); else - tSubTexture = SearchInTextureAtlas->GetByName( search ); + tSubTexture = SearchInTextureAtlas->getByName( search ); if ( NULL != tSubTexture ) { t = 1; @@ -135,12 +135,12 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std // in case that name doesn't start with 0 - 1, we test with 00 - 01 if ( 0 == t ) { for ( i = 0; i < 2; i++ ) { - search = String::StrFormated( "%s%02d%s", name.c_str(), i, realext.c_str() ); + search = String::strFormated( "%s%02d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) tSubTexture = GetSubTextureByName( search ); else - tSubTexture = SearchInTextureAtlas->GetByName( search ); + tSubTexture = SearchInTextureAtlas->getByName( search ); if ( NULL != tSubTexture ) { t = 2; @@ -152,12 +152,12 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std // in case that name doesn't start with 00 - 01, we test with 000 - 001 if ( 0 == t ) { for ( i = 0; i < 2; i++ ) { - search = String::StrFormated( "%s%03d%s", name.c_str(), i, realext.c_str() ); + search = String::strFormated( "%s%03d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) tSubTexture = GetSubTextureByName( search ); else - tSubTexture = SearchInTextureAtlas->GetByName( search ); + tSubTexture = SearchInTextureAtlas->getByName( search ); if ( NULL != tSubTexture ) { t = 3; @@ -168,12 +168,12 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std if ( 0 == t ) { for ( i = 0; i < 2; i++ ) { - search = String::StrFormated( "%s%04d%s", name.c_str(), i, realext.c_str() ); + search = String::strFormated( "%s%04d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) tSubTexture = GetSubTextureByName( search ); else - tSubTexture = SearchInTextureAtlas->GetByName( search ); + tSubTexture = SearchInTextureAtlas->getByName( search ); if ( NULL != tSubTexture ) { t = 4; @@ -184,12 +184,12 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std if ( 0 == t ) { for ( i = 0; i < 2; i++ ) { - search = String::StrFormated( "%s%05d%s", name.c_str(), i, realext.c_str() ); + search = String::strFormated( "%s%05d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) tSubTexture = GetSubTextureByName( search ); else - tSubTexture = SearchInTextureAtlas->GetByName( search ); + tSubTexture = SearchInTextureAtlas->getByName( search ); if ( NULL != tSubTexture ) { t = 5; @@ -200,12 +200,12 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std if ( 0 == t ) { for ( i = 0; i < 2; i++ ) { - search = String::StrFormated( "%s%06d%s", name.c_str(), i, realext.c_str() ); + search = String::strFormated( "%s%06d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) tSubTexture = GetSubTextureByName( search ); else - tSubTexture = SearchInTextureAtlas->GetByName( search ); + tSubTexture = SearchInTextureAtlas->getByName( search ); if ( NULL != tSubTexture ) { t = 6; @@ -222,12 +222,12 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std if ( 0 != t ) { do { switch ( t ) { - case 1: search = String::StrFormated( "%s%d%s", name.c_str(), c, realext.c_str() ); break; - case 2: search = String::StrFormated( "%s%02d%s", name.c_str(), c, realext.c_str() ); break; - case 3: search = String::StrFormated( "%s%03d%s", name.c_str(), c, realext.c_str() ); break; - case 4: search = String::StrFormated( "%s%04d%s", name.c_str(), c, realext.c_str() ); break; - case 5: search = String::StrFormated( "%s%05d%s", name.c_str(), c, realext.c_str() ); break; - case 6: search = String::StrFormated( "%s%06d%s", name.c_str(), c, realext.c_str() ); break; + case 1: search = String::strFormated( "%s%d%s", name.c_str(), c, realext.c_str() ); break; + case 2: search = String::strFormated( "%s%02d%s", name.c_str(), c, realext.c_str() ); break; + case 3: search = String::strFormated( "%s%03d%s", name.c_str(), c, realext.c_str() ); break; + case 4: search = String::strFormated( "%s%04d%s", name.c_str(), c, realext.c_str() ); break; + case 5: search = String::strFormated( "%s%05d%s", name.c_str(), c, realext.c_str() ); break; + case 6: search = String::strFormated( "%s%06d%s", name.c_str(), c, realext.c_str() ); break; default: found = false; } @@ -235,7 +235,7 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std if ( NULL == SearchInTextureAtlas ) tSubTexture = GetSubTextureByName( search ); else - tSubTexture = SearchInTextureAtlas->GetByName( search ); + tSubTexture = SearchInTextureAtlas->getByName( search ); if ( NULL != tSubTexture ) { SubTextures.push_back( tSubTexture ); diff --git a/src/eepp/graphics/texturefactory.cpp b/src/eepp/graphics/texturefactory.cpp index e651c326c..1deb41958 100755 --- a/src/eepp/graphics/texturefactory.cpp +++ b/src/eepp/graphics/texturefactory.cpp @@ -33,43 +33,43 @@ Uint32 TextureFactory::CreateEmptyTexture( const unsigned int& Width, const unsi Uint32 TextureFactory::LoadFromPixels( const unsigned char * Pixels, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy, const std::string& FileName ) { TextureLoader myTex( Pixels, Width, Height, Channels, Mipmap, ClampMode, CompressTexture, KeepLocalCopy, FileName ); - myTex.Load(); + myTex.load(); return myTex.Id(); } Uint32 TextureFactory::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { TextureLoader myTex( Pack, FilePackPath, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); - myTex.Load(); + myTex.load(); return myTex.Id(); } Uint32 TextureFactory::LoadFromMemory( const unsigned char * ImagePtr, const unsigned int& Size, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { TextureLoader myTex( ImagePtr, Size, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); - myTex.Load(); + myTex.load(); return myTex.Id(); } Uint32 TextureFactory::LoadFromStream( IOStream& Stream, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { TextureLoader myTex( Stream, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); - myTex.Load(); + myTex.load(); return myTex.Id(); } Uint32 TextureFactory::Load( const std::string& Filepath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { TextureLoader myTex( Filepath, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); - myTex.Load(); + myTex.load(); return myTex.Id(); } Uint32 TextureFactory::PushTexture( const std::string& Filepath, const Uint32& TexId, const unsigned int& Width, const unsigned int& Height, const unsigned int& ImgWidth, const unsigned int& ImgHeight, const bool& Mipmap, const unsigned int& Channels, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& LocalCopy, const Uint32& MemSize ) { - Lock(); + lock(); Texture * Tex = NULL; Uint32 Pos; std::string FPath( Filepath ); - FileSystem::FilePathRemoveProcessPath( FPath ); + FileSystem::filePathRemoveProcessPath( FPath ); Pos = FindFreeSlot(); Tex = mTextures[ Pos ] = eeNew( Texture, () ); @@ -84,7 +84,7 @@ Uint32 TextureFactory::PushTexture( const std::string& Filepath, const Uint32& T mMemSize += MemSize; - Unlock(); + unlock(); return Pos; } @@ -274,7 +274,7 @@ void TextureFactory::Allocate( const unsigned int& size ) { } Texture * TextureFactory::GetByName( const std::string& Name ) { - return GetByHash( String::Hash( Name ) ); + return GetByHash( String::hash( Name ) ); } Texture * TextureFactory::GetByHash( const Uint32& Hash ) { diff --git a/src/eepp/graphics/texturefont.cpp b/src/eepp/graphics/texturefont.cpp index be8147028..a9b1d5ef8 100755 --- a/src/eepp/graphics/texturefont.cpp +++ b/src/eepp/graphics/texturefont.cpp @@ -143,14 +143,14 @@ void TextureFont::BuildFromGlyphs() { } bool TextureFont::Load( const Uint32& TexId, const std::string& CoordinatesDatPath ) { - if ( FileSystem::FileExists( CoordinatesDatPath ) ) { + if ( FileSystem::fileExists( CoordinatesDatPath ) ) { IOStreamFile IOS( CoordinatesDatPath, std::ios::in | std::ios::binary ); return LoadFromStream( TexId, IOS ); - } else if ( PackManager::instance()->FallbackToPacks() ) { + } else if ( PackManager::instance()->fallbackToPacks() ) { std::string tPath( CoordinatesDatPath ); - Pack * tPack = PackManager::instance()->Exists( tPath ); + Pack * tPack = PackManager::instance()->exists( tPath ); if ( NULL != tPack ) { return LoadFromPack( TexId, tPack, tPath ); @@ -161,10 +161,10 @@ bool TextureFont::Load( const Uint32& TexId, const std::string& CoordinatesDatPa } bool TextureFont::LoadFromPack( const Uint32& TexId, Pack* Pack, const std::string& FilePackPath ) { - if ( NULL != Pack && Pack->IsOpen() && -1 != Pack->Exists( FilePackPath ) ) { + if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( FilePackPath ) ) { SafeDataPointer PData; - Pack->ExtractFileToMemory( FilePackPath, PData ); + Pack->extractFileToMemory( FilePackPath, PData ); return LoadFromMemory( TexId, reinterpret_cast ( PData.Data ), PData.DataSize ); } @@ -182,10 +182,10 @@ bool TextureFont::LoadFromStream( const Uint32& TexId, IOStream& IOS ) { mTexId = TexId; if ( mTexId > 0 ) { - if ( IOS.IsOpen() ) { + if ( IOS.isOpen() ) { sFntHdr FntHdr; - IOS.Read( (char*)&FntHdr, sizeof(sFntHdr) ); + IOS.read( (char*)&FntHdr, sizeof(sFntHdr) ); if ( EE_TTF_FONT_MAGIC != FntHdr.Magic ) return false; @@ -201,7 +201,7 @@ bool TextureFont::LoadFromStream( const Uint32& TexId, IOStream& IOS ) { mGlyphs.resize( mNumChars ); // Read the glyphs - IOS.Read( (char*)&mGlyphs[0], sizeof(eeGlyph) * mNumChars ); + IOS.read( (char*)&mGlyphs[0], sizeof(eeGlyph) * mNumChars ); BuildFromGlyphs(); diff --git a/src/eepp/graphics/texturefontloader.cpp b/src/eepp/graphics/texturefontloader.cpp index 8ae883040..bdc2ff87f 100644 --- a/src/eepp/graphics/texturefontloader.cpp +++ b/src/eepp/graphics/texturefontloader.cpp @@ -57,24 +57,24 @@ TextureFontLoader::~TextureFontLoader() { eeSAFE_DELETE( mTexLoader ); } -void TextureFontLoader::Start() { - ObjectLoader::Start(); +void TextureFontLoader::start() { + ObjectLoader::start(); - mTexLoader->Threaded( false ); + mTexLoader->threaded( false ); if ( !mThreaded ) { - Update(); + update(); } } -void TextureFontLoader::Update() { +void TextureFontLoader::update() { if ( !mLoaded ) { if ( !mTexLoaded ) { - mTexLoader->Load(); + mTexLoader->load(); - mTexLoader->Update(); + mTexLoader->update(); - mTexLoaded = mTexLoader->IsLoaded(); + mTexLoaded = mTexLoader->isLoaded(); } if ( mTexLoaded && !mFontLoaded ) { @@ -82,7 +82,7 @@ void TextureFontLoader::Update() { } if ( mFontLoaded ) { - SetLoaded(); + setLoaded(); } } } @@ -126,18 +126,18 @@ Graphics::Font * TextureFontLoader::Font() const { return mFont; } -void TextureFontLoader::Unload() { +void TextureFontLoader::unload() { if ( mLoaded ) { - mTexLoader->Unload(); + mTexLoader->unload(); - FontManager::instance()->Remove( mFont ); + FontManager::instance()->remove( mFont ); - Reset(); + reset(); } } -void TextureFontLoader::Reset() { - ObjectLoader::Reset(); +void TextureFontLoader::reset() { + ObjectLoader::reset(); mFont = NULL; mTexLoaded = false; diff --git a/src/eepp/graphics/textureloader.cpp b/src/eepp/graphics/textureloader.cpp index 41b71d926..1ea7c279f 100644 --- a/src/eepp/graphics/textureloader.cpp +++ b/src/eepp/graphics/textureloader.cpp @@ -24,19 +24,19 @@ namespace IOCb int read(void* user, char* data, int size) { IOStream * stream = static_cast(user); - return static_cast(stream->Read(data, size)); + return static_cast(stream->read(data, size)); } void skip(void* user, int size) { IOStream * stream = static_cast(user); - stream->Seek(stream->Tell() + size); + stream->seek(stream->tell() + size); } int eof(void* user) { IOStream* stream = static_cast(user); - return stream->Tell() >= stream->GetSize(); + return stream->tell() >= stream->getSize(); } } @@ -53,7 +53,7 @@ namespace jpeg virtual ~jpeg_decoder_stream_steam() {} virtual int read(jpgd::uint8 *pBuf, int max_bytes_to_read, bool *pEOF_flag) { - return mStream->Read( (char*)pBuf, max_bytes_to_read ); + return mStream->read( (char*)pBuf, max_bytes_to_read ); } }; } @@ -226,10 +226,10 @@ TextureLoader::~TextureLoader() { eeSAFE_FREE( mPixels ); } -void TextureLoader::Start() { - ObjectLoader::Start(); +void TextureLoader::start() { + ObjectLoader::start(); - mTE.Restart(); + mTE.restart(); if ( TEX_LT_PATH == mLoadType ) LoadFromPath(); @@ -250,13 +250,13 @@ void TextureLoader::Start() { void TextureLoader::LoadFile() { IOStreamFile fs( mFilepath , std::ios::in | std::ios::binary ); - mSize = FileSystem::FileSize( mFilepath ); + mSize = FileSystem::fileSize( mFilepath ); mPixels = (Uint8*) eeMalloc( mSize ); - fs.Read( reinterpret_cast ( mPixels ), mSize ); + fs.read( reinterpret_cast ( mPixels ), mSize ); } void TextureLoader::LoadFromPath() { - if ( FileSystem::FileExists( mFilepath ) ) { + if ( FileSystem::fileExists( mFilepath ) ) { mImgType = stbi_test( mFilepath.c_str() ); if ( STBI_dds == mImgType && GLi->IsExtension( EEGL_EXT_texture_compression_s3tc ) ) { @@ -277,7 +277,7 @@ void TextureLoader::LoadFromPath() { stbi__pkm_info_from_memory( mPixels, mSize, &mImgWidth, &mImgHeight, &mChannels ); } else { if ( mCompressTexture ) { - mSize = FileSystem::FileSize( mFilepath ); + mSize = FileSystem::fileSize( mFilepath ); } mPixels = stbi_load( mFilepath.c_str(), &mImgWidth, &mImgHeight, &mChannels, ( NULL != mColorKey ) ? STBI_rgb_alpha : STBI_default ); @@ -294,8 +294,8 @@ void TextureLoader::LoadFromPath() { } } } - } else if ( PackManager::instance()->FallbackToPacks() ) { - mPack = PackManager::instance()->Exists( mFilepath ); + } else if ( PackManager::instance()->fallbackToPacks() ) { + mPack = PackManager::instance()->exists( mFilepath ); if ( NULL != mPack ) { mLoadType = TEX_LT_PACK; @@ -308,7 +308,7 @@ void TextureLoader::LoadFromPath() { void TextureLoader::LoadFromPack() { SafeDataPointer PData; - if ( NULL != mPack && mPack->IsOpen() && mPack->ExtractFileToMemory( mFilepath, PData ) ) { + if ( NULL != mPack && mPack->isOpen() && mPack->extractFileToMemory( mFilepath, PData ) ) { mImagePtr = PData.Data; mSize = PData.DataSize; @@ -354,8 +354,8 @@ void TextureLoader::LoadFromMemory() { } void TextureLoader::LoadFromStream() { - if ( mStream->IsOpen() ) { - mSize = mStream->GetSize(); + if ( mStream->isOpen() ) { + mSize = mStream->getSize(); stbi_io_callbacks callbacks; callbacks.read = &IOCb::read; @@ -365,37 +365,37 @@ void TextureLoader::LoadFromStream() { mImgType = stbi_test_from_callbacks( &callbacks, mStream ); if ( STBI_dds == mImgType && GLi->IsExtension( EEGL_EXT_texture_compression_s3tc ) ) { - mSize = mStream->GetSize(); + mSize = mStream->getSize(); mPixels = (Uint8*) eeMalloc( mSize ); - mStream->Seek( 0 ); - mStream->Read( reinterpret_cast ( mPixels ), mSize ); - mStream->Seek( 0 ); + mStream->seek( 0 ); + mStream->read( reinterpret_cast ( mPixels ), mSize ); + mStream->seek( 0 ); stbi__dds_info_from_callbacks( &callbacks, mStream, &mImgWidth, &mImgHeight, &mChannels, &mIsCompressed ); - mStream->Seek( 0 ); + mStream->seek( 0 ); mDirectUpload = true; } else if ( STBI_pvr == mImgType && stbi__pvr_info_from_callbacks( &callbacks, mStream, &mImgWidth, &mImgHeight, &mChannels, &mIsCompressed ) && ( !mIsCompressed || GLi->IsExtension( EEGL_IMG_texture_compression_pvrtc ) ) ) { - mSize = mStream->GetSize(); + mSize = mStream->getSize(); mPixels = (Uint8*) eeMalloc( mSize ); - mStream->Seek( 0 ); - mStream->Read( reinterpret_cast ( mPixels ), mSize ); - mStream->Seek( 0 ); + mStream->seek( 0 ); + mStream->read( reinterpret_cast ( mPixels ), mSize ); + mStream->seek( 0 ); mDirectUpload = true; } else if ( STBI_pkm == mImgType && GLi->IsExtension( EEGL_OES_compressed_ETC1_RGB8_texture ) ) { - mSize = mStream->GetSize(); + mSize = mStream->getSize(); mPixels = (Uint8*) eeMalloc( mSize ); - mStream->Seek( 0 ); - mStream->Read( reinterpret_cast ( mPixels ), mSize ); - mStream->Seek( 0 ); + mStream->seek( 0 ); + mStream->read( reinterpret_cast ( mPixels ), mSize ); + mStream->seek( 0 ); stbi__pkm_info_from_callbacks( &callbacks, mStream, &mImgWidth, &mImgHeight, &mChannels ); - mStream->Seek( 0 ); + mStream->seek( 0 ); mIsCompressed = mDirectUpload = true; } else { - mStream->Seek( 0 ); + mStream->seek( 0 ); mPixels = stbi_load_from_callbacks( &callbacks, mStream, &mImgWidth, &mImgHeight, &mChannels, ( NULL != mColorKey ) ? STBI_rgb_alpha : STBI_default ); - mStream->Seek( 0 ); + mStream->seek( 0 ); } if ( NULL == mPixels ) { @@ -405,7 +405,7 @@ void TextureLoader::LoadFromStream() { jpeg::jpeg_decoder_stream_steam stream( mStream ); mPixels = jpgd::decompress_jpeg_image_from_stream( &stream, &mImgWidth, &mImgHeight, &mChannels, 3 ); - mStream->Seek( 0 ); + mStream->seek( 0 ); } } } @@ -424,7 +424,7 @@ void TextureLoader::LoadFromPixels() { flags = ( mClampMode == CLAMP_REPEAT) ? (flags | SOIL_FLAG_TEXTURE_REPEATS) : flags; flags = ( mCompressTexture ) ? ( flags | SOIL_FLAG_COMPRESS_TO_DXT ) : flags; - bool ForceGLThreaded = Thread::GetCurrentThreadId() != Engine::instance()->GetMainThreadId(); + bool ForceGLThreaded = Thread::getCurrentThreadId() != Engine::instance()->GetMainThreadId(); if ( ( mThreaded || ForceGLThreaded ) && ( ForceGLThreaded || Engine::instance()->IsSharedGLContextEnabled() ) && @@ -450,7 +450,7 @@ void TextureLoader::LoadFromPixels() { Image * tImg = eeNew ( Image, ( mPixels, mImgWidth, mImgHeight, mChannels ) ); - tImg->CreateMaskFromColor( ColorA( mColorKey->R(), mColorKey->G(), mColorKey->B(), 255 ), 0 ); + tImg->CreateMaskFromColor( ColorA( mColorKey->r(), mColorKey->g(), mColorKey->b(), 255 ), 0 ); tImg->AvoidFreeImage( true ); @@ -496,7 +496,7 @@ void TextureLoader::LoadFromPixels() { mTexId = TextureFactory::instance()->PushTexture( mFilepath, tTexId, width, height, mImgWidth, mImgHeight, mMipmap, mChannels, mClampMode, mCompressTexture || mIsCompressed, mLocalCopy, mSize ); - eePRINTL( "Texture %s loaded in %4.3f ms.", mFilepath.c_str(), mTE.Elapsed().AsMilliseconds() ); + eePRINTL( "Texture %s loaded in %4.3f ms.", mFilepath.c_str(), mTE.elapsed().asMilliseconds() ); } else { eePRINTL( "Failed to create texture. Reason: %s", SOIL_last_result() ); } @@ -516,17 +516,17 @@ void TextureLoader::LoadFromPixels() { } else { std::string failText( "Texture " + mFilepath + " failed to load" ); - failText += ( NULL != mPack ) ? ( " from Pack " + mPack->GetPackPath() + "." ) : "."; + failText += ( NULL != mPack ) ? ( " from Pack " + mPack->getPackPath() + "." ) : "."; eePRINTL( failText.c_str() ); } } - SetLoaded(); + setLoaded(); } } -void TextureLoader::Update() { +void TextureLoader::update() { if ( !( Engine::instance()->IsSharedGLContextEnabled() && Engine::instance()->GetCurrentWindow()->IsThreadedGLContext() ) ) { LoadFromPixels(); } @@ -538,7 +538,7 @@ const Uint32& TextureLoader::Id() const { void TextureLoader::SetColorKey( RGB Color ) { eeSAFE_DELETE( mColorKey ); - mColorKey = eeNew( RGB, ( Color.R(), Color.G(), Color.B() ) ); + mColorKey = eeNew( RGB, ( Color.r(), Color.g(), Color.b() ) ); } const std::string& TextureLoader::Filepath() const { @@ -552,16 +552,16 @@ Texture * TextureLoader::GetTexture() const { return NULL; } -void TextureLoader::Unload() { +void TextureLoader::unload() { if ( mLoaded ) { TextureFactory::instance()->Remove( mTexId ); - Reset(); + reset(); } } -void TextureLoader::Reset() { - ObjectLoader::Reset(); +void TextureLoader::reset() { + ObjectLoader::reset(); mPixels = NULL; mTexId = 0; diff --git a/src/eepp/graphics/texturepacker.cpp b/src/eepp/graphics/texturepacker.cpp index 032737fd7..98f4b2ae5 100644 --- a/src/eepp/graphics/texturepacker.cpp +++ b/src/eepp/graphics/texturepacker.cpp @@ -374,16 +374,16 @@ void TexturePacker::CreateChild() { } bool TexturePacker::AddTexturesPath( std::string TexturesPath ) { - if ( FileSystem::IsDirectory( TexturesPath ) ) { + if ( FileSystem::isDirectory( TexturesPath ) ) { - FileSystem::DirPathAddSlashAtEnd( TexturesPath ); + FileSystem::dirPathAddSlashAtEnd( TexturesPath ); - std::vector files = FileSystem::FilesGetInPath( TexturesPath ); + std::vector files = FileSystem::filesGetInPath( TexturesPath ); std::sort( files.begin(), files.end() ); for ( Uint32 i = 0; i < files.size(); i++ ) { std::string path( TexturesPath + files[i] ); - if ( !FileSystem::IsDirectory( path ) ) + if ( !FileSystem::isDirectory( path ) ) AddTexture( path ); } @@ -432,7 +432,7 @@ bool TexturePacker::AddImage( Image * Img, const std::string& Name ) { } bool TexturePacker::AddTexture( const std::string& TexturePath ) { - if ( FileSystem::FileExists( TexturePath ) ) { + if ( FileSystem::fileExists( TexturePath ) ) { TexturePackerTex * TPack = eeNew( TexturePackerTex, ( TexturePath ) ); return AddPackerTex( TPack ); } @@ -626,29 +626,29 @@ void TexturePacker::SaveSubTextures() { std::vector tSubTexturesHdr; - std::string path = FileSystem::FileRemoveExtension( mFilepath ) + EE_TEXTURE_ATLAS_EXTENSION; + std::string path = FileSystem::fileRemoveExtension( mFilepath ) + EE_TEXTURE_ATLAS_EXTENSION; IOStreamFile fs ( path , std::ios::out | std::ios::binary ); - if ( fs.IsOpen() ) { - fs.Write( reinterpret_cast (&TexGrHdr), sizeof(sTextureAtlasHdr) ); + if ( fs.isOpen() ) { + fs.write( reinterpret_cast (&TexGrHdr), sizeof(sTextureAtlasHdr) ); - fs.Write( reinterpret_cast (&TexHdr[ 0 ]), sizeof(sTextureHdr) ); + fs.write( reinterpret_cast (&TexHdr[ 0 ]), sizeof(sTextureHdr) ); CreateSubTexturesHdr( this, tSubTexturesHdr ); if ( tSubTexturesHdr.size() ) - fs.Write( reinterpret_cast (&tSubTexturesHdr[ 0 ]), sizeof(sSubTextureHdr) * (std::streamsize)tSubTexturesHdr.size() ); + fs.write( reinterpret_cast (&tSubTexturesHdr[ 0 ]), sizeof(sSubTextureHdr) * (std::streamsize)tSubTexturesHdr.size() ); Int32 HdrPos = 1; TexturePacker * Child = mChild; while ( NULL != Child ) { - fs.Write( reinterpret_cast (&TexHdr[ HdrPos ]), sizeof(sTextureHdr) ); + fs.write( reinterpret_cast (&TexHdr[ HdrPos ]), sizeof(sTextureHdr) ); CreateSubTexturesHdr( Child, tSubTexturesHdr ); if ( tSubTexturesHdr.size() ) - fs.Write( reinterpret_cast (&tSubTexturesHdr[ 0 ]), sizeof(sSubTextureHdr) * (std::streamsize)tSubTexturesHdr.size() ); + fs.write( reinterpret_cast (&tSubTexturesHdr[ 0 ]), sizeof(sSubTextureHdr) * (std::streamsize)tSubTexturesHdr.size() ); Child = Child->GetChild(); @@ -673,16 +673,16 @@ void TexturePacker::CreateSubTexturesHdr( TexturePacker * Packer, std::vectorPlaced() ) { - std::string name = FileSystem::FileNameFromPath( tTex->Name() ); + std::string name = FileSystem::fileNameFromPath( tTex->Name() ); memset( tSubTextureHdr.Name, 0, HDR_NAME_SIZE ); - String::StrCopy( tSubTextureHdr.Name, name.c_str(), HDR_NAME_SIZE ); + String::strCopy( tSubTextureHdr.Name, name.c_str(), HDR_NAME_SIZE ); if ( !mSaveExtensions ) - name = FileSystem::FileRemoveExtension( name ); + name = FileSystem::fileRemoveExtension( name ); - tSubTextureHdr.ResourceID = String::Hash( name ); + tSubTextureHdr.ResourceID = String::hash( name ); tSubTextureHdr.Width = tTex->Width(); tSubTextureHdr.Height = tTex->Height(); tSubTextureHdr.Channels = tTex->Channels(); @@ -692,7 +692,7 @@ void TexturePacker::CreateSubTexturesHdr( TexturePacker * Packer, std::vectorX(); tSubTextureHdr.Y = tTex->Y(); - tSubTextureHdr.Date = FileSystem::FileGetModificationDate( tTex->Name() ); + tSubTextureHdr.Date = FileSystem::fileGetModificationDate( tTex->Name() ); tSubTextureHdr.Flags = 0; if ( tTex->Flipped() ) @@ -708,14 +708,14 @@ void TexturePacker::CreateSubTexturesHdr( TexturePacker * Packer, std::vectorGetFilepath() ) ); + std::string name( FileSystem::fileNameFromPath( Packer->GetFilepath() ) ); memset( TexHdr.Name, 0, HDR_NAME_SIZE ); - String::StrCopy( TexHdr.Name, name.c_str(), HDR_NAME_SIZE ); + String::strCopy( TexHdr.Name, name.c_str(), HDR_NAME_SIZE ); - TexHdr.ResourceID = String::Hash( name ); - TexHdr.Size = FileSystem::FileSize( Packer->GetFilepath() ); + TexHdr.ResourceID = String::hash( name ); + TexHdr.Size = FileSystem::fileSize( Packer->GetFilepath() ); TexHdr.SubTextureCount = Packer->GetPlacedCount(); return TexHdr; @@ -735,9 +735,9 @@ void TexturePacker::ChildSave( const EE_SAVE_TYPE& Format ) { } if ( NULL != LastParent ) { - std::string fFpath = FileSystem::FileRemoveExtension( LastParent->GetFilepath() ); - std::string fExt = FileSystem::FileExtension( LastParent->GetFilepath() ); - std::string fName = fFpath + "_ch" + String::ToStr( ParentCount ) + "." + fExt; + std::string fFpath = FileSystem::fileRemoveExtension( LastParent->GetFilepath() ); + std::string fExt = FileSystem::fileExtension( LastParent->GetFilepath() ); + std::string fName = fFpath + "_ch" + String::toStr( ParentCount ) + "." + fExt; mChild->Save( fName, Format, mSaveExtensions ); } diff --git a/src/eepp/graphics/ttffont.cpp b/src/eepp/graphics/ttffont.cpp index 30624fac1..ffaca7ac8 100755 --- a/src/eepp/graphics/ttffont.cpp +++ b/src/eepp/graphics/ttffont.cpp @@ -30,7 +30,7 @@ bool TTFFont::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const u bool Ret = false; SafeDataPointer PData; - if ( Pack->IsOpen() && Pack->ExtractFileToMemory( FilePackPath, PData ) ) { + if ( Pack->isOpen() && Pack->extractFileToMemory( FilePackPath, PData ) ) { mFilepath = FilePackPath; Ret = LoadFromMemory( PData.Data, PData.DataSize, Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); @@ -58,7 +58,7 @@ bool TTFFont::LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, c bool TTFFont::Load( const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) { mFilepath = Filepath; - if ( FileSystem::FileExists( Filepath ) ) { + if ( FileSystem::fileExists( Filepath ) ) { mLoadedFromMemory = false; mFont = hkFontManager::instance()->OpenFromFile( Filepath.c_str(), Size, 0, NumCharsToGen ); @@ -69,8 +69,8 @@ bool TTFFont::Load( const std::string& Filepath, const unsigned int& Size, EE_TT } return iLoad( Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); - } else if ( PackManager::instance()->FallbackToPacks() ) { - Pack * tPack = PackManager::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 ); @@ -161,7 +161,7 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui //Loop through all chars for ( unsigned int i = 0; i < mNumChars; i++ ) { - TempGlyphSurface = mFont->GlyphRender( i, fFontColor.GetValue() ); + TempGlyphSurface = mFont->GlyphRender( i, fFontColor.getValue() ); //New temp glyph eeGlyph TempGlyph; @@ -175,7 +175,7 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui // Create the outline for the glyph and copy the outline to the texture if ( OutlineSize && OutlineFreetype == OutlineMethod ) { - TempOutGlyphSurface = mFontOutline->GlyphRender( i, ColorA( OutlineColor ).GetValue() ); + TempOutGlyphSurface = mFontOutline->GlyphRender( i, ColorA( OutlineColor ).getValue() ); mFontOutline->GlyphMetrics( i, &TempGlyph.MinX, &TempGlyph.MaxX, &TempGlyph.MinY, &TempGlyph.MaxY, &TempGlyph.Advance ); @@ -266,7 +266,7 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui RPos = ( nGlyphR.Left + x ) + ( nGlyphR.Top + y ) * w; Pos = x + y * nGlyphS.x; - alpha_init[ Pos ] = mPixels[ RPos ].A(); + alpha_init[ Pos ] = mPixels[ RPos ].a(); alpha_final[ Pos ] = 0; } } @@ -280,7 +280,7 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui Pos = x + y * nGlyphS.x; // Blending the normal glyph color to the outline color - mPixels[ RPos ] = Color::Blend( ColorA( FontColor, alpha_init[ Pos ] ), ColorA( OutlineColor, alpha_final[ Pos ] ) ); + mPixels[ RPos ] = Color::blend( ColorA( FontColor, alpha_init[ Pos ] ), ColorA( OutlineColor, alpha_final[ Pos ] ) ); } } @@ -313,7 +313,7 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui void TTFFont::UpdateLoading() { if ( mTexReady && NULL != mPixels ) { - std::string name( FileSystem::FileRemoveExtension( FileSystem::FileNameFromPath( mFilepath ) ) ); + std::string name( FileSystem::fileRemoveExtension( FileSystem::fileNameFromPath( mFilepath ) ) ); mTexId = TextureFactory::instance()->LoadFromPixels( reinterpret_cast ( &mPixels[0] ), (Uint32)mTexWidth, (Uint32)mTexHeight, 4, false, CLAMP_TO_EDGE, false, false, name ); @@ -380,7 +380,7 @@ bool TTFFont::SaveTexture( const std::string& Filepath, const EE_SAVE_TYPE& Form bool TTFFont::SaveCoordinates( const std::string& Filepath ) { IOStreamFile fs( Filepath, std::ios::out | std::ios::binary ); - if ( fs.IsOpen() ) { + if ( fs.isOpen() ) { sFntHdr FntHdr; FntHdr.Magic = EE_TTF_FONT_MAGIC; @@ -393,10 +393,10 @@ bool TTFFont::SaveCoordinates( const std::string& Filepath ) { FntHdr.Descent = mDescent; // Write the header - fs.Write( reinterpret_cast( &FntHdr ), sizeof(sFntHdr) ); + fs.write( reinterpret_cast( &FntHdr ), sizeof(sFntHdr) ); // Write the glyphs - fs.Write( reinterpret_cast (&mGlyphs[0]), sizeof(eeGlyph) * mGlyphs.size() ); + fs.write( reinterpret_cast (&mGlyphs[0]), sizeof(eeGlyph) * mGlyphs.size() ); RebuildFromGlyphs(); diff --git a/src/eepp/graphics/ttffontloader.cpp b/src/eepp/graphics/ttffontloader.cpp index 347cdf820..c01f2c360 100644 --- a/src/eepp/graphics/ttffontloader.cpp +++ b/src/eepp/graphics/ttffontloader.cpp @@ -64,8 +64,8 @@ void TTFFontLoader::Create() { mFont = TTFFont::New( mFontName ); } -void TTFFontLoader::Start() { - ObjectLoader::Start(); +void TTFFontLoader::start() { + ObjectLoader::start(); mFont->ThreadedLoading( mThreaded ); @@ -79,14 +79,14 @@ void TTFFontLoader::Start() { mFontLoaded = true; if ( !mThreaded ) - Update(); + update(); } -void TTFFontLoader::Update() { +void TTFFontLoader::update() { if ( !mLoaded && mFontLoaded ) { mFont->UpdateLoading(); - SetLoaded(); + setLoaded(); } } @@ -110,18 +110,18 @@ Graphics::Font * TTFFontLoader::Font() const { return mFont; } -void TTFFontLoader::Unload() { +void TTFFontLoader::unload() { if ( mLoaded ) { TextureFactory::instance()->Remove( mFont->GetTexId() ); - FontManager::instance()->Remove( mFont ); + FontManager::instance()->remove( mFont ); - Reset(); + reset(); } } -void TTFFontLoader::Reset() { - ObjectLoader::Reset(); +void TTFFontLoader::reset() { + ObjectLoader::reset(); mFontLoaded = false; } diff --git a/src/eepp/graphics/vertexbuffer.cpp b/src/eepp/graphics/vertexbuffer.cpp index 27b7782e6..5e8032396 100644 --- a/src/eepp/graphics/vertexbuffer.cpp +++ b/src/eepp/graphics/vertexbuffer.cpp @@ -31,11 +31,11 @@ VertexBuffer::VertexBuffer( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, co } } - VertexBufferManager::instance()->Add( this ); + VertexBufferManager::instance()->add( this ); } VertexBuffer::~VertexBuffer() { - VertexBufferManager::instance()->Remove( this ); + VertexBufferManager::instance()->remove( this ); } void VertexBuffer::AddVertex( const Uint32& Type, const Vector2f& Vertex ) { @@ -54,10 +54,10 @@ void VertexBuffer::AddVertexCoord( const Vector2f& VertexCoord, const Uint32& Te } void VertexBuffer::AddColor( const ColorA& Color ) { - mColorArray.push_back( Color.R() ); - mColorArray.push_back( Color.G() ); - mColorArray.push_back( Color.B() ); - mColorArray.push_back( Color.A() ); + mColorArray.push_back( Color.r() ); + mColorArray.push_back( Color.g() ); + mColorArray.push_back( Color.b() ); + mColorArray.push_back( Color.a() ); } void VertexBuffer::AddIndex( const Uint32& Index ) { diff --git a/src/eepp/helper/haikuttf/hkfontmanager.cpp b/src/eepp/helper/haikuttf/hkfontmanager.cpp index 63cecb429..1727135d5 100644 --- a/src/eepp/helper/haikuttf/hkfontmanager.cpp +++ b/src/eepp/helper/haikuttf/hkfontmanager.cpp @@ -16,7 +16,7 @@ hkFontManager * hkFontManager::instance() { return mSingleton; } -void hkFontManager::DestroySingleton() { +void hkFontManager::destroySingleton() { hkSAFE_DELETE( mSingleton ); } diff --git a/src/eepp/helper/haikuttf/hkfontmanager.hpp b/src/eepp/helper/haikuttf/hkfontmanager.hpp index adb55a05c..c238ebacd 100644 --- a/src/eepp/helper/haikuttf/hkfontmanager.hpp +++ b/src/eepp/helper/haikuttf/hkfontmanager.hpp @@ -15,7 +15,7 @@ class hkFontManager : private hkMutex { static hkFontManager * instance(); - static void DestroySingleton(); + static void destroySingleton(); hkFontManager(); diff --git a/src/eepp/math/interpolation.cpp b/src/eepp/math/interpolation.cpp index 47b85f913..e8f70bf6e 100644 --- a/src/eepp/math/interpolation.cpp +++ b/src/eepp/math/interpolation.cpp @@ -161,7 +161,7 @@ void Interpolation::Update( const Time& Elapsed ) { mUpdate = false; } - mCurTime += Elapsed.AsMilliseconds(); + mCurTime += Elapsed.asMilliseconds(); mCurPos = easingCb[ mType ]( mCurTime, mActP->p, ( mNexP->p - mActP->p ), mActP->t ); @@ -188,12 +188,12 @@ void Interpolation::SetTotalTime( const Time & TotTime ) { if ( mLoop ) { tdist += eeabs( mPoints[ mPoints.size() - 1 ].p - mPoints[0].p ); - mPoints[ mPoints.size() - 1 ].t = eeabs( mPoints[ mPoints.size() - 1 ].p - mPoints[0].p ) * TotTime.AsMilliseconds() / tdist; + mPoints[ mPoints.size() - 1 ].t = eeabs( mPoints[ mPoints.size() - 1 ].p - mPoints[0].p ) * TotTime.asMilliseconds() / tdist; } for ( unsigned int i = 0; i < mPoints.size() - 1; i++) { Float CurDist = eeabs( mPoints[i].p - mPoints[i + 1].p ); - mPoints[i].t = CurDist * TotTime.AsMilliseconds() / tdist; + mPoints[i].t = CurDist * TotTime.asMilliseconds() / tdist; } } diff --git a/src/eepp/math/waypoints.cpp b/src/eepp/math/waypoints.cpp index 91bc42983..5e10dee9f 100755 --- a/src/eepp/math/waypoints.cpp +++ b/src/eepp/math/waypoints.cpp @@ -177,7 +177,7 @@ void Waypoints::Update( const Time& Elapsed ) { mUpdate = false; } - mCurTime += Elapsed.AsMilliseconds(); + mCurTime += Elapsed.asMilliseconds(); mCurPos.x = easingCb[ mType ]( mCurTime, mActP->p.x, ( mNexP->p.x - mActP->p.x ), mActP->t ); mCurPos.y = easingCb[ mType ]( mCurTime, mActP->p.y, ( mNexP->p.y - mActP->p.y ), mActP->t ); @@ -209,11 +209,11 @@ void Waypoints::SetTotalTime( const Time& TotTime ) { if ( mLoop ) { tdist += mPoints[ mPoints.size() - 1 ].p.Distance( mPoints[0].p ); - mPoints[ mPoints.size() - 1 ].t = mPoints[ mPoints.size() - 1 ].p.Distance( mPoints[0].p ) * TotTime.AsMilliseconds() / tdist; + mPoints[ mPoints.size() - 1 ].t = mPoints[ mPoints.size() - 1 ].p.Distance( mPoints[0].p ) * TotTime.asMilliseconds() / tdist; } for (i = 0; i < mPoints.size() - 1; i++) - mPoints[i].t = mPoints[i].p.Distance( mPoints[i + 1].p ) * TotTime.AsMilliseconds() / tdist; + mPoints[i].t = mPoints[i].p.Distance( mPoints[i + 1].p ) * TotTime.asMilliseconds() / tdist; } void Waypoints::Type( Ease::Interpolation InterpolationType ) { diff --git a/src/eepp/network/http.cpp b/src/eepp/network/http.cpp index 406e3896f..18ed08065 100644 --- a/src/eepp/network/http.cpp +++ b/src/eepp/network/http.cpp @@ -21,7 +21,7 @@ Http::Request::Request(const std::string& uri, Method method, const std::string& } void Http::Request::SetField(const std::string& field, const std::string& value) { - mFields[String::ToLower(field)] = value; + mFields[String::toLower(field)] = value; } void Http::Request::SetMethod(Http::Request::Method method) { @@ -98,7 +98,7 @@ std::string Http::Request::Prepare() const { } bool Http::Request::HasField(const std::string& field) const { - return mFields.find(String::ToLower(field)) != mFields.end(); + return mFields.find(String::toLower(field)) != mFields.end(); } Http::Response::Response() : @@ -109,7 +109,7 @@ Http::Response::Response() : } const std::string& Http::Response::GetField(const std::string& field) const { - FieldTable::const_iterator it = mFields.find(String::ToLower(field)); + FieldTable::const_iterator it = mFields.find(String::toLower(field)); if (it != mFields.end()) { return it->second; } else { @@ -143,7 +143,7 @@ void Http::Response::Parse(const std::string& data) { if (in >> version) { std::locale loc; if ((version.size() >= 8) && (version[6] == '.') && - (String::ToLower(version.substr(0, 5)) == "http/") && + (String::toLower(version.substr(0, 5)) == "http/") && std::isdigit(version[5],loc) && std::isdigit(version[7],loc)) { mMajorVersion = version[5] - '0'; mMinorVersion = version[7] - '0'; @@ -175,7 +175,7 @@ void Http::Response::Parse(const std::string& data) { mBody.clear(); // Determine whether the transfer is chunked - if (String::ToLower(GetField("transfer-encoding")) != "chunked") { + if (String::toLower(GetField("transfer-encoding")) != "chunked") { // Not chunked - everything at once std::copy(std::istreambuf_iterator(in), std::istreambuf_iterator(), std::back_inserter(mBody)); } else { @@ -216,7 +216,7 @@ void Http::Response::ParseFields(std::istream &in) { value.erase(value.size() - 1); // Add the field - mFields[String::ToLower(field)] = value; + mFields[String::toLower(field)] = value; } } } @@ -241,7 +241,7 @@ Http::~Http() { // First we wait to finish any request pending for ( itt = mThreads.begin(); itt != mThreads.end(); itt++ ) { - (*itt)->Wait(); + (*itt)->wait(); } for ( itt = mThreads.begin(); itt != mThreads.end(); itt++ ) { @@ -256,11 +256,11 @@ Http::~Http() { void Http::SetHost(const std::string& host, unsigned short port, bool useSSL) { // Check the protocol - if (String::ToLower(host.substr(0, 7)) == "http://") { + if (String::toLower(host.substr(0, 7)) == "http://") { // HTTP protocol mHostName = host.substr(7); mPort = (port != 0 ? port : 80); - } else if (String::ToLower(host.substr(0, 8)) == "https://") { + } else if (String::toLower(host.substr(0, 8)) == "https://") { // HTTPS protocol #ifdef EE_SSL_SUPPORT mIsSSL = true; @@ -368,7 +368,7 @@ Http::AsyncRequest::AsyncRequest(Http *http, AsyncResponseCallback cb, Http::Req { } -void Http::AsyncRequest::Run() { +void Http::AsyncRequest::run() { Http::Response response = mHttp->SendRequest( mRequest, mTimeout ); mCb( *mHttp, mRequest, response ); @@ -391,7 +391,7 @@ void Http::RemoveOldThreads() { if ( !ar->mRunning ) { // We need to be sure, since the state is set in the thread, this will not block the thread anyway - ar->Wait(); + ar->wait(); eeDelete( ar ); @@ -407,7 +407,7 @@ void Http::RemoveOldThreads() { void Http::SendAsyncRequest( AsyncResponseCallback cb, const Http::Request& request, Time timeout ) { AsyncRequest * thread = eeNew( AsyncRequest, ( this, cb, request, timeout ) ); - thread->Launch(); + thread->launch(); // Clean old threads Lock l( mThreadsMutex ); diff --git a/src/eepp/network/socketselector.cpp b/src/eepp/network/socketselector.cpp index fedff8b89..c0dd1c45a 100644 --- a/src/eepp/network/socketselector.cpp +++ b/src/eepp/network/socketselector.cpp @@ -94,8 +94,8 @@ void SocketSelector::Clear() { bool SocketSelector::Wait(Time timeout) { // Setup the timeout timeval time; - time.tv_sec = static_cast(timeout.AsMicroseconds() / 1000000); - time.tv_usec = static_cast(timeout.AsMicroseconds() % 1000000); + time.tv_sec = static_cast(timeout.asMicroseconds() / 1000000); + time.tv_usec = static_cast(timeout.asMicroseconds() % 1000000); // Initialize the set that will contain the sockets that are ready mImpl->SocketsReady = mImpl->AllSockets; diff --git a/src/eepp/network/ssl/backend/openssl/opensslsocket.cpp b/src/eepp/network/ssl/backend/openssl/opensslsocket.cpp index 29a64c784..379aa1212 100644 --- a/src/eepp/network/ssl/backend/openssl/opensslsocket.cpp +++ b/src/eepp/network/ssl/backend/openssl/opensslsocket.cpp @@ -140,9 +140,9 @@ bool OpenSSLSocket::Init() { OpenSSL_add_all_algorithms(); // Load all available encryption algorithms //! Load the certificates and config - if ( FileSystem::FileExists( SSLSocket::CertificatesPath ) ) { + if ( FileSystem::fileExists( SSLSocket::CertificatesPath ) ) { SafeDataPointer data; - FileSystem::FileGet( SSLSocket::CertificatesPath, data ); + FileSystem::fileGet( SSLSocket::CertificatesPath, data ); if ( data.DataSize > 0 ) { BIO* mem = BIO_new(BIO_s_mem()); diff --git a/src/eepp/network/ssl/sslsocket.cpp b/src/eepp/network/ssl/sslsocket.cpp index 90be34b08..15df260ba 100644 --- a/src/eepp/network/ssl/sslsocket.cpp +++ b/src/eepp/network/ssl/sslsocket.cpp @@ -26,28 +26,28 @@ bool SSLSocket::Init() { if ( CertificatesPath.empty() ) { #if EE_PLATFORM == EE_PLATFORM_LINUX // Debian Systems - if ( FileSystem::FileExists( "/etc/ssl/certs/ca-certificates.crt" ) ) { + if ( FileSystem::fileExists( "/etc/ssl/certs/ca-certificates.crt" ) ) { CertificatesPath = "/etc/ssl/certs/ca-certificates.crt"; // SuSE Systems - } else if ( FileSystem::FileExists( "/etc/ssl/ca-bundle.pem" ) ) { + } else if ( FileSystem::fileExists( "/etc/ssl/ca-bundle.pem" ) ) { CertificatesPath = "/etc/ssl/ca-bundle.pem"; // Redhat and Mandriva Systems - } else if ( FileSystem::FileExists( "/etc/pki/tls/certs/ca-bundle.crt" ) ) { + } else if ( FileSystem::fileExists( "/etc/pki/tls/certs/ca-bundle.crt" ) ) { CertificatesPath = "/etc/pki/tls/certs/ca-bundle.crt"; // older Redhat Systems - } else if ( FileSystem::FileExists( "/usr/share/ssl/certs/ca-bundle.crt" ) ) { + } else if ( FileSystem::fileExists( "/usr/share/ssl/certs/ca-bundle.crt" ) ) { CertificatesPath = "/usr/share/ssl/certs/ca-bundle.crt"; } #elif EE_PLATFORM == EE_PLATFORM_BSD // FreeBSD - if ( FileSystem::FileExists( "/usr/local/share/certs/ca-root.crt" ) ) { + if ( FileSystem::fileExists( "/usr/local/share/certs/ca-root.crt" ) ) { CertificatesPath = "/usr/local/share/certs/ca-root.crt"; // OpenBSD - } else if ( FileSystem::FileExists( "/etc/ssl/cert.pem" ) ) { + } else if ( FileSystem::fileExists( "/etc/ssl/cert.pem" ) ) { CertificatesPath = "/etc/ssl/cert.pem"; } #elif EE_PLATFORM == EE_PLATFORM_HAIKU - if ( FileSystem::FileExists( "/boot/common/data/ssl/cert.pem" ) ) { + if ( FileSystem::fileExists( "/boot/common/data/ssl/cert.pem" ) ) { CertificatesPath = "/boot/common/data/ssl/cert.pem"; } #endif diff --git a/src/eepp/network/tcpsocket.cpp b/src/eepp/network/tcpsocket.cpp index 31de1901f..ae30261bc 100644 --- a/src/eepp/network/tcpsocket.cpp +++ b/src/eepp/network/tcpsocket.cpp @@ -117,8 +117,8 @@ Socket::Status TcpSocket::Connect(const IpAddress& remoteAddress, unsigned short // Setup the timeout timeval time; - time.tv_sec = static_cast(timeout.AsMicroseconds() / 1000000); - time.tv_usec = static_cast(timeout.AsMicroseconds() % 1000000); + time.tv_sec = static_cast(timeout.asMicroseconds() / 1000000); + time.tv_usec = static_cast(timeout.asMicroseconds() % 1000000); // Wait for something to write on our socket (which means that the connection request has returned) if (select(static_cast(GetHandle() + 1), NULL, &selector, NULL, &time) > 0) { diff --git a/src/eepp/network/uri.cpp b/src/eepp/network/uri.cpp index 193e2962e..bf645ec4f 100644 --- a/src/eepp/network/uri.cpp +++ b/src/eepp/network/uri.cpp @@ -44,7 +44,7 @@ URI::URI(const std::string& scheme, const std::string& pathEtc): mScheme(scheme), mPort(0) { - String::ToLowerInPlace(mScheme); + String::toLowerInPlace(mScheme); mPort = GetWellKnownPort(); std::string::const_iterator beg = pathEtc.begin(); std::string::const_iterator end = pathEtc.end(); @@ -54,7 +54,7 @@ URI::URI(const std::string& scheme, const std::string& pathEtc): URI::URI(const std::string& scheme, const std::string& authority, const std::string& pathEtc): mScheme(scheme) { - String::ToLowerInPlace(mScheme); + String::toLowerInPlace(mScheme); std::string::const_iterator beg = authority.begin(); std::string::const_iterator end = authority.end(); ParseAuthority(beg, end); @@ -68,7 +68,7 @@ URI::URI(const std::string& scheme, const std::string& authority, const std::str mPath(path), mQuery(query) { - String::ToLowerInPlace(mScheme); + String::toLowerInPlace(mScheme); std::string::const_iterator beg = authority.begin(); std::string::const_iterator end = authority.end(); ParseAuthority(beg, end); @@ -80,7 +80,7 @@ URI::URI(const std::string& scheme, const std::string& authority, const std::str mQuery(query), mFragment(fragment) { - String::ToLowerInPlace(mScheme); + String::toLowerInPlace(mScheme); std::string::const_iterator beg = authority.begin(); std::string::const_iterator end = authority.end(); ParseAuthority(beg, end); @@ -208,7 +208,7 @@ std::string URI::ToString() const void URI::SetScheme(const std::string& scheme) { mScheme = scheme; - String::ToLowerInPlace(mScheme); + String::toLowerInPlace(mScheme); if (mPort == 0) mPort = GetWellKnownPort(); } @@ -256,7 +256,7 @@ std::string URI::GetAuthority() const if (mPort && !IsWellKnownPort()) { auth += ':'; - auth += String::ToStr( mPort ); + auth += String::toStr( mPort ); } return auth; } @@ -689,7 +689,7 @@ void URI::ParseHostAndPort(std::string::const_iterator& it, const std::string::c { int nport = 0; - if ( String::FromString( nport, port ) && nport > 0 && nport < 65536) + if ( String::fromString( nport, port ) && nport > 0 && nport < 65536) mPort = (unsigned short) nport; else { return; //throw SyntaxException("bad or invalid port number", port); @@ -699,7 +699,7 @@ void URI::ParseHostAndPort(std::string::const_iterator& it, const std::string::c } else mPort = GetWellKnownPort(); mHost = host; - String::ToLowerInPlace(mHost); + String::toLowerInPlace(mHost); } void URI::ParsePath(std::string::const_iterator& it, const std::string::const_iterator& end) diff --git a/src/eepp/physics/space.cpp b/src/eepp/physics/space.cpp index 761d4dbdb..7fea15127 100644 --- a/src/eepp/physics/space.cpp +++ b/src/eepp/physics/space.cpp @@ -64,7 +64,7 @@ void Space::Step( const cpFloat& dt ) { void Space::Update() { #ifdef PHYSICS_RENDERER_ENABLED - Step( Window::Engine::instance()->Elapsed().AsSeconds() ); + Step( Window::Engine::instance()->Elapsed().asSeconds() ); #else Step( 1 / 60 ); #endif diff --git a/src/eepp/system/base64.cpp b/src/eepp/system/base64.cpp index 6592e05d3..5d07cc2d3 100644 --- a/src/eepp/system/base64.cpp +++ b/src/eepp/system/base64.cpp @@ -7,7 +7,7 @@ namespace EE { namespace System { /* $Id: base64.c 156 2007-07-12 23:29:10Z orange $ */ /* decode a base64 string in one shot */ -int Base64::Decode(size_t in_len, const char *in, size_t out_len, unsigned char *out) { +int Base64::decode(size_t in_len, const char *in, size_t out_len, unsigned char *out) { static const Uint8 base64dec_tab[256] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, @@ -53,7 +53,7 @@ int Base64::Decode(size_t in_len, const char *in, size_t out_len, unsigned char return io; } -int Base64::Encode(size_t in_len, const unsigned char *in, size_t out_len, char *out) { +int Base64::encode(size_t in_len, const unsigned char *in, size_t out_len, char *out) { static const Uint8 base64enc_tab[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; unsigned ii, io; @@ -85,14 +85,14 @@ int Base64::Encode(size_t in_len, const unsigned char *in, size_t out_len, char return io; } -bool Base64::Encode(const std::string & in, std::string & out) { - size_t b64len = EncodeSafeOutLen( in.size() ); +bool Base64::encode(const std::string & in, std::string & out) { + size_t b64len = encodeSafeOutLen( in.size() ); if ( out.size() < b64len ) { out.resize( b64len ); } - int len = Encode( in.size(), (const unsigned char*)in.c_str(), out.size(), (char*)&out[0] ); + int len = encode( in.size(), (const unsigned char*)in.c_str(), out.size(), (char*)&out[0] ); if ( -1 != len && (size_t)len != out.size() ) { out.resize( len ); @@ -101,14 +101,14 @@ bool Base64::Encode(const std::string & in, std::string & out) { return -1 != len; } -bool Base64::Decode(const std::string & in, std::string & out) { - size_t d64len = DecodeSafeOutLen( in.size() ); +bool Base64::decode(const std::string & in, std::string & out) { + size_t d64len = decodeSafeOutLen( in.size() ); if ( out.size() < d64len ) { out.resize( d64len ); } - int len = Decode( in.size(), in.c_str(), out.size(), (unsigned char*)&out[0] ); + int len = decode( in.size(), in.c_str(), out.size(), (unsigned char*)&out[0] ); if ( -1 != len && (size_t)len != out.size() ) { out.resize( len ); diff --git a/src/eepp/system/clock.cpp b/src/eepp/system/clock.cpp index f13d60b5e..3a5ee20a3 100755 --- a/src/eepp/system/clock.cpp +++ b/src/eepp/system/clock.cpp @@ -6,24 +6,24 @@ namespace EE { namespace System { Clock::Clock() : mClockImpl( new Platform::ClockImpl() ) { - Restart(); + restart(); } Clock::~Clock() { delete mClockImpl; } -void Clock::Restart() { - mClockImpl->Restart(); +void Clock::restart() { + mClockImpl->restart(); } -Time Clock::GetElapsedTime() const { - return Microseconds( mClockImpl->GetElapsedTime() ); +Time Clock::getElapsedTime() const { + return Microseconds( mClockImpl->getElapsedTime() ); } -Time Clock::Elapsed() { - Time r = GetElapsedTime(); - Restart(); +Time Clock::elapsed() { + Time r = getElapsedTime(); + restart(); return r; } diff --git a/src/eepp/system/condition.cpp b/src/eepp/system/condition.cpp index 4d90a6b9b..0ffb7cd74 100644 --- a/src/eepp/system/condition.cpp +++ b/src/eepp/system/condition.cpp @@ -14,47 +14,47 @@ Condition::~Condition() { delete mCondImpl; } -void Condition::Lock() { - mCondImpl->Lock(); +void Condition::lock() { + mCondImpl->lock(); } -bool Condition::WaitAndLock( int awaitedValue, int autorelease ) { - bool flag = mCondImpl->WaitAndRetain( awaitedValue ); +bool Condition::waitAndLock( int awaitedValue, int autorelease ) { + bool flag = mCondImpl->waitAndRetain( awaitedValue ); if ( autorelease ) { - mCondImpl->Release( awaitedValue ); + mCondImpl->release( awaitedValue ); } return flag; } -void Condition::Unlock( int value ) { - mCondImpl->Release(value); +void Condition::unlock( int value ) { + mCondImpl->release(value); } -void Condition::Unlock() { - mCondImpl->Unlock(); +void Condition::unlock() { + mCondImpl->unlock(); } int Condition::operator=( int value ) { - mCondImpl->SetValue( value ); + mCondImpl->setValue( value ); return value; } -int Condition::Value() const { - return mCondImpl->Value(); +int Condition::value() const { + return mCondImpl->value(); } -void Condition::Signal() { - mCondImpl->Signal(); +void Condition::signal() { + mCondImpl->signal(); } -void Condition::Invalidate() { - mCondImpl->Invalidate(); +void Condition::invalidate() { + mCondImpl->invalidate(); } -void Condition::Restore() { - mCondImpl->Restore(); +void Condition::restore() { + mCondImpl->restore(); } }} diff --git a/src/eepp/system/filesystem.cpp b/src/eepp/system/filesystem.cpp index fd2e1710a..c3930f625 100644 --- a/src/eepp/system/filesystem.cpp +++ b/src/eepp/system/filesystem.cpp @@ -26,7 +26,7 @@ namespace EE { namespace System { -std::string FileSystem::GetOSlash() { +std::string FileSystem::getOSlash() { #if EE_PLATFORM == EE_PLATFORM_WIN return std::string( "\\" ); #else @@ -34,16 +34,16 @@ std::string FileSystem::GetOSlash() { #endif } -bool FileSystem::FileGet( const std::string& path, SafeDataPointer& data ) { - if ( FileExists( path ) ) { +bool FileSystem::fileGet( const std::string& path, SafeDataPointer& data ) { + if ( fileExists( path ) ) { IOStreamFile fs ( path , std::ios::in | std::ios::binary ); eeSAFE_DELETE( data.Data ); - data.DataSize = FileSize( path ); + data.DataSize = fileSize( path ); data.Data = eeNewArray( Uint8, ( data.DataSize ) ); - fs.Read( reinterpret_cast ( data.Data ), data.DataSize ); + fs.read( reinterpret_cast ( data.Data ), data.DataSize ); return true; } @@ -51,15 +51,15 @@ bool FileSystem::FileGet( const std::string& path, SafeDataPointer& data ) { return false; } -bool FileSystem::FileGet( const std::string& path, std::vector& data ) { - if ( FileExists( path ) ) { +bool FileSystem::fileGet( const std::string& path, std::vector& data ) { + if ( fileExists( path ) ) { IOStreamFile fs ( path, std::ios::in | std::ios::binary ); - Uint32 fsize = FileSize( path ); + Uint32 fsize = fileSize( path ); data.clear(); data.resize( fsize ); - fs.Read( reinterpret_cast (&data[0]), fsize ); + fs.read( reinterpret_cast (&data[0]), fsize ); return true; } @@ -67,10 +67,10 @@ bool FileSystem::FileGet( const std::string& path, std::vector& data ) { return false; } -bool FileSystem::FileCopy( const std::string& src, const std::string& dst ) { - if ( FileExists( src ) ) { +bool FileSystem::fileCopy( const std::string& src, const std::string& dst ) { + if ( fileExists( src ) ) { Int64 chunksize = EE_1MB; - Int64 size = FileSize( src ); + Int64 size = fileSize( src ); Int64 size_left = (Int32)size; Int64 allocate = ( size < chunksize ) ? size : chunksize; Int64 copysize = 0; @@ -83,7 +83,7 @@ bool FileSystem::FileCopy( const std::string& src, const std::string& dst ) { 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 ) { + if ( in.isOpen() && out.isOpen() && size > 0 ) { do { if ( size_left - chunksize < 0 ) { copysize = size_left; @@ -91,8 +91,8 @@ bool FileSystem::FileCopy( const std::string& src, const std::string& dst ) { copysize = chunksize; } - in.Read ( &buff[0], copysize ); - out.Write ( (const char*)&buff[0], copysize ); + in.read ( &buff[0], copysize ); + out.write ( (const char*)&buff[0], copysize ); size_left -= copysize; } while ( size_left > 0 ); @@ -104,42 +104,42 @@ bool FileSystem::FileCopy( const std::string& src, const std::string& dst ) { return false; } -std::string FileSystem::FileExtension( const std::string& filepath, const bool& lowerExt ) { +std::string FileSystem::fileExtension( const std::string& filepath, const bool& lowerExt ) { std::string tstr( filepath.substr( filepath.find_last_of(".") + 1 ) ); if ( lowerExt ) - String::ToLowerInPlace( tstr ); + String::toLowerInPlace( tstr ); return tstr; } -std::string FileSystem::FileRemoveExtension( const std::string& filepath ) { +std::string FileSystem::fileRemoveExtension( const std::string& filepath ) { return filepath.substr( 0, filepath.find_last_of(".") ); } -std::string FileSystem::FileNameFromPath( const std::string& filepath ) { +std::string FileSystem::fileNameFromPath( const std::string& filepath ) { return filepath.substr( filepath.find_last_of("/\\") + 1 ); } -std::string FileSystem::FileRemoveFileName( const std::string& filepath ) { +std::string FileSystem::fileRemoveFileName( const std::string& filepath ) { return filepath.substr( 0, filepath.find_last_of("/\\") + 1 ); } -void FileSystem::FilePathRemoveProcessPath( std::string& path ) { - static std::string ProcessPath = Sys::GetProcessPath(); +void FileSystem::filePathRemoveProcessPath( std::string& path ) { + static std::string ProcessPath = Sys::getProcessPath(); - if ( String::StartsWith( path, ProcessPath ) && ProcessPath.length() < path.size() ) { + if ( String::startsWith( path, ProcessPath ) && ProcessPath.length() < path.size() ) { path = path.substr( ProcessPath.length() ); } } -bool FileSystem::FileWrite( const std::string& filepath, const Uint8* data, const Uint32& dataSize ) { +bool FileSystem::fileWrite( const std::string& filepath, const Uint8* data, const Uint32& dataSize ) { IOStreamFile fs( filepath, std::ios::out | std::ios::binary ); - if ( fs.IsOpen() ) { + if ( fs.isOpen() ) { if ( dataSize ) { - fs.Write( reinterpret_cast (data), dataSize ); + fs.write( reinterpret_cast (data), dataSize ); } return true; @@ -148,15 +148,15 @@ bool FileSystem::FileWrite( const std::string& filepath, const Uint8* data, cons return false; } -bool FileSystem::FileWrite( const std::string& filepath, const std::vector& data ) { - return FileWrite( filepath, reinterpret_cast ( &data[0] ), (Uint32)data.size() ); +bool FileSystem::fileWrite( const std::string& filepath, const std::vector& data ) { + return fileWrite( filepath, reinterpret_cast ( &data[0] ), (Uint32)data.size() ); } -bool FileSystem::FileRemove( const std::string& filepath ) { +bool FileSystem::fileRemove( const std::string& filepath ) { return 0 == remove( filepath.c_str() ); } -Uint32 FileSystem::FileGetModificationDate( const std::string& Filepath ) { +Uint32 FileSystem::fileGetModificationDate( const std::string& Filepath ) { struct stat st; int res = stat( Filepath.c_str(), &st ); @@ -166,24 +166,24 @@ Uint32 FileSystem::FileGetModificationDate( const std::string& Filepath ) { return 0; } -void FileSystem::DirPathAddSlashAtEnd( std::string& path ) { +void FileSystem::dirPathAddSlashAtEnd( std::string& path ) { if ( path.size() && path[ path.size() - 1 ] != '/' && path[ path.size() - 1 ] != '\\' ) - path += GetOSlash(); + path += getOSlash(); } -std::string FileSystem::RemoveLastFolderFromPath( std::string path ) { +std::string FileSystem::removeLastFolderFromPath( std::string path ) { if ( path.size() > 1 && ( path[ path.size() - 1 ] == '/' || path[ path.size() - 1 ] == '\\' ) ) { path.resize( path.size() - 1 ); } - std::size_t pos = path.find_last_of( GetOSlash() ); + std::size_t pos = path.find_last_of( getOSlash() ); if ( std::string::npos != pos ) { std::string sstr; - std::size_t pos2 = path.find_first_of( GetOSlash() ); + std::size_t pos2 = path.find_first_of( getOSlash() ); if ( pos2 != pos ) { - sstr = path.substr(0,pos) + GetOSlash(); + sstr = path.substr(0,pos) + getOSlash(); } else { if ( pos == pos2 ) { sstr = path.substr(0,pos2+1); @@ -191,22 +191,22 @@ std::string FileSystem::RemoveLastFolderFromPath( std::string path ) { } if ( sstr.size() ) { - DirPathAddSlashAtEnd( sstr ); + dirPathAddSlashAtEnd( sstr ); return sstr; } } - DirPathAddSlashAtEnd( path ); + dirPathAddSlashAtEnd( path ); return path; } -bool FileSystem::IsDirectory( const String& path ) { - return IsDirectory( path.ToUtf8() ); +bool FileSystem::isDirectory( const String& path ) { + return isDirectory( path.toUtf8() ); } -bool FileSystem::IsDirectory( const std::string& path ) { +bool FileSystem::isDirectory( const std::string& path ) { #ifndef EE_COMPILER_MSVC DIR *dp = NULL; @@ -221,7 +221,7 @@ bool FileSystem::IsDirectory( const std::string& path ) { #endif } -bool FileSystem::MakeDir( const std::string& path, const Uint16& mode ) { +bool FileSystem::makeDir( const std::string& path, const Uint16& mode ) { Int16 v; #if EE_PLATFORM == EE_PLATFORM_WIN #ifdef EE_COMPILER_MSVC @@ -235,7 +235,7 @@ bool FileSystem::MakeDir( const std::string& path, const Uint16& mode ) { return v == 0; } -std::vector FileSystem::FilesGetInPath( const String& path, const bool& sortByName, const bool& foldersFirst ) { +std::vector FileSystem::filesGetInPath( const String& path, const bool& sortByName, const bool& foldersFirst ) { std::vector files; #ifdef EE_COMPILER_MSVC @@ -279,13 +279,13 @@ std::vector FileSystem::FilesGetInPath( const String& path, const bool& HANDLE hFind = FindFirstFile( (LPCTSTR) mPath.ToAnsiString().c_str(), &findFileData ); if( hFind != INVALID_HANDLE_VALUE ) { - String tmpstr( String::FromUtf8( findFileData.cFileName ) ); + String tmpstr( String::fromUtf8( findFileData.cFileName ) ); if ( tmpstr != "." && tmpstr != ".." ) files.push_back( tmpstr ); while( FindNextFile( hFind, &findFileData ) ) { - tmpstr = String::FromUtf8( findFileData.cFileName ); + tmpstr = String::fromUtf8( findFileData.cFileName ); if ( tmpstr != "." && tmpstr != ".." ) files.push_back( tmpstr ); @@ -298,7 +298,7 @@ std::vector FileSystem::FilesGetInPath( const String& path, const bool& DIR *dp; struct dirent *dirp; - if( ( dp = opendir( path.ToUtf8().c_str() ) ) == NULL ) + if( ( dp = opendir( path.toUtf8().c_str() ) ) == NULL ) return files; while ( ( dirp = readdir(dp) ) != NULL) { @@ -330,13 +330,13 @@ std::vector FileSystem::FilesGetInPath( const String& path, const bool& String fpath( path ); if ( fpath[ fpath.size() - 1 ] != '/' && fpath[ fpath.size() - 1 ] != '\\' ) - fpath += GetOSlash(); + fpath += getOSlash(); std::list folders; std::list file; for ( size_t i = 0; i < files.size(); i++ ) { - if ( FileSystem::IsDirectory( fpath + files[i] ) ) { + if ( FileSystem::isDirectory( fpath + files[i] ) ) { folders.push_back( files[i] ); } else { file.push_back( files[i] ); @@ -357,12 +357,12 @@ std::vector FileSystem::FilesGetInPath( const String& path, const bool& return files; } -std::vector FileSystem::FilesGetInPath( const std::string& path, const bool& sortByName, const bool& foldersFirst ) { +std::vector FileSystem::filesGetInPath( const std::string& path, const bool& sortByName, const bool& foldersFirst ) { std::vector files; #ifdef EE_COMPILER_MSVC #ifdef UNICODE - String mPath( String::FromUtf8( path ) ); + String mPath( String::fromUtf8( path ) ); if ( mPath[ mPath.size() - 1 ] == '/' || mPath[ mPath.size() - 1 ] == '\\' ) { mPath += "*"; @@ -377,13 +377,13 @@ std::vector FileSystem::FilesGetInPath( const std::string& path, co String tmpstr( findFileData.cFileName ); if ( tmpstr != "." && tmpstr != ".." ) - files.push_back( tmpstr.ToUtf8() ); + files.push_back( tmpstr.toUtf8() ); while( FindNextFile(hFind, &findFileData ) ) { tmpstr = String( findFileData.cFileName ); if ( tmpstr != "." && tmpstr != ".." ) - files.push_back( String( findFileData.cFileName ).ToUtf8() ); + files.push_back( String( findFileData.cFileName ).toUtf8() ); } FindClose( hFind ); @@ -441,13 +441,13 @@ std::vector FileSystem::FilesGetInPath( const std::string& path, co String fpath( path ); if ( fpath[ fpath.size() - 1 ] != '/' && fpath[ fpath.size() - 1 ] != '\\' ) - fpath += GetOSlash(); + fpath += getOSlash(); std::list folders; std::list file; for ( size_t i = 0; i < files.size(); i++ ) { - if ( FileSystem::IsDirectory( fpath + files[i] ) ) { + if ( FileSystem::isDirectory( fpath + files[i] ) ) { folders.push_back( files[i] ); } else { file.push_back( files[i] ); @@ -468,7 +468,7 @@ std::vector FileSystem::FilesGetInPath( const std::string& path, co return files; } -Uint64 FileSystem::FileSize( const std::string& Filepath ) { +Uint64 FileSystem::fileSize( const std::string& Filepath ) { struct stat st; int res = stat( Filepath.c_str(), &st ); @@ -478,12 +478,12 @@ Uint64 FileSystem::FileSize( const std::string& Filepath ) { return 0; } -bool FileSystem::FileExists( const std::string& Filepath ) { +bool FileSystem::fileExists( const std::string& Filepath ) { struct stat st; return ( stat( Filepath.c_str(), &st ) == 0 ) && !S_ISDIR( st.st_mode ); } -std::string FileSystem::SizeToString( const Int64& Size ) { +std::string FileSystem::sizeToString( const Int64& Size ) { double mem = static_cast( Size ); std::string size; Uint8 c = 0; @@ -502,7 +502,7 @@ std::string FileSystem::SizeToString( const Int64& Size ) { default: size = " WTF"; } - return std::string( String::ToStr( mem ) + size ); + return std::string( String::toStr( mem ) + size ); } }} diff --git a/src/eepp/system/inifile.cpp b/src/eepp/system/inifile.cpp index defbbb458..8919fa2fe 100755 --- a/src/eepp/system/inifile.cpp +++ b/src/eepp/system/inifile.cpp @@ -14,93 +14,93 @@ namespace EE { namespace System { #define iniEOL '\r' << std::endl #endif -IniFile::IniFile ( std::string const iniPath, const bool& readFile ) : +IniFile::IniFile ( std::string const iniPath, const bool& shouldReadFile ) : mCaseInsensitive( true ), mIniReaded( false ) { - LoadFromFile( iniPath ); + loadFromFile( iniPath ); - if ( readFile ) - ReadFile(); + if ( shouldReadFile ) + readFile(); } -IniFile::IniFile ( const Uint8* RAWData, const Uint32& size, const bool& readFile ) : +IniFile::IniFile (const Uint8* RAWData, const Uint32& size, const bool& shouldReadFile ) : mCaseInsensitive( true ), mIniReaded( false ) { - LoadFromMemory( RAWData, size ); + loadFromMemory( RAWData, size ); - if ( readFile ) - ReadFile(); + if ( shouldReadFile ) + readFile(); } -IniFile::IniFile( Pack * Pack, std::string iniPackPath, const bool& readFile ) : +IniFile::IniFile( Pack * Pack, std::string iniPackPath, const bool& shouldReadFile ) : mCaseInsensitive( true ), mIniReaded( false ) { - LoadFromPack( Pack, iniPackPath ); + loadFromPack( Pack, iniPackPath ); - if ( readFile ) - ReadFile(); + if ( shouldReadFile ) + readFile(); } -bool IniFile::LoadFromPack( Pack * Pack, std::string iniPackPath ) { - if ( NULL != Pack && Pack->IsOpen() && Pack->Exists( iniPackPath ) ) { +bool IniFile::loadFromPack( Pack * Pack, std::string iniPackPath ) { + if ( NULL != Pack && Pack->isOpen() && Pack->exists( iniPackPath ) ) { SafeDataPointer PData; - Pack->ExtractFileToMemory( iniPackPath, PData ); + Pack->extractFileToMemory( iniPackPath, PData ); - return LoadFromMemory( PData.Data, PData.DataSize ); + return loadFromMemory( PData.Data, PData.DataSize ); } return false; } -bool IniFile::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 ); mLines.clear(); - mLines = String::Split( myfile ); + mLines = String::split( myfile ); mIniReaded = false; return true; } -bool IniFile::LoadFromFile( const std::string& iniPath ) { - Path ( iniPath ); +bool IniFile::loadFromFile( const std::string& iniPath ) { + path ( iniPath ); - if ( FileSystem::FileExists( iniPath ) ) { + if ( FileSystem::fileExists( iniPath ) ) { IOStreamFile f( mPath ); - if ( !f.IsOpen() ) + if ( !f.isOpen() ) return false; - std::string myfile( (size_t)f.GetSize(), '\0' ); + std::string myfile( (size_t)f.getSize(), '\0' ); - f.Read( (char*)&myfile[0], f.GetSize() ); + f.read( (char*)&myfile[0], f.getSize() ); mLines.clear(); - mLines = String::Split( myfile ); + mLines = String::split( myfile ); mIniReaded = false; return true; - } else if ( PackManager::instance()->FallbackToPacks() ) { + } else if ( PackManager::instance()->fallbackToPacks() ) { std::string tPath( iniPath ); - Pack * tPack = PackManager::instance()->Exists( tPath ); + Pack * tPack = PackManager::instance()->exists( tPath ); if ( NULL != tPack ) { - return LoadFromPack( tPack, tPath ); + return loadFromPack( tPack, tPath ); } } return false; } -bool IniFile::ReadFile() { +bool IniFile::readFile() { std::string line; std::string keyname, valuename, value; std::string::size_type pLeft, pRight; @@ -112,7 +112,7 @@ bool IniFile::ReadFile() { return false; for ( Uint32 i = 0; i < mLines.size(); i++ ) { - line = String::LTrim ( mLines[i] ); + line = String::lTrim ( mLines[i] ); // To be compatible with Win32, check for existence of '\r'. // Win32 files have the '\r' and Unix files don't at the end of a line. @@ -136,20 +136,20 @@ bool IniFile::ReadFile() { if ( ( pRight = line.find_last_of ( "]" ) ) != std::string::npos && pRight > pLeft ) { keyname = line.substr ( pLeft + 1, pRight - pLeft - 1 ); - AddKeyName ( keyname ); + addKeyName ( keyname ); } break; case '=': - valuename = String::Trim( line.substr ( 0, pLeft ) ); // Remove the extra space between valuename and = . No spaced valuename permited. - value = String::LTrim( line.substr ( pLeft + 1 ) ); - SetValue ( keyname, valuename, value ); + valuename = String::trim( line.substr ( 0, pLeft ) ); // Remove the extra space between valuename and = . No spaced valuename permited. + value = String::lTrim( line.substr ( pLeft + 1 ) ); + setValue ( keyname, valuename, value ); break; case ';': case '#': if ( !mNames.size() ) - AddHeaderComment ( line.substr ( pLeft + 1 ) ); + addHeaderComment ( line.substr ( pLeft + 1 ) ); else - AddKeyComment ( keyname, line.substr ( pLeft + 1 ) ); + addKeyComment ( keyname, line.substr ( pLeft + 1 ) ); break; } } @@ -165,12 +165,12 @@ bool IniFile::ReadFile() { return false; } -bool IniFile::WriteFile() { +bool IniFile::writeFile() { unsigned commentID, keyID, valueID; IOStreamFile f( mPath, std::ios::out ); - if ( !f.IsOpen() ) + if ( !f.isOpen() ) return false; std::string str; @@ -179,51 +179,51 @@ bool IniFile::WriteFile() { for ( commentID = 0; commentID < mComments.size(); ++commentID ) { str = ';' + mComments[commentID] + '\n'; - f.Write( str.c_str(), str.size() ); + f.write( str.c_str(), str.size() ); } if ( mComments.size() ) { str = "\n"; - f.Write( str.c_str(), str.size() ); + f.write( str.c_str(), str.size() ); } // Write Keys and values. for ( keyID = 0; keyID < mKeys.size(); ++keyID ) { str = '[' + mNames[keyID] + ']' + '\n'; - f.Write( str.c_str(), str.size() ); + f.write( str.c_str(), str.size() ); // Comments. for ( commentID = 0; commentID < mKeys[keyID].comments.size(); ++commentID ) { str = ';' + mKeys[keyID].comments[commentID] + '\n'; - f.Write( str.c_str(), str.size() ); + f.write( str.c_str(), str.size() ); } // Values. for ( valueID = 0; valueID < mKeys[keyID].names.size(); ++valueID ) { str = mKeys[keyID].names[valueID] + '=' + mKeys[keyID].values[valueID] + '\n'; - f.Write( str.c_str(), str.size() ); + f.write( str.c_str(), str.size() ); } str = "\n"; - f.Write( str.c_str(), str.size() ); + f.write( str.c_str(), str.size() ); } return true; } -long IniFile::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 IniFile::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,62 +233,62 @@ long IniFile::FindValue ( unsigned const keyID, std::string const valuename ) co return noID; } -unsigned IniFile::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 IniFile::GetKeyName ( unsigned const keyID ) const { +std::string IniFile::getKeyName ( unsigned const keyID ) const { if ( keyID < mNames.size() ) return mNames[keyID]; else return ""; } -unsigned IniFile::GetNumValues ( unsigned const keyID ) { +unsigned IniFile::getNumValues ( unsigned const keyID ) { if ( keyID < mKeys.size() ) return (unsigned int)mKeys[keyID].names.size(); return 0; } -unsigned IniFile::GetNumValues ( std::string const keyname ) { - long keyID = FindKey ( 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 IniFile::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 IniFile::GetValueName ( std::string const keyname, unsigned const valueID ) const { - long keyID = FindKey ( keyname ); +std::string IniFile::getValueName ( std::string const keyname, unsigned const valueID ) const { + long keyID = findKey ( keyname ); if ( keyID == noID ) return ""; - return GetValueName ( keyID, valueID ); + return getValueName ( keyID, valueID ); } -bool IniFile::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 IniFile::SetValue ( std::string const keyname, std::string const valuename, std::string const value, bool create ) { - long keyID = FindKey ( keyname ); +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 ) - keyID = long ( AddKeyName ( keyname ) ); + keyID = long ( addKeyName ( keyname ) ); else return false; } - long valueID = FindValue ( unsigned ( keyID ), valuename ); + long valueID = findValue ( unsigned ( keyID ), valuename ); if ( valueID == noID ) { if ( !create ) return false; @@ -300,21 +300,21 @@ bool IniFile::SetValue ( std::string const keyname, std::string const valuename, return true; } -bool IniFile::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 ); + String::strFormat( svalue, MAX_VALUEDATA, "%d", value ); + return setValue ( keyname, valuename, svalue, create ); } -bool IniFile::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 ); + String::strFormat ( svalue, MAX_VALUEDATA, "%f", value ); + return setValue ( keyname, valuename, svalue, create ); } -bool IniFile::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]; @@ -325,43 +325,43 @@ bool IniFile::SetValueV ( std::string const keyname, std::string const valuename vsprintf ( value, format, args ); #endif va_end ( args ); - return SetValue ( keyname, valuename, value ); + return setValue ( keyname, valuename, value ); } -std::string IniFile::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 IniFile::GetValue ( std::string const keyname, std::string const valuename, std::string const defValue ) const { - long keyID = FindKey ( keyname ); +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; - long valueID = FindValue ( unsigned ( keyID ), valuename ); + long valueID = findValue ( unsigned ( keyID ), valuename ); if ( valueID == noID ) return defValue; return mKeys[keyID].values[valueID]; } -int IniFile::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() ); + String::strFormat ( svalue, MAX_VALUEDATA, "%d", defValue ); + return atoi ( getValue ( keyname, valuename, svalue ).c_str() ); } -double IniFile::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 ); - return atof ( GetValue ( keyname, valuename, svalue ).c_str() ); + String::strFormat ( svalue, MAX_VALUEDATA, "%f", defValue ); + return atof ( getValue ( keyname, valuename, svalue ).c_str() ); } // 16 variables may be a bit of over kill, but hey, it's only code. -unsigned IniFile::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, @@ -371,7 +371,7 @@ unsigned IniFile::GetValueV ( std::string const keyname, std::string const value unsigned nVals; - value = GetValue ( keyname, valuename ); + value = getValue ( keyname, valuename ); if ( !value.length() ) return false; // Why is there not vsscanf() function. Linux man pages say that there is @@ -392,12 +392,12 @@ unsigned IniFile::GetValueV ( std::string const keyname, std::string const value return nVals; } -bool IniFile::DeleteValue ( std::string const keyname, std::string const valuename ) { - long keyID = FindKey ( keyname ); +bool IniFile::deleteValue ( std::string const keyname, std::string const valuename ) { + long keyID = findKey ( keyname ); if ( keyID == noID ) return false; - long valueID = FindValue ( unsigned ( keyID ), valuename ); + long valueID = findValue ( unsigned ( keyID ), valuename ); if ( valueID == noID ) return false; @@ -410,8 +410,8 @@ bool IniFile::DeleteValue ( std::string const keyname, std::string const valuena return true; } -bool IniFile::DeleteKey ( std::string const keyname ) { - long keyID = FindKey ( keyname ); +bool IniFile::deleteKey ( std::string const keyname ) { + long keyID = findKey ( keyname ); if ( keyID == noID ) return false; @@ -430,7 +430,7 @@ bool IniFile::DeleteKey ( std::string const keyname ) { return true; } -void IniFile::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 IniFile::Clear() { mComments.clear(); } -void IniFile::AddHeaderComment ( std::string const comment ) { +void IniFile::addHeaderComment ( std::string const comment ) { mComments.resize ( mComments.size() + 1, comment ); } -std::string IniFile::GetHeaderComment ( unsigned const commentID ) const { +std::string IniFile::getHeaderComment ( unsigned const commentID ) const { if ( commentID < mComments.size() ) return mComments[commentID]; return ""; } -bool IniFile::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 IniFile::DeleteHeaderComment ( unsigned commentID ) { return false; } -unsigned IniFile::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 IniFile::GetNumKeyComments ( std::string const keyname ) const { - long keyID = FindKey ( keyname ); +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 IniFile::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 IniFile::AddKeyComment ( unsigned const keyID, std::string const comment ) return false; } -bool IniFile::AddKeyComment ( std::string const keyname, std::string const comment ) { - long keyID = FindKey ( keyname ); +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 ); + return addKeyComment ( unsigned ( keyID ), comment ); } -std::string IniFile::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 IniFile::GetKeyComment ( std::string const keyname, unsigned const commentID ) const { - long keyID = FindKey ( keyname ); +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 ); + return getKeyComment ( unsigned ( keyID ), commentID ); } -bool IniFile::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 IniFile::DeleteKeyComment ( unsigned const keyID, unsigned const commentID return false; } -bool IniFile::DeleteKeyComment ( std::string const keyname, unsigned const commentID ) { - long keyID = FindKey ( keyname ); +bool IniFile::deleteKeyComment ( std::string const keyname, unsigned const commentID ) { + long keyID = findKey ( keyname ); if ( keyID == noID ) return false; - return DeleteKeyComment ( unsigned ( keyID ), commentID ); + return deleteKeyComment ( unsigned ( keyID ), commentID ); } -bool IniFile::DeleteKeyComments ( unsigned const keyID ) { +bool IniFile::deleteKeyComments ( unsigned const keyID ) { if ( keyID < mKeys.size() ) { mKeys[keyID].comments.clear(); return true; @@ -526,11 +526,11 @@ bool IniFile::DeleteKeyComments ( unsigned const keyID ) { return false; } -bool IniFile::DeleteKeyComments ( std::string const keyname ) { - long keyID = FindKey ( keyname ); +bool IniFile::deleteKeyComments ( std::string const keyname ) { + long keyID = findKey ( keyname ); if ( keyID == noID ) return false; - return DeleteKeyComments ( unsigned ( keyID ) ); + return deleteKeyComments ( unsigned ( keyID ) ); } std::string IniFile::CheckCase ( std::string s ) const { diff --git a/src/eepp/system/iostreamfile.cpp b/src/eepp/system/iostreamfile.cpp index 1e57910a6..d26ca47cd 100644 --- a/src/eepp/system/iostreamfile.cpp +++ b/src/eepp/system/iostreamfile.cpp @@ -9,43 +9,43 @@ IOStreamFile::IOStreamFile( const std::string& path, std::ios_base::openmode mod } IOStreamFile::~IOStreamFile() { - if ( IsOpen() ) { + if ( isOpen() ) { mFS.close(); } } -ios_size IOStreamFile::Read( char * data, ios_size size ) { - if ( IsOpen() ) { +ios_size IOStreamFile::read( char * data, ios_size size ) { + if ( isOpen() ) { mFS.read( data, size ); } return size; } -ios_size IOStreamFile::Write( const char * data, ios_size size ) { - if ( IsOpen() ) { +ios_size IOStreamFile::write( const char * data, ios_size size ) { + if ( isOpen() ) { mFS.write( data, size ); } return size; } -ios_size IOStreamFile::Seek( ios_size position ) { - if ( IsOpen() ) { +ios_size IOStreamFile::seek( ios_size position ) { + if ( isOpen() ) { mFS.seekg( position , std::ios::beg ); } return position; } -ios_size IOStreamFile::Tell() { +ios_size IOStreamFile::tell() { return mFS.tellg(); } -ios_size IOStreamFile::GetSize() { - if ( IsOpen() ) { +ios_size IOStreamFile::getSize() { + if ( isOpen() ) { if ( 0 == mSize ) { - ios_size Pos = Tell(); + ios_size Pos = tell(); mFS.seekg ( 0, std::ios::end ); @@ -60,11 +60,11 @@ ios_size IOStreamFile::GetSize() { return 0; } -bool IOStreamFile::IsOpen() { +bool IOStreamFile::isOpen() { return mFS.is_open(); } -void IOStreamFile::Flush() { +void IOStreamFile::flush() { mFS.flush(); } diff --git a/src/eepp/system/iostreammemory.cpp b/src/eepp/system/iostreammemory.cpp index 19e3f9510..43229b18e 100644 --- a/src/eepp/system/iostreammemory.cpp +++ b/src/eepp/system/iostreammemory.cpp @@ -21,7 +21,7 @@ IOStreamMemory::IOStreamMemory( char * data, ios_size size ) : IOStreamMemory::~IOStreamMemory() { } -ios_size IOStreamMemory::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 IOStreamMemory::Read( char * data, ios_size size ) { return 0; } -ios_size IOStreamMemory::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 IOStreamMemory::Write( const char * data, ios_size size ) { return mPos; } -ios_size IOStreamMemory::Seek( ios_size position ) { +ios_size IOStreamMemory::seek( ios_size position ) { if ( position < mSize ) mPos = position; return mPos; } -ios_size IOStreamMemory::Tell() { +ios_size IOStreamMemory::tell() { return mPos; } -ios_size IOStreamMemory::GetSize() { +ios_size IOStreamMemory::getSize() { return mSize; } -bool IOStreamMemory::IsOpen() { +bool IOStreamMemory::isOpen() { return NULL != mReadPtr; } diff --git a/src/eepp/system/lock.cpp b/src/eepp/system/lock.cpp index 20ded7155..8f31d521c 100644 --- a/src/eepp/system/lock.cpp +++ b/src/eepp/system/lock.cpp @@ -6,11 +6,11 @@ namespace EE { namespace System { Lock::Lock( Mutex& mutex ) : mMutex( mutex ) { - mMutex.Lock(); + mMutex.lock(); } Lock::~Lock() { - mMutex.Unlock(); + mMutex.unlock(); } }} diff --git a/src/eepp/system/log.cpp b/src/eepp/system/log.cpp index 1e0a23090..e553920e8 100755 --- a/src/eepp/system/log.cpp +++ b/src/eepp/system/log.cpp @@ -25,41 +25,41 @@ Log::Log() : mLiveWrite( false ), mFS( NULL ) { - Write("...::: Entropia Engine++ Loaded :::..."); - Write( "Loaded on " + Sys::GetDateTimeStr() + "\n" ); + write("...::: Entropia Engine++ Loaded :::..."); + write( "Loaded on " + Sys::getDateTimeStr() + "\n" ); } Log::~Log() { - Write( "\nUnloaded on " + Sys::GetDateTimeStr() ); - Write( "...::: Entropia Engine++ Unloaded :::...\n" ); + write( "\nUnloaded on " + Sys::getDateTimeStr() ); + write( "...::: Entropia Engine++ Unloaded :::...\n" ); if ( mSave && !mLiveWrite ) { - OpenFS(); + openFS(); - mFS->Write( mData.c_str(), mData.size() ); + mFS->write( mData.c_str(), mData.size() ); } - CloseFS(); + closeFS(); } -void Log::Save( const std::string& filepath ) { +void Log::save( const std::string& filepath ) { if ( filepath.size() ) { mFilePath = filepath; } else { - mFilePath = Sys::GetProcessPath(); + mFilePath = Sys::getProcessPath(); } mSave = true; } -void Log::Write( std::string Text, const bool& newLine ) { +void Log::write( std::string Text, const bool& newLine ) { if ( newLine ) { Text += '\n'; } mData += Text; - WriteToReaders( Text ); + writeToReaders( Text ); if ( mConsoleOutput ) { #if EE_PLATFORM == EE_PLATFORM_ANDROID @@ -72,17 +72,17 @@ void Log::Write( std::string Text, const bool& newLine ) { } if ( mLiveWrite ) { - OpenFS(); + openFS(); - mFS->Write( Text.c_str(), Text.size() ); + mFS->write( Text.c_str(), Text.size() ); - mFS->Flush(); + mFS->flush(); } } -void Log::OpenFS() { +void Log::openFS() { if ( mFilePath.empty() ) { - mFilePath = Sys::GetProcessPath(); + mFilePath = Sys::getProcessPath(); } if ( NULL == mFS ) { @@ -92,15 +92,15 @@ void Log::OpenFS() { } } -void Log::CloseFS() { - Lock(); +void Log::closeFS() { + lock(); eeSAFE_DELETE( mFS ); - Unlock(); + unlock(); } -void Log::Writef( const char* format, ... ) { +void Log::writef( const char* format, ... ) { int n, size = 256; std::string tstr( size, '\0' ); @@ -117,7 +117,7 @@ void Log::Writef( const char* format, ... ) { mData += tstr; - WriteToReaders( tstr ); + writeToReaders( tstr ); if ( mConsoleOutput ) { #if EE_PLATFORM == EE_PLATFORM_ANDROID @@ -130,11 +130,11 @@ void Log::Writef( const char* format, ... ) { } if ( mLiveWrite ) { - OpenFS(); + openFS(); - mFS->Write( tstr.c_str(), tstr.size() ); + mFS->write( tstr.c_str(), tstr.size() ); - mFS->Flush(); + mFS->flush(); } va_end( args ); @@ -151,15 +151,15 @@ void Log::Writef( const char* format, ... ) { } } -std::string Log::Buffer() const { +std::string Log::buffer() const { return mData; } -const bool& Log::ConsoleOutput() const { +const bool& Log::consoleOutput() const { return mConsoleOutput; } -void Log::ConsoleOutput( const bool& output ) { +void Log::consoleOutput( const bool& output ) { bool OldOutput = mConsoleOutput; mConsoleOutput = output; @@ -167,28 +167,28 @@ void Log::ConsoleOutput( const bool& output ) { if ( !OldOutput && output ) { std::string data( mData ); mData = ""; - Write( data, false ); + write( data, false ); } } -const bool& Log::LiveWrite() const { +const bool& Log::liveWrite() const { return mLiveWrite; } -void Log::LiveWrite( const bool& lw ) { +void Log::liveWrite( const bool& lw ) { mLiveWrite = lw; } -void Log::AddLogReader( LogReaderInterface * reader ) { +void Log::addLogReader( LogReaderInterface * reader ) { mReaders.push_back( reader ); } -void Log::RemoveLogReader( LogReaderInterface * reader ) { +void Log::removeLogReader( LogReaderInterface * reader ) { mReaders.remove( reader ); } -void Log::WriteToReaders( std::string& text ) { +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/md5.cpp b/src/eepp/system/md5.cpp index 95e140f4a..e4f94f0ae 100644 --- a/src/eepp/system/md5.cpp +++ b/src/eepp/system/md5.cpp @@ -78,7 +78,7 @@ namespace EE { namespace System { * This processes one or more 64-byte data blocks, but does NOT update * the bit counters. There are no alignment requirements. */ -const void * MD5::Body(MD5::Context *ctx, const void *data, unsigned long size) +const void * MD5::body(MD5::Context *ctx, const void *data, unsigned long size) { const unsigned char *ptr; MD5_u32plus a, b, c, d; @@ -185,7 +185,7 @@ const void * MD5::Body(MD5::Context *ctx, const void *data, unsigned long size) return ptr; } -std::string MD5::HexDigest( std::vector& digest ) { +std::string MD5::hexDigest( std::vector& digest ) { char buf[33]; size_t size = digest.size(); @@ -198,7 +198,7 @@ std::string MD5::HexDigest( std::vector& digest ) { return std::string( buf ); } -void MD5::Init(MD5::Context * ctx) { +void MD5::init(MD5::Context * ctx) { ctx->a = 0x67452301; ctx->b = 0xefcdab89; ctx->c = 0x98badcfe; @@ -208,7 +208,7 @@ void MD5::Init(MD5::Context * ctx) { ctx->hi = 0; } -void MD5::Update(MD5::Context * ctx, const void * data, unsigned long size) { +void MD5::update(MD5::Context * ctx, const void * data, unsigned long size) { MD5_u32plus saved_lo; unsigned long used, available; @@ -230,18 +230,18 @@ void MD5::Update(MD5::Context * ctx, const void * data, unsigned long size) { memcpy(&ctx->buffer[used], data, available); data = (const unsigned char *)data + available; size -= available; - Body(ctx, ctx->buffer, 64); + body(ctx, ctx->buffer, 64); } if (size >= 64) { - data = Body(ctx, data, size & ~(unsigned long)0x3f); + data = body(ctx, data, size & ~(unsigned long)0x3f); size &= 0x3f; } memcpy(ctx->buffer, data, size); } -void MD5::Final( unsigned char * result, MD5::Context * ctx) { +void MD5::final( unsigned char * result, MD5::Context * ctx) { unsigned long used, available; used = ctx->lo & 0x3f; @@ -252,7 +252,7 @@ void MD5::Final( unsigned char * result, MD5::Context * ctx) { if (available < 8) { memset(&ctx->buffer[used], 0, available); - Body(ctx, ctx->buffer, 64); + body(ctx, ctx->buffer, 64); used = 0; available = 64; } @@ -269,7 +269,7 @@ void MD5::Final( unsigned char * result, MD5::Context * ctx) { ctx->buffer[62] = ctx->hi >> 16; ctx->buffer[63] = ctx->hi >> 24; - Body(ctx, ctx->buffer, 64); + body(ctx, ctx->buffer, 64); result[0] = ctx->a; result[1] = ctx->a >> 8; @@ -291,24 +291,24 @@ void MD5::Final( unsigned char * result, MD5::Context * ctx) { memset(ctx, 0, sizeof(*ctx)); } -MD5::Result MD5::FromStream( IOStream & stream ) { +MD5::Result MD5::fromStream( IOStream & stream ) { Result res; Context ctx; Int64 buff_size = 512; - Int64 size = (Int64)stream.GetSize(); + Int64 size = (Int64)stream.getSize(); char data[buff_size]; - Init( &ctx ); + init( &ctx ); while ( size > 0 ) { if ( size > buff_size ) { - stream.Read( data, buff_size ); + stream.read( data, buff_size ); - Update( &ctx, data, buff_size ); + update( &ctx, data, buff_size ); } else { - stream.Read( data, size ); + stream.read( data, size ); - Update( &ctx, data, size ); + update( &ctx, data, size ); } size -= buff_size; @@ -316,38 +316,38 @@ MD5::Result MD5::FromStream( IOStream & stream ) { res.digest.resize(16); - Final( &res.digest[0], &ctx ); + final( &res.digest[0], &ctx ); return res; } -MD5::Result MD5::FromFile( std::string path ) { +MD5::Result MD5::fromFile( std::string path ) { IOStreamFile file( path, std::ios::in | std::ios::binary ); - return FromStream( file ); + return fromStream( file ); } -MD5::Result MD5::FromMemory( const Uint8 * data, Uint64 size ) { +MD5::Result MD5::fromMemory( const Uint8 * data, Uint64 size ) { Result res; Context ctx; - Init( &ctx ); + init( &ctx ); - Update( &ctx, data, size ); + update( &ctx, data, size ); res.digest.resize(16); - Final( &res.digest[0], &ctx ); + final( &res.digest[0], &ctx ); return res; } -MD5::Result MD5::FromString( const std::string & str ) { - return FromMemory( (const Uint8 *)str.c_str(), str.size() ); +MD5::Result MD5::fromString( const std::string & str ) { + return fromMemory( (const Uint8 *)str.c_str(), str.size() ); } -MD5::Result MD5::FromString( const String & str ) { - return FromMemory( (const Uint8 *)str.c_str(), str.size() ); +MD5::Result MD5::fromString( const String & str ) { + return fromMemory( (const Uint8 *)str.c_str(), str.size() ); } }} diff --git a/src/eepp/system/mutex.cpp b/src/eepp/system/mutex.cpp index d52707d78..75d6cd930 100755 --- a/src/eepp/system/mutex.cpp +++ b/src/eepp/system/mutex.cpp @@ -12,16 +12,16 @@ Mutex::~Mutex() { delete mMutexImpl; } -void Mutex::Lock() { - mMutexImpl->Lock(); +void Mutex::lock() { + mMutexImpl->lock(); } -void Mutex::Unlock() { - mMutexImpl->Unlock(); +void Mutex::unlock() { + mMutexImpl->unlock(); } -int Mutex::TryLock() { - return mMutexImpl->TryLock(); +int Mutex::tryLock() { + return mMutexImpl->tryLock(); } }} diff --git a/src/eepp/system/objectloader.cpp b/src/eepp/system/objectloader.cpp index 13ef8b3bb..5551dd2a7 100644 --- a/src/eepp/system/objectloader.cpp +++ b/src/eepp/system/objectloader.cpp @@ -14,59 +14,59 @@ ObjectLoader::~ObjectLoader() { } -void ObjectLoader::Load() { +void ObjectLoader::load() { if ( mLoaded ) { - SetLoaded(); + setLoaded(); } - Launch(); + launch(); } -void ObjectLoader::Load( ObjLoadCallback Cb ) { +void ObjectLoader::load( ObjLoadCallback Cb ) { if ( Cb.IsSet() ) { mLoadCbs.push_back( Cb ); } - Load(); + load(); } -void ObjectLoader::Launch() { +void ObjectLoader::launch() { if ( mThreaded ) { - Thread::Launch(); + Thread::launch(); } else { - Run(); + run(); } } -void ObjectLoader::Start() { +void ObjectLoader::start() { mLoading = true; } -void ObjectLoader::Update() { +void ObjectLoader::update() { } -bool ObjectLoader::IsLoaded() { +bool ObjectLoader::isLoaded() { return mLoaded; } -bool ObjectLoader::IsLoading() { +bool ObjectLoader::isLoading() { return mLoading; } -bool ObjectLoader::Threaded() const { +bool ObjectLoader::threaded() const { return mThreaded; } -void ObjectLoader::Threaded( const bool& threaded ) { +void ObjectLoader::threaded( const bool& threaded ) { mThreaded = threaded; } -void ObjectLoader::Run() { - Start(); +void ObjectLoader::run() { + start(); } -void ObjectLoader::SetLoaded() { +void ObjectLoader::setLoaded() { mLoaded = true; mLoading = false; @@ -81,11 +81,11 @@ void ObjectLoader::SetLoaded() { } } -const Uint32& ObjectLoader::Type() const { +const Uint32& ObjectLoader::type() const { return mObjType; } -void ObjectLoader::Reset() { +void ObjectLoader::reset() { mLoaded = false; mLoading = false; } diff --git a/src/eepp/system/pack.cpp b/src/eepp/system/pack.cpp index 85ca68105..1c0c9ed5c 100644 --- a/src/eepp/system/pack.cpp +++ b/src/eepp/system/pack.cpp @@ -7,14 +7,14 @@ Pack::Pack() : Mutex(), mIsOpen(false) { - PackManager::instance()->Add( this ); + PackManager::instance()->add( this ); } Pack::~Pack() { - PackManager::instance()->Remove( this ); + PackManager::instance()->remove( this ); } -bool Pack::IsOpen() const { +bool Pack::isOpen() const { return mIsOpen; } diff --git a/src/eepp/system/packmanager.cpp b/src/eepp/system/packmanager.cpp index ceeb6db30..51357ca09 100644 --- a/src/eepp/system/packmanager.cpp +++ b/src/eepp/system/packmanager.cpp @@ -14,15 +14,15 @@ PackManager::PackManager() : PackManager::~PackManager() { } -Pack * PackManager::Exists( std::string& path ) { +Pack * PackManager::exists( std::string& path ) { std::string tpath( path ); - FileSystem::FilePathRemoveProcessPath( tpath ); + FileSystem::filePathRemoveProcessPath( tpath ); std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) { - if ( -1 != (*it)->Exists( tpath ) ) { + if ( -1 != (*it)->exists( tpath ) ) { if ( path.size() != tpath.size() ) { path = tpath; } @@ -34,11 +34,11 @@ Pack * PackManager::Exists( std::string& path ) { return NULL; } -Pack * PackManager::GetPackByPath( std::string path ) { +Pack * PackManager::getPackByPath( std::string path ) { std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) { - if ( path == (*it)->GetPackPath() ) { + if ( path == (*it)->getPackPath() ) { return (*it); } } @@ -46,11 +46,11 @@ Pack * PackManager::GetPackByPath( std::string path ) { return NULL; } -const bool& PackManager::FallbackToPacks() const { +const bool& PackManager::fallbackToPacks() const { return mFallback; } -void PackManager::FallbackToPacks( const bool& fallback ) { +void PackManager::fallbackToPacks( const bool& fallback ) { mFallback = fallback; } diff --git a/src/eepp/system/pak.cpp b/src/eepp/system/pak.cpp index 77d8e5981..91e9b4e64 100755 --- a/src/eepp/system/pak.cpp +++ b/src/eepp/system/pak.cpp @@ -11,11 +11,11 @@ Pak::Pak() : } Pak::~Pak() { - Close(); + close(); } -bool Pak::Create( const std::string& path ) { - if ( !FileSystem::FileExists(path) ) { +bool Pak::create( const std::string& path ) { + if ( !FileSystem::fileExists(path) ) { pakFile Pak; Pak.header.head[0] = 'P'; @@ -30,39 +30,39 @@ bool Pak::Create( const std::string& path ) { 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) ); + mPak.fs->write( reinterpret_cast (&Pak.header), sizeof(Pak.header) ); eeSAFE_DELETE( mPak.fs ); - Open( path ); + open( path ); return true; } else { - return Open( path ); + return open( path ); } return false; } -bool Pak::Open( const std::string& path ) { - if ( FileSystem::FileExists(path) ) { +bool Pak::open( const std::string& path ) { + if ( FileSystem::fileExists(path) ) { mPak.pakPath = path; eeSAFE_DELETE( mPak.fs ); 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 + mPak.fs->read( reinterpret_cast (&mPak.header), sizeof(pakHeader) ); // Read the PAK header - if ( CheckPack() == 0 ) { + if ( checkPack() == 0 ) { mPak.pakFilesNum = mPak.header.dir_length / 64; // Number of files in the PAK - mPak.fs->Seek( mPak.header.dir_offset ); // Seek to read the pakEntrys + mPak.fs->seek( mPak.header.dir_offset ); // Seek to read the pakEntrys for ( Uint32 i = 0; i < mPak.pakFilesNum; i++ ) { // Read all the pakEntrys pakEntry Entry; - mPak.fs->Read( reinterpret_cast (&Entry), sizeof(pakEntry) ); + mPak.fs->read( reinterpret_cast (&Entry), sizeof(pakEntry) ); mPakFiles.push_back( Entry ); } @@ -76,7 +76,7 @@ bool Pak::Open( const std::string& path ) { return false; } -bool Pak::Close() { +bool Pak::close() { if ( mIsOpen ) { eeSAFE_DELETE( mPak.fs ); @@ -90,8 +90,8 @@ bool Pak::Close() { return false; } -Int8 Pak::CheckPack() { - if ( NULL != mPak.fs && mPak.fs->IsOpen() ) { +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,8 +102,8 @@ Int8 Pak::CheckPack() { return 0; } -Int32 Pak::Exists( const std::string& path ) { - if ( IsOpen() ) { +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 ) return i; @@ -112,114 +112,114 @@ Int32 Pak::Exists( const std::string& path ) { return -1; } -bool Pak::ExtractFile( const std::string& path , const std::string& dest ) { - if ( NULL == mPak.fs || !mPak.fs->IsOpen() ) { +bool Pak::extractFile( const std::string& path , const std::string& dest ) { + if ( NULL == mPak.fs || !mPak.fs->isOpen() ) { return false; } - Lock(); + lock(); bool Ret = false; - Int32 Pos = Exists( path ); + Int32 Pos = exists( path ); if ( Pos != -1 ) { SafeDataPointer data; - if ( ExtractFileToMemory( path, data ) ) { - FileSystem::FileWrite( path, data.Data, data.DataSize ); + if ( extractFileToMemory( path, data ) ) { + FileSystem::fileWrite( path, data.Data, data.DataSize ); } Ret = true; } - Unlock(); + unlock(); return Ret; } -bool Pak::ExtractFileToMemory( const std::string& path, std::vector& data ) { - if ( NULL == mPak.fs || !mPak.fs->IsOpen() ) { +bool Pak::extractFileToMemory( const std::string& path, std::vector& data ) { + if ( NULL == mPak.fs || !mPak.fs->isOpen() ) { return false; } - Lock(); + lock(); bool Ret = false; - Int32 Pos = Exists( path ); + Int32 Pos = exists( path ); if ( Pos != -1 ) { data.clear(); data.resize( mPakFiles[Pos].file_length ); - mPak.fs->Seek( mPakFiles[Pos].file_position ); - mPak.fs->Read( reinterpret_cast (&data[0]), mPakFiles[Pos].file_length ); + mPak.fs->seek( mPakFiles[Pos].file_position ); + mPak.fs->read( reinterpret_cast (&data[0]), mPakFiles[Pos].file_length ); Ret = true; } - Unlock(); + unlock(); return Ret; } -bool Pak::ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) { - if ( NULL == mPak.fs || !mPak.fs->IsOpen() ) { +bool Pak::extractFileToMemory( const std::string& path, SafeDataPointer& data ) { + if ( NULL == mPak.fs || !mPak.fs->isOpen() ) { return false; } - Lock(); + lock(); bool Ret = false; - Int32 Pos = Exists( path ); + Int32 Pos = exists( path ); if ( Pos != -1 ) { data.DataSize = mPakFiles[Pos].file_length; data.Data = eeNewArray( Uint8, ( data.DataSize ) ); - mPak.fs->Seek( mPakFiles[Pos].file_position ); - mPak.fs->Read( reinterpret_cast ( data.Data ), mPakFiles[Pos].file_length ); + mPak.fs->seek( mPakFiles[Pos].file_position ); + mPak.fs->read( reinterpret_cast ( data.Data ), mPakFiles[Pos].file_length ); Ret = true; } - Unlock(); + unlock(); return Ret; } -bool Pak::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; Uint32 fsize = dataSize; - if ( NULL != mPak.fs && mPak.fs->IsOpen() ) { + if ( NULL != mPak.fs && mPak.fs->isOpen() ) { if ( mPak.header.dir_length == 1 ) { mPak.header.dir_offset = sizeof(pakHeader) + fsize; mPak.header.dir_length = sizeof(pakEntry); mPak.pakFilesNum = 1; - mPak.fs->Seek( 4 ); // seek after head (PACK) - mPak.fs->Write( reinterpret_cast (&mPak.header.dir_offset), sizeof( mPak.header.dir_offset ) ); - mPak.fs->Write( reinterpret_cast (&mPak.header.dir_length), sizeof( mPak.header.dir_length ) ); + mPak.fs->seek( 4 ); // seek after head (PACK) + mPak.fs->write( reinterpret_cast (&mPak.header.dir_offset), sizeof( mPak.header.dir_offset ) ); + mPak.fs->write( reinterpret_cast (&mPak.header.dir_length), sizeof( mPak.header.dir_length ) ); - mPak.fs->Write( reinterpret_cast (&data[0]), fsize ); + mPak.fs->write( reinterpret_cast (&data[0]), fsize ); pakEntry newFile; - String::StrCopy( newFile.filename, inpack.c_str(), 56 ); + String::strCopy( newFile.filename, inpack.c_str(), 56 ); newFile.file_position = sizeof(pakHeader); newFile.file_length = fsize; - mPak.fs->Write( reinterpret_cast (&newFile), sizeof( pakEntry ) ); + mPak.fs->write( reinterpret_cast (&newFile), sizeof( pakEntry ) ); mPakFiles.push_back( newFile ); return true; } else { - if ( Exists( inpack ) != -1 ) // If the file already exists exit + if ( exists( inpack ) != -1 ) // If the file already exists exit return false; if ( mPak.header.dir_length % 64 != 0 ) // Corrupted file? @@ -228,27 +228,27 @@ bool Pak::AddFile( const Uint8 * data, const Uint32& dataSize, const std::string std::vector pakE; pakE.resize( mPak.pakFilesNum + 1 ); // Alloc space for all the pakEntrys and the new one - mPak.fs->Seek( mPak.header.dir_offset ); // seek to the file pakEntrys - mPak.fs->Read( reinterpret_cast (&pakE[0]), sizeof(pakEntry) * mPak.pakFilesNum ); // get all the pakEntrys + mPak.fs->seek( mPak.header.dir_offset ); // seek to the file pakEntrys + mPak.fs->read( reinterpret_cast (&pakE[0]), sizeof(pakEntry) * mPak.pakFilesNum ); // get all the pakEntrys mPak.header.dir_offset = mPak.header.dir_offset + fsize; // Update the new dir_offset mPak.header.dir_length = mPak.header.dir_length + sizeof(pakEntry); // Update the new dir_length - mPak.fs->Seek( 4 ); // Update the new dir_offset and dir_length to the pakFile - mPak.fs->Write( reinterpret_cast (&mPak.header.dir_offset), sizeof( mPak.header.dir_offset ) ); - mPak.fs->Write( reinterpret_cast (&mPak.header.dir_length), sizeof( mPak.header.dir_length ) ); + mPak.fs->seek( 4 ); // Update the new dir_offset and dir_length to the pakFile + mPak.fs->write( reinterpret_cast (&mPak.header.dir_offset), sizeof( mPak.header.dir_offset ) ); + mPak.fs->write( reinterpret_cast (&mPak.header.dir_length), sizeof( mPak.header.dir_length ) ); - mPak.fs->Seek( mPak.header.dir_offset - fsize ); // Seek to the file allocation zone - mPak.fs->Write( reinterpret_cast (&data[0]), fsize ); // Alloc the file + mPak.fs->seek( mPak.header.dir_offset - fsize ); // Seek to the file allocation zone + mPak.fs->write( reinterpret_cast (&data[0]), fsize ); // Alloc the file // Fill the new file data on the pakEntry - String::StrCopy (pakE[ mPak.pakFilesNum ].filename, inpack.c_str(), 56 ); + String::strCopy (pakE[ mPak.pakFilesNum ].filename, inpack.c_str(), 56 ); pakE[ mPak.pakFilesNum ].file_position = mPak.header.dir_offset - fsize; pakE[ mPak.pakFilesNum ].file_length = fsize; // Update the new pakEntrys on pakFile - mPak.fs->Write( reinterpret_cast(&pakE[0]), (std::streamsize)( sizeof(pakEntry) * pakE.size() ) ); + mPak.fs->write( reinterpret_cast(&pakE[0]), (std::streamsize)( sizeof(pakEntry) * pakE.size() ) ); mPakFiles.push_back( pakE[ mPak.pakFilesNum ] ); mPak.pakFilesNum += 1; @@ -262,36 +262,36 @@ bool Pak::AddFile( const Uint8 * data, const Uint32& dataSize, const std::string return false; } -bool Pak::AddFile( std::vector& data, const std::string& inpack ) { - return AddFile( reinterpret_cast ( &data[0] ), (Uint32)data.size(), inpack ); +bool Pak::addFile( std::vector& data, const std::string& inpack ) { + return addFile( reinterpret_cast ( &data[0] ), (Uint32)data.size(), inpack ); } -bool Pak::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; SafeDataPointer file; - FileSystem::FileGet( path, file ); + FileSystem::fileGet( path, file ); - return AddFile( file.Data, file.DataSize, inpack ); + return addFile( file.Data, file.DataSize, inpack ); } -bool Pak::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 ) ) + if ( !addFile( itr->first, itr->second ) ) return false; return true; } -bool Pak::EraseFile( const std::string& path ) { +bool Pak::eraseFile( const std::string& path ) { std::vector tmpv; tmpv.push_back( path ); - return EraseFiles( tmpv ); + return eraseFiles( tmpv ); } -bool Pak::EraseFiles( const std::vector& paths ) { +bool Pak::eraseFiles( const std::vector& paths ) { std::vector files; Int32 Ex; Uint32 total_offset = 0, i = 0; @@ -300,7 +300,7 @@ bool Pak::EraseFiles( const std::vector& paths ) { bool Remove; for ( i = 0; i < paths.size(); i++ ) { - Ex = Exists( paths[i] ); + Ex = exists( paths[i] ); if ( Ex == -1 ) return false; else @@ -330,32 +330,32 @@ bool Pak::EraseFiles( const std::vector& paths ) { nPf.header.dir_offset = total_offset + sizeof(pakHeader); nPf.header.dir_length = (Uint32)uEntry.size() * sizeof( pakEntry ); - nPf.fs->Write( reinterpret_cast(&nPf.header), sizeof(pakHeader) ); + nPf.fs->write( reinterpret_cast(&nPf.header), sizeof(pakHeader) ); std::vector data; for ( i = 0; i < uEntry.size(); i++ ) - if ( ExtractFileToMemory( std::string( uEntry[i].filename ), data ) ) { - uEntry[i].file_position = nPf.fs->Tell(); + if ( extractFileToMemory( std::string( uEntry[i].filename ), data ) ) { + uEntry[i].file_position = nPf.fs->tell(); uEntry[i].file_length = (Uint32)data.size(); - nPf.fs->Write( reinterpret_cast(&data[0]), (std::streamsize)data.size() ); + nPf.fs->write( reinterpret_cast(&data[0]), (std::streamsize)data.size() ); } - nPf.fs->Write( reinterpret_cast(&uEntry[0]), (std::streamsize)( sizeof(pakEntry) * uEntry.size() ) ); + nPf.fs->write( reinterpret_cast(&uEntry[0]), (std::streamsize)( sizeof(pakEntry) * uEntry.size() ) ); eeSAFE_DELETE( nPf.fs ); remove( mPak.pakPath.c_str() ); rename( nPf.pakPath.c_str(), mPak.pakPath.c_str() ); - Close(); + close(); - Open( mPak.pakPath ); + open( mPak.pakPath ); return true; } -std::vector Pak::GetFileList() { +std::vector Pak::getFileList() { std::vector tmpv; tmpv.resize( mPakFiles.size() ); @@ -366,11 +366,11 @@ std::vector Pak::GetFileList() { return tmpv; } -bool Pak::IsOpen() const { +bool Pak::isOpen() const { return mIsOpen; } -std::string Pak::GetPackPath() { +std::string Pak::getPackPath() { return mPak.pakPath; } diff --git a/src/eepp/system/platform/posix/clockimpl.cpp b/src/eepp/system/platform/posix/clockimpl.cpp index 2dc7fa3b8..748a842d5 100644 --- a/src/eepp/system/platform/posix/clockimpl.cpp +++ b/src/eepp/system/platform/posix/clockimpl.cpp @@ -10,7 +10,7 @@ ClockImpl::ClockImpl() { ClockImpl::~ClockImpl() { } -void ClockImpl::Restart() { +void ClockImpl::restart() { #ifdef EE_HAVE_CLOCK_GETTIME clock_gettime( CLOCK_MONOTONIC, &mStart ); #else @@ -18,7 +18,7 @@ void ClockImpl::Restart() { #endif } -unsigned long ClockImpl::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/clockimpl.hpp b/src/eepp/system/platform/posix/clockimpl.hpp index a391ad477..438f06bfa 100644 --- a/src/eepp/system/platform/posix/clockimpl.hpp +++ b/src/eepp/system/platform/posix/clockimpl.hpp @@ -19,9 +19,9 @@ class ClockImpl { ~ClockImpl(); - void Restart(); + void restart(); - unsigned long GetElapsedTime(); + unsigned long getElapsedTime(); private: #ifdef EE_HAVE_CLOCK_GETTIME struct timespec mStart; diff --git a/src/eepp/system/platform/posix/conditionimpl.cpp b/src/eepp/system/platform/posix/conditionimpl.cpp index 192b861a4..ca8809383 100755 --- a/src/eepp/system/platform/posix/conditionimpl.cpp +++ b/src/eepp/system/platform/posix/conditionimpl.cpp @@ -27,15 +27,15 @@ ConditionImpl::~ConditionImpl() { std::cerr << "ConditionImpl::~ConditionImpl(): pthread_mutex_destroy() error\n"; } -void ConditionImpl::Lock() { +void ConditionImpl::lock() { pthread_mutex_lock( &mMutex ); } -void ConditionImpl::Unlock() { +void ConditionImpl::unlock() { pthread_mutex_unlock( &mMutex ); } -bool ConditionImpl::WaitAndRetain( int value ) { +bool ConditionImpl::waitAndRetain( int value ) { pthread_mutex_lock(&mMutex); while ( mConditionnedVar != value && mIsInvalid ) { @@ -51,15 +51,15 @@ bool ConditionImpl::WaitAndRetain( int value ) { return false; } -void ConditionImpl::Release( int value ) { +void ConditionImpl::release( int value ) { mConditionnedVar = value; pthread_mutex_unlock( &mMutex ); - Signal(); + signal(); } -void ConditionImpl::SetValue( int value ) { +void ConditionImpl::setValue( int value ) { // Make sure the Condition's value is not modified while retained pthread_mutex_lock( &mMutex ); @@ -67,25 +67,25 @@ void ConditionImpl::SetValue( int value ) { pthread_mutex_unlock(&mMutex); - Signal(); + signal(); } -int ConditionImpl::Value() const { +int ConditionImpl::value() const { return mConditionnedVar; } -void ConditionImpl::Signal() { +void ConditionImpl::signal() { pthread_cond_signal( &mCond ); } -void ConditionImpl::Invalidate() { +void ConditionImpl::invalidate() { if (mIsInvalid) { mIsInvalid = false; - Signal(); + signal(); } } -void ConditionImpl::Restore() { +void ConditionImpl::restore() { if ( !mIsInvalid ) { mIsInvalid = true; } diff --git a/src/eepp/system/platform/posix/conditionimpl.hpp b/src/eepp/system/platform/posix/conditionimpl.hpp index b1c9840b8..9dacccf75 100755 --- a/src/eepp/system/platform/posix/conditionimpl.hpp +++ b/src/eepp/system/platform/posix/conditionimpl.hpp @@ -15,23 +15,23 @@ class ConditionImpl { ~ConditionImpl(); - void Lock(); + void lock(); - void Unlock(); + void unlock(); - bool WaitAndRetain( int value ); + bool waitAndRetain( int value ); - void Release( int value ); + void release( int value ); - void SetValue( int value ); + void setValue( int value ); - int Value() const; + int value() const; - void Signal(); + void signal(); - void Invalidate(); + void invalidate(); - void Restore(); + void restore(); private: int mIsInvalid; int mConditionnedVar; diff --git a/src/eepp/system/platform/posix/muteximpl.cpp b/src/eepp/system/platform/posix/muteximpl.cpp index 037242570..12405352b 100644 --- a/src/eepp/system/platform/posix/muteximpl.cpp +++ b/src/eepp/system/platform/posix/muteximpl.cpp @@ -19,15 +19,15 @@ MutexImpl::~MutexImpl() { std::cerr << "MutexImpl::~MutexImpl(): pthread_mutex_destroy() error\n"; } -void MutexImpl::Lock() { +void MutexImpl::lock() { pthread_mutex_lock(&mMutex); } -void MutexImpl::Unlock() { +void MutexImpl::unlock() { pthread_mutex_unlock(&mMutex); } -int MutexImpl::TryLock() { +int MutexImpl::tryLock() { return pthread_mutex_trylock(&mMutex); } diff --git a/src/eepp/system/platform/posix/muteximpl.hpp b/src/eepp/system/platform/posix/muteximpl.hpp index 955e104d1..9fda62dde 100644 --- a/src/eepp/system/platform/posix/muteximpl.hpp +++ b/src/eepp/system/platform/posix/muteximpl.hpp @@ -15,11 +15,11 @@ class MutexImpl { ~MutexImpl(); - void Lock(); + void lock(); - void Unlock(); + void unlock(); - int TryLock(); + int tryLock(); private: pthread_mutex_t mMutex; }; diff --git a/src/eepp/system/platform/posix/threadimpl.cpp b/src/eepp/system/platform/posix/threadimpl.cpp index 2c5315c65..0f3376778 100644 --- a/src/eepp/system/platform/posix/threadimpl.cpp +++ b/src/eepp/system/platform/posix/threadimpl.cpp @@ -6,20 +6,20 @@ namespace EE { namespace System { namespace Platform { #if defined( EE_PLATFORM_POSIX ) -UintPtr ThreadImpl::GetCurrentThreadId() { +UintPtr ThreadImpl::getCurrentThreadId() { return (UintPtr)pthread_self(); } ThreadImpl::ThreadImpl( Thread * owner ) : mIsActive(false) { - mIsActive = pthread_create( &mThread, NULL, &ThreadImpl::EntryPoint, owner ) == 0; + mIsActive = pthread_create( &mThread, NULL, &ThreadImpl::entryPoint, owner ) == 0; if ( !mIsActive ) std::cerr << "Failed to create thread" << std::endl; } -void ThreadImpl::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 ThreadImpl::Wait() { } } -void ThreadImpl::Terminate() { +void ThreadImpl::terminate() { if ( mIsActive ) { #if EE_PLATFORM != EE_PLATFORM_ANDROID pthread_cancel( mThread ); @@ -42,11 +42,11 @@ void ThreadImpl::Terminate() { } } -UintPtr ThreadImpl::Id() { +UintPtr ThreadImpl::id() { return (UintPtr)mThread; } -void * ThreadImpl::EntryPoint( void * userData ) { +void * ThreadImpl::entryPoint( void * userData ) { // The Thread instance is stored in the user data Thread * owner = static_cast( userData ); @@ -56,7 +56,7 @@ void * ThreadImpl::EntryPoint( void * userData ) { #endif // Forward to the owner - owner->Run(); + owner->run(); return NULL; } diff --git a/src/eepp/system/platform/posix/threadimpl.hpp b/src/eepp/system/platform/posix/threadimpl.hpp index f161e496e..700a4e1ad 100644 --- a/src/eepp/system/platform/posix/threadimpl.hpp +++ b/src/eepp/system/platform/posix/threadimpl.hpp @@ -15,17 +15,17 @@ namespace Platform { class ThreadImpl { public: - static UintPtr GetCurrentThreadId(); + static UintPtr getCurrentThreadId(); ThreadImpl( Thread * owner ); - void Wait(); + void wait(); - void Terminate(); + void terminate(); - UintPtr Id(); + UintPtr id(); protected: - static void * EntryPoint( void* userData ); + static void * entryPoint( void* userData ); pthread_t mThread; bool mIsActive; diff --git a/src/eepp/system/platform/posix/threadlocalimpl.cpp b/src/eepp/system/platform/posix/threadlocalimpl.cpp index e3ceed834..6a5235caa 100644 --- a/src/eepp/system/platform/posix/threadlocalimpl.cpp +++ b/src/eepp/system/platform/posix/threadlocalimpl.cpp @@ -12,11 +12,11 @@ ThreadLocalImpl::~ThreadLocalImpl() { pthread_key_delete(mKey); } -void ThreadLocalImpl::Value(void* value) { - pthread_setspecific(mKey, value); +void ThreadLocalImpl::value(void* val) { + pthread_setspecific(mKey, val); } -void* ThreadLocalImpl::Value() const { +void* ThreadLocalImpl::value() const { return pthread_getspecific(mKey); } diff --git a/src/eepp/system/platform/posix/threadlocalimpl.hpp b/src/eepp/system/platform/posix/threadlocalimpl.hpp index e27817a7e..98e146db1 100644 --- a/src/eepp/system/platform/posix/threadlocalimpl.hpp +++ b/src/eepp/system/platform/posix/threadlocalimpl.hpp @@ -16,9 +16,9 @@ class ThreadLocalImpl : NonCopyable { ~ThreadLocalImpl(); - void Value(void* value); + void value(void* val); - void* Value() const; + void* value() const; private : pthread_key_t mKey; }; diff --git a/src/eepp/system/platform/win/clockimpl.cpp b/src/eepp/system/platform/win/clockimpl.cpp index 629c1605b..d1eaf292a 100644 --- a/src/eepp/system/platform/win/clockimpl.cpp +++ b/src/eepp/system/platform/win/clockimpl.cpp @@ -12,7 +12,7 @@ ClockImpl::ClockImpl() : ClockImpl::~ClockImpl() { } -void ClockImpl::Restart() { +void ClockImpl::restart() { // Get the current process core mask DWORD procMask; DWORD sysMask; @@ -51,7 +51,7 @@ void ClockImpl::Restart() { mLastTime = 0; } -unsigned long ClockImpl::GetElapsedTime() { +unsigned long ClockImpl::getElapsedTime() { LARGE_INTEGER curTime; HANDLE thread = GetCurrentThread(); diff --git a/src/eepp/system/platform/win/clockimpl.hpp b/src/eepp/system/platform/win/clockimpl.hpp index 54e82fe78..20e0bcc60 100644 --- a/src/eepp/system/platform/win/clockimpl.hpp +++ b/src/eepp/system/platform/win/clockimpl.hpp @@ -23,9 +23,9 @@ class ClockImpl { ~ClockImpl(); - void Restart(); + void restart(); - unsigned long GetElapsedTime(); + unsigned long getElapsedTime(); private: unsigned long mStartTick; LONGLONG mLastTime; diff --git a/src/eepp/system/platform/win/conditionimpl.cpp b/src/eepp/system/platform/win/conditionimpl.cpp index f99843f9e..169b3db80 100755 --- a/src/eepp/system/platform/win/conditionimpl.cpp +++ b/src/eepp/system/platform/win/conditionimpl.cpp @@ -21,66 +21,66 @@ ConditionImpl::~ConditionImpl() { CloseHandle( mCond ); } -void ConditionImpl::Lock() { - mMutex.Lock(); +void ConditionImpl::lock() { + mMutex.lock(); } -void ConditionImpl::Unlock() { - mMutex.Unlock(); +void ConditionImpl::unlock() { + mMutex.unlock(); } -bool ConditionImpl::WaitAndRetain(int value) { - mMutex.Lock(); +bool ConditionImpl::waitAndRetain(int value) { + mMutex.lock(); while ( mConditionnedVar != value && mIsValid ) { - mMutex.Unlock(); + mMutex.unlock(); WaitForSingleObject( mCond, INFINITE ); - mMutex.Lock(); + mMutex.lock(); } if ( mIsValid ) { return true; } - mMutex.Unlock(); + mMutex.unlock(); return false; } -void ConditionImpl::Release( int value ) { +void ConditionImpl::release( int value ) { mConditionnedVar = value; - mMutex.Unlock(); + mMutex.unlock(); - Signal(); + signal(); } -void ConditionImpl::SetValue( int value ) { +void ConditionImpl::setValue( int value ) { // Make sure the Condition's value is not modified while retained - mMutex.Lock(); + mMutex.lock(); mConditionnedVar = value; - mMutex.Unlock(); + mMutex.unlock(); - Signal(); + signal(); } -int ConditionImpl::Value() const { +int ConditionImpl::value() const { return mConditionnedVar; } -void ConditionImpl::Signal() { +void ConditionImpl::signal() { SetEvent( mCond ); } -void ConditionImpl::Invalidate() { +void ConditionImpl::invalidate() { if ( mIsValid ) { mIsValid = false; - Signal(); + signal(); } } -void ConditionImpl::Restore() { +void ConditionImpl::restore() { if ( !mIsValid ) { mIsValid = true; } diff --git a/src/eepp/system/platform/win/conditionimpl.hpp b/src/eepp/system/platform/win/conditionimpl.hpp index bfe2fd374..76b201bbc 100755 --- a/src/eepp/system/platform/win/conditionimpl.hpp +++ b/src/eepp/system/platform/win/conditionimpl.hpp @@ -16,23 +16,23 @@ class ConditionImpl { ~ConditionImpl(); - void Lock(); + void lock(); - void Unlock(); + void unlock(); - bool WaitAndRetain( int value ); + bool waitAndRetain( int value ); - void Release( int value ); + void release( int value ); - void SetValue( int value ); + void setValue( int value ); - int Value() const; + int value() const; - void Signal(); + void signal(); - void Invalidate(); + void invalidate(); - void Restore(); + void restore(); private: int mIsValid; int mConditionnedVar; diff --git a/src/eepp/system/platform/win/muteximpl.cpp b/src/eepp/system/platform/win/muteximpl.cpp index 52734c7eb..e097f3a2a 100644 --- a/src/eepp/system/platform/win/muteximpl.cpp +++ b/src/eepp/system/platform/win/muteximpl.cpp @@ -12,15 +12,15 @@ MutexImpl::~MutexImpl() { DeleteCriticalSection(&mMutex); } -void MutexImpl::Lock() { +void MutexImpl::lock() { EnterCriticalSection(&mMutex); } -void MutexImpl::Unlock() { +void MutexImpl::unlock() { LeaveCriticalSection(&mMutex); } -int MutexImpl::TryLock() { +int MutexImpl::tryLock() { return TryEnterCriticalSection(&mMutex); } diff --git a/src/eepp/system/platform/win/muteximpl.hpp b/src/eepp/system/platform/win/muteximpl.hpp index add1406a6..d5bc9d574 100644 --- a/src/eepp/system/platform/win/muteximpl.hpp +++ b/src/eepp/system/platform/win/muteximpl.hpp @@ -21,11 +21,11 @@ class MutexImpl { ~MutexImpl(); - void Lock(); + void lock(); - void Unlock(); + void unlock(); - int TryLock(); + int tryLock(); private: CRITICAL_SECTION mMutex; }; diff --git a/src/eepp/system/platform/win/threadimpl.cpp b/src/eepp/system/platform/win/threadimpl.cpp index 4497d2cd7..72b028fb9 100644 --- a/src/eepp/system/platform/win/threadimpl.cpp +++ b/src/eepp/system/platform/win/threadimpl.cpp @@ -6,12 +6,12 @@ namespace EE { namespace System { namespace Platform { #if EE_PLATFORM == EE_PLATFORM_WIN -UintPtr ThreadImpl::GetCurrentThreadId() { +UintPtr ThreadImpl::getCurrentThreadId() { return (UintPtr)::GetCurrentThreadId(); } ThreadImpl::ThreadImpl( Thread * owner ) { - mThread = reinterpret_cast( _beginthreadex( NULL, 0, &ThreadImpl::EntryPoint, owner, 0, &mThreadId ) ); + mThread = reinterpret_cast( _beginthreadex( NULL, 0, &ThreadImpl::entryPoint, owner, 0, &mThreadId ) ); if ( !mThread ) std::cerr << "Failed to create thread" << std::endl; @@ -24,31 +24,31 @@ ThreadImpl::~ThreadImpl() } } -void ThreadImpl::Wait() { +void ThreadImpl::wait() { if ( mThread ) { // Wait for the thread to finish, no timeout - eeASSERT( mThreadId != GetCurrentThreadId() ); // A thread cannot wait for itself! + eeASSERT( mThreadId != getCurrentThreadId() ); // A thread cannot wait for itself! WaitForSingleObject( mThread, INFINITE ); } } -void ThreadImpl::Terminate() { +void ThreadImpl::terminate() { if ( mThread ) { TerminateThread( mThread, 0 ); } } -UintPtr ThreadImpl::Id() { +UintPtr ThreadImpl::id() { return (UintPtr)mThreadId; } -unsigned int __stdcall ThreadImpl::EntryPoint( void * userData ) { +unsigned int __stdcall ThreadImpl::entryPoint( void * userData ) { // The Thread instance is stored in the user data Thread * owner = static_cast( userData ); // Forward to the owner - owner->Run(); + owner->run(); // Optional, but it is cleaner _endthreadex(0); diff --git a/src/eepp/system/platform/win/threadimpl.hpp b/src/eepp/system/platform/win/threadimpl.hpp index 228d5a5ed..bcf3f5f3c 100644 --- a/src/eepp/system/platform/win/threadimpl.hpp +++ b/src/eepp/system/platform/win/threadimpl.hpp @@ -18,19 +18,19 @@ namespace Platform { class ThreadImpl { public: - static UintPtr GetCurrentThreadId(); + static UintPtr getCurrentThreadId(); ThreadImpl( Thread * owner ); ~ThreadImpl(); - void Wait(); + void wait(); - void Terminate(); + void terminate(); - UintPtr Id(); + UintPtr id(); protected: - static unsigned int __stdcall EntryPoint(void* userData); + static unsigned int __stdcall entryPoint(void* userData); HANDLE mThread; unsigned int mThreadId; diff --git a/src/eepp/system/platform/win/threadlocalimpl.cpp b/src/eepp/system/platform/win/threadlocalimpl.cpp index ed28691a9..e0fa51284 100644 --- a/src/eepp/system/platform/win/threadlocalimpl.cpp +++ b/src/eepp/system/platform/win/threadlocalimpl.cpp @@ -12,11 +12,11 @@ ThreadLocalImpl::~ThreadLocalImpl() { TlsFree(mIndex); } -void ThreadLocalImpl::Value(void* value) { - TlsSetValue(mIndex, value); +void ThreadLocalImpl::value(void* val) { + TlsSetValue(mIndex, val); } -void* ThreadLocalImpl::Value() const { +void* ThreadLocalImpl::value() const { return TlsGetValue(mIndex); } diff --git a/src/eepp/system/platform/win/threadlocalimpl.hpp b/src/eepp/system/platform/win/threadlocalimpl.hpp index 2eaea7235..ec5f2952e 100644 --- a/src/eepp/system/platform/win/threadlocalimpl.hpp +++ b/src/eepp/system/platform/win/threadlocalimpl.hpp @@ -22,9 +22,9 @@ class ThreadLocalImpl : NonCopyable { ~ThreadLocalImpl(); - void Value(void* value); + void value(void* val); - void* Value() const; + void* value() const; private : DWORD mIndex; }; diff --git a/src/eepp/system/rc4.cpp b/src/eepp/system/rc4.cpp index fe737ee80..2f290f174 100644 --- a/src/eepp/system/rc4.cpp +++ b/src/eepp/system/rc4.cpp @@ -10,14 +10,14 @@ RC4::RC4() RC4::~RC4() {} -void RC4::Swap( Uint8& a, Uint8& b ) { +void RC4::swap( Uint8& a, Uint8& b ) { Uint8 tmpb; tmpb = a; a = b; b = tmpb; } -void RC4::SetKey( const Uint8 * key, Uint32 size ) { +void RC4::setKey( const Uint8 * key, Uint32 size ) { Uint8 a = 0; int i; @@ -27,19 +27,19 @@ void RC4::SetKey( const Uint8 * key, Uint32 size ) { for( i = 0; i < 256; i++ ) { a = ( a + mKey.state[i] + key[ i % size ] ) % 256; - Swap( mKey.state[i], mKey.state[a] ); + swap( mKey.state[i], mKey.state[a] ); } } -void RC4::SetKey( const std::vector& Key ) { - SetKey( reinterpret_cast( &Key[0] ), Key.size() ); +void RC4::setKey( const std::vector& Key ) { + setKey( reinterpret_cast( &Key[0] ), Key.size() ); } -void RC4::SetKey( const std::string& Key ) { - SetKey( reinterpret_cast( &Key[0] ), Key.size() ); +void RC4::setKey( const std::string& Key ) { + setKey( reinterpret_cast( &Key[0] ), Key.size() ); } -void RC4::EncryptByte( Uint8 * data, Uint32 size ) { +void RC4::encryptByte( Uint8 * data, Uint32 size ) { Uint8 x = 0; Uint8 y = 0; Uint8 xorIndex; @@ -52,7 +52,7 @@ void RC4::EncryptByte( Uint8 * data, Uint32 size ) { x = (x + 1) % 256; y = ( tKey.state[x] + y ) % 256; - Swap( tKey.state[x], tKey.state[y] ); + swap( tKey.state[x], tKey.state[y] ); xorIndex = ( tKey.state[x] + tKey.state[y] ) % 256; @@ -60,39 +60,39 @@ void RC4::EncryptByte( Uint8 * data, Uint32 size ) { } } -void RC4::EncryptByte( std::vector& buffer ) { - EncryptByte( reinterpret_cast( &buffer[0] ), buffer.size() ); +void RC4::encryptByte( std::vector& buffer ) { + encryptByte( reinterpret_cast( &buffer[0] ), buffer.size() ); } -void RC4::EncryptString( std::string& buffer ) { - EncryptByte( reinterpret_cast( &buffer[0] ), buffer.size() ); +void RC4::encryptString( std::string& buffer ) { + encryptByte( reinterpret_cast( &buffer[0] ), buffer.size() ); } -bool RC4::EncryptFile( const std::string& SourceFile, const std::string& DestFile ) { - if ( !FileSystem::FileExists( SourceFile ) ) +bool RC4::encryptFile( const std::string& SourceFile, const std::string& DestFile ) { + if ( !FileSystem::fileExists( SourceFile ) ) return false; SafeDataPointer data; - FileSystem::FileGet( SourceFile, data ); + FileSystem::fileGet( SourceFile, data ); - EncryptByte( data.Data, data.DataSize ); + encryptByte( data.Data, data.DataSize ); - FileSystem::FileWrite( DestFile, data.Data, data.DataSize ); + FileSystem::fileWrite( DestFile, data.Data, data.DataSize ); return true; } -void RC4::DecryptByte( std::vector& buffer ) { - EncryptByte( buffer ); +void RC4::decryptByte( std::vector& buffer ) { + encryptByte( buffer ); } -void RC4::DecryptString( std::string& buffer ) { - EncryptString( buffer ); +void RC4::decryptString( std::string& buffer ) { + encryptString( buffer ); } -bool RC4::DecryptFile( const std::string& SourceFile, const std::string& DestFile ) { - return EncryptFile( SourceFile, DestFile ); +bool RC4::decryptFile( const std::string& SourceFile, const std::string& DestFile ) { + return encryptFile( SourceFile, DestFile ); } }} diff --git a/src/eepp/system/resourceloader.cpp b/src/eepp/system/resourceloader.cpp index ce52fb3c4..b7b7b9f22 100644 --- a/src/eepp/system/resourceloader.cpp +++ b/src/eepp/system/resourceloader.cpp @@ -9,16 +9,16 @@ ResourceLoader::ResourceLoader( const Uint32& MaxThreads ) : mThreaded(true), mThreads(MaxThreads) { - SetThreads(); + setThreads(); } ResourceLoader::~ResourceLoader() { - Clear(); + clear(); } -void ResourceLoader::SetThreads() { +void ResourceLoader::setThreads() { if ( THREADS_AUTO == mThreads ) { - mThreads = Sys::GetCPUCount(); + mThreads = Sys::getCPUCount(); if ( 1 == mThreads ) { mThreaded = false; @@ -26,25 +26,25 @@ void ResourceLoader::SetThreads() { } } -bool ResourceLoader::Threaded() const { +bool ResourceLoader::threaded() const { return mThreaded; } -Uint32 ResourceLoader::Count() const { +Uint32 ResourceLoader::count() const { return mObjs.size(); } -void ResourceLoader::Threaded( const bool& threaded ) { +void ResourceLoader::threaded( const bool& threaded ) { if ( !mLoading ) { mThreaded = threaded; } } -void ResourceLoader::Add( ObjectLoader * Object ) { +void ResourceLoader::add( ObjectLoader * Object ) { mObjs.push_front( Object ); } -bool ResourceLoader::Clear( const bool& ClearObjectsLoaded ) { +bool ResourceLoader::clear( const bool& ClearObjectsLoaded ) { if ( !mLoading ) { mLoaded = false; mLoading = false; @@ -69,14 +69,14 @@ bool ResourceLoader::Clear( const bool& ClearObjectsLoaded ) { return false; } -void ResourceLoader::Load( ResLoadCallback Cb ) { +void ResourceLoader::load( ResLoadCallback Cb ) { if ( Cb.IsSet() ) mLoadCbs.push_back( Cb ); - Load(); + load(); } -void ResourceLoader::Load() { +void ResourceLoader::load() { if ( mLoaded ) return; @@ -94,20 +94,20 @@ void ResourceLoader::Load() { Obj = (*it); if ( NULL != Obj ) { - Obj->Threaded( mThreaded ); + Obj->threaded( mThreaded ); - if ( !Obj->IsLoaded() ) { - if ( !Obj->IsLoading() ) { - Obj->Load(); + if ( !Obj->isLoaded() ) { + if ( !Obj->isLoading() ) { + Obj->load(); } - if ( Obj->IsLoading() ) { + if ( Obj->isLoading() ) { count++; } - Obj->Update(); + Obj->update(); - if ( !Obj->IsLoaded() ) { + if ( !Obj->isLoaded() ) { AllLoaded = false; } else { ObjsErase.push_back( Obj ); @@ -128,35 +128,35 @@ void ResourceLoader::Load() { } if ( AllLoaded ) { - SetLoaded(); + setLoaded(); } } -void ResourceLoader::Update() { - Load(); +void ResourceLoader::update() { + load(); } -void ResourceLoader::Unload() { +void ResourceLoader::unload() { if ( mLoaded ) { std::list::iterator it; for ( it = mObjs.begin(); it != mObjs.end(); it++ ) { - (*it)->Unload(); + (*it)->unload(); } mLoaded = false; } } -bool ResourceLoader::IsLoaded() { +bool ResourceLoader::isLoaded() { return mLoaded; } -bool ResourceLoader::IsLoading() { +bool ResourceLoader::isLoading() { return mLoading; } -void ResourceLoader::SetLoaded() { +void ResourceLoader::setLoaded() { mLoaded = true; mLoading = false; @@ -171,7 +171,7 @@ void ResourceLoader::SetLoaded() { } } -Float ResourceLoader::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 9cd5a53f0..99b409385 100644 --- a/src/eepp/system/sys.cpp +++ b/src/eepp/system/sys.cpp @@ -251,7 +251,7 @@ static std::string GetWindowsVersion() { // Include service pack (if any) and build number. #if defined( EE_COMPILER_MSVC ) && defined( UNICODE ) - std::string CSDVer( EE::String( osvi.szCSDVersion ).ToUtf8() ); + std::string CSDVer( EE::String( osvi.szCSDVersion ).toUtf8() ); #else std::string CSDVer( osvi.szCSDVersion ); #endif @@ -305,7 +305,7 @@ static struct timeval start; #endif -std::string Sys::GetOSName( bool showReleaseName ) { +std::string Sys::getOSName( bool showReleaseName ) { #if defined( EE_PLATFORM_POSIX ) struct utsname os; @@ -321,7 +321,7 @@ std::string Sys::GetOSName( bool showReleaseName ) { #endif } -std::string Sys::GetOSArchitecture() { +std::string Sys::getOSArchitecture() { #if defined( EE_PLATFORM_POSIX ) struct utsname os; @@ -356,7 +356,7 @@ static void eeStartTicks() { } } -Uint32 Sys::GetTicks() { +Uint32 Sys::getTicks() { eeStartTicks(); #if EE_PLATFORM == EE_PLATFORM_WIN @@ -392,22 +392,22 @@ Uint32 Sys::GetTicks() { #endif } -void Sys::Sleep( const Uint32& ms ) { - Sleep( Milliseconds( ms ) ); +void Sys::sleep( const Uint32& ms ) { + sleep( Milliseconds( ms ) ); } -void Sys::Sleep( const Time& time ) { +void Sys::sleep( const Time& time ) { #if EE_PLATFORM == EE_PLATFORM_WIN TIMECAPS tc; timeGetDevCaps(&tc, sizeof(TIMECAPS)); timeBeginPeriod(tc.wPeriodMin); - ::Sleep( time.AsMilliseconds() ); + ::Sleep( time.asMilliseconds() ); timeEndPeriod(tc.wPeriodMin); #elif defined( EE_PLATFORM_POSIX ) - Uint64 usecs = time.AsMicroseconds(); + Uint64 usecs = time.asMicroseconds(); // Construct the time to wait timespec ti; @@ -465,7 +465,7 @@ static std::string sGetProcessPath() { GetModuleFileName(0, &dllName[0], _MAX_PATH); - std::string dllstrName( String( dllName ).ToUtf8() ); + std::string dllstrName( String( dllName ).toUtf8() ); #ifdef EE_COMPILER_MSVC _splitpath_s( dllstrName.c_str(), szDrive, _MAX_DRIVE, szDir, _MAX_DIR, szFilename, _MAX_DIR, szExt, _MAX_DIR ); @@ -525,12 +525,12 @@ static std::string sGetProcessPath() { #endif } -std::string Sys::GetProcessPath() { +std::string Sys::getProcessPath() { static std::string path = sGetProcessPath(); return path; } -double Sys::GetSystemTime() { +double Sys::getSystemTime() { #if EE_PLATFORM == EE_PLATFORM_WIN static LARGE_INTEGER Frequency; static BOOL UseHighPerformanceTimer = QueryPerformanceFrequency(&Frequency); @@ -551,7 +551,7 @@ double Sys::GetSystemTime() { #endif } -std::string Sys::GetDateTimeStr() { +std::string Sys::getDateTimeStr() { time_t rawtime; time ( &rawtime ); @@ -566,7 +566,7 @@ std::string Sys::GetDateTimeStr() { } #define EE_MAX_CFG_PATH_LEN 1024 -std::string Sys::GetConfigPath( std::string appname ) { +std::string Sys::getConfigPath( std::string appname ) { char path[EE_MAX_CFG_PATH_LEN]; #if EE_PLATFORM == EE_PLATFORM_WIN @@ -645,7 +645,7 @@ std::string Sys::GetConfigPath( std::string appname ) { return std::string( path ); } -std::string Sys::GetTempPath() { +std::string Sys::getTempPath() { char path[EE_MAX_CFG_PATH_LEN]; #if EE_PLATFORM == EE_PLATFORM_WIN @@ -664,20 +664,20 @@ std::string Sys::GetTempPath() { char * tmpdir = getenv("TMPDIR"); if ( NULL != tmpdir ) { - String::StrCopy( path, tmpdir, EE_MAX_CFG_PATH_LEN ); + String::strCopy( path, tmpdir, EE_MAX_CFG_PATH_LEN ); } else { - String::StrCopy( path, "/tmp", EE_MAX_CFG_PATH_LEN ); + String::strCopy( path, "/tmp", EE_MAX_CFG_PATH_LEN ); } #endif std::string rpath( path ); - FileSystem::DirPathAddSlashAtEnd( rpath ); + FileSystem::dirPathAddSlashAtEnd( rpath ); return rpath; } -int Sys::GetCPUCount() { +int Sys::getCPUCount() { int nprocs = -1; #if EE_PLATFORM == EE_PLATFORM_WIN @@ -716,7 +716,7 @@ int Sys::GetCPUCount() { return nprocs; } -Int64 Sys::GetDiskFreeSpace(const std::string& path) { +Int64 Sys::getDiskFreeSpace(const std::string& path) { #if defined( EE_PLATFORM_POSIX ) struct statvfs data; statvfs(path.c_str(), &data); @@ -751,7 +751,7 @@ int WIN_SetError( std::string prefix = "" ) { } #endif -void * Sys::LoadObject( const std::string& sofile ) { +void * Sys::loadObject( const std::string& sofile ) { #if defined( EE_PLATFORM_POSIX ) void * handle = dlopen( sofile.c_str(), RTLD_NOW | RTLD_LOCAL ); @@ -776,7 +776,7 @@ void * Sys::LoadObject( const std::string& sofile ) { #endif } -void Sys::UnloadObject( void * handle ) { +void Sys::unloadObject( void * handle ) { #if defined( EE_PLATFORM_POSIX ) if ( handle != NULL ) { dlclose(handle); @@ -790,7 +790,7 @@ void Sys::UnloadObject( void * handle ) { #endif } -void * Sys::LoadFunction( void * handle, const std::string& name ) { +void * Sys::loadFunction( void * handle, const std::string& name ) { #if defined( EE_PLATFORM_POSIX ) void *symbol = dlsym( handle, name.c_str() ); diff --git a/src/eepp/system/thread.cpp b/src/eepp/system/thread.cpp index 5266dcd05..01f8d6308 100755 --- a/src/eepp/system/thread.cpp +++ b/src/eepp/system/thread.cpp @@ -3,8 +3,8 @@ namespace EE { namespace System { -Uint32 Thread::GetCurrentThreadId() { - return Platform::ThreadImpl::GetCurrentThreadId(); +Uint32 Thread::getCurrentThreadId() { + return Platform::ThreadImpl::getCurrentThreadId(); } Thread::Thread() : @@ -14,39 +14,39 @@ Thread::Thread() : } Thread::~Thread() { - Wait(); + wait(); if ( NULL != mEntryPoint ) delete mEntryPoint; } -void Thread::Launch() { - Wait(); +void Thread::launch() { + wait(); mThreadImpl = eeNew( Platform::ThreadImpl, ( this ) ); } -void Thread::Wait() { +void Thread::wait() { if ( mThreadImpl ) { - mThreadImpl->Wait(); + mThreadImpl->wait(); eeSAFE_DELETE( mThreadImpl ); } } -void Thread::Terminate() { +void Thread::terminate() { if ( mThreadImpl ) { - mThreadImpl->Terminate(); + mThreadImpl->terminate(); eeSAFE_DELETE( mThreadImpl ); } } Uint32 Thread::Id() { - return mThreadImpl->Id(); + return mThreadImpl->id(); } -void Thread::Run() { +void Thread::run() { mEntryPoint->Run(); } diff --git a/src/eepp/system/threadlocal.cpp b/src/eepp/system/threadlocal.cpp index db8686132..d448e1ec3 100644 --- a/src/eepp/system/threadlocal.cpp +++ b/src/eepp/system/threadlocal.cpp @@ -3,22 +3,22 @@ namespace EE { namespace System { -ThreadLocal::ThreadLocal(void* value) : +ThreadLocal::ThreadLocal(void* val) : mImpl( eeNew( Private::ThreadLocalImpl, () ) ) { - Value( value ); + value( val ); } ThreadLocal::~ThreadLocal() { eeSAFE_DELETE( mImpl ); } -void ThreadLocal::Value(void* value) { - mImpl->Value(value); +void ThreadLocal::value(void* val) { + mImpl->value(val); } -void* ThreadLocal::Value() const { - return mImpl->Value(); +void* ThreadLocal::value() const { + return mImpl->value(); } }} diff --git a/src/eepp/system/time.cpp b/src/eepp/system/time.cpp index 35fe76365..fe2b137cf 100644 --- a/src/eepp/system/time.cpp +++ b/src/eepp/system/time.cpp @@ -9,15 +9,15 @@ Time::Time() : { } -double Time::AsSeconds() const { +double Time::asSeconds() const { return mMicroseconds / 1000000.0; } -double Time::AsMilliseconds() const { +double Time::asMilliseconds() const { return mMicroseconds / 1000.0; } -Int64 Time::AsMicroseconds() const { +Int64 Time::asMicroseconds() const { return mMicroseconds; } @@ -39,35 +39,35 @@ Time Microseconds(Int64 amount) { } bool operator ==(Time left, Time right) { - return left.AsMicroseconds() == right.AsMicroseconds(); + return left.asMicroseconds() == right.asMicroseconds(); } bool operator !=(Time left, Time right) { - return left.AsMicroseconds() != right.AsMicroseconds(); + return left.asMicroseconds() != right.asMicroseconds(); } bool operator <(Time left, Time right) { - return left.AsMicroseconds() < right.AsMicroseconds(); + return left.asMicroseconds() < right.asMicroseconds(); } bool operator >(Time left, Time right) { - return left.AsMicroseconds() > right.AsMicroseconds(); + return left.asMicroseconds() > right.asMicroseconds(); } bool operator <=(Time left, Time right) { - return left.AsMicroseconds() <= right.AsMicroseconds(); + return left.asMicroseconds() <= right.asMicroseconds(); } bool operator >=(Time left, Time right) { - return left.AsMicroseconds() >= right.AsMicroseconds(); + return left.asMicroseconds() >= right.asMicroseconds(); } Time operator -(Time right) { - return Microseconds(-right.AsMicroseconds()); + return Microseconds(-right.asMicroseconds()); } Time operator +(Time left, Time right) { - return Microseconds(left.AsMicroseconds() + right.AsMicroseconds()); + return Microseconds(left.asMicroseconds() + right.asMicroseconds()); } Time& operator +=(Time& left, Time right) { @@ -75,7 +75,7 @@ Time& operator +=(Time& left, Time right) { } Time operator -(Time left, Time right) { - return Microseconds(left.AsMicroseconds() - right.AsMicroseconds()); + return Microseconds(left.asMicroseconds() - right.asMicroseconds()); } Time& operator -=(Time& left, Time right) { @@ -83,11 +83,11 @@ Time& operator -=(Time& left, Time right) { } Time operator *(Time left, Time right) { - return Microseconds(left.AsMicroseconds() * right.AsMicroseconds()); + return Microseconds(left.asMicroseconds() * right.asMicroseconds()); } Time operator *(Time left, double right) { - return Seconds(left.AsSeconds() * right); + return Seconds(left.asSeconds() * right); } Time operator *(double left, Time right) { @@ -95,7 +95,7 @@ Time operator *(double left, Time right) { } Time operator *(Time left, Int64 right) { - return Microseconds(left.AsMicroseconds() * right); + return Microseconds(left.asMicroseconds() * right); } Time operator *(Int64 left, Time right) { @@ -115,15 +115,15 @@ Time& operator *=(Time& left, Int64 right) { } Time operator /(Time left, Time right) { - return Microseconds(left.AsMicroseconds() / right.AsMicroseconds()); + return Microseconds(left.asMicroseconds() / right.asMicroseconds()); } Time operator /(Time left, double right) { - return Seconds(left.AsSeconds() / right); + return Seconds(left.asSeconds() / right); } Time operator /(Time left, Int64 right) { - return Microseconds(left.AsMicroseconds() / right); + return Microseconds(left.asMicroseconds() / right); } Time& operator /=(Time& left, Time right) { @@ -135,7 +135,7 @@ Time& operator /=(Time& left, Int64 right) { } Time operator %(Time left, Time right) { - return Microseconds(left.AsMicroseconds() % right.AsMicroseconds()); + return Microseconds(left.asMicroseconds() % right.asMicroseconds()); } Time& operator %=(Time& left, Time right) { diff --git a/src/eepp/system/zip.cpp b/src/eepp/system/zip.cpp index f4b67cac0..115527c45 100644 --- a/src/eepp/system/zip.cpp +++ b/src/eepp/system/zip.cpp @@ -11,15 +11,15 @@ Zip::Zip() : } Zip::~Zip() { - Close(); + close(); } -bool Zip::Create( const std::string& path ) { - if ( !FileSystem::FileExists(path) ) { +bool Zip::create( const std::string& path ) { + if ( !FileSystem::fileExists(path) ) { int err; mZip = zip_open( path.c_str(), ZIP_CREATE, &err ); - if ( 0 == CheckPack() ) { + if ( 0 == checkPack() ) { mZipPath = path; mIsOpen = true; @@ -27,18 +27,18 @@ bool Zip::Create( const std::string& path ) { return true; } } else { - return Open( path ); + return open( path ); } return false; } -bool Zip::Open( const std::string& path ) { - if ( FileSystem::FileExists( path ) ) { +bool Zip::open( const std::string& path ) { + if ( FileSystem::fileExists( path ) ) { int err; mZip = zip_open( path.c_str(), 0, &err ); - if ( 0 == CheckPack() ) { + if ( 0 == checkPack() ) { mZipPath = path; mIsOpen = true; @@ -46,14 +46,14 @@ bool Zip::Open( const std::string& path ) { return true; } } else { - return Create( path ); + return create( path ); } return false; } -bool Zip::Close() { - if ( 0 == CheckPack() ) { +bool Zip::close() { + if ( 0 == checkPack() ) { zip_close( mZip ); mIsOpen = false; @@ -68,24 +68,24 @@ bool Zip::Close() { return false; } -bool Zip::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 ); + FileSystem::fileGet( path, file ); - return AddFile( file.Data, file.DataSize, inpack ); + return addFile( file.Data, file.DataSize, inpack ); } -bool Zip::AddFile( const Uint8 * data, const Uint32& dataSize, const std::string& inpack ) { - if ( 0 == CheckPack() ) { +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 ); if ( NULL != zs ) { Int32 Result = (Int32)zip_add( mZip, inpack.c_str(), zs ); std::string path = mZipPath; - Close(); - Open( path ); + close(); + open( path ); if ( -1 != Result ) return true; @@ -96,30 +96,30 @@ bool Zip::AddFile( const Uint8 * data, const Uint32& dataSize, const std::string return false; } -bool Zip::AddFile( std::vector& data, const std::string& inpack ) { - return AddFile( reinterpret_cast ( &data[0] ), (Uint32)data.size(), inpack ); +bool Zip::addFile( std::vector& data, const std::string& inpack ) { + return addFile( reinterpret_cast ( &data[0] ), (Uint32)data.size(), inpack ); } -bool Zip::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 ) ) + if ( !addFile( itr->first, itr->second ) ) return false; return true; } -bool Zip::EraseFile( const std::string& path ) { +bool Zip::eraseFile( const std::string& path ) { std::vector tmpv; tmpv.push_back( path ); - return EraseFiles( tmpv ); + return eraseFiles( tmpv ); } -bool Zip::EraseFiles( const std::vector& paths ) { +bool Zip::eraseFiles( const std::vector& paths ) { Int32 Ex; Uint32 i = 0; for ( i = 0; i < paths.size(); i++ ) { - Ex = Exists( paths[i] ); + Ex = exists( paths[i] ); if ( Ex == -1 ) return false; @@ -132,31 +132,31 @@ bool Zip::EraseFiles( const std::vector& paths ) { return false; } -bool Zip::ExtractFile( const std::string& path , const std::string& dest ) { - Lock(); +bool Zip::extractFile( const std::string& path , const std::string& dest ) { + lock(); bool Ret = false; SafeDataPointer data; - Ret = ExtractFileToMemory( path, data ); + Ret = extractFileToMemory( path, data ); if ( Ret ) - FileSystem::FileWrite( dest, data.Data, data.DataSize ); + FileSystem::fileWrite( dest, data.Data, data.DataSize ); - Unlock(); + unlock(); return Ret; } -bool Zip::ExtractFileToMemory( const std::string& path, std::vector& data ) { - Lock(); +bool Zip::extractFileToMemory( const std::string& path, std::vector& data ) { + lock(); bool Ret = false; - Int32 Pos = Exists( path ); + Int32 Pos = exists( path ); int Result = 0; - if ( 0 == CheckPack() && -1 != Pos ) { + if ( 0 == checkPack() && -1 != Pos ) { data.clear(); struct zip_stat zs; @@ -178,20 +178,20 @@ bool Zip::ExtractFileToMemory( const std::string& path, std::vector& data } } - Unlock(); + unlock(); return Ret; } -bool Zip::ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) { - Lock(); +bool Zip::extractFileToMemory( const std::string& path, SafeDataPointer& data ) { + lock(); bool Ret = false; - Int32 Pos = Exists( path ); + Int32 Pos = exists( path ); Int32 Result = 0; - if ( 0 == CheckPack() && -1 != Pos ) { + if ( 0 == checkPack() && -1 != Pos ) { struct zip_stat zs; int err = zip_stat( mZip, path.c_str(), 0, &zs ); @@ -212,23 +212,23 @@ bool Zip::ExtractFileToMemory( const std::string& path, SafeDataPointer& data ) } } - Unlock(); + unlock(); return Ret; } -Int32 Zip::Exists( const std::string& path ) { - if ( IsOpen() ) +Int32 Zip::exists( const std::string& path ) { + if ( isOpen() ) return zip_name_locate( mZip, path.c_str(), 0 ); return -1; } -Int8 Zip::CheckPack() { +Int8 Zip::checkPack() { return NULL != mZip ? 0 : -1; } -std::vector Zip::GetFileList() { +std::vector Zip::getFileList() { std::vector tmpv; Int32 numfiles = zip_get_num_files( mZip ); @@ -246,7 +246,7 @@ std::vector Zip::GetFileList() { } /** @return The file path of the opened package */ -std::string Zip::GetPackPath() { +std::string Zip::getPackPath() { return mZipPath; } diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index c53618579..0c70327b3 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -275,7 +275,7 @@ void TextureAtlasEditor::OnTextureAtlasCreate( TexturePacker * TexPacker ) { eeSAFE_DELETE( mTextureAtlasLoader ); - std::string FPath( FileSystem::FileRemoveExtension( mTexturePacker->GetFilepath() + EE_TEXTURE_ATLAS_EXTENSION ) ); + std::string FPath( FileSystem::fileRemoveExtension( mTexturePacker->GetFilepath() + EE_TEXTURE_ATLAS_EXTENSION ) ); mTextureAtlasLoader = eeNew( TextureAtlasLoader, ( FPath, true, cb::Make1( this, &TextureAtlasEditor::OnTextureAtlasLoaded ) ) ); } @@ -290,7 +290,7 @@ void TextureAtlasEditor::FillSubTextureList() { if ( NULL == mTextureAtlasLoader || NULL == mTextureAtlasLoader->GetTextureAtlas() || !mTextureAtlasLoader->IsLoaded() ) return; - std::list& Res = mTextureAtlasLoader->GetTextureAtlas()->GetResources(); + std::list& Res = mTextureAtlasLoader->GetTextureAtlas()->getResources(); mSubTextureList->Clear(); @@ -312,7 +312,7 @@ void TextureAtlasEditor::FillSubTextureList() { void TextureAtlasEditor::OnSubTextureChange( const UIEvent * Event ) { if ( NULL != mTextureAtlasLoader && NULL != mTextureAtlasLoader->GetTextureAtlas() ) { - mCurSubTexture = mTextureAtlasLoader->GetTextureAtlas()->GetByName( mSubTextureList->GetItemSelectedText() ); + mCurSubTexture = mTextureAtlasLoader->GetTextureAtlas()->getByName( mSubTextureList->GetItemSelectedText() ); if ( NULL != mCurSubTexture ) { mSubTextureEditor->SubTexture( mCurSubTexture ); diff --git a/src/eepp/ui/tools/textureatlasnew.cpp b/src/eepp/ui/tools/textureatlasnew.cpp index 5960054ff..94029f84d 100644 --- a/src/eepp/ui/tools/textureatlasnew.cpp +++ b/src/eepp/ui/tools/textureatlasnew.cpp @@ -43,7 +43,7 @@ TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) : std::vector Sizes; for ( Uint32 i = 6; i < 14; i++ ) { - Sizes.push_back( String::ToStr( 1 << i ) ); + Sizes.push_back( String::toStr( 1 << i ) ); } mComboWidth->ListBox()->AddListBoxItems( Sizes ); @@ -89,7 +89,7 @@ void TextureAtlasNew::OKClick( const UIEvent * Event ) { if ( MouseEvent->Flags() & EE_BUTTON_LMASK ) { std::string ext( mSaveFileType->Text() ); - String::ToLowerInPlace( ext ); + String::toLowerInPlace( ext ); UICommonDialog * TGDialog = mTheme->CreateCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS | CDL_FLAG_SAVE_DIALOG, "*." + ext ); @@ -120,10 +120,10 @@ void TextureAtlasNew::TextureAtlasSave( const UIEvent * Event ) { UICommonDialog * CDL = reinterpret_cast ( Event->Ctrl() ); std::string FPath( CDL->GetFullPath() ); - if ( !FileSystem::IsDirectory( FPath ) ) { + if ( !FileSystem::isDirectory( FPath ) ) { Int32 w = 0, h = 0, b; - bool Res1 = String::FromString( w, mComboWidth->Text() ); - bool Res2 = String::FromString( h, mComboHeight->Text() ); + bool Res1 = String::fromString( w, mComboWidth->Text() ); + bool Res2 = String::fromString( h, mComboHeight->Text() ); b = static_cast( mPixelSpace->Value() ); if ( Res1 && Res2 ) { @@ -133,14 +133,14 @@ void TextureAtlasNew::TextureAtlasSave( const UIEvent * Event ) { TexturePacker->PackTextures(); - std::string ext = FileSystem::FileExtension( FPath, true ); + std::string ext = FileSystem::fileExtension( FPath, true ); if ( !IsValidExtension( ext ) ) { - FPath = FileSystem::FileRemoveExtension( FPath ); + FPath = FileSystem::fileRemoveExtension( FPath ); ext = mSaveFileType->Text(); - String::ToLowerInPlace( ext ); + String::toLowerInPlace( ext ); FPath += "." + ext; } @@ -172,21 +172,21 @@ void TextureAtlasNew::OnSelectFolder( const UIEvent * Event ) { UICommonDialog * CDL = reinterpret_cast ( Event->Ctrl() ); UIMessageBox * MsgBox; std::string FPath( CDL->GetFullPath() ); - FileSystem::DirPathAddSlashAtEnd( FPath ); + FileSystem::dirPathAddSlashAtEnd( FPath ); - if ( !FileSystem::IsDirectory( FPath ) ) { + if ( !FileSystem::isDirectory( FPath ) ) { FPath = CDL->GetCurPath(); - FileSystem::DirPathAddSlashAtEnd( FPath ); + FileSystem::dirPathAddSlashAtEnd( FPath ); } - if ( FileSystem::IsDirectory( FPath ) ) { - std::vector files = FileSystem::FilesGetInPath( FPath ); + if ( FileSystem::isDirectory( FPath ) ) { + std::vector files = FileSystem::filesGetInPath( FPath ); int x,y,c, count = 0; for ( Uint32 i = 0; i < files.size(); i++ ) { std::string ImgPath( FPath + files[i] ); - if ( !FileSystem::IsDirectory( ImgPath ) ) { + if ( !FileSystem::isDirectory( ImgPath ) ) { int res = stbi_info( ImgPath.c_str(), &x, &y, &c ); if ( res ) { diff --git a/src/eepp/ui/uicheckbox.cpp b/src/eepp/ui/uicheckbox.cpp index ab5c58925..42c0f9303 100644 --- a/src/eepp/ui/uicheckbox.cpp +++ b/src/eepp/ui/uicheckbox.cpp @@ -156,8 +156,8 @@ Uint32 UICheckBox::OnKeyDown( const UIEventKey& Event ) { UITextBox::OnKeyDown( Event ); if ( Event.KeyCode() == KEY_SPACE ) { - if ( Sys::GetTicks() - mLastTick > 250 ) { - mLastTick = Sys::GetTicks(); + if ( Sys::getTicks() - mLastTick > 250 ) { + mLastTick = Sys::getTicks(); Active( !mActive ); } diff --git a/src/eepp/ui/uicommondialog.cpp b/src/eepp/ui/uicommondialog.cpp index b4aa72f7d..655109acd 100644 --- a/src/eepp/ui/uicommondialog.cpp +++ b/src/eepp/ui/uicommondialog.cpp @@ -170,7 +170,7 @@ void UICommonDialog::SetTheme( UITheme * Theme ) { } void UICommonDialog::RefreshFolder() { - std::vector flist = FileSystem::FilesGetInPath( String( mCurPath ) ); + std::vector flist = FileSystem::filesGetInPath( String( mCurPath ) ); std::vector files; std::vector folders; std::vector patterns; @@ -178,21 +178,21 @@ void UICommonDialog::RefreshFolder() { Uint32 i, z; if ( "*" != mFiletype->Text() ) { - patterns = String::Split( mFiletype->Text().ToUtf8(), ';' ); + patterns = String::split( mFiletype->Text().toUtf8(), ';' ); for ( i = 0; i < patterns.size(); i++ ) - patterns[i] = FileSystem::FileExtension( patterns[i] ); + patterns[i] = FileSystem::fileExtension( patterns[i] ); } for ( i = 0; i < flist.size(); i++ ) { - if ( FoldersFirst() && FileSystem::IsDirectory( mCurPath + flist[i] ) ) { + if ( FoldersFirst() && FileSystem::isDirectory( mCurPath + flist[i] ) ) { folders.push_back( flist[i] ); } else { accepted = false; if ( patterns.size() ) { for ( z = 0; z < patterns.size(); z++ ) { - if ( patterns[z] == FileSystem::FileExtension( flist[i] ) ) { + if ( patterns[z] == FileSystem::fileExtension( flist[i] ) ) { accepted = true; break; } @@ -263,7 +263,7 @@ Uint32 UICommonDialog::OnMessage( const UIMessage * Msg ) { CloseWindow(); } else if ( Msg->Sender() == mButtonUp ) { - mCurPath = FileSystem::RemoveLastFolderFromPath( mCurPath ); + mCurPath = FileSystem::removeLastFolderFromPath( mCurPath ); mPath->Text( mCurPath ); RefreshFolder(); } @@ -277,8 +277,8 @@ Uint32 UICommonDialog::OnMessage( const UIMessage * Msg ) { if ( Msg->Sender()->IsType( UI_TYPE_LISTBOXITEM ) ) { std::string newPath = mCurPath + mList->GetItemSelectedText(); - if ( FileSystem::IsDirectory( newPath ) ) { - mCurPath = newPath + FileSystem::GetOSlash(); + if ( FileSystem::isDirectory( newPath ) ) { + mCurPath = newPath + FileSystem::getOSlash(); mPath->Text( mCurPath ); RefreshFolder(); } else { @@ -296,12 +296,12 @@ Uint32 UICommonDialog::OnMessage( const UIMessage * Msg ) { if ( AllowFolderSelect() ) { mFile->Text( mList->GetItemSelectedText() ); } else { - if ( !FileSystem::IsDirectory( GetTempFullPath() ) ) { + if ( !FileSystem::isDirectory( GetTempFullPath() ) ) { mFile->Text( mList->GetItemSelectedText() ); } } } else { - if ( !FileSystem::IsDirectory( GetTempFullPath() ) ) { + if ( !FileSystem::isDirectory( GetTempFullPath() ) ) { mFile->Text( mList->GetItemSelectedText() ); } } @@ -327,10 +327,10 @@ void UICommonDialog::Save() { void UICommonDialog::Open() { if ( "" != mList->GetItemSelectedText() || AllowFolderSelect() ) { if ( !AllowFolderSelect() ) { - if ( FileSystem::IsDirectory( GetFullPath() ) ) + if ( FileSystem::isDirectory( GetFullPath() ) ) return; } else { - if ( !FileSystem::IsDirectory( GetFullPath() ) && !FileSystem::IsDirectory( GetCurPath() ) ) + if ( !FileSystem::isDirectory( GetFullPath() ) && !FileSystem::isDirectory( GetCurPath() ) ) return; } @@ -343,9 +343,9 @@ void UICommonDialog::Open() { } void UICommonDialog::OnPressEnter( const UIEvent * Event ) { - if ( FileSystem::IsDirectory( mPath->Text() ) ) { + if ( FileSystem::isDirectory( mPath->Text() ) ) { std::string tpath = mPath->Text(); - FileSystem::DirPathAddSlashAtEnd( tpath ); + FileSystem::dirPathAddSlashAtEnd( tpath ); mPath->Text( tpath ); mCurPath = mPath->Text(); RefreshFolder(); @@ -379,23 +379,23 @@ bool UICommonDialog::AllowFolderSelect() { } void UICommonDialog::SortAlphabetically( const bool& sortAlphabetically ) { - BitOp::SetBitFlagValue( &mCDLFlags, CDL_FLAG_SORT_ALPHABETICALLY, sortAlphabetically ? 1 : 0 ); + BitOp::setBitFlagValue( &mCDLFlags, CDL_FLAG_SORT_ALPHABETICALLY, sortAlphabetically ? 1 : 0 ); RefreshFolder(); } void UICommonDialog::FoldersFirst( const bool& foldersFirst ) { - BitOp::SetBitFlagValue( &mCDLFlags, CDL_FLAG_FOLDERS_FISRT , foldersFirst ? 1 : 0 ); + BitOp::setBitFlagValue( &mCDLFlags, CDL_FLAG_FOLDERS_FISRT , foldersFirst ? 1 : 0 ); RefreshFolder(); } void UICommonDialog::AllowFolderSelect( const bool& allowFolderSelect ) { - BitOp::SetBitFlagValue( &mCDLFlags, CDL_FLAG_ALLOW_FOLDER_SELECT, allowFolderSelect ? 1 : 0 ); + BitOp::setBitFlagValue( &mCDLFlags, CDL_FLAG_ALLOW_FOLDER_SELECT, allowFolderSelect ? 1 : 0 ); } std::string UICommonDialog::GetFullPath() { std::string tPath = mCurPath; - FileSystem::DirPathAddSlashAtEnd( tPath ); + FileSystem::dirPathAddSlashAtEnd( tPath ); tPath += GetCurFile(); @@ -405,9 +405,9 @@ std::string UICommonDialog::GetFullPath() { std::string UICommonDialog::GetTempFullPath() { std::string tPath = mCurPath; - FileSystem::DirPathAddSlashAtEnd( tPath ); + FileSystem::dirPathAddSlashAtEnd( tPath ); - tPath += mList->GetItemSelectedText().ToUtf8(); + tPath += mList->GetItemSelectedText().toUtf8(); return tPath; } @@ -420,7 +420,7 @@ std::string UICommonDialog::GetCurFile() const { if ( mCDLFlags & CDL_FLAG_SAVE_DIALOG ) return mFile->Text(); - return mList->GetItemSelectedText().ToUtf8(); + return mList->GetItemSelectedText().toUtf8(); } UIPushButton * UICommonDialog::GetButtonOpen() const { diff --git a/src/eepp/ui/uicomplexcontrol.cpp b/src/eepp/ui/uicomplexcontrol.cpp index e08d7b8dd..e96813a43 100644 --- a/src/eepp/ui/uicomplexcontrol.cpp +++ b/src/eepp/ui/uicomplexcontrol.cpp @@ -54,12 +54,12 @@ void UIComplexControl::Update() { mTooltip->Show(); } else { - if ( -1.f != mTooltip->TooltipTime().AsMilliseconds() ) { + if ( -1.f != mTooltip->TooltipTime().asMilliseconds() ) { mTooltip->TooltipTimeAdd( UIManager::instance()->Elapsed() ); } if ( mTooltip->TooltipTime() >= UIThemeManager::instance()->TooltipTimeToShow() ) { - if ( mTooltip->TooltipTime().AsMilliseconds() != -1.f ) { + if ( mTooltip->TooltipTime().asMilliseconds() != -1.f ) { mTooltip->Pos( Pos ); mTooltip->Show(); diff --git a/src/eepp/ui/uicontrol.cpp b/src/eepp/ui/uicontrol.cpp index 74c3133de..2dacf4251 100644 --- a/src/eepp/ui/uicontrol.cpp +++ b/src/eepp/ui/uicontrol.cpp @@ -939,7 +939,7 @@ UIBorder * UIControl::Border() { } void UIControl::SetThemeByName( const std::string& Theme ) { - SetTheme( UIThemeManager::instance()->GetByName( Theme ) ); + SetTheme( UIThemeManager::instance()->getByName( Theme ) ); } void UIControl::SetTheme( UITheme * Theme ) { @@ -958,7 +958,7 @@ void UIControl::SafeDeleteSkinState() { void UIControl::SetThemeControl( UITheme * Theme, const std::string& ControlName ) { if ( NULL != Theme ) { - UISkin * tSkin = Theme->GetByName( Theme->Abbr() + "_" + ControlName ); + UISkin * tSkin = Theme->getByName( Theme->Abbr() + "_" + ControlName ); if ( NULL != tSkin ) { Uint32 InitialState = UISkinState::StateNormal; @@ -1051,7 +1051,7 @@ UISkin * UIControl::GetSkin() { } void UIControl::WriteCtrlFlag( const Uint32& Flag, const Uint32& Val ) { - BitOp::SetBitFlagValue( &mControlFlags, Flag, Val ); + BitOp::setBitFlagValue( &mControlFlags, Flag, Val ); } void UIControl::WriteFlag( const Uint32& Flag, const Uint32& Val ) { diff --git a/src/eepp/ui/uicontrolanim.cpp b/src/eepp/ui/uicontrolanim.cpp index 0a07ee4b5..818f995b1 100644 --- a/src/eepp/ui/uicontrolanim.cpp +++ b/src/eepp/ui/uicontrolanim.cpp @@ -392,7 +392,7 @@ void UIControlAnim::BorderDraw() { } ColorA UIControlAnim::GetColor( const ColorA& Col ) { - return ColorA( Col.R(), Col.G(), Col.B(), static_cast( (Float)Col.A() * ( mAlpha / 255.f ) ) ); + return ColorA( Col.r(), Col.g(), Col.b(), static_cast( (Float)Col.a() * ( mAlpha / 255.f ) ) ); } void UIControlAnim::UpdateQuad() { diff --git a/src/eepp/ui/uigenericgrid.cpp b/src/eepp/ui/uigenericgrid.cpp index 0385d061a..6c53024c7 100644 --- a/src/eepp/ui/uigenericgrid.cpp +++ b/src/eepp/ui/uigenericgrid.cpp @@ -579,13 +579,13 @@ void UIGenericGrid::Update() { mVScrollBar->Value( mVScrollBar->Value() + ( -diff.y / (Float)( ( mItems.size() - 1 ) * mRowHeight ) ) ); - mTouchDragAcceleration += Elapsed().AsMilliseconds() * diff.y * mTouchDragDeceleration; + mTouchDragAcceleration += Elapsed().asMilliseconds() * diff.y * mTouchDragDeceleration; mTouchDragPoint = Pos; UIManager::instance()->SetControlDragging( true ); } else { - mTouchDragAcceleration -= Elapsed().AsMilliseconds() * mTouchDragAcceleration * 0.01f; + mTouchDragAcceleration -= Elapsed().asMilliseconds() * mTouchDragAcceleration * 0.01f; } } else { // Mouse Down @@ -608,7 +608,7 @@ void UIGenericGrid::Update() { if ( mTouchDragAcceleration > 0.01f || mTouchDragAcceleration < -0.01f ) { mVScrollBar->Value( mVScrollBar->Value() + ( -mTouchDragAcceleration / (Float)( ( mItems.size() - 1 ) * mRowHeight ) ) ); - mTouchDragAcceleration -= mTouchDragAcceleration * mTouchDragDeceleration * Elapsed().AsMilliseconds(); + mTouchDragAcceleration -= mTouchDragAcceleration * mTouchDragDeceleration * Elapsed().asMilliseconds(); } } } diff --git a/src/eepp/ui/uigfx.cpp b/src/eepp/ui/uigfx.cpp index 260bd66a2..0c17fb0d5 100644 --- a/src/eepp/ui/uigfx.cpp +++ b/src/eepp/ui/uigfx.cpp @@ -114,7 +114,7 @@ const ColorA& UIGfx::Color() const { void UIGfx::Color( const ColorA& color ) { mColor = color; - Alpha( color.A() ); + Alpha( color.a() ); } const EE_RENDER_MODE& UIGfx::RenderMode() const { diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index 193aab8fe..1461c348d 100644 --- a/src/eepp/ui/uilistbox.cpp +++ b/src/eepp/ui/uilistbox.cpp @@ -834,17 +834,17 @@ Uint32 UIListBox::OnKeyDown( const UIEventKey &Event ) { if ( !mSelected.size() || mFlags & UI_MULTI_SELECT ) return 0; - if ( Sys::GetTicks() - mLastTickMove > 100 ) { + if ( Sys::getTicks() - mLastTickMove > 100 ) { if ( KEY_DOWN == Event.KeyCode() ) { - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); SelectNext(); } else if ( KEY_UP == Event.KeyCode() ) { - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); SelectPrev(); } else if ( KEY_HOME == Event.KeyCode() ) { - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); if ( mSelected.front() != 0 ) { mVScrollBar->Value( 0 ); @@ -854,7 +854,7 @@ Uint32 UIListBox::OnKeyDown( const UIEventKey &Event ) { SetSelected( 0 ); } } else if ( KEY_END == Event.KeyCode() ) { - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); if ( mSelected.front() != Count() - 1 ) { mVScrollBar->Value( 1 ); @@ -973,13 +973,13 @@ void UIListBox::Update() { mVScrollBar->Value( mVScrollBar->Value() + ( -diff.y / (Float)( ( mItems.size() - 1 ) * mRowHeight ) ) ); - mTouchDragAcceleration += Elapsed().AsMilliseconds() * diff.y * mTouchDragDeceleration; + mTouchDragAcceleration += Elapsed().asMilliseconds() * diff.y * mTouchDragDeceleration; mTouchDragPoint = Pos; UIManager::instance()->SetControlDragging( true ); } else { - mTouchDragAcceleration -= Elapsed().AsMilliseconds() * mTouchDragAcceleration * 0.01f; + mTouchDragAcceleration -= Elapsed().asMilliseconds() * mTouchDragAcceleration * 0.01f; } } else { // Mouse Down @@ -1002,7 +1002,7 @@ void UIListBox::Update() { if ( mTouchDragAcceleration > 0.01f || mTouchDragAcceleration < -0.01f ) { mVScrollBar->Value( mVScrollBar->Value() + ( -mTouchDragAcceleration / (Float)( ( mItems.size() - 1 ) * mRowHeight ) ) ); - mTouchDragAcceleration -= mTouchDragAcceleration * mTouchDragDeceleration * Elapsed().AsMilliseconds(); + mTouchDragAcceleration -= mTouchDragAcceleration * mTouchDragDeceleration * Elapsed().asMilliseconds(); } } } diff --git a/src/eepp/ui/uimanager.cpp b/src/eepp/ui/uimanager.cpp index 21a7bfe09..0819dbb76 100644 --- a/src/eepp/ui/uimanager.cpp +++ b/src/eepp/ui/uimanager.cpp @@ -74,7 +74,7 @@ void UIManager::Init( Uint32 Flags, EE::Window::Window * window ) { void UIManager::Shutdown() { if ( mInit ) { if ( -1 != mCbId && - NULL != Engine::ExistsSingleton() && + NULL != Engine::existsSingleton() && Engine::instance()->ExistsWindow( mWindow ) ) { @@ -94,7 +94,7 @@ void UIManager::Shutdown() { mInit = false; } - UIThemeManager::DestroySingleton(); + UIThemeManager::destroySingleton(); } void UIManager::InputCallback( InputEvent * Event ) { @@ -294,7 +294,7 @@ void UIManager::ClipDisable() { } void UIManager::HighlightFocus( bool Highlight ) { - BitOp::SetBitFlagValue( &mFlags, UI_MANAGER_HIGHLIGHT_FOCUS, Highlight ? 1 : 0 ); + BitOp::setBitFlagValue( &mFlags, UI_MANAGER_HIGHLIGHT_FOCUS, Highlight ? 1 : 0 ); } bool UIManager::HighlightFocus() const { @@ -310,7 +310,7 @@ const ColorA& UIManager::HighlightFocusColor() const { } void UIManager::HighlightOver( bool Highlight ) { - BitOp::SetBitFlagValue( &mFlags, UI_MANAGER_HIGHLIGHT_OVER, Highlight ? 1 : 0 ); + BitOp::setBitFlagValue( &mFlags, UI_MANAGER_HIGHLIGHT_OVER, Highlight ? 1 : 0 ); } bool UIManager::HighlightOver() const { diff --git a/src/eepp/ui/uimenu.cpp b/src/eepp/ui/uimenu.cpp index 568b20d4f..ff4f145d3 100644 --- a/src/eepp/ui/uimenu.cpp +++ b/src/eepp/ui/uimenu.cpp @@ -512,15 +512,15 @@ void UIMenu::PrevSel() { } Uint32 UIMenu::OnKeyDown( const UIEventKey& Event ) { - if ( Sys::GetTicks() - mLastTickMove > 50 ) { + if ( Sys::getTicks() - mLastTickMove > 50 ) { switch ( Event.KeyCode() ) { case KEY_DOWN: - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); NextSel(); break; case KEY_UP: - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); PrevSel(); break; diff --git a/src/eepp/ui/uimenucheckbox.cpp b/src/eepp/ui/uimenucheckbox.cpp index 6f14ce911..8eb771576 100644 --- a/src/eepp/ui/uimenucheckbox.cpp +++ b/src/eepp/ui/uimenucheckbox.cpp @@ -26,8 +26,8 @@ bool UIMenuCheckBox::IsType( const Uint32& type ) const { void UIMenuCheckBox::SetTheme( UITheme * Theme ) { UIControl::SetThemeControl( Theme, "menuitem" ); - mSkinActive = Theme->GetByName( Theme->Abbr() + "_" + "menucheckbox_active" ); - mSkinInactive = Theme->GetByName( Theme->Abbr() + "_" + "menucheckbox_inactive" ); + mSkinActive = Theme->getByName( Theme->Abbr() + "_" + "menucheckbox_active" ); + mSkinInactive = Theme->getByName( Theme->Abbr() + "_" + "menucheckbox_inactive" ); Active( mActive ); diff --git a/src/eepp/ui/uimenusubmenu.cpp b/src/eepp/ui/uimenusubmenu.cpp index 1b84d3edb..09bf64330 100644 --- a/src/eepp/ui/uimenusubmenu.cpp +++ b/src/eepp/ui/uimenusubmenu.cpp @@ -41,7 +41,7 @@ bool UIMenuSubMenu::IsType( const Uint32& type ) const { void UIMenuSubMenu::SetTheme( UITheme * Theme ) { UIMenuItem::SetTheme( Theme ); - mSkinArrow = Theme->GetByName( Theme->Abbr() + "_" + "menuarrow" ); + mSkinArrow = Theme->getByName( Theme->Abbr() + "_" + "menuarrow" ); OnStateChange(); } @@ -88,7 +88,7 @@ Uint32 UIMenuSubMenu::OnMouseMove( const Vector2i &Pos, const Uint32 Flags ) { UIMenuItem::OnMouseMove( Pos, Flags ); if ( NULL != mSubMenu && !mSubMenu->Visible() ) { - mTimeOver += UIManager::instance()->Elapsed().AsMilliseconds(); + mTimeOver += UIManager::instance()->Elapsed().asMilliseconds(); if ( mTimeOver >= mMaxTime ) { ShowSubMenu(); diff --git a/src/eepp/ui/uiprogressbar.cpp b/src/eepp/ui/uiprogressbar.cpp index 73ea698be..946e4e26b 100644 --- a/src/eepp/ui/uiprogressbar.cpp +++ b/src/eepp/ui/uiprogressbar.cpp @@ -58,7 +58,7 @@ void UIProgressBar::SetTheme( UITheme * Theme ) { Size( mSize.x, GetSkinSize().Height() ); } - UISkin * tSkin = Theme->GetByName( Theme->Abbr() + "_progressbar_filler" ); + UISkin * tSkin = Theme->getByName( Theme->Abbr() + "_progressbar_filler" ); if ( tSkin ) { SubTexture * tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); @@ -172,7 +172,7 @@ const bool& UIProgressBar::DisplayPercent() const { void UIProgressBar::UpdateTextBox() { mTextBox->Visible( mDisplayPercent ); mTextBox->Size( mSize ); - mTextBox->Text( String::ToStr( (Int32)( ( mProgress / mTotalSteps ) * 100.f ) ) + "%" ); + mTextBox->Text( String::toStr( (Int32)( ( mProgress / mTotalSteps ) * 100.f ) ) + "%" ); } UITextBox * UIProgressBar::TextBox() const { diff --git a/src/eepp/ui/uiradiobutton.cpp b/src/eepp/ui/uiradiobutton.cpp index aa99ea528..796ab6e9b 100644 --- a/src/eepp/ui/uiradiobutton.cpp +++ b/src/eepp/ui/uiradiobutton.cpp @@ -220,8 +220,8 @@ UIControlAnim * UIRadioButton::InactiveButton() const { Uint32 UIRadioButton::OnKeyDown( const UIEventKey& Event ) { if ( Event.KeyCode() == KEY_SPACE ) { - if ( Sys::GetTicks() - mLastTick > 250 ) { - mLastTick = Sys::GetTicks(); + if ( Sys::getTicks() - mLastTick > 250 ) { + mLastTick = Sys::getTicks(); Active( true ); } diff --git a/src/eepp/ui/uiskin.cpp b/src/eepp/ui/uiskin.cpp index d33f12e44..48b18bdf1 100644 --- a/src/eepp/ui/uiskin.cpp +++ b/src/eepp/ui/uiskin.cpp @@ -19,12 +19,12 @@ const char * UISkin::GetSkinStateName( const Uint32& State ) { UISkin::UISkin( const std::string& Name, const Uint32& Type ) : mType( Type ), mName( Name ), - mNameHash( String::Hash( mName ) ), + mNameHash( String::hash( mName ) ), mTheme(NULL) { ColorA tColor( 255, 255, 255, 255 ); - mColorDefault = tColor.GetValue(); + mColorDefault = tColor.getValue(); for ( Int32 i = 0; i < UISkinState::StateCount; i++ ) { mColor[ i ] = tColor; @@ -37,7 +37,7 @@ UISkin::~UISkin() { void UISkin::SetColor( const Uint32& State, const ColorA& Color ) { eeASSERT ( State < UISkinState::StateCount ); - BitOp::WriteBitKey( &mColorDefault, State, 0 ); + BitOp::writeBitKey( &mColorDefault, State, 0 ); mColor[ State ] = Color; } @@ -54,7 +54,7 @@ const std::string& UISkin::Name() const { void UISkin::Name( const std::string& name ) { mName = name; - mNameHash = String::Hash( mName ); + mNameHash = String::hash( mName ); } const Uint32& UISkin::Id() const { @@ -79,7 +79,7 @@ const Uint32& UISkin::GetType() const { } bool UISkin::GetColorDefault( const Uint32& State ) { - return BitOp::ReadBitKey( &mColorDefault, State ); + return BitOp::readBitKey( &mColorDefault, State ); } }} diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index 051d59e2e..52c194fe8 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -270,21 +270,21 @@ void UISlider::Update() { } Uint32 UISlider::OnKeyDown( const UIEventKey &Event ) { - if ( Sys::GetTicks() - mLastTickMove > 100 ) { + if ( Sys::getTicks() - mLastTickMove > 100 ) { if ( Event.KeyCode() == KEY_DOWN ) { - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); Value( mValue + mClickStep ); } else if ( Event.KeyCode() == KEY_UP ) { - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); Value( mValue - mClickStep ); } else if ( Event.KeyCode() == KEY_PAGEUP ) { - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); Value( mMinValue ); } else if ( Event.KeyCode() == KEY_PAGEDOWN ) { - mLastTickMove = Sys::GetTicks(); + mLastTickMove = Sys::getTicks(); Value( mMaxValue ); } diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index 99c05c9d1..93a7f8e41 100644 --- a/src/eepp/ui/uispinbox.cpp +++ b/src/eepp/ui/uispinbox.cpp @@ -146,7 +146,7 @@ Uint32 UISpinBox::OnMessage( const UIMessage * Msg ) { void UISpinBox::AddValue( const Float& value ) { if ( !mInput->Text().size() ) - mInput->Text( String::ToStr( static_cast( mMinValue ) ) ); + mInput->Text( String::toStr( static_cast( mMinValue ) ) ); Value( mValue + value ); } @@ -158,9 +158,9 @@ void UISpinBox::InternalValue( const Float& Val, const bool& Force ) { Float fValN = (Float)iValN; if ( fValN == Val ) { - mInput->Text( String::ToStr( iValN ) ); + mInput->Text( String::toStr( iValN ) ); } else { - mInput->Text( String::ToStr( Val ) ); + mInput->Text( String::toStr( Val ) ); } mValue = Val; @@ -217,7 +217,7 @@ void UISpinBox::Update() { if ( pos != mInput->Text().size() - 1 ) mInput->Text( mInput->Text().substr( 0, mInput->Text().size() - 1 ) ); } else { - bool Res = String::FromString( Val, mInput->Text() ); + bool Res = String::fromString( Val, mInput->Text() ); if ( Res ) Value( Val ); diff --git a/src/eepp/ui/uisprite.cpp b/src/eepp/ui/uisprite.cpp index 671e96f2c..dd0ec5e11 100644 --- a/src/eepp/ui/uisprite.cpp +++ b/src/eepp/ui/uisprite.cpp @@ -88,7 +88,7 @@ void UISprite::Color( const ColorA& color ) { if ( NULL != mSprite ) mSprite->Color( color ); - Alpha( color.A() ); + Alpha( color.a() ); } const EE_RENDER_MODE& UISprite::RenderMode() const { diff --git a/src/eepp/ui/uitabwidget.cpp b/src/eepp/ui/uitabwidget.cpp index ede05a00f..8f30983d5 100644 --- a/src/eepp/ui/uitabwidget.cpp +++ b/src/eepp/ui/uitabwidget.cpp @@ -67,7 +67,7 @@ void UITabWidget::SetTheme( UITheme * Theme ) { mCtrlContainer->SetThemeControl( Theme, "tabcontainer" ); if ( 0 == mTabWidgetHeight ) { - UISkin * tSkin = Theme->GetByName( Theme->Abbr() + "_" + "tab" ); + UISkin * tSkin = Theme->getByName( Theme->Abbr() + "_" + "tab" ); Sizei tSize1 = GetSkinSize( tSkin ); Sizei tSize2 = GetSkinSize( tSkin, UISkinState::StateSelected ); diff --git a/src/eepp/ui/uitextbox.cpp b/src/eepp/ui/uitextbox.cpp index 84dca5d7f..fb35f558c 100644 --- a/src/eepp/ui/uitextbox.cpp +++ b/src/eepp/ui/uitextbox.cpp @@ -113,7 +113,7 @@ void UITextBox::Color( const ColorA& color ) { mFontColor = color; mTextCache->Color( color ); - Alpha( color.A() ); + Alpha( color.a() ); } const ColorA& UITextBox::ShadowColor() const { diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index 979de37af..80169cd7c 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -75,7 +75,7 @@ void UITextInput::OnCursorPosChange() { void UITextInput::DrawWaitingCursor() { if ( mVisible && mTextBuffer.Active() && mTextBuffer.SupportFreeEditing() ) { - mWaitCursorTime += UIManager::instance()->Elapsed().AsMilliseconds(); + mWaitCursorTime += UIManager::instance()->Elapsed().asMilliseconds(); if ( mShowingWait ) { bool disableSmooth = mShowingWait && GLi->IsLineSmooth(); diff --git a/src/eepp/ui/uitheme.cpp b/src/eepp/ui/uitheme.cpp index a2bbe7202..9535b1cfe 100644 --- a/src/eepp/ui/uitheme.cpp +++ b/src/eepp/ui/uitheme.cpp @@ -157,12 +157,12 @@ UITheme * UITheme::LoadFromTextureAtlas( UITheme * tTheme, Graphics::TextureAtla for ( i = 0; i < ElemFound.size(); i++ ) { if ( ElemType[i] ) - tTheme->Add( eeNew( UISkinComplex, ( ElemFound[i] ) ) ); + tTheme->add( eeNew( UISkinComplex, ( ElemFound[i] ) ) ); else - tTheme->Add( eeNew( UISkinSimple, ( ElemFound[i] ) ) ); + tTheme->add( eeNew( UISkinSimple, ( ElemFound[i] ) ) ); } - eePRINTL( "UI Theme Loaded in: %4.3f ms ( from TextureAtlas )", TE.Elapsed().AsMilliseconds() ); + eePRINTL( "UI Theme Loaded in: %4.3f ms ( from TextureAtlas )", TE.elapsed().asMilliseconds() ); return tTheme; } @@ -178,9 +178,9 @@ UITheme * UITheme::LoadFromPath( UITheme * tTheme, const std::string& Path, cons std::string ElemName; std::string RPath( Path ); - FileSystem::DirPathAddSlashAtEnd( RPath ); + FileSystem::dirPathAddSlashAtEnd( RPath ); - if ( !FileSystem::IsDirectory( RPath ) ) + if ( !FileSystem::isDirectory( RPath ) ) return NULL; std::vector ElemFound; @@ -208,24 +208,24 @@ UITheme * UITheme::LoadFromPath( UITheme * tTheme, const std::string& Path, cons ElemName = tTheme->Abbr() + "_icon_" + *it; Element = RPath + ElemName + "." + ImgExt; - if ( FileSystem::FileExists( Element ) ) { - tSG->Add( eeNew( SubTexture, ( TextureFactory::instance()->Load( Element ), ElemName ) ) ); + if ( FileSystem::fileExists( Element ) ) { + tSG->add( eeNew( SubTexture, ( TextureFactory::instance()->Load( Element ), ElemName ) ) ); } } - if ( tSG->Count() ) - TextureAtlasManager::instance()->Add( tSG ); + if ( tSG->count() ) + TextureAtlasManager::instance()->add( tSG ); else eeSAFE_DELETE( tSG ); for ( i = 0; i < ElemFound.size(); i++ ) { if ( ElemType[i] ) - tTheme->Add( eeNew( UISkinComplex, ( ElemFound[i] ) ) ); + tTheme->add( eeNew( UISkinComplex, ( ElemFound[i] ) ) ); else - tTheme->Add( eeNew( UISkinSimple, ( ElemFound[i] ) ) ); + tTheme->add( eeNew( UISkinSimple, ( ElemFound[i] ) ) ); } - eePRINTL( "UI Theme Loaded in: %4.3f ms ( from path )", TE.Elapsed().AsMilliseconds() ); + eePRINTL( "UI Theme Loaded in: %4.3f ms ( from path )", TE.elapsed().asMilliseconds() ); return tTheme; } @@ -249,7 +249,7 @@ bool UITheme::SearchFilesInAtlas( Graphics::TextureAtlas * SG, std::string Eleme for ( s = 0; s < UISkinComplex::SideCount; s++ ) { ElemName = Element + "_" + UISkin::GetSkinStateName( i ) + "_" + UISkinComplex::GetSideSuffix( s ); - if ( SG->GetByName( ElemName ) ) { + if ( SG->getByName( ElemName ) ) { IsComplex = 1; Found = true; break; @@ -266,7 +266,7 @@ bool UITheme::SearchFilesInAtlas( Graphics::TextureAtlas * SG, std::string Eleme for ( i = 0; i < UISkinState::StateCount; i++ ) { ElemName = Element + "_" + UISkin::GetSkinStateName( i ); - if ( SG->GetByName( ElemName ) ) { + if ( SG->getByName( ElemName ) ) { Found = true; break; } @@ -291,8 +291,8 @@ bool UITheme::SearchFilesOfElement( Graphics::TextureAtlas * SG, const std::stri ElemPath = Path + ElemName; ElemFullPath = ElemPath + "." + ImgExt; - if ( FileSystem::FileExists( ElemFullPath ) ) { - SG->Add( eeNew( SubTexture, ( TextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); + if ( FileSystem::fileExists( ElemFullPath ) ) { + SG->add( eeNew( SubTexture, ( TextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); IsComplex = 1; Found = true; @@ -308,8 +308,8 @@ bool UITheme::SearchFilesOfElement( Graphics::TextureAtlas * SG, const std::stri ElemPath = Path + ElemName; ElemFullPath = ElemPath + "." + ImgExt; - if ( FileSystem::FileExists( ElemFullPath ) ) { - SG->Add( eeNew( SubTexture, ( TextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); + if ( FileSystem::fileExists( ElemFullPath ) ) { + SG->add( eeNew( SubTexture, ( TextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); Found = true; } @@ -322,7 +322,7 @@ bool UITheme::SearchFilesOfElement( Graphics::TextureAtlas * SG, const std::stri UITheme::UITheme( const std::string& Name, const std::string& Abbr, Graphics::Font * DefaultFont ) : ResourceManager ( false ), mName( Name ), - mNameHash( String::Hash( mName ) ), + mNameHash( String::hash( mName ) ), mAbbr( Abbr ), mTextureAtlas( NULL ), mFont( DefaultFont ), @@ -344,7 +344,7 @@ const std::string& UITheme::Name() const { void UITheme::Name( const std::string& name ) { mName = name; - mNameHash = String::Hash( mName ); + mNameHash = String::hash( mName ); } const Uint32& UITheme::Id() const { @@ -355,10 +355,10 @@ const std::string& UITheme::Abbr() const { return mAbbr; } -UISkin * UITheme::Add( UISkin * Resource ) { +UISkin * UITheme::add( UISkin * Resource ) { Resource->Theme( this ); - return ResourceManager::Add( Resource ); + return ResourceManager::add( Resource ); } void UITheme::Font( Graphics::Font * Font ) { @@ -419,7 +419,7 @@ void UITheme::TextureAtlas( Graphics::TextureAtlas * SG ) { SubTexture * UITheme::GetIconByName( const std::string& name ) { if ( NULL != mTextureAtlas ) - return mTextureAtlas->GetByName( mAbbr + "_icon_" + name ); + return mTextureAtlas->getByName( mAbbr + "_icon_" + name ); return NULL; } diff --git a/src/eepp/ui/uithememanager.cpp b/src/eepp/ui/uithememanager.cpp index dde7ec70c..88b569ebc 100644 --- a/src/eepp/ui/uithememanager.cpp +++ b/src/eepp/ui/uithememanager.cpp @@ -32,7 +32,7 @@ Font * UIThemeManager::DefaultFont() const { } void UIThemeManager::SetTheme( const std::string& Theme ) { - SetTheme( GetByName( Theme ) ); + SetTheme( getByName( Theme ) ); } void UIThemeManager::SetTheme( UITheme * Theme ) { @@ -49,7 +49,7 @@ void UIThemeManager::DefaultTheme( UITheme * Theme ) { } void UIThemeManager::DefaultTheme( const std::string& Theme ) { - DefaultTheme( UIThemeManager::instance()->GetByName( Theme ) ); + DefaultTheme( UIThemeManager::instance()->getByName( Theme ) ); } UITheme * UIThemeManager::DefaultTheme() const { diff --git a/src/eepp/ui/uitooltip.cpp b/src/eepp/ui/uitooltip.cpp index c0d0015bd..0e20f4149 100644 --- a/src/eepp/ui/uitooltip.cpp +++ b/src/eepp/ui/uitooltip.cpp @@ -131,7 +131,7 @@ const ColorA& UITooltip::Color() const { void UITooltip::Color( const ColorA& color ) { mFontColor = color; - Alpha( color.A() ); + Alpha( color.a() ); } const ColorA& UITooltip::ShadowColor() const { @@ -140,7 +140,7 @@ const ColorA& UITooltip::ShadowColor() const { void UITooltip::ShadowColor( const ColorA& color ) { mFontShadowColor = color; - Alpha( color.A() ); + Alpha( color.a() ); mTextCache->ShadowColor( mFontColor ); } diff --git a/src/eepp/window/backend/SDL/windowsdl.cpp b/src/eepp/window/backend/SDL/windowsdl.cpp index eb4e6c179..a89af4832 100644 --- a/src/eepp/window/backend/SDL/windowsdl.cpp +++ b/src/eepp/window/backend/SDL/windowsdl.cpp @@ -129,8 +129,8 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE , 8 ); } - if ( NULL == cGL::ExistsSingleton() ) { - cGL::CreateSingleton( mWindow.ContextConfig.Version ); + if ( NULL == cGL::existsSingleton() ) { + cGL::createSingleton( mWindow.ContextConfig.Version ); cGL::instance()->Init(); } diff --git a/src/eepp/window/backend/SDL2/clipboardsdl2.cpp b/src/eepp/window/backend/SDL2/clipboardsdl2.cpp index fb3da59d8..a23e5103e 100644 --- a/src/eepp/window/backend/SDL2/clipboardsdl2.cpp +++ b/src/eepp/window/backend/SDL2/clipboardsdl2.cpp @@ -29,7 +29,7 @@ std::string ClipboardSDL::GetText() { String ClipboardSDL::GetWideText() { char * text = SDL_GetClipboardText(); - String str( String::FromUtf8( text ) ); + String str( String::fromUtf8( text ) ); SDL_free(text); return str; } diff --git a/src/eepp/window/backend/SDL2/inputsdl2.cpp b/src/eepp/window/backend/SDL2/inputsdl2.cpp index c1e507e59..3f378bccc 100644 --- a/src/eepp/window/backend/SDL2/inputsdl2.cpp +++ b/src/eepp/window/backend/SDL2/inputsdl2.cpp @@ -95,7 +95,7 @@ void InputSDL::Update() { } case SDL_TEXTINPUT: { - String txt = String::FromUtf8( SDLEvent.text.text ); + String txt = String::fromUtf8( SDLEvent.text.text ); EEEvent.Type = InputEvent::TextInput; EEEvent.text.timestamp = SDLEvent.text.timestamp; diff --git a/src/eepp/window/backend/SDL2/joystickmanagersdl2.cpp b/src/eepp/window/backend/SDL2/joystickmanagersdl2.cpp index 36471fdb5..74fdaf97c 100644 --- a/src/eepp/window/backend/SDL2/joystickmanagersdl2.cpp +++ b/src/eepp/window/backend/SDL2/joystickmanagersdl2.cpp @@ -38,7 +38,7 @@ void JoystickManagerSDL::OpenAsync() { } void JoystickManagerSDL::Open() { - mAsyncInit.Launch(); + mAsyncInit.launch(); } void JoystickManagerSDL::Close() { diff --git a/src/eepp/window/backend/SDL2/joysticksdl2.cpp b/src/eepp/window/backend/SDL2/joysticksdl2.cpp index 04f8da2e0..e60ad8916 100644 --- a/src/eepp/window/backend/SDL2/joysticksdl2.cpp +++ b/src/eepp/window/backend/SDL2/joysticksdl2.cpp @@ -28,7 +28,7 @@ void JoystickSDL::Open() { #if defined(SDL_REVISION_NUMBER) && SDL_REVISION_NUMBER >= 7236 mName = SDL_JoystickName( mJoystick ); #else - mName = std::string( "USB Joysick " ) + String::ToStr( mIndex ); + mName = std::string( "USB Joysick " ) + String::toStr( mIndex ); #endif mHats = SDL_JoystickNumHats( mJoystick ); diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index fea6fbe90..879ec8ae2 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -227,8 +227,8 @@ bool WindowSDL::Create( WindowSettings Settings, ContextSettings Context ) { SDL_GL_MakeCurrent( mSDLWindow, mGLContext ); - if ( NULL == cGL::ExistsSingleton() ) { - cGL::CreateSingleton( mWindow.ContextConfig.Version ); + if ( NULL == cGL::existsSingleton() ) { + cGL::createSingleton( mWindow.ContextConfig.Version ); cGL::instance()->Init(); } @@ -295,7 +295,7 @@ std::string WindowSDL::GetVersion() { SDL_GetVersion( &ver ); - return String::StrFormated( "SDL %d.%d.%d", ver.major, ver.minor, ver.patch ); + return String::strFormated( "SDL %d.%d.%d", ver.major, ver.minor, ver.patch ); } void WindowSDL::CreatePlatform() { @@ -415,7 +415,7 @@ void WindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { Position( mWinPos.x, mWinPos.y ); } - BitOp::SetBitFlagValue( &mWindow.WindowConfig.Style, WindowStyle::Fullscreen, !Windowed ); + BitOp::setBitFlagValue( &mWindow.WindowConfig.Style, WindowStyle::Fullscreen, !Windowed ); mDefaultView.SetView( 0, 0, Width, Height ); diff --git a/src/eepp/window/backend/SFML/joysticksfml.cpp b/src/eepp/window/backend/SFML/joysticksfml.cpp index b8adbe482..6e41415f9 100644 --- a/src/eepp/window/backend/SFML/joysticksfml.cpp +++ b/src/eepp/window/backend/SFML/joysticksfml.cpp @@ -20,7 +20,7 @@ JoystickSFML::~JoystickSFML() { } void JoystickSFML::Open() { - mName = "Joystick " + String::ToStr( mIndex ); + mName = "Joystick " + String::toStr( mIndex ); mHats = 0; mButtons = eemin( sf::Joystick::getButtonCount( mIndex ), (unsigned int)32 ); mAxes = sf::Joystick::AxisCount; diff --git a/src/eepp/window/backend/SFML/windowsfml.cpp b/src/eepp/window/backend/SFML/windowsfml.cpp index b8813314e..a34b0af83 100644 --- a/src/eepp/window/backend/SFML/windowsfml.cpp +++ b/src/eepp/window/backend/SFML/windowsfml.cpp @@ -61,8 +61,8 @@ bool WindowSFML::Create( WindowSettings Settings, ContextSettings Context ) { mSFMLWindow.setVerticalSyncEnabled( Context.VSync ); - if ( NULL == cGL::ExistsSingleton() ) { - cGL::CreateSingleton( mWindow.ContextConfig.Version ); + if ( NULL == cGL::existsSingleton() ) { + cGL::createSingleton( mWindow.ContextConfig.Version ); cGL::instance()->Init(); } diff --git a/src/eepp/window/cursor.cpp b/src/eepp/window/cursor.cpp index 253006c53..5dbd8c163 100644 --- a/src/eepp/window/cursor.cpp +++ b/src/eepp/window/cursor.cpp @@ -3,7 +3,7 @@ namespace EE { namespace Window { Cursor::Cursor( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : - mId( String::Hash( name ) ), + mId( String::hash( name ) ), mName( name ), mImage( NULL ), mHotSpot( hotspot ), @@ -19,7 +19,7 @@ Cursor::Cursor( Texture * tex, const Vector2i& hotspot, const std::string& name, } Cursor::Cursor( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : - mId( String::Hash( name ) ), + mId( String::hash( name ) ), mName( name ), mImage( NULL ), mHotSpot( hotspot ), @@ -33,7 +33,7 @@ Cursor::Cursor( Graphics::Image * img, const Vector2i& hotspot, const std::strin } Cursor::Cursor( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : - mId( String::Hash( name ) ), + mId( String::hash( name ) ), mName( name ), mImage( NULL ), mHotSpot( hotspot ), diff --git a/src/eepp/window/cursormanager.cpp b/src/eepp/window/cursormanager.cpp index 439df6a3a..96ba799b5 100644 --- a/src/eepp/window/cursormanager.cpp +++ b/src/eepp/window/cursormanager.cpp @@ -33,7 +33,7 @@ void CursorManager::Remove( Cursor * cursor, bool Delete ) { } void CursorManager::Remove( const std::string& name, bool Delete ) { - Remove( String::Hash( name ), Delete ); + Remove( String::hash( name ), Delete ); } void CursorManager::Remove( const Uint32& id, bool Delete ) { @@ -46,7 +46,7 @@ void CursorManager::Remove( const Uint32& id, bool Delete ) { } Cursor * CursorManager::Get( const std::string& name ) { - return GetById( String::Hash( name ) ); + return GetById( String::hash( name ) ); } Cursor * CursorManager::GetById( const Uint32& id ) { @@ -60,7 +60,7 @@ Cursor * CursorManager::GetById( const Uint32& id ) { } void CursorManager::Set( const std::string& name ) { - SetById( String::Hash( name ) ); + SetById( String::hash( name ) ); } void CursorManager::SetById( const Uint32& id ) { diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index 4d2497736..39256e1fd 100755 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -45,35 +45,35 @@ Engine::Engine() : mSharedGLContext( false ), mMainThreadId( 0 ) { - TextureAtlasManager::CreateSingleton(); + TextureAtlasManager::createSingleton(); } Engine::~Engine() { - Physics::PhysicsManager::DestroySingleton(); + Physics::PhysicsManager::destroySingleton(); - Graphics::Private::FrameBufferManager::DestroySingleton(); + Graphics::Private::FrameBufferManager::destroySingleton(); - Graphics::Private::VertexBufferManager::DestroySingleton(); + Graphics::Private::VertexBufferManager::destroySingleton(); - GlobalBatchRenderer::DestroySingleton(); + GlobalBatchRenderer::destroySingleton(); - TextureFactory::DestroySingleton(); + TextureFactory::destroySingleton(); - TextureAtlasManager::DestroySingleton(); + TextureAtlasManager::destroySingleton(); - FontManager::DestroySingleton(); + FontManager::destroySingleton(); - UI::UIManager::DestroySingleton(); + UI::UIManager::destroySingleton(); - Graphics::cGL::DestroySingleton(); + Graphics::cGL::destroySingleton(); - ShaderProgramManager::DestroySingleton(); + ShaderProgramManager::destroySingleton(); - PackManager::DestroySingleton(); + PackManager::destroySingleton(); - Log::DestroySingleton(); + Log::destroySingleton(); - HaikuTTF::hkFontManager::DestroySingleton(); + HaikuTTF::hkFontManager::destroySingleton(); #ifdef EE_SSL_SUPPORT Network::SSL::SSLSocket::End(); @@ -171,7 +171,7 @@ EE::Window::Window * Engine::CreateWindow( WindowSettings Settings, ContextSetti if ( NULL != mWindow ) { Settings.Backend = mWindow->GetWindowInfo()->WindowConfig.Backend; } else { - mMainThreadId = Thread::GetCurrentThreadId(); + mMainThreadId = Thread::getCurrentThreadId(); } switch ( Settings.Backend ) { @@ -271,18 +271,18 @@ Uint32 Engine::GetDefaultBackend() const { WindowSettings Engine::CreateWindowSettings( IniFile * ini, std::string iniKeyName ) { eeASSERT ( NULL != ini ); - ini->ReadFile(); + ini->readFile(); - int Width = ini->GetValueI( iniKeyName, "Width", 800 ); - int Height = ini->GetValueI( iniKeyName, "Height", 600 ); - int BitColor = ini->GetValueI( iniKeyName, "BitColor", 32); - bool Windowed = ini->GetValueB( iniKeyName, "Windowed", true ); - bool Resizeable = ini->GetValueB( iniKeyName, "Resizeable", true ); + int Width = ini->getValueI( iniKeyName, "Width", 800 ); + int Height = ini->getValueI( iniKeyName, "Height", 600 ); + int BitColor = ini->getValueI( iniKeyName, "BitColor", 32); + bool Windowed = ini->getValueB( iniKeyName, "Windowed", true ); + bool Resizeable = ini->getValueB( iniKeyName, "Resizeable", true ); - std::string Backend = ini->GetValue( iniKeyName, "Backend", "" ); + std::string Backend = ini->getValue( iniKeyName, "Backend", "" ); Uint32 WinBackend = GetDefaultBackend(); - String::ToLowerInPlace( Backend ); + String::toLowerInPlace( Backend ); if ( "sdl2" == Backend ) WinBackend = WindowBackend::SDL2; else if ( "sdl" == Backend ) WinBackend = WindowBackend::SDL; @@ -296,8 +296,8 @@ WindowSettings Engine::CreateWindowSettings( IniFile * ini, std::string iniKeyNa if ( Resizeable ) Style |= WindowStyle::Resize; - std::string Icon = ini->GetValue( iniKeyName, "WinIcon", "" ); - std::string Caption = ini->GetValue( iniKeyName, "WinCaption", "" ); + std::string Icon = ini->getValue( iniKeyName, "WinIcon", "" ); + std::string Caption = ini->getValue( iniKeyName, "WinCaption", "" ); WindowSettings WinSettings( Width, Height, Caption, Style, WinBackend, BitColor, Icon ); @@ -320,12 +320,12 @@ WindowSettings Engine::CreateWindowSettings( std::string iniPath, std::string in ContextSettings Engine::CreateContextSettings( IniFile * ini, std::string iniKeyName ) { eeASSERT ( NULL != ini ); - ini->ReadFile(); + ini->readFile(); - bool VSync = ini->GetValueB( iniKeyName, "VSync", true ); - std::string GLVersion = ini->GetValue( iniKeyName, "GLVersion", "0" ); + bool VSync = ini->getValueB( iniKeyName, "VSync", true ); + std::string GLVersion = ini->getValue( iniKeyName, "GLVersion", "0" ); - String::ToLowerInPlace( GLVersion ); + String::toLowerInPlace( GLVersion ); EEGL_version GLVer; if ( "3" == GLVersion || "opengl 3" == GLVersion || "gl3" == GLVersion || "opengl3" == GLVersion ) GLVer = GLv_3; @@ -338,9 +338,9 @@ ContextSettings Engine::CreateContextSettings( IniFile * ini, std::string iniKey else if ( "2" == GLVersion || "opengl 2" == GLVersion || "gl2" == GLVersion || "gl 2" == GLVersion ) GLVer = GLv_2; else GLVer = GLv_default; - bool doubleBuffering = ini->GetValueB( iniKeyName, "DoubleBuffering", true ); - int depthBufferSize = ini->GetValueI( iniKeyName, "DepthBufferSize", 24 ); - int stencilBufferSize = ini->GetValueI( iniKeyName, "StencilBufferSize", 1 ); + bool doubleBuffering = ini->getValueB( iniKeyName, "DoubleBuffering", true ); + int depthBufferSize = ini->getValueI( iniKeyName, "DepthBufferSize", 24 ); + int stencilBufferSize = ini->getValueI( iniKeyName, "StencilBufferSize", 1 ); return ContextSettings( VSync, GLVer, doubleBuffering, depthBufferSize, stencilBufferSize ); } diff --git a/src/eepp/window/input.cpp b/src/eepp/window/input.cpp index 567c625d7..f7033f694 100644 --- a/src/eepp/window/input.cpp +++ b/src/eepp/window/input.cpp @@ -49,7 +49,7 @@ void Input::ProcessEvent( InputEvent * Event ) { if ( Event->key.keysym.mod != eeINDEX_NOT_FOUND ) mInputMod = Event->key.keysym.mod; - BitOp::WriteBitKey( &mKeysDown [ Event->key.keysym.sym / 8 ], Event->key.keysym.sym % 8, 1 ); + BitOp::writeBitKey( &mKeysDown [ Event->key.keysym.sym / 8 ], Event->key.keysym.sym % 8, 1 ); break; } case InputEvent::KeyUp: @@ -57,8 +57,8 @@ void Input::ProcessEvent( InputEvent * Event ) { if ( Event->key.keysym.sym > EE_KEYS_NUM ) break; - BitOp::WriteBitKey( &mKeysDown [ Event->key.keysym.sym / 8 ], Event->key.keysym.sym % 8, 0 ); - BitOp::WriteBitKey( &mKeysUp [ Event->key.keysym.sym / 8 ], Event->key.keysym.sym % 8, 1 ); + BitOp::writeBitKey( &mKeysDown [ Event->key.keysym.sym / 8 ], Event->key.keysym.sym % 8, 0 ); + BitOp::writeBitKey( &mKeysUp [ Event->key.keysym.sym / 8 ], Event->key.keysym.sym % 8, 1 ); break; } case InputEvent::MouseMotion: @@ -99,7 +99,7 @@ void Input::ProcessEvent( InputEvent * Event ) { // I know this is ugly, but i'm too lazy to fix it, it works... if ( Event->button.button == EE_BUTTON_LEFT ) { mLastButtonLeftClicked = mLastButtonLeftClick; - mLastButtonLeftClick = Sys::GetTicks(); + mLastButtonLeftClick = Sys::getTicks(); mTClick = mLastButtonLeftClick - mLastButtonLeftClicked; @@ -110,7 +110,7 @@ void Input::ProcessEvent( InputEvent * Event ) { } } else if ( Event->button.button == EE_BUTTON_RIGHT ) { mLastButtonRightClicked = mLastButtonRightClick; - mLastButtonRightClick = Sys::GetTicks(); + mLastButtonRightClick = Sys::getTicks(); mTClick = mLastButtonRightClick - mLastButtonRightClicked; @@ -121,7 +121,7 @@ void Input::ProcessEvent( InputEvent * Event ) { } } else if( Event->button.button == EE_BUTTON_MIDDLE ) { mLastButtonMiddleClicked = mLastButtonMiddleClick; - mLastButtonMiddleClick = Sys::GetTicks(); + mLastButtonMiddleClick = Sys::getTicks(); mTClick = mLastButtonMiddleClick - mLastButtonMiddleClicked; @@ -227,19 +227,19 @@ void Input::ResetFingerWasDown() { } bool Input::IsKeyDown( const EE_KEY& Key ) { - return 0 != BitOp::ReadBitKey( &mKeysDown[ Key / 8 ], Key % 8 ); + return 0 != BitOp::readBitKey( &mKeysDown[ Key / 8 ], Key % 8 ); } bool Input::IsKeyUp( const EE_KEY& Key ) { - return 0 != BitOp::ReadBitKey( &mKeysUp[ Key / 8 ], Key % 8 ); + return 0 != BitOp::readBitKey( &mKeysUp[ Key / 8 ], Key % 8 ); } void Input::InjectKeyDown( const EE_KEY& Key ) { - BitOp::WriteBitKey( &mKeysDown [ Key / 8 ], Key % 8, 1 ); + BitOp::writeBitKey( &mKeysDown [ Key / 8 ], Key % 8, 1 ); } void Input::InjectKeyUp( const EE_KEY& Key ) { - BitOp::WriteBitKey( &mKeysUp [ Key / 8 ], Key % 8, 1 ); + BitOp::writeBitKey( &mKeysUp [ Key / 8 ], Key % 8, 1 ); } void Input::InjectButtonPress( const Uint32& Button ) { diff --git a/src/eepp/window/inputhelper.cpp b/src/eepp/window/inputhelper.cpp index c4e3fe5a6..af59e32d2 100644 --- a/src/eepp/window/inputhelper.cpp +++ b/src/eepp/window/inputhelper.cpp @@ -9,7 +9,7 @@ Uint32 eeConvertKeyCharacter( const Uint32& KeyCode, const Uint16& Unicode, cons value = Unicode; } - if ( String::IsCharacter( value ) ) { + if ( String::isCharacter( value ) ) { return value; } diff --git a/src/eepp/window/inputtextbuffer.cpp b/src/eepp/window/inputtextbuffer.cpp index 133d742ab..f2c34926f 100755 --- a/src/eepp/window/inputtextbuffer.cpp +++ b/src/eepp/window/inputtextbuffer.cpp @@ -58,7 +58,7 @@ InputTextBuffer::InputTextBuffer( EE::Window::Window * window ) : InputTextBuffer::~InputTextBuffer() { if ( 0 != mCallback && - Engine::ExistsSingleton() && + Engine::existsSingleton() && Engine::instance()->ExistsWindow( mWindow ) ) { mWindow->GetInput()->PopCallback( mCallback ); @@ -83,7 +83,7 @@ void InputTextBuffer::PromptToLeftFirstNoChar() { if ( mPromptPos - 2 > 0 ) { for ( Int32 i = mPromptPos - 2; i > 0; i-- ) { - if ( !String::IsLetter( mText[i] ) && !String::IsNumber( mText[i] ) && '\n' != mText[i] ) { + if ( !String::isLetter( mText[i] ) && !String::isNumber( mText[i] ) && '\n' != mText[i] ) { mPromptPos = i + 1; break; } else if ( i - 1 == 0 ) { @@ -105,7 +105,7 @@ void InputTextBuffer::PromptToRightFirstNoChar() { return; for ( Int32 i = mPromptPos; i < s; i++ ) { - if ( !String::IsLetter( mText[i] ) && !String::IsNumber( mText[i] ) && '\n' != mText[i] ) { + if ( !String::isLetter( mText[i] ) && !String::isNumber( mText[i] ) && '\n' != mText[i] ) { mPromptPos = i + 1; break; } else if ( i + 1 == s ) { @@ -144,7 +144,7 @@ void InputTextBuffer::EraseToPrevNoChar() { } c = mText[ mPromptPos - 1 ]; - } while ( String::IsLetter( c ) || String::IsNumber( c ) ); + } while ( String::isLetter( c ) || String::isNumber( c ) ); ResetSelection(); @@ -167,7 +167,7 @@ void InputTextBuffer::EraseToNextNoChar() { } else { break; } - } while ( String::IsLetter( c ) || String::IsNumber( c ) ); + } while ( String::isLetter( c ) || String::isNumber( c ) ); if ( tPromptPos <= size ) { String iniStr( mText.substr( 0, mPromptPos ) ); @@ -191,10 +191,10 @@ bool InputTextBuffer::IsIgnoredChar( const Uint32& c ) { } bool InputTextBuffer::ValidChar( const Uint32& c ) { - if ( CanAdd() && String::IsCharacter( c ) ) { + if ( CanAdd() && String::isCharacter( c ) ) { bool Ignored = false; - if ( AllowOnlyNumbers() && !String::IsNumber( c, AllowDotsInNumbers() ) ) { + if ( AllowOnlyNumbers() && !String::isNumber( c, AllowDotsInNumbers() ) ) { Ignored = true; } @@ -221,16 +221,16 @@ void InputTextBuffer::TryAddChar( const Uint32& c ) { mText += c; mPromptPos = (int)mText.size(); } else { - String::InsertChar( mText, mPromptPos, c ); + String::insertChar( mText, mPromptPos, c ); mPromptPos++; } } } else { - if ( CanAdd() && String::IsCharacter(c) ) { + if ( CanAdd() && String::isCharacter(c) ) { Input * Input = mWindow->GetInput(); if ( !Input->MetaPressed() && !Input->AltPressed() && !Input->ControlPressed() ) { - if ( !( AllowOnlyNumbers() && !String::IsNumber( c, AllowDotsInNumbers() ) ) ) { + if ( !( AllowOnlyNumbers() && !String::isNumber( c, AllowDotsInNumbers() ) ) ) { mText += c; } } @@ -279,7 +279,7 @@ void InputTextBuffer::Update( InputEvent* Event ) { if ( ( Event->key.keysym.mod & KEYMOD_CTRL ) && ( Event->key.keysym.sym == KEY_C || Event->key.keysym.sym == KEY_X ) ) { Int32 init = eemin( mSelCurInit, mSelCurEnd ); Int32 end = eemax( mSelCurInit, mSelCurEnd ); - std::string clipStr( mText.substr( init, end - init ).ToUtf8() ); + std::string clipStr( mText.substr( init, end - init ).toUtf8() ); mWindow->GetClipboard()->SetText( clipStr ); } else if ( ( Event->key.keysym.sym >= KEY_UP && Event->key.keysym.sym <= KEY_END ) && !( Event->key.keysym.sym >= KEY_NUMLOCK && Event->key.keysym.sym <= KEY_COMPOSE ) @@ -375,7 +375,7 @@ void InputTextBuffer::Update( InputEvent* Event ) { } } else if ( ( c == KEY_RETURN || c == KEY_KP_ENTER ) ) { if ( SupportNewLine() && CanAdd() ) { - String::InsertChar( mText, mPromptPos, '\n' ); + String::insertChar( mText, mPromptPos, '\n' ); mPromptPos++; @@ -683,11 +683,11 @@ bool InputTextBuffer::ChangedSinceLastUpdate() { } void InputTextBuffer::ChangedSinceLastUpdate( const bool& Changed ) { - BitOp::WriteBitKey( &mFlags, INPUT_TB_CHANGE_SINCE_LAST_UPDATE, Changed == true ); + BitOp::writeBitKey( &mFlags, INPUT_TB_CHANGE_SINCE_LAST_UPDATE, Changed == true ); } void InputTextBuffer::AutoPrompt( const bool& set ) { - BitOp::WriteBitKey( &mFlags, INPUT_TB_PROMPT_AUTO_POS, set == true ); + BitOp::writeBitKey( &mFlags, INPUT_TB_PROMPT_AUTO_POS, set == true ); if ( set ) { mPromptPos = (int)mText.size(); @@ -703,7 +703,7 @@ bool InputTextBuffer::Active() const { } void InputTextBuffer::Active( const bool& Active ) { - BitOp::WriteBitKey( &mFlags, INPUT_TB_ACTIVE, Active == true ); + BitOp::writeBitKey( &mFlags, INPUT_TB_ACTIVE, Active == true ); } bool InputTextBuffer::SupportNewLine() { @@ -711,12 +711,12 @@ bool InputTextBuffer::SupportNewLine() { } void InputTextBuffer::SupportNewLine( const bool& SupportNewLine ) { - BitOp::WriteBitKey( &mFlags, INPUT_TB_SUPPORT_NEW_LINE, SupportNewLine == true ); + BitOp::writeBitKey( &mFlags, INPUT_TB_SUPPORT_NEW_LINE, SupportNewLine == true ); } void InputTextBuffer::AllowOnlyNumbers( const bool& onlynums, const bool& allowdots ) { - BitOp::WriteBitKey( &mFlags, INPUT_TB_ALLOW_ONLY_NUMBERS, onlynums == true ); - BitOp::WriteBitKey( &mFlags, INPUT_TB_ALLOW_DOT_IN_NUMBERS, allowdots == true ); + BitOp::writeBitKey( &mFlags, INPUT_TB_ALLOW_ONLY_NUMBERS, onlynums == true ); + BitOp::writeBitKey( &mFlags, INPUT_TB_ALLOW_DOT_IN_NUMBERS, allowdots == true ); } bool InputTextBuffer::AllowOnlyNumbers() { @@ -732,11 +732,11 @@ bool InputTextBuffer::SupportFreeEditing() const { } void InputTextBuffer::SupportFreeEditing( const bool& Support ) { - BitOp::WriteBitKey( &mFlags, INPUT_TB_FREE_EDITING, Support == true ); + BitOp::writeBitKey( &mFlags, INPUT_TB_FREE_EDITING, Support == true ); } void InputTextBuffer::SupportCopyPaste( const bool& support ) { - BitOp::WriteBitKey( &mFlags, INPUT_TB_SUPPORT_COPY_PASTE, support == true ); + BitOp::writeBitKey( &mFlags, INPUT_TB_SUPPORT_COPY_PASTE, support == true ); } bool InputTextBuffer::SupportCopyPaste() { @@ -748,7 +748,7 @@ bool InputTextBuffer::TextSelectionEnabled() { } void InputTextBuffer::TextSelectionEnabled( const bool& enabled ) { - BitOp::WriteBitKey( &mFlags, INPUT_TB_TEXT_SELECTION_ENABLED, enabled == true ); + BitOp::writeBitKey( &mFlags, INPUT_TB_TEXT_SELECTION_ENABLED, enabled == true ); } void InputTextBuffer::CursorToEnd() { diff --git a/src/eepp/window/platform/win/cursorwin.cpp b/src/eepp/window/platform/win/cursorwin.cpp index 5f4bd067c..1e2f08110 100644 --- a/src/eepp/window/platform/win/cursorwin.cpp +++ b/src/eepp/window/platform/win/cursorwin.cpp @@ -85,10 +85,10 @@ static BYTE *get_dib_from_bitmap_32(Image *bitmap) { ColorA C = bitmap->GetPixel( x, y ); /* BGR */ - dst[0] = C.B(); - dst[1] = C.G(); - dst[2] = C.R(); - dst[3] = C.A(); + dst[0] = C.b(); + dst[1] = C.g(); + dst[2] = C.r(); + dst[3] = C.a(); dst += 4; } @@ -178,7 +178,7 @@ void CursorWin::Create() { for (x = 0; x < (int)mImage->Width(); x++) { ColorA C = mImage->GetPixel( x, y ); - if ( C.A() != 0 ) { + if ( C.a() != 0 ) { /* Don't touch XOR value */ SetPixel( h_and_dc, x, y, 0 ); } else { diff --git a/src/eepp/window/platform/x11/cursorx11.cpp b/src/eepp/window/platform/x11/cursorx11.cpp index 853572ff6..33aa9d77a 100644 --- a/src/eepp/window/platform/x11/cursorx11.cpp +++ b/src/eepp/window/platform/x11/cursorx11.cpp @@ -58,7 +58,7 @@ void CursorX11::Create() { for ( ix = 0; ix < mImage->Width(); ix++ ) { ColorA C = mImage->GetPixel( ix, iy ); - image->pixels[c++] = ( C.A() << 24 ) | ( C.R() << 16 ) | ( C.G() <<8 ) | ( C.B() ); + image->pixels[c++] = ( C.a() << 24 ) | ( C.r() << 16 ) | ( C.g() <<8 ) | ( C.b() ); } } diff --git a/src/eepp/window/window.cpp b/src/eepp/window/window.cpp index 0c3249b57..b675cfe77 100644 --- a/src/eepp/window/window.cpp +++ b/src/eepp/window/window.cpp @@ -171,7 +171,7 @@ const WindowInfo * Window::GetWindowInfo() const { void Window::BackColor( const RGB& Color ) { mWindow.BackgroundColor = Color; - GLi->ClearColor( static_cast( mWindow.BackgroundColor.R() ) / 255.0f, static_cast( mWindow.BackgroundColor.G() ) / 255.0f, static_cast( mWindow.BackgroundColor.B() ) / 255.0f, 255.0f ); + GLi->ClearColor( static_cast( mWindow.BackgroundColor.r() ) / 255.0f, static_cast( mWindow.BackgroundColor.g() ) / 255.0f, static_cast( mWindow.BackgroundColor.b() ) / 255.0f, 255.0f ); } const RGB& Window::BackColor() const { @@ -188,10 +188,10 @@ bool Window::TakeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) File = filepath.substr( filepath.find_last_of("/\\") + 1 ); Ext = File.substr( File.find_last_of(".") + 1 ); - if ( FileSystem::IsDirectory( filepath ) || !Ext.size() ) + if ( FileSystem::isDirectory( filepath ) || !Ext.size() ) CreateNewFile = true; } else { - filepath = Sys::GetProcessPath(); + filepath = Sys::getProcessPath(); CreateNewFile = true; } @@ -200,17 +200,17 @@ bool Window::TakeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) Int32 FileNum = 1; std::string TmpPath = filepath, Ext; - if ( !FileSystem::IsDirectory( filepath ) ) - FileSystem::MakeDir( filepath ); + if ( !FileSystem::isDirectory( filepath ) ) + FileSystem::makeDir( filepath ); Ext = "." + Image::SaveTypeToExtension( Format ); while ( !find && FileNum < 10000 ) { - TmpPath = String::StrFormated( "%s%05d%s", filepath.c_str(), FileNum, Ext.c_str() ); + TmpPath = String::strFormated( "%s%05d%s", filepath.c_str(), FileNum, Ext.c_str() ); FileNum++; - if ( !FileSystem::FileExists( TmpPath ) ) + if ( !FileSystem::fileExists( TmpPath ) ) find = true; if ( FileNum == 10000 && find == false ) @@ -219,10 +219,10 @@ bool Window::TakeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) return 0 != SOIL_save_screenshot(TmpPath.c_str(), Format, 0, 0, mWindow.WindowConfig.Width, mWindow.WindowConfig.Height ); } else { - std::string Direc = FileSystem::FileRemoveFileName( filepath ); + std::string Direc = FileSystem::fileRemoveFileName( filepath ); - if ( !FileSystem::IsDirectory( Direc ) ) - FileSystem::MakeDir( Direc ); + if ( !FileSystem::isDirectory( Direc ) ) + FileSystem::makeDir( Direc ); return 0 != SOIL_save_screenshot(filepath.c_str(), Format, 0, 0, mWindow.WindowConfig.Width, mWindow.WindowConfig.Height ); } @@ -261,14 +261,14 @@ void Window::GetElapsedTime() { mFrameData.FrameElapsed = eeNew( Clock, () ); } - mFrameData.ElapsedTime = mFrameData.FrameElapsed->Elapsed(); + mFrameData.ElapsedTime = mFrameData.FrameElapsed->elapsed(); } void Window::CalculateFps() { - if ( Sys::GetTicks() - mFrameData.FPS.LastCheck >= 1000 ) { + if ( Sys::getTicks() - mFrameData.FPS.LastCheck >= 1000 ) { mFrameData.FPS.Current = mFrameData.FPS.Count; mFrameData.FPS.Count = 0; - mFrameData.FPS.LastCheck = Sys::GetTicks(); + mFrameData.FPS.LastCheck = Sys::getTicks(); } mFrameData.FPS.Count++; @@ -277,7 +277,7 @@ void Window::CalculateFps() { void Window::LimitFps() { if ( mFrameData.FPS.Limit > 0 ) { mFrameData.FPS.Error = 0; - double RemainT = 1000.0 / mFrameData.FPS.Limit - ( mFrameData.ElapsedTime.AsMilliseconds() * 0.1f ); + double RemainT = 1000.0 / mFrameData.FPS.Limit - ( mFrameData.ElapsedTime.asMilliseconds() * 0.1f ); if ( RemainT < 0 ) { mFrameData.FPS.Error = 0; @@ -290,7 +290,7 @@ void Window::LimitFps() { } if ( RemainT > 0 ) { - Sys::Sleep( (Uint32) RemainT ); + Sys::sleep( (Uint32) RemainT ); } } } @@ -377,27 +377,27 @@ void Window::SendVideoResizeCb() { } void Window::LogSuccessfulInit(const std::string& BackendName , const std::string&ProcessPath ) { - std::string msg( "Engine Initialized Succesfully.\n\tVersion: " + Version::GetVersionName() + " (codename: \"" + Version::GetCodename() + "\")" + - "\n\tBuild time: " + Version::GetBuildTime() + - "\n\tOS: " + Sys::GetOSName(true) + - "\n\tArch: " + Sys::GetOSArchitecture() + - "\n\tCPU Cores: " + String::ToStr( Sys::GetCPUCount() ) + - "\n\tProcess Path: " + ( !ProcessPath.empty() ? ProcessPath : Sys::GetProcessPath() ) + - "\n\tDisk Free Space: " + String::ToStr( FileSystem::SizeToString( Sys::GetDiskFreeSpace( Sys::GetProcessPath() ) ) ) + + std::string msg( "Engine Initialized Succesfully.\n\tVersion: " + Version::getVersionName() + " (codename: \"" + Version::getCodename() + "\")" + + "\n\tBuild time: " + Version::getBuildTime() + + "\n\tOS: " + Sys::getOSName(true) + + "\n\tArch: " + Sys::getOSArchitecture() + + "\n\tCPU Cores: " + String::toStr( Sys::getCPUCount() ) + + "\n\tProcess Path: " + ( !ProcessPath.empty() ? ProcessPath : Sys::getProcessPath() ) + + "\n\tDisk Free Space: " + String::toStr( FileSystem::sizeToString( Sys::getDiskFreeSpace( Sys::getProcessPath() ) ) ) + "\n\tWindow/Input Backend: " + BackendName + "\n\tGL Backend: " + GLi->VersionStr() + "\n\tGL Vendor: " + GLi->GetVendor() + "\n\tGL Renderer: " + GLi->GetRenderer() + "\n\tGL Version: " + GLi->GetVersion() + "\n\tGL Shading Language Version: " + GLi->GetShadingLanguageVersion() + - "\n\tResolution: " + String::ToStr( GetWidth() ) + "x" + String::ToStr( GetHeight() ) + + "\n\tResolution: " + String::toStr( GetWidth() ) + "x" + String::toStr( GetHeight() ) + "\n\tGL extensions supported:\n\t\t" + GLi->GetExtensions() ); #ifndef EE_SILENT eePRINTL( msg.c_str() ); #else - Log::instance()->Write( msg ); + Log::instance()->write( msg ); #endif } diff --git a/src/examples/empty_window/empty_window.cpp b/src/examples/empty_window/empty_window.cpp index 6e3d9e890..c3daeeabe 100644 --- a/src/examples/empty_window/empty_window.cpp +++ b/src/examples/empty_window/empty_window.cpp @@ -1,6 +1,8 @@ #include - +#include EE::Window::Window * win = NULL; +float circ = 0, circ2 = 0; +int op = 1; void MainLoop() { @@ -22,8 +24,55 @@ void MainLoop() win->Close(); } + circ += win->Elapsed().asMilliseconds() * 0.5f * op; + circ2 += win->Elapsed().asMilliseconds() * 0.75f; + + if ( op == 1 && circ > 340 ) + { + op = -1; + } + else if ( op == -1 && circ < 20 ) + { + op = 1; + } + + Vector2f winCenter( win->GetWidth() * 0.5f, win->GetHeight() * 0.5f ); + + + GLi->Enable(GL_STENCIL_TEST); + GLi->StencilMask(0xFF); + GLi->StencilFunc(GL_NEVER, 1, 0xFF); + GLi->StencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); + + p.DrawCircle( winCenter, 150, 40 ); + + GLi->StencilFunc(GL_EQUAL, 0, 0xFF); + // Draw a circle - p.DrawCircle( Vector2f( win->GetWidth() * 0.5f, win->GetHeight() * 0.5f ), 200, 50 ); + p.DrawArc( winCenter, 200, 40, circ, circ2 ); + + GLi->Disable(GL_STENCIL_TEST); + +/* + GLi->Enable(GL_STENCIL_TEST); + + GLi->StencilFunc(GL_ALWAYS, 1, 1); + GLi->ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); + GLi->StencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); + + p.SetColor( ColorA( 255, 255, 255, 255 ) ); + p.DrawCircle( winCenter, 150, 40 ); + + GLi->StencilFunc(GL_NOTEQUAL, 1, 1); + GLi->StencilOp(GL_KEEP, GL_KEEP, GL_KEEP); + GLi->ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + + // Draw a circle + p.SetColor( ColorA( 0, 255, 0, 150 ) ); + p.DrawArc( winCenter, 200, 40, circ, circ2 ); + + GLi->Disable(GL_STENCIL_TEST); +*/ // Draw frame win->Display(); @@ -40,6 +89,8 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Set window background color win->BackColor( RGB( 50, 50, 50 ) ); + GLi->PolygonMode( ); + // Set the MainLoop function and run it // This is the application loop, it will loop until the window is closed. // This is only a requirement if you want to support Emscripten builds ( WebGL + Canvas ). @@ -52,10 +103,10 @@ EE_MAIN_FUNC int main (int argc, char * argv []) } // Destroy the engine instance. Destroys all the windows and engine singletons. - Engine::DestroySingleton(); + Engine::destroySingleton(); // If was compiled in debug mode it will print the memory manager report - MemoryManager::ShowResults(); + MemoryManager::showResults(); return EXIT_SUCCESS; } diff --git a/src/examples/external_shader/external_shader.cpp b/src/examples/external_shader/external_shader.cpp index 256e2804e..acacaf15e 100644 --- a/src/examples/external_shader/external_shader.cpp +++ b/src/examples/external_shader/external_shader.cpp @@ -197,7 +197,7 @@ void MainLoop() /// Stop the simulation if the window is not visible while ( !win->Visible() ) { imp->Update(); /// To get the real state of the window you need to update the window input - Sys::Sleep( 100 ); /// Sleep 100 ms + Sys::sleep( 100 ); /// Sleep 100 ms } win->Display(); @@ -241,7 +241,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) /// Since fixed-pipeline OpenGL use gl_FrontColor for glColorPointer, we need to replace the color attribute /// This is all to show how it works, in a real world scenario, you will choose to work fixed-pipeline or programmable-pipeline. if ( GLi->Version() == GLv_2 ) { - String::ReplaceAll( fs, "gl_FragColor = dgl_Color", "gl_FragColor = gl_FrontColor" ); + String::replaceAll( fs, "gl_FragColor = dgl_Color", "gl_FragColor = gl_FrontColor" ); } /// Create the new shader program @@ -279,9 +279,9 @@ EE_MAIN_FUNC int main (int argc, char * argv []) eeSAFE_DELETE_ARRAY( colors ); } - Engine::DestroySingleton(); + Engine::destroySingleton(); - MemoryManager::ShowResults(); + MemoryManager::showResults(); return EXIT_SUCCESS; } diff --git a/src/examples/fonts/fonts.cpp b/src/examples/fonts/fonts.cpp index a947ed989..85ec9a750 100644 --- a/src/examples/fonts/fonts.cpp +++ b/src/examples/fonts/fonts.cpp @@ -56,7 +56,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Check if created if ( win->Created() ) { // Get the application path - std::string AppPath = Sys::GetProcessPath(); + std::string AppPath = Sys::getProcessPath(); // Create a new True Type Font TTF = TTFFont::New( "DejaVuSansMonoOutline" ); @@ -87,7 +87,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Load a monospaced texture font from image ( using the texture loader to set the color key ) TextureLoader TexLoader( AppPath + "assets/fonts/conchars.png" ); TexLoader.SetColorKey( RGB(0,0,0) ); - TexLoader.Load();; + TexLoader.load();; TexF2->Load( TexLoader.Id(), 32 ); // Set a text to render @@ -131,10 +131,10 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Destroy the engine instance. Destroys all the windows and engine singletons. // Fonts are autoreleased by the engine - Engine::DestroySingleton(); + Engine::destroySingleton(); // If was compiled in debug mode it will print the memory manager report - MemoryManager::ShowResults(); + MemoryManager::showResults(); return EXIT_SUCCESS; } diff --git a/src/examples/http_request/http_request.cpp b/src/examples/http_request/http_request.cpp index 429e97d48..0e9cada61 100644 --- a/src/examples/http_request/http_request.cpp +++ b/src/examples/http_request/http_request.cpp @@ -28,7 +28,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { request.SetUri("/wiki/Main_Page"); // Creates an async http request - Http::Request asyncRequest( "/wiki/" + Version::GetCodename() ); + Http::Request asyncRequest( "/wiki/" + Version::getCodename() ); http.SendAsyncRequest( cb::Make3( AsyncRequestCallback ), asyncRequest, Seconds( 5 ) ); } else { @@ -55,7 +55,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { } } - MemoryManager::ShowResults(); + MemoryManager::showResults(); return EXIT_SUCCESS; } diff --git a/src/examples/physics/physics.cpp b/src/examples/physics/physics.cpp index f3d228ebc..08b1ba44d 100644 --- a/src/examples/physics/physics.cpp +++ b/src/examples/physics/physics.cpp @@ -540,7 +540,7 @@ void ChangeDemo( int num ) { void PhysicsCreate() { // Initialize the physics engine - PhysicsManager::CreateSingleton(); + PhysicsManager::createSingleton(); mDemo.clear(); @@ -642,9 +642,9 @@ EE_MAIN_FUNC int main (int argc, char * argv []) PhysicsDestroy(); } - Engine::DestroySingleton(); + Engine::destroySingleton(); - MemoryManager::ShowResults(); + MemoryManager::showResults(); return EXIT_SUCCESS; } diff --git a/src/examples/sound/sound.cpp b/src/examples/sound/sound.cpp index 4c29fb420..7a47b26df 100644 --- a/src/examples/sound/sound.cpp +++ b/src/examples/sound/sound.cpp @@ -1,7 +1,7 @@ #include // Get the process path to be used to load the sounds ( it is safer ) -std::string AppPath = Sys::GetProcessPath(); +std::string AppPath = Sys::getProcessPath(); /// Play a sound void PlaySound() { @@ -15,7 +15,7 @@ void PlaySound() { // Display sound informations std::cout << "sound.ogg :" << std::endl; - std::cout << " " << buffer.GetDuration().AsSeconds() << " seconds" << std::endl; + std::cout << " " << buffer.GetDuration().asSeconds() << " seconds" << std::endl; std::cout << " " << buffer.GetSampleRate() << " samples / sec" << std::endl; std::cout << " " << buffer.GetChannelCount() << " channels" << std::endl; @@ -34,7 +34,7 @@ void PlayMusic() { // Display music informations std::cout << "music.ogg :" << std::endl; - std::cout << " " << music.GetDuration().AsSeconds() << " seconds" << std::endl; + std::cout << " " << music.GetDuration().asSeconds() << " seconds" << std::endl; std::cout << " " << music.GetSampleRate() << " samples / sec" << std::endl; std::cout << " " << music.GetChannelCount() << " channels" << std::endl; @@ -44,10 +44,10 @@ void PlayMusic() { // Loop while the music is playing while ( music.State() == Sound::Playing ) { // Leave some CPU time for other processes - Sys::Sleep( 100 ); + Sys::sleep( 100 ); // Display the playing position - std::cout << "\rPlaying... " << music.PlayingOffset().AsSeconds() << " sec "; + std::cout << "\rPlaying... " << music.PlayingOffset().asSeconds() << " sec "; std::cout << std::flush; } @@ -68,7 +68,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) std::cin.ignore(10000, '\n'); // If was compiled in debug mode it will print the memory manager report - MemoryManager::ShowResults(); + MemoryManager::showResults(); return EXIT_SUCCESS; } diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index f016b1a96..0c95d9849 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -96,7 +96,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Check if created if ( win->Created() ) { // Get the application path - std::string AppPath = Sys::GetProcessPath(); + std::string AppPath = Sys::getProcessPath(); // Load the rock texture Uint32 PlanetId = TextureFactory::instance()->Load( AppPath + "assets/sprites/7.png" ); @@ -167,10 +167,10 @@ EE_MAIN_FUNC int main (int argc, char * argv []) eeSAFE_DELETE( Blindy ); // Destroy the engine instance. Destroys all the windows and engine singletons. - Engine::DestroySingleton(); + Engine::destroySingleton(); // If was compiled in debug mode it will print the memory manager report - MemoryManager::ShowResults(); + MemoryManager::showResults(); return EXIT_SUCCESS; } diff --git a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp index d0cc6741c..beae82678 100644 --- a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +++ b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp @@ -93,7 +93,7 @@ void MainLoop() Batch->Draw(); // Add the rotation angle - ang+=win->Elapsed().AsMilliseconds() * 0.1f; + ang+=win->Elapsed().asMilliseconds() * 0.1f; ang = (ang>=360) ? 0 : ang; // Change the scale value @@ -104,7 +104,7 @@ void MainLoop() side = false; scale = 0.5f; } - scale = (!side) ? scale+win->Elapsed().AsMilliseconds() * 0.00025f : scale-win->Elapsed().AsMilliseconds() * 0.00025f; + scale = (!side) ? scale+win->Elapsed().asMilliseconds() * 0.00025f : scale-win->Elapsed().asMilliseconds() * 0.00025f; // Draw frame win->Display(); @@ -160,10 +160,10 @@ EE_MAIN_FUNC int main (int argc, char * argv []) } // Destroy the engine instance. Destroys all the windows and engine singletons. - Engine::DestroySingleton(); + Engine::destroySingleton(); // If was compiled in debug mode it will print the memory manager report - MemoryManager::ShowResults(); + MemoryManager::showResults(); return EXIT_SUCCESS; } diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index 3eb3d0073..a8746530e 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -11,8 +11,8 @@ namespace Demo_Test { void EETest::Init() { EE = Engine::instance(); - Log::instance()->LiveWrite( true ); - Log::instance()->ConsoleOutput( true ); + Log::instance()->liveWrite( true ); + Log::instance()->consoleOutput( true ); DrawBack = false; MultiViewportMode = false; @@ -37,20 +37,20 @@ void EETest::Init() { mShowMenu = NULL; mTerrainUp = true; - MyPath = Sys::GetProcessPath() + "assets/"; + MyPath = Sys::getProcessPath() + "assets/"; IniFile Ini( MyPath + "ee.ini" ); - PartsNum = Ini.GetValueI( "EEPP", "ParticlesNum", 1000 ); - mUseShaders = Ini.GetValueB( "EEPP", "UseShaders", false ); - mJoyEnabled = Ini.GetValueB( "EEPP", "JoystickEnabled", false ); + PartsNum = Ini.getValueI( "EEPP", "ParticlesNum", 1000 ); + mUseShaders = Ini.getValueB( "EEPP", "UseShaders", false ); + mJoyEnabled = Ini.getValueB( "EEPP", "JoystickEnabled", false ); #if defined( EE_PLATFORM_TOUCH ) mJoyEnabled = false; #endif - mMusEnabled = Ini.GetValueB( "EEPP", "Music", false ); - Int32 StartScreen = Ini.GetValueI( "EEPP", "StartScreen", 0 ); + mMusEnabled = Ini.getValueB( "EEPP", "Music", false ); + Int32 StartScreen = Ini.getValueI( "EEPP", "StartScreen", 0 ); WindowSettings WinSettings = EE->CreateWindowSettings( &Ini ); ContextSettings ConSettings = EE->CreateContextSettings( &Ini ); @@ -82,7 +82,7 @@ void EETest::Init() { //InBuf.Start(); InBuf.SupportNewLine( true ); - SetRandomSeed( static_cast( Sys::GetSystemTime() * 1000 ) ); + SetRandomSeed( static_cast( Sys::getSystemTime() * 1000 ) ); LoadTextures(); @@ -135,11 +135,11 @@ void EETest::Init() { PhysicsCreate(); #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN - Launch(); + launch(); #endif } else { - Engine::DestroySingleton(); + Engine::destroySingleton(); exit(0); } @@ -153,7 +153,7 @@ void EETest::CreateUIThemeTextureAtlas() { std::string tgpath( MyPath + "ui/uitheme" ); std::string Path( MyPath + "ui/uitheme" ); - if ( !FileSystem::FileExists( tgpath + EE_TEXTURE_ATLAS_EXTENSION ) ) { + if ( !FileSystem::fileExists( tgpath + EE_TEXTURE_ATLAS_EXTENSION ) ) { TexturePacker tp( 256, 256, true, 2 ); tp.AddTexturesPath( Path ); tp.PackTextures(); @@ -165,26 +165,26 @@ void EETest::CreateUIThemeTextureAtlas() { } void EETest::LoadFonts() { - mFTE.Restart(); + mFTE.restart(); TextureLoader * tl = eeNew( TextureLoader, ( MyPath + "fonts/conchars.png" ) ); tl->SetColorKey( RGB(0,0,0) ); - mFontLoader.Add( eeNew( TextureFontLoader, ( "conchars", tl, (unsigned int)32 ) ) ); - mFontLoader.Add( eeNew( TextureFontLoader, ( "ProggySquareSZ", eeNew( TextureLoader, ( MyPath + "fonts/ProggySquareSZ.png" ) ), MyPath + "fonts/ProggySquareSZ.dat" ) ) ); - mFontLoader.Add( eeNew( TTFFontLoader, ( "arial", MyPath + "fonts/arial.ttf", 12, TTF_STYLE_NORMAL, 256, RGB(255,255,255) ) ) ); - mFontLoader.Add( eeNew( TTFFontLoader, ( "arialb", MyPath + "fonts/arial.ttf", 12, TTF_STYLE_NORMAL, 256, RGB(255,255,255), 1, RGB(0,0,0), true ) ) ); + mFontLoader.add( eeNew( TextureFontLoader, ( "conchars", tl, (unsigned int)32 ) ) ); + mFontLoader.add( eeNew( TextureFontLoader, ( "ProggySquareSZ", eeNew( TextureLoader, ( MyPath + "fonts/ProggySquareSZ.png" ) ), MyPath + "fonts/ProggySquareSZ.dat" ) ) ); + mFontLoader.add( eeNew( TTFFontLoader, ( "arial", MyPath + "fonts/arial.ttf", 12, TTF_STYLE_NORMAL, 256, RGB(255,255,255) ) ) ); + mFontLoader.add( eeNew( TTFFontLoader, ( "arialb", MyPath + "fonts/arial.ttf", 12, TTF_STYLE_NORMAL, 256, RGB(255,255,255), 1, RGB(0,0,0), true ) ) ); - mFontLoader.Load( cb::Make1( this, &EETest::OnFontLoaded ) ); + mFontLoader.load( cb::Make1( this, &EETest::OnFontLoaded ) ); } void EETest::OnFontLoaded( ResourceLoader * ObjLoaded ) { - FF = FontManager::instance()->GetByName( "conchars" ); - FF2 = FontManager::instance()->GetByName( "ProggySquareSZ" ); - TTF = FontManager::instance()->GetByName( "arial" ); - TTFB = FontManager::instance()->GetByName( "arialb" ); + FF = FontManager::instance()->getByName( "conchars" ); + FF2 = FontManager::instance()->getByName( "ProggySquareSZ" ); + TTF = FontManager::instance()->getByName( "arial" ); + TTFB = FontManager::instance()->getByName( "arialb" ); - eePRINTL( "Fonts loading time: %4.3f ms.", mFTE.Elapsed().AsMilliseconds() ); + eePRINTL( "Fonts loading time: %4.3f ms.", mFTE.elapsed().asMilliseconds() ); eeASSERT( TTF != NULL ); eeASSERT( TTFB != NULL ); @@ -192,7 +192,7 @@ void EETest::OnFontLoaded( ResourceLoader * ObjLoaded ) { Con.Create( FF, true ); Con.IgnoreCharOnPrompt( 186 ); // 'º' - mBuda = String::FromUtf8( "El mono ve el pez en el agua y sufre. Piensa que su mundo es el único que existe, el mejor, el real. Sufre porque es bueno y tiene compasión, lo ve y piensa: \"Pobre se está ahogando no puede respirar\". Y lo saca, lo saca y se queda tranquilo, por fin lo salvé. Pero el pez se retuerce de dolor y muere. Por eso te mostré el sueño, es imposible meter el mar en tu cabeza, que es un balde." ); + mBuda = String::fromUtf8( "El mono ve el pez en el agua y sufre. Piensa que su mundo es el único que existe, el mejor, el real. Sufre porque es bueno y tiene compasión, lo ve y piensa: \"Pobre se está ahogando no puede respirar\". Y lo saca, lo saca y se queda tranquilo, por fin lo salvé. Pero el pez se retuerce de dolor y muere. Por eso te mostré el sueño, es imposible meter el mar en tu cabeza, que es un balde." ); CreateUI(); @@ -252,7 +252,7 @@ void EETest::CreateUI() { CreateUIThemeTextureAtlas(); - eePRINTL( "Texture Atlas Loading Time: %4.3f ms.", TE.Elapsed().AsMilliseconds() ); + eePRINTL( "Texture Atlas Loading Time: %4.3f ms.", TE.elapsed().asMilliseconds() ); UIManager::instance()->Init(); //UI_MANAGER_HIGHLIGHT_FOCUS | UI_MANAGER_HIGHLIGHT_OVER @@ -260,9 +260,9 @@ void EETest::CreateUI() { TextureAtlasLoader tgl( MyPath + "ui/uitheme" + EE_TEXTURE_ATLAS_EXTENSION ); - mTheme = UITheme::LoadFromTextureAtlas( eeNew( UIDefaultTheme, ( "uitheme", "uitheme" ) ), TextureAtlasManager::instance()->GetByName( "uitheme" ) ); + mTheme = UITheme::LoadFromTextureAtlas( eeNew( UIDefaultTheme, ( "uitheme", "uitheme" ) ), TextureAtlasManager::instance()->getByName( "uitheme" ) ); - UIThemeManager::instance()->Add( mTheme ); + UIThemeManager::instance()->add( mTheme ); UIThemeManager::instance()->DefaultEffectsEnabled( true ); UIThemeManager::instance()->DefaultFont( TTF ); UIThemeManager::instance()->DefaultTheme( "uitheme" ); @@ -421,7 +421,7 @@ void EETest::CreateUI() { std::vector str(wsize); for ( Int32 i = 1; i <= wsize; i++ ) - str[i-1] = "Test ListBox " + String::ToStr(i) + " testing it right now!"; + str[i-1] = "Test ListBox " + String::toStr(i) + " testing it right now!"; mListBox->AddListBoxItems( str ); } @@ -542,7 +542,7 @@ void EETest::CreateUI() { UITextInput * TxtInput = eeNew( UITextInput, ( TxtInputParams ) ); UIGfx * TxtGfx = eeNew( UIGfx, ( TxtGfxParams ) ); - TxtBox->Text( "Test " + String::ToStr( i+1 ) ); + TxtBox->Text( "Test " + String::toStr( i+1 ) ); Cell->Cell( 0, TxtBox ); Cell->Cell( 1, TxtGfx ); @@ -573,7 +573,7 @@ void EETest::CreateUI() { C = reinterpret_cast ( C->Parent() ); - eePRINTL( "CreateUI time: %4.3f ms.", TE.Elapsed().AsMilliseconds() ); + eePRINTL( "CreateUI time: %4.3f ms.", TE.elapsed().asMilliseconds() ); } void EETest::CreateMapEditor() { @@ -724,7 +724,7 @@ void EETest::ItemClick( const UIEvent * Event ) { } void EETest::OnValueChange( const UIEvent * Event ) { - mTextBoxValue->Text( "Scroll Value:\n" + String::ToStr( mScrollBar->Value() ) ); + mTextBoxValue->Text( "Scroll Value:\n" + String::toStr( mScrollBar->Value() ) ); mProgressBar->Progress( mScrollBar->Value() * 100.f ); } @@ -774,7 +774,7 @@ void EETest::ButtonClick( const UIEvent * Event ) { Gfx->StartMovement( Vector2i( Math::Randi( 0, mWindow->GetWidth() ), -64 ), Vector2i( Math::Randi( 0, mWindow->GetWidth() ), mWindow->GetHeight() + 64 ), Milliseconds( 2500 ) ); Gfx->CloseFadeOut( Milliseconds( 3500 ) ); - mListBox->AddListBoxItem( "Test ListBox " + String::ToStr( mListBox->Count() + 1 ) + " testing it right now!" ); + mListBox->AddListBoxItem( "Test ListBox " + String::toStr( mListBox->Count() + 1 ) + " testing it right now!" ); } } @@ -794,11 +794,11 @@ void EETest::CmdSetPartsNum ( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; - bool Res = String::FromString( tInt, params[1] ); + bool Res = String::fromString( tInt, params[1] ); if ( Res && ( tInt >= 0 && tInt <= 100000 ) ) { PS[2].Create( PSE_WormHole, tInt, TN[5], Vector2f( mWindow->GetWidth() * 0.5f, mWindow->GetHeight() * 0.5f ), 32, true ); - Con.PushText( "Wormhole Particles Number Changed to: " + String::ToStr(tInt) ); + Con.PushText( "Wormhole Particles Number Changed to: " + String::toStr(tInt) ); } else Con.PushText( "Valid parameters are between 0 and 100000 (0 = no limit)." ); } @@ -821,49 +821,49 @@ void EETest::LoadTextures() { Engine::instance()->EnableSharedGLContext(); #endif - PakTest->Open( MyPath + "test.zip" ); + PakTest->open( MyPath + "test.zip" ); - std::vector files = PakTest->GetFileList(); + std::vector files = PakTest->getFileList(); for ( i = 0; i < files.size(); i++ ) { std::string name( files[i] ); - if ( "jpg" == FileSystem::FileExtension( name ) ) { - mResLoad.Add( eeNew( TextureLoader, ( PakTest, name ) ) ); + if ( "jpg" == FileSystem::fileExtension( name ) ) { + mResLoad.add( eeNew( TextureLoader, ( PakTest, name ) ) ); } } #endif - mResLoad.Add( eeNew( SoundLoader, ( &SndMng, "mysound", MyPath + "sounds/sound.ogg" ) ) ); + mResLoad.add( eeNew( SoundLoader, ( &SndMng, "mysound", MyPath + "sounds/sound.ogg" ) ) ); - mResLoad.Load( cb::Make1( this, &EETest::OnTextureLoaded ) ); + mResLoad.load( cb::Make1( this, &EETest::OnTextureLoaded ) ); TN.resize(12); TNP.resize(12); for ( i = 0; i <= 6; i++ ) { - TN[i] = TF->Load( MyPath + "sprites/" + String::ToStr(i+1) + ".png", (i+1) == 7 ? true : false, ( (i+1) == 4 ) ? CLAMP_REPEAT : CLAMP_TO_EDGE ); + TN[i] = TF->Load( MyPath + "sprites/" + String::toStr(i+1) + ".png", (i+1) == 7 ? true : false, ( (i+1) == 4 ) ? CLAMP_REPEAT : CLAMP_TO_EDGE ); TNP[i] = TF->GetTexture( TN[i] ); } Tiles.resize(10); TextureAtlasLoader tgl( MyPath + "atlases/tiles.eta" ); - TextureAtlas * SG = TextureAtlasManager::instance()->GetByName( "tiles" ); + TextureAtlas * SG = TextureAtlasManager::instance()->getByName( "tiles" ); if ( NULL != SG ) { for ( i = 0; i < 6; i++ ) { - Tiles[i] = SG->GetByName( String::ToStr( i+1 ) ); + Tiles[i] = SG->getByName( String::toStr( i+1 ) ); } - Tiles[6] = SG->Add( TF->Load( MyPath + "sprites/objects/1.png" ), "7" ); + Tiles[6] = SG->add( TF->Load( MyPath + "sprites/objects/1.png" ), "7" ); #ifdef EE_GLES Image tImg( MyPath + "sprites/objects/2.png", 4 ); tImg.CreateMaskFromColor( ColorA(0,0,0,255), 0 ); Tiles[7] = SG->Add( TF->LoadFromPixels( tImg.GetPixelsPtr(), tImg.Width(), tImg.Height(), tImg.Channels() ), "8" ); #else - Tiles[7] = SG->Add( TF->Load( MyPath + "sprites/objects/2.png" ), "8" ); + Tiles[7] = SG->add( TF->Load( MyPath + "sprites/objects/2.png" ), "8" ); Tiles[7]->GetTexture()->CreateMaskFromColor( ColorA(0,0,0,255), 0 ); #endif } @@ -893,10 +893,10 @@ void EETest::LoadTextures() { for ( x = 0; x < w; x++) { ColorA C = Tex->GetPixel(x, y); - if ( C.R() > 200 && C.G() > 200 && C.B() > 200 ) - Tex->SetPixel(x, y, ColorA( Math::Randi(0, 255), Math::Randi(0, 255), Math::Randi(0, 255), C.A() ) ); + if ( C.r() > 200 && C.g() > 200 && C.b() > 200 ) + Tex->SetPixel(x, y, ColorA( Math::Randi(0, 255), Math::Randi(0, 255), Math::Randi(0, 255), C.a() ) ); else - Tex->SetPixel(x, y, ColorA( Math::Randi(200, 255), Math::Randi(200, 255), Math::Randi(200, 255), C.A() ) ); + Tex->SetPixel(x, y, ColorA( Math::Randi(200, 255), Math::Randi(200, 255), Math::Randi(200, 255), C.a() ) ); } } @@ -925,10 +925,10 @@ void EETest::LoadTextures() { mBlindy.AddFramesByPattern( "rn" ); mBlindy.Position( 320.f, 0.f ); - mBoxSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->Add( eeNew( SubTexture, ( TN[3], "ilmare" ) ) ) ) ); - mCircleSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->Add( eeNew( SubTexture, ( TN[1], "thecircle" ) ) ) ) ); + mBoxSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->add( eeNew( SubTexture, ( TN[3], "ilmare" ) ) ) ) ); + mCircleSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->add( eeNew( SubTexture, ( TN[1], "thecircle" ) ) ) ) ); - eePRINTL( "Textures loading time: %4.3f ms.", TE.Elapsed().AsMilliseconds() ); + eePRINTL( "Textures loading time: %4.3f ms.", TE.elapsed().asMilliseconds() ); Map.Load( MyPath + "maps/test.eem" ); Map.DrawGrid( false ); @@ -936,23 +936,23 @@ void EETest::LoadTextures() { Map.DrawBackground( false ); Map.ViewSize( mWindow->Size() ); - eePRINTL( "Map creation time: %4.3f ms.", TE.Elapsed().AsMilliseconds() ); + eePRINTL( "Map creation time: %4.3f ms.", TE.elapsed().asMilliseconds() ); } -void EETest::Run() { +void EETest::run() { ParticlesThread(); } void EETest::ParticlesThread() { while ( mWindow->Running() ) { UpdateParticles(); - Sys::Sleep(10); + Sys::sleep(10); } } void EETest::UpdateParticles() { if ( MultiViewportMode || Screen == 2 ) { - PSElapsed = cElapsed.Elapsed(); + PSElapsed = cElapsed.elapsed(); for ( Uint8 i = 0; i < PS.size(); i++ ) PS[i].Update( PSElapsed ); @@ -965,7 +965,7 @@ void EETest::Screen1() { } void EETest::Screen2() { - if ( mResLoad.IsLoaded() ) { + if ( mResLoad.isLoaded() ) { Texture * TexLoaded = TF->GetByName( "1.jpg" ); if ( NULL != TexLoaded ) @@ -1012,7 +1012,7 @@ void EETest::Screen2() { Float PlanetX = HWidth - TNP[6]->Width() * 0.5f; Float PlanetY = HHeight - TNP[6]->Height() * 0.5f; - ang+=et.AsMilliseconds() * 0.1f; + ang+=et.asMilliseconds() * 0.1f; ang = (ang>=360) ? 0 : ang; if (scale>=1.5f) { @@ -1022,7 +1022,7 @@ void EETest::Screen2() { side = false; scale = 0.5f; } - scale = (!side) ? scale+et.AsMilliseconds() * 0.00025f : scale-et.AsMilliseconds() * 0.00025f; + scale = (!side) ? scale+et.asMilliseconds() * 0.00025f : scale-et.asMilliseconds() * 0.00025f; if ( mUseShaders ) { mBlurFactor = ( 1.5f * 0.01f ) - ( scale * 0.01f ); @@ -1040,7 +1040,7 @@ void EETest::Screen2() { TNP[3]->Draw( HWidth - 128, HHeight, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICAL); TNP[3]->Draw( HWidth, HHeight, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICALNEGATIVE); - alpha = (!aside) ? alpha+et.AsMilliseconds() * 0.1f : alpha-et.AsMilliseconds() * 0.1f; + alpha = (!aside) ? alpha+et.asMilliseconds() * 0.1f : alpha-et.asMilliseconds() * 0.1f; if (alpha>=255) { aside = true; alpha = 255; @@ -1084,7 +1084,7 @@ void EETest::Screen2() { PR.DrawQuad( CL1.GetQuad() ); #endif - Ang = Ang + mWindow->Elapsed().AsMilliseconds() * 0.1f; + Ang = Ang + mWindow->Elapsed().asMilliseconds() * 0.1f; if (Ang > 360.f) Ang = 1.f; if ( ShowParticles ) @@ -1141,7 +1141,7 @@ void EETest::Screen3() { AnimVal = 0.5f; AnimSide = false; } - AnimVal = (!AnimSide) ? AnimVal+et.AsMilliseconds() * 0.1f : AnimVal-et.AsMilliseconds() * 0.1f; + AnimVal = (!AnimSide) ? AnimVal+et.asMilliseconds() * 0.1f : AnimVal-et.asMilliseconds() * 0.1f; Batch.SetTexture( TNP[3] ); Batch.LineLoopBegin(); @@ -1187,25 +1187,25 @@ void EETest::Render() { HWidth = mWindow->GetWidth() * 0.5f; HHeight = mWindow->GetHeight() * 0.5f; - if ( Sys::GetTicks() - lasttick >= 50 ) { - lasttick = Sys::GetTicks(); + if ( Sys::getTicks() - lasttick >= 50 ) { + lasttick = Sys::getTicks(); #ifdef EE_DEBUG - mInfo = String::StrFormated( "EE - FPS: %d Elapsed Time: %4.2f\nMouse X: %d Mouse Y: %d\nTexture Memory Usage: %s\nApp Memory Usage: %s\nApp Peak Memory Usage: %s", + mInfo = String::strFormated( "EE - FPS: %d Elapsed Time: %4.2f\nMouse X: %d Mouse Y: %d\nTexture Memory Usage: %s\nApp Memory Usage: %s\nApp Peak Memory Usage: %s", mWindow->FPS(), - et.AsMilliseconds(), + et.asMilliseconds(), (Int32)Mouse.x, (Int32)Mouse.y, - FileSystem::SizeToString( TF->MemorySize() ).c_str(), - FileSystem::SizeToString( (Uint32)MemoryManager::GetTotalMemoryUsage() ).c_str(), - FileSystem::SizeToString( (Uint32)MemoryManager::GetPeakMemoryUsage() ).c_str() + FileSystem::sizeToString( TF->MemorySize() ).c_str(), + FileSystem::sizeToString( (Uint32)MemoryManager::getTotalMemoryUsage() ).c_str(), + FileSystem::sizeToString( (Uint32)MemoryManager::getPeakMemoryUsage() ).c_str() ); #else - mInfo = String::StrFormated( "EE - FPS: %d Elapsed Time: %4.2f\nMouse X: %d Mouse Y: %d\nTexture Memory Usage: %s", + mInfo = String::strFormated( "EE - FPS: %d Elapsed Time: %4.2f\nMouse X: %d Mouse Y: %d\nTexture Memory Usage: %s", mWindow->FPS(), et.AsMilliseconds(), (Int32)Mouse.x, (Int32)Mouse.y, - FileSystem::SizeToString( TF->MemorySize() ).c_str() + FileSystem::sizeToString( TF->MemorySize() ).c_str() ); #endif @@ -1271,7 +1271,7 @@ void EETest::Render() { FF2->Draw( "_", 6.f + FF2->GetTextWidth(), 180.f + (Float)LineNum * (Float)FF2->GetFontHeight() ); } - FF2->SetText( "FPS: " + String::ToStr( mWindow->FPS() ) ); + FF2->SetText( "FPS: " + String::toStr( mWindow->FPS() ) ); FF2->Draw( mWindow->GetWidth() - FF2->GetTextWidth() - 15, 0 ); FF2->SetText( InBuf.Buffer() ); @@ -1399,7 +1399,7 @@ void EETest::Input() { Float aY = Joy->GetAxis( AXIS_Y ); if ( 0 != aX || 0 != aY ) { - double rE = mWindow->Elapsed().AsMilliseconds(); + double rE = mWindow->Elapsed().asMilliseconds(); mAxisX += aX * rE; mAxisY += aY * rE; } @@ -1440,32 +1440,32 @@ void EETest::Input() { Uint8 hat = Joy->GetHat(); if ( HAT_LEFT == hat || HAT_LEFTDOWN == hat || HAT_LEFTUP == hat ) - Map.Move( (mWindow->Elapsed().AsMilliseconds() * 0.2f), 0 ); + Map.Move( (mWindow->Elapsed().asMilliseconds() * 0.2f), 0 ); if ( HAT_RIGHT == hat || HAT_RIGHTDOWN == hat || HAT_RIGHTUP == hat ) - Map.Move( -mWindow->Elapsed().AsMilliseconds() * 0.2f, 0 ); + Map.Move( -mWindow->Elapsed().asMilliseconds() * 0.2f, 0 ); if ( HAT_UP == hat || HAT_LEFTUP == hat || HAT_RIGHTUP == hat ) - Map.Move( 0, (mWindow->Elapsed().AsMilliseconds() * 0.2f) ); + Map.Move( 0, (mWindow->Elapsed().asMilliseconds() * 0.2f) ); if ( HAT_DOWN == hat || HAT_LEFTDOWN == hat || HAT_RIGHTDOWN == hat ) - Map.Move( 0, -mWindow->Elapsed().AsMilliseconds() * 0.2f ); + Map.Move( 0, -mWindow->Elapsed().asMilliseconds() * 0.2f ); } if ( KM->IsKeyDown(KEY_LEFT) ) { - Map.Move( mWindow->Elapsed().AsMilliseconds() * 0.2f, 0 ); + Map.Move( mWindow->Elapsed().asMilliseconds() * 0.2f, 0 ); } if ( KM->IsKeyDown(KEY_RIGHT) ) { - Map.Move( -mWindow->Elapsed().AsMilliseconds() * 0.2f, 0 ); + Map.Move( -mWindow->Elapsed().asMilliseconds() * 0.2f, 0 ); } if ( KM->IsKeyDown(KEY_UP) ) { - Map.Move( 0, mWindow->Elapsed().AsMilliseconds() * 0.2f ); + Map.Move( 0, mWindow->Elapsed().asMilliseconds() * 0.2f ); } if ( KM->IsKeyDown(KEY_DOWN) ) { - Map.Move( 0, -mWindow->Elapsed().AsMilliseconds() * 0.2f ); + Map.Move( 0, -mWindow->Elapsed().asMilliseconds() * 0.2f ); } if ( KM->IsKeyUp(KEY_F8) ) @@ -1505,12 +1505,12 @@ void EETest::Update() { Input(); - mResLoad.Update(); + mResLoad.update(); - if ( mFontLoader.IsLoaded() ) { + if ( mFontLoader.isLoaded() ) { Render(); } else { - mFontLoader.Update(); + mFontLoader.update(); } #if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN @@ -1778,7 +1778,7 @@ void EETest::ChangeDemo( Uint32 num ) { } void EETest::PhysicsCreate() { - PhysicsManager::CreateSingleton(); + PhysicsManager::createSingleton(); PhysicsManager * PM = PhysicsManager::instance(); PhysicsManager::DrawSpaceOptions * DSO = PM->GetDrawOptions(); @@ -1869,7 +1869,7 @@ void EETest::PhysicsDestroy() { } void EETest::End() { - Wait(); + wait(); PhysicsDestroy(); @@ -1881,9 +1881,9 @@ void EETest::End() { eeSAFE_DELETE( mCircleSprite ); eeSAFE_DELETE( PakTest ); - Log::instance()->Save(); + Log::instance()->save(); - Engine::DestroySingleton(); + Engine::destroySingleton(); } } @@ -1895,7 +1895,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { eeDelete( Test ); - MemoryManager::ShowResults(); + MemoryManager::showResults(); return EXIT_SUCCESS; } diff --git a/src/test/eetest.hpp b/src/test/eetest.hpp index 32ace4a2e..f22a6001d 100644 --- a/src/test/eetest.hpp +++ b/src/test/eetest.hpp @@ -11,13 +11,13 @@ class UITest : public UIControlAnim { virtual Uint32 OnMouseEnter( const Vector2i& Pos, const Uint32 Flags ) { if ( 4 == mOldColor.size() ) { - mBackground->Colors( ColorA( mOldColor[0].R(), mOldColor[0].G(), mOldColor[0].B(), 200 ), - ColorA( mOldColor[1].R(), mOldColor[1].G(), mOldColor[1].B(), 200 ), - ColorA( mOldColor[2].R(), mOldColor[2].G(), mOldColor[2].B(), 200 ), - ColorA( mOldColor[3].R(), mOldColor[3].G(), mOldColor[3].B(), 200 ) + mBackground->Colors( ColorA( mOldColor[0].r(), mOldColor[0].g(), mOldColor[0].b(), 200 ), + ColorA( mOldColor[1].r(), mOldColor[1].g(), mOldColor[1].b(), 200 ), + ColorA( mOldColor[2].r(), mOldColor[2].g(), mOldColor[2].b(), 200 ), + ColorA( mOldColor[3].r(), mOldColor[3].g(), mOldColor[3].b(), 200 ) ); } else { - mBackground->Color( ColorA( mOldColor[0].R(), mOldColor[0].G(), mOldColor[0].B(), 200 ) ); + mBackground->Color( ColorA( mOldColor[0].r(), mOldColor[0].g(), mOldColor[0].b(), 200 ) ); } return 1; @@ -127,7 +127,7 @@ class EETest : private Thread { bool DrawBack; Console Con; - virtual void Run(); + virtual void run(); Vector2f Point;