diff --git a/src/base.hpp b/src/base.hpp index 9768e2823..07a506be6 100644 --- a/src/base.hpp +++ b/src/base.hpp @@ -72,7 +72,7 @@ #endif #ifndef EE_DEBUG - #if defined( DEBUG ) || defined( _DEBUG ) || defined( __DEBUG ) + #if defined( DEBUG ) || defined( _DEBUG ) || defined( __DEBUG ) || defined( __DEBUG__ ) #define EE_DEBUG #endif #endif diff --git a/src/ee.h b/src/ee.h index 45359bd80..23e769c89 100755 --- a/src/ee.h +++ b/src/ee.h @@ -23,7 +23,6 @@ /** @TODO Check for endianness problems, and make EEPP endianness agnostic. - @TODO May be SFML backend ( may be implement as the default build-in backend with sfml-window static linked ). @TODO Support for Android and iOS. @TODO Add Scripting support ( squirrel or angel script ). */ diff --git a/src/graphics/cbatchrenderer.cpp b/src/graphics/cbatchrenderer.cpp index b8dd4f755..bb2ae6310 100755 --- a/src/graphics/cbatchrenderer.cpp +++ b/src/graphics/cbatchrenderer.cpp @@ -120,12 +120,12 @@ void cBatchRenderer::Flush() { Uint32 alloc = sizeof(eeVertex) * NumVertex; - GLi->VertexPointer ( 2, GL_FP , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) , alloc ); + GLi->VertexPointer ( 2, GL_FP , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) , alloc ); GLi->ColorPointer ( 4, GL_UNSIGNED_BYTE , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) + sizeof(eeVector2f) + sizeof(eeTexCoord) , alloc ); if ( NULL != mTexture ) { cTextureFactory::instance()->Bind( mTexture ); - GLi->TexCoordPointer( 2, GL_FP , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) + sizeof(eeVector2f) , alloc ); + GLi->TexCoordPointer( 2, GL_FP , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) + sizeof(eeVector2f) , alloc ); } else { GLi->Disable( GL_TEXTURE_2D ); GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); diff --git a/src/physics/cphysicsmanager.hpp b/src/physics/cphysicsmanager.hpp index a1b656b36..d7aeaeafc 100644 --- a/src/physics/cphysicsmanager.hpp +++ b/src/physics/cphysicsmanager.hpp @@ -16,7 +16,6 @@ class CP_API cPhysicsManager : public tSingleton { class cDrawSpaceOptions { public: cDrawSpaceOptions() : - DrawHash( false ), DrawBBs( false ), DrawShapes( true ), CollisionPointSize( 4.0f ), @@ -24,7 +23,6 @@ class CP_API cPhysicsManager : public tSingleton { LineThickness( 1.5f ) {} - bool DrawHash; bool DrawBBs; bool DrawShapes; cpFloat CollisionPointSize; diff --git a/src/physics/cshape.cpp b/src/physics/cshape.cpp index 0e95e64ab..fa0612911 100644 --- a/src/physics/cshape.cpp +++ b/src/physics/cshape.cpp @@ -169,8 +169,12 @@ cShapeSegment * cShape::GetAsSegment() { void cShape::DrawBB() { #ifdef PHYSICS_RENDERER_ENABLED cPrimitives P; - P.SetColor( eeColorA( 76, 128, 76, 255 ) ); - P.DrawRectangle( eeRectf( mShape->bb.l, mShape->bb.t, mShape->bb.r, mShape->bb.b ), 0.f, 1.f, EE_DRAW_LINE ); + P.SetColor( eeColorA( 76, 128, 76, 255 ) ); + P.ForceDraw( false ); + P.DrawLine( eeVector2f( mShape->bb.l, mShape->bb.t ), eeVector2f( mShape->bb.r, mShape->bb.t ) ); + P.DrawLine( eeVector2f( mShape->bb.l, mShape->bb.t ), eeVector2f( mShape->bb.l, mShape->bb.b ) ); + P.DrawLine( eeVector2f( mShape->bb.l, mShape->bb.b ), eeVector2f( mShape->bb.r, mShape->bb.b ) ); + P.DrawLine( eeVector2f( mShape->bb.r, mShape->bb.t ), eeVector2f( mShape->bb.r, mShape->bb.b ) ); #endif } diff --git a/src/physics/cspace.cpp b/src/physics/cspace.cpp index 8c3fb8378..e22cad54c 100644 --- a/src/physics/cspace.cpp +++ b/src/physics/cspace.cpp @@ -291,32 +291,28 @@ void cSpace::Draw() { cpFloat lw = BR->GetLineWidth(); cpFloat ps = BR->GetPointSize(); - if( options->DrawHash ) { - //cpBBTreeRenderDebug( mSpace->staticShapes ); - //cpBBTreeRenderDebug( mSpace->activeShapes ); - } - BR->SetLineWidth( options->LineThickness ); - if( options->DrawShapes ) { + if ( options->DrawShapes ) { cpSpatialIndexEach( mSpace->CP_PRIVATE(activeShapes), (cpSpatialIndexIteratorFunc)drawObject, mSpace ); cpSpatialIndexEach( mSpace->CP_PRIVATE(staticShapes), (cpSpatialIndexIteratorFunc)drawObject, mSpace ); } BR->SetLineWidth( lw ); - if( options->DrawBBs ){ + if ( options->DrawBBs ){ cpSpatialIndexEach( mSpace->CP_PRIVATE(activeShapes), (cpSpatialIndexIteratorFunc)drawBB, NULL ); cpSpatialIndexEach( mSpace->CP_PRIVATE(staticShapes), (cpSpatialIndexIteratorFunc)drawBB, NULL ); + BR->Draw(); } cpArray * constraints = mSpace->CP_PRIVATE(constraints); - for( int i=0, count = constraints->num; i < count; i++ ) { + for ( int i = 0, count = constraints->num; i < count; i++ ) { drawConstraint( (cpConstraint *)constraints->arr[i] ); } - if( options->BodyPointSize ) { + if ( options->BodyPointSize ) { BR->SetPointSize( options->BodyPointSize ); BR->PointsBegin(); BR->PointSetColor( eeColorA( 255, 255, 255, 255 ) ); diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index 445b56540..ecd46ec8c 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -1704,7 +1704,6 @@ void cEETest::PhysicsCreate() { cPhysicsManager * PM = cPhysicsManager::instance(); cPhysicsManager::cDrawSpaceOptions * DSO = PM->GetDrawOptions(); - DSO->DrawHash = false; DSO->DrawBBs = false; DSO->DrawShapes = true; DSO->CollisionPointSize = 0; diff --git a/src/window/backend/SDL13/ccursormanagersdl.cpp b/src/window/backend/SDL13/ccursormanagersdl.cpp index 16774192d..895506ce8 100644 --- a/src/window/backend/SDL13/ccursormanagersdl.cpp +++ b/src/window/backend/SDL13/ccursormanagersdl.cpp @@ -25,7 +25,7 @@ cCursor * cCursorManagerSDL::Create( const std::string& path, const eeVector2i& void cCursorManagerSDL::Set( cCursor * cursor ) { SDL_SetCursor( reinterpret_cast( cursor )->GetCursor() ); - mCurrrent = cursor; + mCurrent = cursor; mCurSysCursor = false; mSysCursor = Cursor::SYS_CURSOR_NONE; } @@ -33,7 +33,7 @@ void cCursorManagerSDL::Set( cCursor * cursor ) { void cCursorManagerSDL::Set( EE_SYSTEM_CURSOR syscurid ) { mWindow->GetPlatform()->SetSystemMouseCursor( syscurid ); - mCurrrent = NULL; + mCurrent = NULL; mCurSysCursor = true; mSysCursor = syscurid; } @@ -67,7 +67,7 @@ void cCursorManagerSDL::Reload() { if ( mCurSysCursor ) { Set( mSysCursor ); } else { - Set( mCurrrent ); + Set( mCurrent ); } } else { Hide(); diff --git a/src/window/backend/allegro5/ccursormanageral.cpp b/src/window/backend/allegro5/ccursormanageral.cpp index 10a58cbd6..495862ba4 100644 --- a/src/window/backend/allegro5/ccursormanageral.cpp +++ b/src/window/backend/allegro5/ccursormanageral.cpp @@ -28,14 +28,14 @@ void cCursorManagerAl::Set( cCursor * cursor ) { return; al_set_mouse_cursor( reinterpret_cast( mWindow )->GetDisplay(), reinterpret_cast( cursor )->GetCursor() ); - mCurrrent = cursor; + mCurrent = cursor; mCurSysCursor = false; mSysCursor = Cursor::SYS_CURSOR_NONE; } void cCursorManagerAl::Set( EE_SYSTEM_CURSOR syscurid ) { al_set_system_mouse_cursor( reinterpret_cast( mWindow )->GetDisplay(), (ALLEGRO_SYSTEM_MOUSE_CURSOR)syscurid ); - mCurrrent = NULL; + mCurrent = NULL; mCurSysCursor = true; mSysCursor = syscurid; } @@ -69,7 +69,7 @@ void cCursorManagerAl::Reload() { if ( mCurSysCursor ) { Set( mSysCursor ); } else { - Set( mCurrrent ); + Set( mCurrent ); } } else { Hide(); diff --git a/src/window/ccursormanager.cpp b/src/window/ccursormanager.cpp index e8a2c6d73..80d43e68e 100644 --- a/src/window/ccursormanager.cpp +++ b/src/window/ccursormanager.cpp @@ -4,7 +4,7 @@ namespace EE { namespace Window { cCursorManager::cCursorManager( cWindow * window ) : mWindow( window ), - mCurrrent( NULL ), + mCurrent( NULL ), mSysCursor( SYS_CURSOR_NONE ), mCursors(), mCurSysCursor( SYS_CURSOR_NONE ), @@ -75,5 +75,17 @@ bool cCursorManager::Visible() { return mVisible; } +cCursor * cCursorManager::Current() const { + return mCurrent; +} + +EE_SYSTEM_CURSOR cCursorManager::CurrentSysCursor() const { + return mSysCursor; +} + +bool cCursorManager::CurrentIsSysCursor() const { + return mCurSysCursor; +} + }} diff --git a/src/window/ccursormanager.hpp b/src/window/ccursormanager.hpp index cb9a9a185..6d74e5992 100644 --- a/src/window/ccursormanager.hpp +++ b/src/window/ccursormanager.hpp @@ -55,10 +55,16 @@ class EE_API cCursorManager { virtual void Visible( bool visible ) = 0; virtual bool Visible(); + + cCursor * Current() const; + + EE_SYSTEM_CURSOR CurrentSysCursor() const; + + bool CurrentIsSysCursor() const; protected: typedef std::set CursorsList; cWindow * mWindow; - cCursor * mCurrrent; + cCursor * mCurrent; EE_SYSTEM_CURSOR mSysCursor; CursorsList mCursors; bool mCurSysCursor; diff --git a/src/window/cengine.cpp b/src/window/cengine.cpp index 29611f244..4296e1267 100755 --- a/src/window/cengine.cpp +++ b/src/window/cengine.cpp @@ -20,8 +20,6 @@ #define BACKEND_SDL 1 #define BACKEND_ALLEGRO 2 -//#define DEFAULT_BACKEND BACKEND_ALLEGRO - #ifndef DEFAULT_BACKEND #if defined( EE_BACKEND_SDL_ACTIVE )