From 5bd65e9fc02ecd2f875ab0da283abb03dc17c0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 8 Sep 2013 19:24:06 -0300 Subject: [PATCH] Some comments and minor things changed. --- include/eepp/window/cengine.hpp | 2 +- include/eepp/window/cwindow.hpp | 4 ++++ src/eepp/base/string.cpp | 9 +++++---- src/eepp/ui/cuitheme.cpp | 6 +++++- src/eepp/window/backend/SDL2/cwindowsdl2.cpp | 4 ++++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/include/eepp/window/cengine.hpp b/include/eepp/window/cengine.hpp index d33e00a06..341ac03e9 100755 --- a/include/eepp/window/cengine.hpp +++ b/include/eepp/window/cengine.hpp @@ -10,7 +10,7 @@ namespace EE { namespace Window { namespace Backend { class cBackend; } } } namespace EE { namespace Window { -/** @brief The window management class. Here the engine start working. (Singleton Class). */ +/** @brief The window management class. Here the engine starts working. (Singleton Class). */ class EE_API cEngine { SINGLETON_DECLARE_HEADERS(cEngine) diff --git a/include/eepp/window/cwindow.hpp b/include/eepp/window/cwindow.hpp index bd4dc901d..f159bdf2c 100644 --- a/include/eepp/window/cwindow.hpp +++ b/include/eepp/window/cwindow.hpp @@ -416,10 +416,14 @@ class EE_API cWindow { virtual std::string GetApkPath(); #endif + /** @return True if the current window support a threaded GL Context. This means that supports OpenGL Shared Contexts ( multithreaded opengl contexts ). + ** Only supported with SDL2 backend.*/ virtual bool IsThreadedGLContext(); + /** Activates the shared GL context in the current thread. */ virtual void SetGLContextThread(); + /** Deactviates the shared GL context in the current thread. */ virtual void UnsetGLContextThread(); protected: friend class cEngine; diff --git a/src/eepp/base/string.cpp b/src/eepp/base/string.cpp index 29a6225e0..3727024d9 100644 --- a/src/eepp/base/string.cpp +++ b/src/eepp/base/string.cpp @@ -134,12 +134,13 @@ void String::StrCopy( char * Dst, const char * Src, eeUint DstSize ) { } Int32 String::StartsWith( const std::string& Start, const std::string Str ) { - Int32 Pos = -1; + Int32 Pos = -1; + Int32 s = (Int32)Start.size(); - if ( Str.size() >= Start.size() ) { - for ( Uint32 i = 0; i < Start.size(); i++ ) { + if ( (Int32)Str.size() >= s ) { + for ( Int32 i = 0; i < s; i++ ) { if ( Start[i] == Str[i] ) { - Pos = (Int32)i; + Pos = i; } else { Pos = -1; break; diff --git a/src/eepp/ui/cuitheme.cpp b/src/eepp/ui/cuitheme.cpp index 8a137bde9..f2c4666e7 100644 --- a/src/eepp/ui/cuitheme.cpp +++ b/src/eepp/ui/cuitheme.cpp @@ -262,9 +262,13 @@ bool cUITheme::SearchFilesInAtlas( cTextureAtlas * SG, std::string Element, Uint break; } } + + if ( Found ) { + break; + } } - // Seach Simple Skin + // Search Simple Skin if ( !IsComplex ) { for ( i = 0; i < cUISkinState::StateCount; i++ ) { ElemName = Element + "_" + cUISkin::GetSkinStateName( i ); diff --git a/src/eepp/window/backend/SDL2/cwindowsdl2.cpp b/src/eepp/window/backend/SDL2/cwindowsdl2.cpp index 0560da812..3d4467eda 100644 --- a/src/eepp/window/backend/SDL2/cwindowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/cwindowsdl2.cpp @@ -92,6 +92,10 @@ cWindowSDL::~cWindowSDL() { SDL_GL_DeleteContext( mGLContext ); } + if ( NULL != mGLContextThread ) { + SDL_GL_DeleteContext( mGLContextThread ); + } + #ifdef EE_USE_WMINFO eeSAFE_DELETE( mWMinfo ); #endif