From 5015469465a3784b37d21b863d7ad653387eaac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=C2=ADn=20Lucas=20Golini?= Date: Sun, 19 Feb 2017 04:03:31 -0300 Subject: [PATCH] Gaming module refactored. --HG-- branch : dev --- include/eepp/gaming/gameobject.hpp | 56 +-- include/eepp/gaming/gameobjectobject.hpp | 50 +-- include/eepp/gaming/gameobjectpolygon.hpp | 14 +- include/eepp/gaming/gameobjectpolyline.hpp | 8 +- include/eepp/gaming/gameobjectsprite.hpp | 26 +- include/eepp/gaming/gameobjectsubtexture.hpp | 24 +- .../eepp/gaming/gameobjectsubtextureex.hpp | 8 +- include/eepp/gaming/gameobjectvirtual.hpp | 22 +- include/eepp/gaming/maplayer.hpp | 44 +- include/eepp/gaming/maplight.hpp | 40 +- include/eepp/gaming/maplightmanager.hpp | 38 +- include/eepp/gaming/mapobjectlayer.hpp | 20 +- include/eepp/gaming/tilemap.hpp | 186 +++++---- include/eepp/gaming/tilemaplayer.hpp | 22 +- include/eepp/helper/PlusCallback/callback.hpp | 4 +- include/eepp/ui/uidragable.hpp | 2 +- projects/linux/ee.files | 2 +- src/eepp/gaming/gameobject.cpp | 84 ++-- src/eepp/gaming/gameobjectobject.cpp | 54 +-- src/eepp/gaming/gameobjectpolygon.cpp | 18 +- src/eepp/gaming/gameobjectpolyline.cpp | 10 +- src/eepp/gaming/gameobjectsprite.cpp | 78 ++-- src/eepp/gaming/gameobjectsubtexture.cpp | 74 ++-- src/eepp/gaming/gameobjectsubtextureex.cpp | 50 +-- src/eepp/gaming/gameobjectvirtual.cpp | 68 +-- src/eepp/gaming/mapeditor/mapeditor.cpp | 238 +++++------ .../gaming/mapeditor/maplayerproperties.cpp | 52 +-- .../gaming/mapeditor/maplayerproperties.hpp | 18 +- .../gaming/mapeditor/mapobjectproperties.cpp | 58 +-- .../gaming/mapeditor/mapobjectproperties.hpp | 20 +- .../gaming/mapeditor/tilemapproperties.cpp | 86 ++-- .../gaming/mapeditor/tilemapproperties.hpp | 34 +- src/eepp/gaming/mapeditor/uigotypenew.cpp | 14 +- src/eepp/gaming/mapeditor/uigotypenew.hpp | 6 +- src/eepp/gaming/mapeditor/uimap.cpp | 188 ++++----- src/eepp/gaming/mapeditor/uimap.hpp | 66 +-- src/eepp/gaming/mapeditor/uimaplayernew.cpp | 32 +- src/eepp/gaming/mapeditor/uimaplayernew.hpp | 16 +- src/eepp/gaming/mapeditor/uimapnew.cpp | 68 +-- src/eepp/gaming/mapeditor/uimapnew.hpp | 12 +- src/eepp/gaming/maplayer.cpp | 48 +-- src/eepp/gaming/maplight.cpp | 60 +-- src/eepp/gaming/maplightmanager.cpp | 100 ++--- .../{objectlayer.cpp => mapobjectlayer.cpp} | 56 +-- src/eepp/gaming/tilemap.cpp | 390 +++++++++--------- src/eepp/gaming/tilemaplayer.cpp | 56 +-- src/eepp/ui/uidragable.cpp | 4 +- src/test/eetest.cpp | 34 +- 48 files changed, 1328 insertions(+), 1330 deletions(-) rename src/eepp/gaming/{objectlayer.cpp => mapobjectlayer.cpp} (60%) diff --git a/include/eepp/gaming/gameobject.hpp b/include/eepp/gaming/gameobject.hpp index 79cb1ad71..f9016f36f 100644 --- a/include/eepp/gaming/gameobject.hpp +++ b/include/eepp/gaming/gameobject.hpp @@ -16,64 +16,64 @@ class EE_API GameObject { virtual ~GameObject(); - virtual void Draw(); + virtual void draw(); - virtual void Update(); + virtual void update(); - virtual Vector2f Pos() const; + virtual Vector2f getPosition() const; - virtual void Pos( Vector2f pos ); + virtual void setPosition( Vector2f pos ); - virtual Vector2i TilePos() const; + virtual Vector2i getTilePosition() const; - virtual void TilePos( Vector2i pos ); + virtual void setTilePosition( Vector2i pos ); - virtual Sizei Size(); + virtual Sizei getSize(); - virtual Uint32 Type() const; + virtual Uint32 getType() const; - virtual bool IsType( const Uint32& type ); + virtual bool isType( const Uint32& type ); - const Uint32& Flags() const; + const Uint32& getFlags() const; - Uint32 FlagGet( const Uint32& Flag ); + Uint32 getFlag( const Uint32& Flag ); - virtual void FlagSet( const Uint32& Flag ); + virtual void setFlag( const Uint32& Flag ); - void FlagClear( const Uint32& Flag ); + void clearFlag( const Uint32& Flag ); - Uint32 Blocked() const; + bool isBlocked() const; - void Blocked( bool blocked ); + void setBlocked( bool blocked ); - Uint32 Rotated() const; + bool isRotated() const; - void Rotated( bool rotated ); + void setRotated( bool rotated ); - Uint32 Mirrored() const; + bool isMirrored() const; - void Mirrored( bool mirrored ); + void setMirrored( bool mirrored ); - Uint32 Fliped() const; + bool isFliped() const; - void Fliped( bool fliped ); + void setFliped( bool fliped ); - virtual Uint32 DataId(); + virtual Uint32 getDataId(); - virtual void DataId( Uint32 Id ); + virtual void setDataId( Uint32 Id ); - MapLayer * Layer() const; + MapLayer * getLayer() const; protected: Uint32 mFlags; MapLayer * mLayer; - virtual EE_RENDER_MODE RenderModeFromFlags(); + virtual EE_RENDER_MODE getRenderModeFromFlags(); - void AutoFixTilePos(); + void autoFixTilePos(); - void AssignTilePos(); + void assignTilePos(); - Float GetAngle(); + Float getRotation(); }; }} diff --git a/include/eepp/gaming/gameobjectobject.hpp b/include/eepp/gaming/gameobjectobject.hpp index 40d93a154..a665c4a2a 100644 --- a/include/eepp/gaming/gameobjectobject.hpp +++ b/include/eepp/gaming/gameobjectobject.hpp @@ -18,55 +18,55 @@ class EE_API GameObjectObject : public GameObject { virtual ~GameObjectObject(); - virtual void Draw(); + virtual void draw(); - virtual Vector2f Pos() const; + virtual Vector2f getPosition() const; - virtual Sizei Size(); + virtual Sizei getSize(); - virtual void Pos( Vector2f pos ); + virtual void setPosition( Vector2f pos ); - virtual Uint32 Type() const; + virtual Uint32 getType() const; - virtual bool IsType( const Uint32& type ); + virtual bool isType( const Uint32& type ); - virtual Uint32 DataId(); + virtual Uint32 getDataId(); - virtual void DataId( Uint32 Id ); + virtual void setDataId( Uint32 Id ); - void AddProperty( std::string Text, std::string Value ); + void addProperty( std::string Text, std::string Value ); - void EditProperty( std::string Text, std::string Value ); + void editProperty( std::string Text, std::string Value ); - void RemoveProperty( std::string Text ); + void removeProperty( std::string Text ); - void SetProperties( const PropertiesMap& prop ); + void setProperties( const PropertiesMap& prop ); - void ClearProperties(); + void clearProperties(); - PropertiesMap& GetProperties(); + PropertiesMap& getProperties(); - Uint32 GetPropertyCount(); + Uint32 getPropertyCount(); - const std::string& Name() const; + const std::string& getName() const; - void Name( const std::string& name ); + void setName( const std::string& name ); - const std::string& TypeName() const; + const std::string& getTypeName() const; - void TypeName( const std::string& type ); + void setTypeName( const std::string& type ); - virtual bool PointInside( const Vector2f& p ); + virtual bool pointInside( const Vector2f& p ); - Polygon2f& GetPolygon(); + Polygon2f& getPolygon(); - const bool& Selected() const; + const bool& isSelected() const; - void Selected( const bool& sel ); + void setSelected( const bool& sel ); - virtual void SetPolygonPoint( Uint32 index, Vector2f p ); + virtual void setPolygonPoint( Uint32 index, Vector2f p ); - virtual GameObjectObject * Copy(); + virtual GameObjectObject * clone(); protected: Rectf mRect; Polygon2f mPoly; diff --git a/include/eepp/gaming/gameobjectpolygon.hpp b/include/eepp/gaming/gameobjectpolygon.hpp index 34e5d6061..21fc39e42 100644 --- a/include/eepp/gaming/gameobjectpolygon.hpp +++ b/include/eepp/gaming/gameobjectpolygon.hpp @@ -11,19 +11,19 @@ class EE_API GameObjectPolygon : public GameObjectObject { virtual ~GameObjectPolygon(); - virtual void Draw(); + virtual void draw(); - virtual Sizei Size(); + virtual Sizei getSize(); - virtual Uint32 Type() const; + virtual Uint32 getType() const; - virtual bool IsType( const Uint32& type ); + virtual bool isType( const Uint32& type ); - virtual bool PointInside( const Vector2f& p ); + virtual bool pointInside( const Vector2f& p ); - virtual void SetPolygonPoint( Uint32 index, Vector2f p ); + virtual void setPolygonPoint( Uint32 index, Vector2f p ); - virtual GameObjectObject * Copy(); + virtual GameObjectObject * clone(); }; }} diff --git a/include/eepp/gaming/gameobjectpolyline.hpp b/include/eepp/gaming/gameobjectpolyline.hpp index f3c46cc88..3580a331f 100644 --- a/include/eepp/gaming/gameobjectpolyline.hpp +++ b/include/eepp/gaming/gameobjectpolyline.hpp @@ -11,13 +11,13 @@ class EE_API GameObjectPolyline : public GameObjectPolygon { virtual ~GameObjectPolyline(); - virtual Uint32 Type() const; + virtual Uint32 getType() const; - virtual bool IsType( const Uint32& type ); + virtual bool isType( const Uint32& type ); - virtual void Draw(); + virtual void draw(); - virtual GameObjectObject * Copy(); + virtual GameObjectObject * clone(); }; }} diff --git a/include/eepp/gaming/gameobjectsprite.hpp b/include/eepp/gaming/gameobjectsprite.hpp index 751386762..98447fdb6 100644 --- a/include/eepp/gaming/gameobjectsprite.hpp +++ b/include/eepp/gaming/gameobjectsprite.hpp @@ -16,31 +16,31 @@ class EE_API GameObjectSprite : public GameObject { virtual ~GameObjectSprite(); - virtual void Draw(); + virtual void draw(); - Vector2f Pos() const; + Vector2f getPosition() const; - virtual void Pos( Vector2f pos ); + virtual void setPosition( Vector2f pos ); - virtual Vector2i TilePos() const; + virtual Vector2i getTilePosition() const; - virtual void TilePos( Vector2i pos ); + virtual void setTilePosition( Vector2i pos ); - virtual Sizei Size(); + virtual Sizei getSize(); - Graphics::Sprite * Sprite() const; + Graphics::Sprite * getSprite() const; - void Sprite( Graphics::Sprite * sprite ); + void setSprite( Graphics::Sprite * sprite ); - virtual Uint32 Type() const; + virtual Uint32 getType() const; - virtual bool IsType( const Uint32& type ); + virtual bool isType( const Uint32& type ); - virtual void FlagSet( const Uint32& Flag ); + virtual void setFlag( const Uint32& Flag ); - virtual Uint32 DataId(); + virtual Uint32 getDataId(); - virtual void DataId( Uint32 Id ); + virtual void setDataId( Uint32 Id ); protected: Graphics::Sprite * mSprite; Vector2i mTilePos; diff --git a/include/eepp/gaming/gameobjectsubtexture.hpp b/include/eepp/gaming/gameobjectsubtexture.hpp index 68bd7b8c0..de2d28232 100644 --- a/include/eepp/gaming/gameobjectsubtexture.hpp +++ b/include/eepp/gaming/gameobjectsubtexture.hpp @@ -15,29 +15,29 @@ class EE_API GameObjectSubTexture : public GameObject { virtual ~GameObjectSubTexture(); - virtual void Draw(); + virtual void draw(); - virtual Vector2f Pos() const; + virtual Vector2f getPosition() const; - virtual void Pos( Vector2f pos ); + virtual void setPosition( Vector2f pos ); - virtual Vector2i TilePos() const; + virtual Vector2i getTilePosition() const; - virtual void TilePos( Vector2i pos ); + virtual void setTilePosition( Vector2i pos ); - virtual Sizei Size(); + virtual Sizei getSize(); - Graphics::SubTexture * SubTexture() const; + Graphics::SubTexture * getSubTexture() const; - void SubTexture( Graphics::SubTexture * subTexture ); + void setSubTexture( Graphics::SubTexture * subTexture ); - virtual Uint32 Type() const; + virtual Uint32 getType() const; - virtual bool IsType( const Uint32& type ); + virtual bool isType( const Uint32& type ); - virtual Uint32 DataId(); + virtual Uint32 getDataId(); - virtual void DataId( Uint32 Id ); + virtual void setDataId( Uint32 Id ); protected: Graphics::SubTexture * mSubTexture; Vector2f mPos; diff --git a/include/eepp/gaming/gameobjectsubtextureex.hpp b/include/eepp/gaming/gameobjectsubtextureex.hpp index ff8d86f1d..78ae47da7 100644 --- a/include/eepp/gaming/gameobjectsubtextureex.hpp +++ b/include/eepp/gaming/gameobjectsubtextureex.hpp @@ -12,13 +12,13 @@ class EE_API GameObjectSubTextureEx : public GameObjectSubTexture { virtual ~GameObjectSubTextureEx(); - virtual void Draw(); + virtual void draw(); - virtual Uint32 Type() const; + virtual Uint32 getType() const; - virtual bool IsType( const Uint32& type ); + virtual bool isType( const Uint32& type ); - virtual void FlagSet( const Uint32& Flag ); + virtual void setFlag( const Uint32& Flag ); protected: EE_BLEND_MODE mBlend; EE_RENDER_MODE mRender; diff --git a/include/eepp/gaming/gameobjectvirtual.hpp b/include/eepp/gaming/gameobjectvirtual.hpp index 54f159e09..47539e8cc 100644 --- a/include/eepp/gaming/gameobjectvirtual.hpp +++ b/include/eepp/gaming/gameobjectvirtual.hpp @@ -12,31 +12,31 @@ class MapLayer; class EE_API GameObjectVirtual : public GameObject { public: - GameObjectVirtual( Uint32 DataId, MapLayer * Layer, const Uint32& Flags = GObjFlags::GAMEOBJECT_STATIC, Uint32 RealType = GAMEOBJECT_TYPE_VIRTUAL, const Vector2f& Pos = Vector2f() ); + GameObjectVirtual( Uint32 getDataId, MapLayer * Layer, const Uint32& Flags = GObjFlags::GAMEOBJECT_STATIC, Uint32 RealType = GAMEOBJECT_TYPE_VIRTUAL, const Vector2f& Pos = Vector2f() ); GameObjectVirtual( SubTexture * SubTexture, MapLayer * Layer, const Uint32& Flags = GObjFlags::GAMEOBJECT_STATIC, Uint32 RealType = GAMEOBJECT_TYPE_VIRTUAL, const Vector2f& Pos = Vector2f() ); virtual ~GameObjectVirtual(); - virtual void Draw(); + virtual void draw(); - virtual Vector2f Pos() const; + virtual Vector2f getPosition() const; - virtual Sizei Size(); + virtual Sizei getSize(); - virtual void Pos( Vector2f pos ); + virtual void setPosition( Vector2f pos ); - virtual Uint32 Type() const; + virtual Uint32 getType() const; - virtual bool IsType( const Uint32& type ); + virtual bool isType( const Uint32& type ); - virtual Uint32 RealType() const; + virtual Uint32 getRealType() const; - virtual Uint32 DataId(); + virtual Uint32 getDataId(); - virtual void DataId( Uint32 Id ); + virtual void setDataId( Uint32 Id ); - void SetLayer( MapLayer * Layer ); + void setLayer( MapLayer * Layer ); protected: Uint32 mType; Uint32 mDataId; diff --git a/include/eepp/gaming/maplayer.hpp b/include/eepp/gaming/maplayer.hpp index a6da729e4..bc07a7906 100644 --- a/include/eepp/gaming/maplayer.hpp +++ b/include/eepp/gaming/maplayer.hpp @@ -13,49 +13,49 @@ class EE_API MapLayer { virtual ~MapLayer(); - virtual void Draw( const Vector2f& Offset = Vector2f(0,0) ) = 0; + virtual void draw( const Vector2f& Offset = Vector2f(0,0) ) = 0; - virtual void Update() = 0; + virtual void update() = 0; - const Uint32& Flags() const; + const Uint32& getFlags() const; - Uint32 FlagGet( const Uint32& Flag ); + Uint32 getFlag( const Uint32& Flag ); - void FlagSet( const Uint32& Flag ); + void setFlag( const Uint32& Flag ); - void FlagClear( const Uint32& Flag ); + void clearFlag( const Uint32& Flag ); - const Uint32& Type() const; + const Uint32& getType() const; - TileMap * Map() const; + TileMap * getMap() const; - const Vector2f& Offset() const; + const Vector2f& getOffset() const; - void Offset( const Vector2f& offset ); + void setOffset( const Vector2f& offset ); - void Name( const std::string& name ); + void setName( const std::string& name ); - const std::string& Name() const; + const std::string& getName() const; - const Uint32& Id() const; + const Uint32& getId() const; - void AddProperty( std::string Text, std::string Value ); + void addProperty( std::string Text, std::string Value ); - void EditProperty( std::string Text, std::string Value ); + void editProperty( std::string Text, std::string Value ); - void RemoveProperty( std::string Text ); + void removeProperty( std::string Text ); - void ClearProperties(); + void clearProperties(); - PropertiesMap& GetProperties(); + PropertiesMap& getProperties(); - void Visible( const bool& visible ); + void setVisible( const bool& visible ); - bool Visible(); + bool isVisible(); - bool LightsEnabled(); + bool getLightsEnabled(); - void LightsEnabled( const bool& enabled ); + void setLightsEnabled( const bool& enabled ); protected: friend class TileMap; diff --git a/include/eepp/gaming/maplight.hpp b/include/eepp/gaming/maplight.hpp index 96a57b72c..526e0c08e 100644 --- a/include/eepp/gaming/maplight.hpp +++ b/include/eepp/gaming/maplight.hpp @@ -19,43 +19,43 @@ class EE_API MapLight { virtual ~MapLight(); - void Create( const Float& Radius, const Float& x, const Float& y, const RGB& Color = RGB(255,255,255), LIGHT_TYPE Type = LIGHT_NORMAL ); + void create( const Float& Radius, const Float& x, const Float& y, const RGB& Color = RGB(255,255,255), LIGHT_TYPE Type = LIGHT_NORMAL ); - virtual RGB ProcessVertex( const Float& PointX, const Float& PointY, const RGB& VertexColor, const RGB& BaseColor ); + virtual RGB processVertex( const Float& PointX, const Float& PointY, const RGB& VertexColor, const RGB& BaseColor ); - virtual ColorA ProcessVertex( const Float& PointX, const Float& PointY, const ColorA& VertexColor, const ColorA& BaseColor ); + virtual ColorA processVertex( const Float& PointX, const Float& PointY, const ColorA& VertexColor, const ColorA& BaseColor ); - RGB ProcessVertex( const Vector2f& Pos, const RGB& VertexColor, const RGB& BaseColor ); + RGB processVertex( const Vector2f& Pos, const RGB& VertexColor, const RGB& BaseColor ); - ColorA ProcessVertex( const Vector2f& Pos, const ColorA& VertexColor, const ColorA& BaseColor ); + ColorA processVertex( const Vector2f& Pos, const ColorA& VertexColor, const ColorA& BaseColor ); - void Move( const Float& addtox, const Float& addtoy ); + void move( const Float& addtox, const Float& addtoy ); - void UpdatePos( const Float& x, const Float& y ); + void updatePos( const Float& x, const Float& y ); - void UpdatePos( const Vector2f& newPos ); + void updatePos( const Vector2f& newPos ); - eeAABB GetAABB() const; + eeAABB getAABB() const; - const Float& Radius() const; + const Float& getRadius() const; - void Radius( const Float& radio ); + void setRadius( const Float& radio ); - const bool& Active() const; + const bool& isActive() const; - void Active( const bool& active ); + void setActive( const bool& active ); - void Color( const RGB& color ); + void setColor( const RGB& color ); - const RGB& Color() const; + const RGB& getColor() const; - void Type( const LIGHT_TYPE& type ); + void setType( const LIGHT_TYPE& type ); - const LIGHT_TYPE& Type() const; + const LIGHT_TYPE& getType() const; - const Vector2f& Position() const; + const Vector2f& getPosition() const; - void Position( const Vector2f& newPos ); + void setPosition( const Vector2f& newPos ); protected: Float mRadius; Vector2f mPos; @@ -64,7 +64,7 @@ class EE_API MapLight { eeAABB mAABB; bool mActive; - void UpdateAABB(); + void updateAABB(); }; }} diff --git a/include/eepp/gaming/maplightmanager.hpp b/include/eepp/gaming/maplightmanager.hpp index fce48a811..e1e452755 100644 --- a/include/eepp/gaming/maplightmanager.hpp +++ b/include/eepp/gaming/maplightmanager.hpp @@ -19,41 +19,41 @@ class EE_API MapLightManager { virtual void Update(); - void AddLight( MapLight * Light ); + void addLight( MapLight * Light ); - void RemoveLight( const Vector2f& OverPos ); + void removeLight( const Vector2f& OverPos ); - void RemoveLight( MapLight * Light ); + void removeLight( MapLight * Light ); - Uint32 Count(); + Uint32 getCount(); - const ColorA * GetTileColor( const Vector2i& TilePos ); + const ColorA * getTileColor( const Vector2i& TilePos ); - const ColorA * GetTileColor( const Vector2i& TilePos, const Uint32& Vertex ); + const ColorA * getTileColor( const Vector2i& TilePos, const Uint32& Vertex ); - ColorA GetColorFromPos( const Vector2f& Pos ); + ColorA getColorFromPos( const Vector2f& Pos ); - const bool& IsByVertex() const; + const bool& isByVertex() const; - LightsList& GetLights(); + LightsList& getLights(); - MapLight * GetLightOver( const Vector2f& OverPos, MapLight * LightCurrent = NULL ); + MapLight * getLightOver( const Vector2f& OverPos, MapLight * LightCurrent = NULL ); protected: - TileMap * mMap; - Int32 mNumVertex; + TileMap * mMap; + Int32 mNumVertex; ColorA**** mTileColors; - LightsList mLights; - bool mIsByVertex; + LightsList mLights; + bool mIsByVertex; - void AllocateColors(); + void allocateColors(); - void DeallocateColors(); + void deallocateColors(); - void DestroyLights(); + void destroyLights(); - virtual void UpdateByVertex(); + virtual void updateByVertex(); - virtual void UpdateByTile(); + virtual void updateByTile(); }; }} diff --git a/include/eepp/gaming/mapobjectlayer.hpp b/include/eepp/gaming/mapobjectlayer.hpp index e644528a3..133e4b4df 100644 --- a/include/eepp/gaming/mapobjectlayer.hpp +++ b/include/eepp/gaming/mapobjectlayer.hpp @@ -21,19 +21,19 @@ class EE_API MapObjectLayer : public MapLayer { virtual ~MapObjectLayer(); - virtual void Draw( const Vector2f &Offset = Vector2f(0,0) ); + virtual void draw( const Vector2f &Offset = Vector2f(0,0) ); - virtual void Update(); + virtual void update(); - virtual void AddGameObject( GameObject * obj ); + virtual void addGameObject( GameObject * obj ); - virtual void RemoveGameObject( GameObject * obj ); + virtual void removeGameObject( GameObject * obj ); - virtual void RemoveGameObject( const Vector2i& pos ); + virtual void removeGameObject( const Vector2i& pos ); - virtual GameObject * GetObjectOver( const Vector2i& pos, SEARCH_TYPE type = SEARCH_ALL ); + virtual GameObject * getObjectOver( const Vector2i& pos, SEARCH_TYPE type = SEARCH_ALL ); - virtual Uint32 GetObjectCount() const; + virtual Uint32 getObjectCount() const; protected: friend class TileMap; @@ -41,11 +41,11 @@ class EE_API MapObjectLayer : public MapLayer { MapObjectLayer( TileMap * map, Uint32 flags, std::string name = "", Vector2f offset = Vector2f(0,0) ); - void AllocateLayer(); + void allocateLayer(); - void DeallocateLayer(); + void deallocateLayer(); - ObjList& GetObjectList(); + ObjList& getObjectList(); }; }} diff --git a/include/eepp/gaming/tilemap.hpp b/include/eepp/gaming/tilemap.hpp index 824b1a6b1..411c8d095 100644 --- a/include/eepp/gaming/tilemap.hpp +++ b/include/eepp/gaming/tilemap.hpp @@ -36,194 +36,192 @@ class EE_API TileMap { virtual ~TileMap(); - virtual void Create( Sizei Size, Uint32 MaxLayers, Sizei TileSize, Uint32 Flags = 0, Sizei viewSize = Sizei( 800, 600 ), EE::Window::Window * Window = NULL ); + virtual void create( Sizei Size, Uint32 MaxLayers, Sizei TileSize, Uint32 Flags = 0, Sizei viewSize = Sizei( 800, 600 ), EE::Window::Window * Window = NULL ); - virtual MapLayer * AddLayer( Uint32 Type, Uint32 flags, std::string name ); + virtual MapLayer * addLayer( Uint32 Type, Uint32 flags, std::string name ); - virtual MapLayer * GetLayer( Uint32 index ); + virtual MapLayer * getLayer( Uint32 index ); - virtual Uint32 GetLayerIndex( MapLayer * Layer ); + virtual Uint32 getLayerIndex( MapLayer * Layer ); - virtual MapLayer * GetLayerByHash( Uint32 hash ); + virtual MapLayer * getLayerByHash( Uint32 hash ); - virtual MapLayer * GetLayer( const std::string& name ); + virtual MapLayer * getLayer( const std::string& name ); - virtual bool Load( const std::string& path ); + virtual bool load( const std::string& path ); - virtual bool LoadFromStream( IOStream& IOS ); + virtual bool loadFromStream( IOStream& IOS ); - virtual bool LoadFromPack( Pack * Pack, const std::string& FilePackPath ); + virtual bool loadFromPack( Pack * Pack, const std::string& FilePackPath ); - virtual bool LoadFromMemory( const char * Data, const Uint32& DataSize ); + virtual bool loadFromMemory( const char * Data, const Uint32& DataSize ); - virtual void Save( const std::string& path ); + virtual void save( const std::string& path ); - virtual void SaveToStream( IOStream& IOS ); + virtual void saveToStream( IOStream& IOS ); - virtual void Draw(); + virtual void draw(); - virtual void Update(); + virtual void update(); - const Sizei& TileSize() const; + const Sizei& getTileSize() const; - const Sizei& Size() const; + const Sizei& getSize() const; - const Uint32& LayerCount() const; + const Uint32& getLayerCount() const; - const Uint32& MaxLayers() const; + const Uint32& getMaxLayers() const; - const Sizei& ViewSize() const; + const Sizei& getViewSize() const; - void ViewSize( const Sizei& viewSize ); + void setViewSize( const Sizei& viewSize ); - const Vector2f& Offset() const; + const Vector2f& getOffset() const; - const Vector2f& OffsetFixed() const; + void setOffset( const Vector2f& offset ); - void Offset( const Vector2f& offset ); + const Vector2i& getPosition() const; - const Vector2i& Position() const; + void setPosition( const Vector2i& position ); - void Position( const Vector2i& position ); + void move( const Vector2f& offset ); - void Move( const Vector2f& offset ); + void move( const Float& offsetx, const Float& offsety ); - void Move( const Float& offsetx, const Float& offsety ); + const Vector2i& getStartTile() const; - const Vector2i& StartTile() const; + const Vector2i& getEndTile() const; - const Vector2i& EndTile() const; + const Uint32& getFlags() const; - const Uint32& Flags() const; + bool getClampBorders() const; - bool ClampBorders() const; + void setClampBorders( const bool& clamp ); - void ClampBorders( const bool& clamp ); + bool getClipedArea() const; - bool ClipedArea() const; + void setClipedArea( const bool& clip ); - void ClipedArea( const bool& clip ); + Uint32 getDrawGrid() const; - void DrawGrid( const bool& draw ); + void setDrawGrid( const bool& draw ); - Uint32 DrawGrid() const; + Uint32 getShowBlocked() const; - void ShowBlocked( const bool& show ); + void setShowBlocked( const bool& show ); - Uint32 ShowBlocked() const; + Uint32 getDrawBackground() const; - void DrawBackground( const bool& draw ); + void setDrawBackground( const bool& draw ); - Uint32 DrawBackground() const; + Uint32 getDrawTileOver() const; - Uint32 DrawTileOver() const; + void setDrawTileOver( const bool& draw ); - void DrawTileOver( const bool& draw ); + bool getLightsEnabled(); - bool LightsEnabled(); + void setLightsEnabled( const bool& enabled ); - void LightsEnabled( const bool& enabled ); + bool getLightsByVertex(); - bool LightsByVertex(); + void reset(); - void Reset(); + bool moveLayerUp( MapLayer * Layer ); - bool MoveLayerUp( MapLayer * Layer ); + bool moveLayerDown( MapLayer * Layer ); - bool MoveLayerDown( MapLayer * Layer ); + bool removeLayer( MapLayer * Layer ); - bool RemoveLayer( MapLayer * Layer ); + const Vector2i& getMouseTilePos() const; - const Vector2i& GetMouseTilePos() const; + Vector2i getMouseTilePosCoords(); - Vector2i GetMouseTilePosCoords(); + Vector2i getTileCoords( const Vector2i& TilePos ); - Vector2i GetTileCoords( const Vector2i& TilePos ); + const Vector2i& getRealMouseTilePos() const; - const Vector2i& GetRealMouseTilePos() const; + const Vector2i& getMouseMapPos() const; - const Vector2i& GetMouseMapPos() const; + Vector2f getMouseMapPosf() const; - Vector2f GetMouseMapPosf() const; + const Sizei& getTotalSize() const; - const Sizei& TotalSize() const; + void addProperty( std::string Text, std::string Value ); - void AddProperty( std::string Text, std::string Value ); + void editProperty( std::string Text, std::string Value ); - void EditProperty( std::string Text, std::string Value ); + void removeProperty( std::string Text ); - void RemoveProperty( std::string Text ); + void clearProperties(); - void ClearProperties(); + PropertiesMap& getProperties(); - PropertiesMap& GetProperties(); + void addVirtualObjectType( const std::string& name ); - void AddVirtualObjectType( const std::string& name ); + void removeVirtualObjectType( const std::string& name ); - void RemoveVirtualObjectType( const std::string& name ); + void clearVirtualObjectTypes(); - void ClearVirtualObjectTypes(); + GOTypesList& getVirtualObjectTypes(); - GOTypesList& GetVirtualObjectTypes(); + void setCreateGameObjectCallback( const CreateGOCb& Cb ); - void SetCreateGameObjectCallback( const CreateGOCb& Cb ); + const std::string& getPath() const; - const std::string& Path() const; + void setBaseColor( const ColorA& color ); - void BaseColor( const ColorA& color ); + const ColorA& getBaseColor() const; - const ColorA& BaseColor() const; + const eeAABB& getViewAreaAABB() const; - const eeAABB& GetViewAreaAABB() const; - - MapLightManager * GetLightManager() const; + MapLightManager * getLightManager() const; /** Tiles to add or subtract from the real values of StartTile and EndTile ( so it will loop over more/less tiles than the required to render every tile on screen ). */ - void ExtraTiles( const Vector2i& extra ); + void setExtraTiles( const Vector2i& extra ); - const Vector2i& ExtraTiles() const; + const Vector2i& getExtraTiles() const; - void SetDrawCallback( MapDrawCb Cb ); + void setDrawCallback( MapDrawCb Cb ); - void SetUpdateCallback( MapUpdateCb Cb ); + void setUpdateCallback( MapUpdateCb Cb ); - Texture * GetBlankTileTexture(); + Texture * getBlankTileTexture(); - bool IsTileBlocked( const Vector2i& TilePos ); + bool isTileBlocked( const Vector2i& TilePos ); - void Data( void * value ); + void setData( void * value ); - void * Data() const; + void * getData() const; - const bool& IsMouseOver() const; + const bool& isMouseOver() const; GameObject * IsTypeInTilePos( const Uint32& Type, const Vector2i& TilePos ); - const Uint8& BackAlpha() const; + const Uint8& getBackAlpha() const; - void BackAlpha( const Uint8& alpha ); + void setBackAlpha( const Uint8& alpha ); - const ColorA& BackColor() const; + const ColorA& getBackColor() const; - void BackColor( const ColorA& col ); + void setBackColor( const ColorA& col ); - const Float& Scale() const; + const Float& getScale() const; - void Scale( const Float& scale ); + void setScale( const Float& scale ); - Vector2i GetMaxOffset(); + Vector2i getMaxOffset(); - Uint32 GetNewObjectId(); + Uint32 getNewObjectId(); - GameObjectPolyData& GetPolyObjData( Uint32 Id ); + GameObjectPolyData& getPolyObjData( Uint32 Id ); - void ForceHeadersOnLoad( Sizei mapSize, Sizei tileSize, Uint32 numLayers, Uint32 flags ); + void forceHeadersOnLoad( Sizei mapSize, Sizei tileSize, Uint32 numLayers, Uint32 flags ); - void DisableForcedHeaders(); + void disableForcedHeaders(); - void GridLinesColor( const ColorA& Col ); + void setGridLinesColor( const ColorA& Col ); - const ColorA& GridLinesColor() const; + const ColorA& setGridLinesColor() const; protected: friend class EE::Gaming::Private::UIMapNew; diff --git a/include/eepp/gaming/tilemaplayer.hpp b/include/eepp/gaming/tilemaplayer.hpp index 6afa9e30a..89ce3f81e 100644 --- a/include/eepp/gaming/tilemaplayer.hpp +++ b/include/eepp/gaming/tilemaplayer.hpp @@ -10,23 +10,23 @@ class EE_API TileMapLayer : public MapLayer { public: virtual ~TileMapLayer(); - virtual void Draw( const Vector2f &Offset = Vector2f(0,0) ); + virtual void draw( const Vector2f &Offset = Vector2f(0,0) ); - virtual void Update(); + virtual void update(); - virtual void AddGameObject( GameObject * obj, const Vector2i& TilePos ); + virtual void addGameObject( GameObject * obj, const Vector2i& TilePos ); - virtual void RemoveGameObject( const Vector2i& TilePos ); + virtual void removeGameObject( const Vector2i& TilePos ); - virtual void MoveTileObject( const Vector2i& FromPos, const Vector2i& ToPos ); + virtual void moveTileObject( const Vector2i& FromPos, const Vector2i& ToPos ); - virtual GameObject * GetGameObject( const Vector2i& TilePos ); + virtual GameObject * getGameObject( const Vector2i& TilePos ); - const Vector2i& GetCurrentTile() const; + const Vector2i& getCurrentTile() const; - Vector2i GetTilePosFromPos( const Vector2f& Pos ); + Vector2i getTilePosFromPos( const Vector2f& Pos ); - Vector2f GetPosFromTilePos( const Vector2i& TilePos ); + Vector2f getPosFromTilePos( const Vector2i& TilePos ); protected: friend class TileMap; @@ -36,9 +36,9 @@ class EE_API TileMapLayer : public MapLayer { TileMapLayer( TileMap * map, Sizei size, Uint32 flags, std::string name = "", Vector2f offset = Vector2f(0,0) ); - void AllocateLayer(); + void allocateLayer(); - void DeallocateLayer(); + void deallocateLayer(); }; }} diff --git a/include/eepp/helper/PlusCallback/callback.hpp b/include/eepp/helper/PlusCallback/callback.hpp index 31250f92f..91fe6e937 100644 --- a/include/eepp/helper/PlusCallback/callback.hpp +++ b/include/eepp/helper/PlusCallback/callback.hpp @@ -157,7 +157,7 @@ namespace cb } ///Returns true if the callback has been set, or false if the callback is not set and is invalid. - bool IsSet() const + bool IsSet() const { return 0 != mCallback; } @@ -172,7 +172,7 @@ namespace cb } ///Invokes the callback. This function can sometimes be more convenient than the operator(), which does the same thing. - R Call() const + R Call() const { if (mCallback) return (*mCallback)(); diff --git a/include/eepp/ui/uidragable.hpp b/include/eepp/ui/uidragable.hpp index 1dfa5f6a8..0bdea0858 100644 --- a/include/eepp/ui/uidragable.hpp +++ b/include/eepp/ui/uidragable.hpp @@ -36,7 +36,7 @@ class EE_API UIDragable : public UIControl { virtual Uint32 onMouseUp( const Vector2i& position, const Uint32 flags ); - virtual Uint32 OnDrag( const Vector2i& position ); + virtual Uint32 onDrag( const Vector2i& position ); virtual Uint32 OnDragStart( const Vector2i& position ); diff --git a/projects/linux/ee.files b/projects/linux/ee.files index cfc6f2328..8a75f036f 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -1,3 +1,4 @@ +../../src/eepp/gaming/mapobjectlayer.cpp ee.config ee.includes ../../../eeiv/src/capp.cpp @@ -98,7 +99,6 @@ ee.includes ../../include/eepp/gaming/mapeditor/mapeditor.hpp ../../src/eepp/gaming/mapeditor/maplayerproperties.hpp ../../src/eepp/gaming/tilemaplayer.cpp -../../src/eepp/gaming/objectlayer.cpp ../../src/eepp/gaming/tilemap.cpp ../../src/eepp/gaming/maplightmanager.cpp ../../src/eepp/gaming/maplight.cpp diff --git a/src/eepp/gaming/gameobject.cpp b/src/eepp/gaming/gameobject.cpp index 83596ef0e..4195b3e31 100644 --- a/src/eepp/gaming/gameobject.cpp +++ b/src/eepp/gaming/gameobject.cpp @@ -13,99 +13,99 @@ GameObject::~GameObject() { } -Uint32 GameObject::Type() const { +Uint32 GameObject::getType() const { return GAMEOBJECT_TYPE_BASE; } -bool GameObject::IsType( const Uint32& type ) { - return type == GameObject::Type(); +bool GameObject::isType( const Uint32& type ) { + return type == GameObject::getType(); } -const Uint32& GameObject::Flags() const { +const Uint32& GameObject::getFlags() const { return mFlags; } -Uint32 GameObject::FlagGet( const Uint32& Flag ) { +Uint32 GameObject::getFlag( const Uint32& Flag ) { return mFlags & Flag; } -void GameObject::FlagSet( const Uint32& Flag ) { +void GameObject::setFlag( const Uint32& Flag ) { if ( !( mFlags & Flag ) ) { mFlags |= Flag; } } -void GameObject::FlagClear( const Uint32& Flag ) { +void GameObject::clearFlag( const Uint32& Flag ) { if ( mFlags & Flag ) { mFlags &= ~Flag; } } -Uint32 GameObject::Blocked() const { +bool GameObject::isBlocked() const { return mFlags & GObjFlags::GAMEOBJECT_BLOCKED; } -void GameObject::Blocked( bool blocked ) { - blocked ? FlagSet( GObjFlags::GAMEOBJECT_BLOCKED ) : FlagClear( GObjFlags::GAMEOBJECT_BLOCKED ); +void GameObject::setBlocked( bool blocked ) { + blocked ? setFlag( GObjFlags::GAMEOBJECT_BLOCKED ) : clearFlag( GObjFlags::GAMEOBJECT_BLOCKED ); } -Uint32 GameObject::Rotated() const { +bool GameObject::isRotated() const { return mFlags & GObjFlags::GAMEOBJECT_ROTATE_90DEG; } -void GameObject::Rotated( bool rotated ) { - rotated ? FlagSet( GObjFlags::GAMEOBJECT_ROTATE_90DEG ) : FlagClear( GObjFlags::GAMEOBJECT_ROTATE_90DEG ); +void GameObject::setRotated( bool rotated ) { + rotated ? setFlag( GObjFlags::GAMEOBJECT_ROTATE_90DEG ) : clearFlag( GObjFlags::GAMEOBJECT_ROTATE_90DEG ); } -Uint32 GameObject::Mirrored() const { +bool GameObject::isMirrored() const { return mFlags & GObjFlags::GAMEOBJECT_MIRRORED; } -void GameObject::Mirrored( bool mirrored ) { - mirrored ? FlagSet( GObjFlags::GAMEOBJECT_MIRRORED ) : FlagClear( GObjFlags::GAMEOBJECT_MIRRORED ); +void GameObject::setMirrored( bool mirrored ) { + mirrored ? setFlag( GObjFlags::GAMEOBJECT_MIRRORED ) : clearFlag( GObjFlags::GAMEOBJECT_MIRRORED ); } -Uint32 GameObject::Fliped() const { +bool GameObject::isFliped() const { return mFlags & GObjFlags::GAMEOBJECT_FLIPED; } -void GameObject::Fliped( bool fliped ) { - fliped ? FlagSet( GObjFlags::GAMEOBJECT_FLIPED ) : FlagClear( GObjFlags::GAMEOBJECT_FLIPED ); +void GameObject::setFliped( bool fliped ) { + fliped ? setFlag( GObjFlags::GAMEOBJECT_FLIPED ) : clearFlag( GObjFlags::GAMEOBJECT_FLIPED ); } -void GameObject::Draw() { +void GameObject::draw() { } -void GameObject::Update() { +void GameObject::update() { } -Vector2f GameObject::Pos() const { +Vector2f GameObject::getPosition() const { return Vector2f(); } -void GameObject::Pos( Vector2f pos ) { - AutoFixTilePos(); +void GameObject::setPosition( Vector2f pos ) { + autoFixTilePos(); } -Vector2i GameObject::TilePos() const { +Vector2i GameObject::getTilePosition() const { return Vector2i(); } -void GameObject::TilePos( Vector2i pos ) { +void GameObject::setTilePosition( Vector2i pos ) { } -Sizei GameObject::Size() { +Sizei GameObject::getSize() { return Sizei(); } -Uint32 GameObject::DataId() { +Uint32 GameObject::getDataId() { return 0; } -void GameObject::DataId( Uint32 Id ){ +void GameObject::setDataId( Uint32 Id ){ } -EE_RENDER_MODE GameObject::RenderModeFromFlags() { +EE_RENDER_MODE GameObject::getRenderModeFromFlags() { EE_RENDER_MODE Render = RN_NORMAL; if ( ( mFlags & GObjFlags::GAMEOBJECT_MIRRORED ) && ( mFlags & GObjFlags::GAMEOBJECT_FLIPED ) ) { @@ -119,36 +119,36 @@ EE_RENDER_MODE GameObject::RenderModeFromFlags() { return Render; } -MapLayer * GameObject::Layer() const { +MapLayer * GameObject::getLayer() const { return mLayer; } -void GameObject::AutoFixTilePos() { - if ( ( mFlags & GObjFlags::GAMEOBJECT_AUTO_FIX_TILE_POS ) && NULL != mLayer && mLayer->Type() == MAP_LAYER_TILED ) { - Vector2i CurPos = TilePos(); +void GameObject::autoFixTilePos() { + if ( ( mFlags & GObjFlags::GAMEOBJECT_AUTO_FIX_TILE_POS ) && NULL != mLayer && mLayer->getType() == MAP_LAYER_TILED ) { + Vector2i CurPos = getTilePosition(); - AssignTilePos(); + assignTilePos(); - Vector2i NewPos = TilePos(); + Vector2i NewPos = getTilePosition(); if ( CurPos != NewPos ) { TileMapLayer * TLayer = static_cast ( mLayer ); - if ( TLayer->GetGameObject( CurPos ) == this ) { - TLayer->MoveTileObject( CurPos, NewPos ); + if ( TLayer->getGameObject( CurPos ) == this ) { + TLayer->moveTileObject( CurPos, NewPos ); } } } } -void GameObject::AssignTilePos() { +void GameObject::assignTilePos() { TileMapLayer * TLayer = static_cast ( mLayer ); - TilePos( TLayer->GetTilePosFromPos( Pos() ) ); + setTilePosition( TLayer->getTilePosFromPos( getPosition() ) ); } -Float GameObject::GetAngle() { - return Rotated() ? 90 : 0; +Float GameObject::getRotation() { + return isRotated() ? 90 : 0; } }} diff --git a/src/eepp/gaming/gameobjectobject.cpp b/src/eepp/gaming/gameobjectobject.cpp index 4626f14ee..50439b7bd 100644 --- a/src/eepp/gaming/gameobjectobject.cpp +++ b/src/eepp/gaming/gameobjectobject.cpp @@ -21,20 +21,20 @@ GameObjectObject::GameObjectObject( Uint32 DataId, const Rectf& rect, MapLayer * GameObjectObject::~GameObjectObject() { } -Uint32 GameObjectObject::Type() const { +Uint32 GameObjectObject::getType() const { return GAMEOBJECT_TYPE_OBJECT; } -bool GameObjectObject::IsType( const Uint32& type ) { - return ( GameObjectObject::Type() == type ) ? true : GameObject::IsType( type ); +bool GameObjectObject::isType( const Uint32& type ) { + return ( GameObjectObject::getType() == type ) ? true : GameObject::isType( type ); } -Sizei GameObjectObject::Size() { +Sizei GameObjectObject::getSize() { Sizef size( mRect.getSize() ); return Sizei( size.x, size.y ); } -void GameObjectObject::Draw() { +void GameObjectObject::draw() { Int32 selAdd = mSelected ? 50 : 0; Int32 colFill = 100 + selAdd; @@ -48,17 +48,17 @@ void GameObjectObject::Draw() { P.drawRectangle( mRect ); } -Vector2f GameObjectObject::Pos() const { +Vector2f GameObjectObject::getPosition() const { return mPos; } -void GameObjectObject::Pos( Vector2f pos ) { +void GameObjectObject::setPosition( Vector2f pos ) { mPoly.move( pos - mPos ); mPos = pos; - mRect = Rectf( pos, Sizef( Size().x, Size().y ) ); + mRect = Rectf( pos, Sizef( getSize().x, getSize().y ) ); } -void GameObjectObject::SetPolygonPoint( Uint32 index, Vector2f p ) { +void GameObjectObject::setPolygonPoint( Uint32 index, Vector2f p ) { switch ( index ) { case 0: { @@ -93,75 +93,75 @@ void GameObjectObject::SetPolygonPoint( Uint32 index, Vector2f p ) { mPoly = mRect; } -Uint32 GameObjectObject::DataId() { +Uint32 GameObjectObject::getDataId() { return mDataId; } -void GameObjectObject::DataId( Uint32 Id ) { +void GameObjectObject::setDataId( Uint32 Id ) { mDataId = Id; } -void GameObjectObject::ClearProperties() { +void GameObjectObject::clearProperties() { mProperties.clear(); } -void GameObjectObject::AddProperty( std::string Text, std::string Value ) { +void GameObjectObject::addProperty( std::string Text, std::string Value ) { mProperties[ Text ] = Value; } -void GameObjectObject::EditProperty( std::string Text, std::string Value ) { +void GameObjectObject::editProperty( std::string Text, std::string Value ) { mProperties[ Text ] = Value; } -void GameObjectObject::RemoveProperty( std::string Text ) { +void GameObjectObject::removeProperty( std::string Text ) { mProperties.erase( Text ); } -GameObjectObject::PropertiesMap& GameObjectObject::GetProperties() { +GameObjectObject::PropertiesMap& GameObjectObject::getProperties() { return mProperties; } -Uint32 GameObjectObject::GetPropertyCount() { +Uint32 GameObjectObject::getPropertyCount() { return mProperties.size(); } -const std::string& GameObjectObject::Name() const { +const std::string& GameObjectObject::getName() const { return mName; } -void GameObjectObject::Name( const std::string& name ) { +void GameObjectObject::setName( const std::string& name ) { mName = name; } -const std::string& GameObjectObject::TypeName() const { +const std::string& GameObjectObject::getTypeName() const { return mType; } -void GameObjectObject::TypeName( const std::string& type ) { +void GameObjectObject::setTypeName( const std::string& type ) { mType = type; } -Polygon2f& GameObjectObject::GetPolygon() { +Polygon2f& GameObjectObject::getPolygon() { return mPoly; } -bool GameObjectObject::PointInside( const Vector2f& p ) { +bool GameObjectObject::pointInside( const Vector2f& p ) { return mRect.contains( p ); } -void GameObjectObject::SetProperties( const PropertiesMap& prop ) { +void GameObjectObject::setProperties( const PropertiesMap& prop ) { mProperties = prop; } -const bool& GameObjectObject::Selected() const { +const bool& GameObjectObject::isSelected() const { return mSelected; } -void GameObjectObject::Selected( const bool& sel ) { +void GameObjectObject::setSelected( const bool& sel ) { mSelected = sel; } -GameObjectObject * GameObjectObject::Copy() { +GameObjectObject * GameObjectObject::clone() { return eeNew( GameObjectObject, ( mDataId, mRect, mLayer, mFlags ) ); } diff --git a/src/eepp/gaming/gameobjectpolygon.cpp b/src/eepp/gaming/gameobjectpolygon.cpp index b80c80b55..db7e59317 100644 --- a/src/eepp/gaming/gameobjectpolygon.cpp +++ b/src/eepp/gaming/gameobjectpolygon.cpp @@ -15,19 +15,19 @@ GameObjectPolygon::GameObjectPolygon( Uint32 DataId, Polygon2f poly, MapLayer * GameObjectPolygon::~GameObjectPolygon() { } -Uint32 GameObjectPolygon::Type() const { +Uint32 GameObjectPolygon::getType() const { return GAMEOBJECT_TYPE_POLYGON; } -bool GameObjectPolygon::IsType( const Uint32& type ) { - return ( GameObjectPolygon::Type() == type ) ? true : GameObjectObject::IsType( type ); +bool GameObjectPolygon::isType( const Uint32& type ) { + return ( GameObjectPolygon::getType() == type ) ? true : GameObjectObject::isType( type ); } -Sizei GameObjectPolygon::Size() { +Sizei GameObjectPolygon::getSize() { return Sizei( mRect.getSize().x, mRect.getSize().y ); } -void GameObjectPolygon::Draw() { +void GameObjectPolygon::draw() { Int32 selAdd = mSelected ? 50 : 0; Int32 colFill = 100 + selAdd; @@ -41,21 +41,21 @@ void GameObjectPolygon::Draw() { P.drawPolygon( mPoly ); } -void GameObjectPolygon::SetPolygonPoint( Uint32 index, Vector2f p ) { +void GameObjectPolygon::setPolygonPoint( Uint32 index, Vector2f p ) { mPoly.setAt( index, p ); mRect = mPoly.toAABB(); mPos = Vector2f( mRect.Left, mRect.Top ); } -bool GameObjectPolygon::PointInside( const Vector2f& p ) { - if ( GameObjectObject::PointInside( p ) ) { +bool GameObjectPolygon::pointInside( const Vector2f& p ) { + if ( GameObjectObject::pointInside( p ) ) { return mPoly.pointInside( p ); } return false; } -GameObjectObject * GameObjectPolygon::Copy() { +GameObjectObject * GameObjectPolygon::clone() { return eeNew( GameObjectPolygon, ( mDataId, mPoly, mLayer, mFlags ) ); } diff --git a/src/eepp/gaming/gameobjectpolyline.cpp b/src/eepp/gaming/gameobjectpolyline.cpp index 7d0df5eca..9a8a64440 100644 --- a/src/eepp/gaming/gameobjectpolyline.cpp +++ b/src/eepp/gaming/gameobjectpolyline.cpp @@ -14,15 +14,15 @@ GameObjectPolyline::GameObjectPolyline( Uint32 DataId, Polygon2f poly, MapLayer GameObjectPolyline::~GameObjectPolyline() { } -Uint32 GameObjectPolyline::Type() const { +Uint32 GameObjectPolyline::getType() const { return GAMEOBJECT_TYPE_POLYGON; } -bool GameObjectPolyline::IsType( const Uint32& type ) { - return ( GameObjectPolyline::Type() == type ) ? true : GameObjectPolygon::IsType( type ); +bool GameObjectPolyline::isType( const Uint32& type ) { + return ( GameObjectPolyline::getType() == type ) ? true : GameObjectPolygon::isType( type ); } -void GameObjectPolyline::Draw() { +void GameObjectPolyline::draw() { Primitives P; if ( mSelected ) { @@ -36,7 +36,7 @@ void GameObjectPolyline::Draw() { P.drawPolygon( mPoly ); } -GameObjectObject * GameObjectPolyline::Copy() { +GameObjectObject * GameObjectPolyline::clone() { return eeNew( GameObjectPolyline, ( mDataId, mPoly, mLayer, mFlags ) ); } diff --git a/src/eepp/gaming/gameobjectsprite.cpp b/src/eepp/gaming/gameobjectsprite.cpp index 01133ef52..082744225 100644 --- a/src/eepp/gaming/gameobjectsprite.cpp +++ b/src/eepp/gaming/gameobjectsprite.cpp @@ -11,55 +11,55 @@ GameObjectSprite::GameObjectSprite( const Uint32& Flags, MapLayer * Layer, Graph mSprite( Sprite ) { if ( NULL != mSprite ) - mSprite->setRenderMode( RenderModeFromFlags() ); + mSprite->setRenderMode( getRenderModeFromFlags() ); - AssignTilePos(); + assignTilePos(); } GameObjectSprite::~GameObjectSprite() { eeSAFE_DELETE( mSprite ); } -Uint32 GameObjectSprite::Type() const { +Uint32 GameObjectSprite::getType() const { return GAMEOBJECT_TYPE_SPRITE; } -bool GameObjectSprite::IsType( const Uint32& type ) { - return ( GameObjectSprite::Type() == type ) ? true : GameObject::IsType( type ); +bool GameObjectSprite::isType( const Uint32& type ) { + return ( GameObjectSprite::getType() == type ) ? true : GameObject::isType( type ); } -void GameObjectSprite::Draw() { +void GameObjectSprite::draw() { if ( NULL != mSprite ) { - mSprite->setRotation( GetAngle() ); + mSprite->setRotation( getRotation() ); - if ( mLayer->Map()->LightsEnabled() && mLayer->LightsEnabled() ) { - MapLightManager * LM = mLayer->Map()->GetLightManager(); + if ( mLayer->getMap()->getLightsEnabled() && mLayer->getLightsEnabled() ) { + MapLightManager * LM = mLayer->getMap()->getLightManager(); - if ( MAP_LAYER_TILED == mLayer->Type() ) { - Vector2i Tile = reinterpret_cast ( mLayer )->GetCurrentTile(); + if ( MAP_LAYER_TILED == mLayer->getType() ) { + Vector2i Tile = reinterpret_cast ( mLayer )->getCurrentTile(); - if ( LM->IsByVertex() ) { + if ( LM->isByVertex() ) { mSprite->updateVertexColors( - *LM->GetTileColor( Tile, 0 ), - *LM->GetTileColor( Tile, 1 ), - *LM->GetTileColor( Tile, 2 ), - *LM->GetTileColor( Tile, 3 ) + *LM->getTileColor( Tile, 0 ), + *LM->getTileColor( Tile, 1 ), + *LM->getTileColor( Tile, 2 ), + *LM->getTileColor( Tile, 3 ) ); } else { - mSprite->setColor( *LM->GetTileColor( Tile ) ); + mSprite->setColor( *LM->getTileColor( Tile ) ); } } else { - if ( LM->IsByVertex() ) { + if ( LM->isByVertex() ) { Quad2f Q = mSprite->getQuad(); mSprite->updateVertexColors( - LM->GetColorFromPos( Q.V[0] ), - LM->GetColorFromPos( Q.V[1] ), - LM->GetColorFromPos( Q.V[2] ), - LM->GetColorFromPos( Q.V[3] ) + LM->getColorFromPos( Q.V[0] ), + LM->getColorFromPos( Q.V[1] ), + LM->getColorFromPos( Q.V[2] ), + LM->getColorFromPos( Q.V[3] ) ); } else { - mSprite->setColor( LM->GetColorFromPos( mSprite->getPosition() ) ); + mSprite->setColor( LM->getColorFromPos( mSprite->getPosition() ) ); } } } @@ -68,57 +68,57 @@ void GameObjectSprite::Draw() { } } -Vector2f GameObjectSprite::Pos() const { +Vector2f GameObjectSprite::getPosition() const { if ( NULL != mSprite ) return mSprite->getPosition(); return Vector2f(); } -void GameObjectSprite::Pos( Vector2f pos ) { +void GameObjectSprite::setPosition( Vector2f pos ) { if ( NULL != mSprite ) { mSprite->setPosition( pos ); - GameObject::Pos( pos ); + GameObject::setPosition( pos ); } } -Vector2i GameObjectSprite::TilePos() const { +Vector2i GameObjectSprite::getTilePosition() const { return mTilePos; } -void GameObjectSprite::TilePos( Vector2i pos ) { +void GameObjectSprite::setTilePosition( Vector2i pos ) { mTilePos = pos; } -Sizei GameObjectSprite::Size() { +Sizei GameObjectSprite::getSize() { if ( NULL != mSprite ) return mSprite->getSubTexture(0)->getRealSize(); return Sizei(); } -Graphics::Sprite * GameObjectSprite::Sprite() const { +Graphics::Sprite * GameObjectSprite::getSprite() const { return mSprite; } -void GameObjectSprite::Sprite( Graphics::Sprite * sprite ) { +void GameObjectSprite::setSprite( Graphics::Sprite * sprite ) { eeSAFE_DELETE( mSprite ); mSprite = sprite; - mSprite->setRenderMode( RenderModeFromFlags() ); + mSprite->setRenderMode( getRenderModeFromFlags() ); } -void GameObjectSprite::FlagSet( const Uint32& Flag ) { +void GameObjectSprite::setFlag( const Uint32& Flag ) { if ( NULL != mSprite ) - mSprite->setRenderMode( RenderModeFromFlags() ); + mSprite->setRenderMode( getRenderModeFromFlags() ); - GameObject::FlagSet( Flag ); + GameObject::setFlag( Flag ); } -Uint32 GameObjectSprite::DataId() { +Uint32 GameObjectSprite::getDataId() { return mSprite->getSubTexture(0)->getId(); } -void GameObjectSprite::DataId( Uint32 Id ) { +void GameObjectSprite::setDataId( Uint32 Id ) { Graphics::Sprite * tSprite = NULL; if ( mFlags & GObjFlags::GAMEOBJECT_ANIMATED ) { @@ -129,13 +129,13 @@ void GameObjectSprite::DataId( Uint32 Id ) { tSprite->createAnimation(); tSprite->addFrames( tSubTextureVec ); - Sprite( tSprite ); + setSprite( tSprite ); } } else { Graphics::SubTexture * tSubTexture = TextureAtlasManager::instance()->getSubTextureById( Id ); if ( NULL != tSubTexture ) { - Sprite( eeNew( Graphics::Sprite, ( tSubTexture ) ) ); + setSprite( eeNew( Graphics::Sprite, ( tSubTexture ) ) ); } } } diff --git a/src/eepp/gaming/gameobjectsubtexture.cpp b/src/eepp/gaming/gameobjectsubtexture.cpp index d2c1906a0..832e05cf3 100644 --- a/src/eepp/gaming/gameobjectsubtexture.cpp +++ b/src/eepp/gaming/gameobjectsubtexture.cpp @@ -11,106 +11,106 @@ GameObjectSubTexture::GameObjectSubTexture( const Uint32& Flags, MapLayer * Laye mSubTexture( SubTexture ), mPos( Pos ) { - AssignTilePos(); + assignTilePos(); } GameObjectSubTexture::~GameObjectSubTexture() { } -Uint32 GameObjectSubTexture::Type() const { +Uint32 GameObjectSubTexture::getType() const { return GAMEOBJECT_TYPE_SUBTEXTURE; } -bool GameObjectSubTexture::IsType( const Uint32& type ) { - return ( GameObjectSubTexture::Type() == type ) ? true : GameObject::IsType( type ); +bool GameObjectSubTexture::isType( const Uint32& type ) { + return ( GameObjectSubTexture::getType() == type ) ? true : GameObject::isType( type ); } -void GameObjectSubTexture::Draw() { +void GameObjectSubTexture::draw() { if ( NULL != mSubTexture ) { - if ( mLayer->Map()->LightsEnabled() && mLayer->LightsEnabled() ) { - MapLightManager * LM = mLayer->Map()->GetLightManager(); + if ( mLayer->getMap()->getLightsEnabled() && mLayer->getLightsEnabled() ) { + MapLightManager * LM = mLayer->getMap()->getLightManager(); - if ( MAP_LAYER_TILED == mLayer->Type() ) { - Vector2i Tile = reinterpret_cast ( mLayer )->GetCurrentTile(); + if ( MAP_LAYER_TILED == mLayer->getType() ) { + Vector2i Tile = reinterpret_cast ( mLayer )->getCurrentTile(); - if ( LM->IsByVertex() ) { + if ( LM->isByVertex() ) { mSubTexture->draw( mPos.x, mPos.y, - GetAngle(), + getRotation(), Vector2f::One, - *LM->GetTileColor( Tile, 0 ), - *LM->GetTileColor( Tile, 1 ), - *LM->GetTileColor( Tile, 2 ), - *LM->GetTileColor( Tile, 3 ), + *LM->getTileColor( Tile, 0 ), + *LM->getTileColor( Tile, 1 ), + *LM->getTileColor( Tile, 2 ), + *LM->getTileColor( Tile, 3 ), ALPHA_NORMAL, - RenderModeFromFlags() + getRenderModeFromFlags() ); } else { - mSubTexture->draw( mPos.x, mPos.y, *LM->GetTileColor( Tile ), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, *LM->getTileColor( Tile ), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); } } else { - if ( LM->IsByVertex() ) { + if ( LM->isByVertex() ) { mSubTexture->draw( mPos.x, mPos.y, - GetAngle(), + getRotation(), Vector2f::One, - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->getDestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y + mSubTexture->getDestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().y, mPos.y ) ), + LM->getColorFromPos( Vector2f( mPos.x, mPos.y ) ), + LM->getColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->getColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->getColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().y, mPos.y ) ), ALPHA_NORMAL, - RenderModeFromFlags() + getRenderModeFromFlags() ); } else { - mSubTexture->draw( mPos.x, mPos.y, LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, LM->getColorFromPos( Vector2f( mPos.x, mPos.y ) ), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); } } } else { - mSubTexture->draw( mPos.x, mPos.y, ColorA(), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, ColorA(), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); } } } -Vector2f GameObjectSubTexture::Pos() const { +Vector2f GameObjectSubTexture::getPosition() const { return mPos; } -void GameObjectSubTexture::Pos( Vector2f pos ) { +void GameObjectSubTexture::setPosition( Vector2f pos ) { mPos = pos; - GameObject::Pos( pos ); + GameObject::setPosition( pos ); } -Vector2i GameObjectSubTexture::TilePos() const { +Vector2i GameObjectSubTexture::getTilePosition() const { return mTilePos; } -void GameObjectSubTexture::TilePos( Vector2i pos ) { +void GameObjectSubTexture::setTilePosition( Vector2i pos ) { mTilePos = pos; } -Sizei GameObjectSubTexture::Size() { +Sizei GameObjectSubTexture::getSize() { if ( NULL != mSubTexture ) return mSubTexture->getRealSize(); return Sizei(); } -Graphics::SubTexture * GameObjectSubTexture::SubTexture() const { +Graphics::SubTexture * GameObjectSubTexture::getSubTexture() const { return mSubTexture; } -void GameObjectSubTexture::SubTexture( Graphics::SubTexture * subTexture ) { +void GameObjectSubTexture::setSubTexture( Graphics::SubTexture * subTexture ) { mSubTexture = subTexture; } -Uint32 GameObjectSubTexture::DataId() { +Uint32 GameObjectSubTexture::getDataId() { return mSubTexture->getId(); } -void GameObjectSubTexture::DataId( Uint32 Id ) { - SubTexture( TextureAtlasManager::instance()->getSubTextureById( Id ) ); +void GameObjectSubTexture::setDataId( Uint32 Id ) { + setSubTexture( TextureAtlasManager::instance()->getSubTextureById( Id ) ); } }} diff --git a/src/eepp/gaming/gameobjectsubtextureex.cpp b/src/eepp/gaming/gameobjectsubtextureex.cpp index 4918e3752..620fe4d42 100644 --- a/src/eepp/gaming/gameobjectsubtextureex.cpp +++ b/src/eepp/gaming/gameobjectsubtextureex.cpp @@ -13,64 +13,64 @@ GameObjectSubTextureEx::GameObjectSubTextureEx( const Uint32& Flags, MapLayer * mColor( Color ), mVertexColors( NULL ) { - mRender = RenderModeFromFlags(); + mRender = getRenderModeFromFlags(); if ( 0 == mAngle ) - mAngle = GetAngle(); + mAngle = getRotation(); } GameObjectSubTextureEx::~GameObjectSubTextureEx() { } -Uint32 GameObjectSubTextureEx::Type() const { +Uint32 GameObjectSubTextureEx::getType() const { return GAMEOBJECT_TYPE_SUBTEXTUREEX; } -bool GameObjectSubTextureEx::IsType( const Uint32& type ) { - return ( GameObjectSubTextureEx::Type() == type ) ? true : GameObjectSubTexture::IsType( type ); +bool GameObjectSubTextureEx::isType( const Uint32& type ) { + return ( GameObjectSubTextureEx::getType() == type ) ? true : GameObjectSubTexture::isType( type ); } -void GameObjectSubTextureEx::Draw() { +void GameObjectSubTextureEx::draw() { if ( NULL != mSubTexture ) { - if ( mLayer->Map()->LightsEnabled() && mLayer->LightsEnabled() ) { - MapLightManager * LM = mLayer->Map()->GetLightManager(); + if ( mLayer->getMap()->getLightsEnabled() && mLayer->getLightsEnabled() ) { + MapLightManager * LM = mLayer->getMap()->getLightManager(); - if ( MAP_LAYER_TILED == mLayer->Type() ) { - Vector2i Tile = reinterpret_cast ( mLayer )->GetCurrentTile(); + if ( MAP_LAYER_TILED == mLayer->getType() ) { + Vector2i Tile = reinterpret_cast ( mLayer )->getCurrentTile(); - if ( LM->IsByVertex() ) { + if ( LM->isByVertex() ) { mSubTexture->draw( mPos.x, mPos.y, mAngle, mScale, - *LM->GetTileColor( Tile, 0 ), - *LM->GetTileColor( Tile, 1 ), - *LM->GetTileColor( Tile, 2 ), - *LM->GetTileColor( Tile, 3 ), + *LM->getTileColor( Tile, 0 ), + *LM->getTileColor( Tile, 1 ), + *LM->getTileColor( Tile, 2 ), + *LM->getTileColor( Tile, 3 ), mBlend, mRender ); } else { - mSubTexture->draw( mPos.x, mPos.y, *LM->GetTileColor( Tile ), mAngle, mScale, mBlend, mRender ); + mSubTexture->draw( mPos.x, mPos.y, *LM->getTileColor( Tile ), mAngle, mScale, mBlend, mRender ); } } else { - if ( LM->IsByVertex() ) { + if ( LM->isByVertex() ) { mSubTexture->draw( mPos.x, mPos.y, mAngle, mScale, - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->getDestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y + mSubTexture->getDestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y ) ), + LM->getColorFromPos( Vector2f( mPos.x, mPos.y ) ), + LM->getColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->getColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->getColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y ) ), mBlend, mRender ); } else { - mSubTexture->draw( mPos.x, mPos.y, LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), mAngle, mScale, mBlend, mRender ); + mSubTexture->draw( mPos.x, mPos.y, LM->getColorFromPos( Vector2f( mPos.x, mPos.y ) ), mAngle, mScale, mBlend, mRender ); } } } else { @@ -83,10 +83,10 @@ void GameObjectSubTextureEx::Draw() { } } -void GameObjectSubTextureEx::FlagSet( const Uint32& Flag ) { - mRender = RenderModeFromFlags(); +void GameObjectSubTextureEx::setFlag( const Uint32& Flag ) { + mRender = getRenderModeFromFlags(); - GameObject::FlagSet( Flag ); + GameObject::setFlag( Flag ); } }} diff --git a/src/eepp/gaming/gameobjectvirtual.cpp b/src/eepp/gaming/gameobjectvirtual.cpp index faa2d176e..9e1b838cd 100644 --- a/src/eepp/gaming/gameobjectvirtual.cpp +++ b/src/eepp/gaming/gameobjectvirtual.cpp @@ -33,72 +33,72 @@ GameObjectVirtual::GameObjectVirtual( SubTexture * SubTexture, MapLayer * Layer, GameObjectVirtual::~GameObjectVirtual() { } -Uint32 GameObjectVirtual::Type() const { +Uint32 GameObjectVirtual::getType() const { return GAMEOBJECT_TYPE_VIRTUAL; } -bool GameObjectVirtual::IsType( const Uint32& type ) { - return ( GameObjectVirtual::Type() == type ) ? true : GameObject::IsType( type ); +bool GameObjectVirtual::isType( const Uint32& type ) { + return ( GameObjectVirtual::getType() == type ) ? true : GameObject::isType( type ); } -Uint32 GameObjectVirtual::RealType() const { +Uint32 GameObjectVirtual::getRealType() const { return mType; } -Sizei GameObjectVirtual::Size() { +Sizei GameObjectVirtual::getSize() { if ( NULL != mSubTexture ) return mSubTexture->getRealSize(); if ( NULL != mLayer ) - return mLayer->Map()->TileSize(); + return mLayer->getMap()->getTileSize(); return Sizei( 32, 32 ); } -void GameObjectVirtual::Draw() { +void GameObjectVirtual::draw() { if ( NULL != mSubTexture ) { - if ( mLayer->Map()->LightsEnabled() && mLayer->LightsEnabled() ) { - MapLightManager * LM = mLayer->Map()->GetLightManager(); + if ( mLayer->getMap()->getLightsEnabled() && mLayer->getLightsEnabled() ) { + MapLightManager * LM = mLayer->getMap()->getLightManager(); - if ( MAP_LAYER_TILED == mLayer->Type() ) { - Vector2i Tile = reinterpret_cast ( mLayer )->GetCurrentTile(); + if ( MAP_LAYER_TILED == mLayer->getType() ) { + Vector2i Tile = reinterpret_cast ( mLayer )->getCurrentTile(); - if ( LM->IsByVertex() ) { + if ( LM->isByVertex() ) { mSubTexture->draw( mPos.x, mPos.y, - GetAngle(), + getRotation(), Vector2f::One, - *LM->GetTileColor( Tile, 0 ), - *LM->GetTileColor( Tile, 1 ), - *LM->GetTileColor( Tile, 2 ), - *LM->GetTileColor( Tile, 3 ), + *LM->getTileColor( Tile, 0 ), + *LM->getTileColor( Tile, 1 ), + *LM->getTileColor( Tile, 2 ), + *LM->getTileColor( Tile, 3 ), ALPHA_NORMAL, - RenderModeFromFlags() + getRenderModeFromFlags() ); } else { - mSubTexture->draw( mPos.x, mPos.y, *LM->GetTileColor( Tile ), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, *LM->getTileColor( Tile ), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); } } else { - if ( LM->IsByVertex() ) { + if ( LM->isByVertex() ) { mSubTexture->draw( mPos.x, mPos.y, - GetAngle(), + getRotation(), Vector2f::One, - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->getDestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y + mSubTexture->getDestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y ) ), + LM->getColorFromPos( Vector2f( mPos.x, mPos.y ) ), + LM->getColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->getColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y + mSubTexture->getDestSize().y ) ), + LM->getColorFromPos( Vector2f( mPos.x + mSubTexture->getDestSize().x, mPos.y ) ), ALPHA_NORMAL, - RenderModeFromFlags() + getRenderModeFromFlags() ); } else { - mSubTexture->draw( mPos.x, mPos.y, LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, LM->getColorFromPos( Vector2f( mPos.x, mPos.y ) ), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); } } } else { - mSubTexture->draw( mPos.x, mPos.y, ColorA(), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, ColorA(), getRotation(), Vector2f::One, ALPHA_NORMAL, getRenderModeFromFlags() ); } } else { Primitives P; @@ -109,7 +109,7 @@ void GameObjectVirtual::Draw() { P.setColor( C ); if ( NULL != mLayer ) { - Sizei ts = mLayer->Map()->TileSize(); + Sizei ts = mLayer->getMap()->getTileSize(); P.drawRectangle( Rectf( Vector2f( mPos.x, mPos.y ), Sizef( ts.x ,ts.y ) ), 0, Vector2f::One ); } else { P.drawRectangle( Rectf( Vector2f( mPos.x, mPos.y ), Sizef( 32 ,32 ) ), 0, Vector2f::One ); @@ -117,23 +117,23 @@ void GameObjectVirtual::Draw() { } } -Vector2f GameObjectVirtual::Pos() const { +Vector2f GameObjectVirtual::getPosition() const { return mPos; } -void GameObjectVirtual::Pos( Vector2f pos ) { +void GameObjectVirtual::setPosition( Vector2f pos ) { mPos = pos; } -Uint32 GameObjectVirtual::DataId() { +Uint32 GameObjectVirtual::getDataId() { return mDataId; } -void GameObjectVirtual::DataId( Uint32 Id ) { +void GameObjectVirtual::setDataId( Uint32 Id ) { mDataId = Id; } -void GameObjectVirtual::SetLayer( MapLayer * Layer ) { +void GameObjectVirtual::setLayer( MapLayer * Layer ) { mLayer = Layer; } diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index b0a69f9d1..f6edc31f3 100644 --- a/src/eepp/gaming/mapeditor/mapeditor.cpp +++ b/src/eepp/gaming/mapeditor/mapeditor.cpp @@ -203,7 +203,7 @@ void MapEditor::CreateTabs() { mTabWidget->add( "Sprites", mSubTextureCont ); if ( NULL != mUIMap && NULL != mUIMap->Map() ) { - if ( mUIMap->Map()->LightsEnabled() ) { + if ( mUIMap->Map()->getLightsEnabled() ) { mTabWidget->add( "Lights", mLightCont ); } } @@ -215,13 +215,13 @@ void MapEditor::OnTabSelected( const UIEvent * Event ) { if ( NULL != mUIMap ) { switch ( mTabWidget->getSelectedTabIndex() ) { case 0: - mUIMap->EditingDisabled(); + mUIMap->editingDisable(); break; case 1: - mUIMap->EditingLights( true ); + mUIMap->setEditingLights( true ); break; case 2: - mUIMap->EditingObjects( true ); + mUIMap->setEditingObjects( true ); break; } } @@ -433,7 +433,7 @@ void MapEditor::OnObjectModeSel( const UIEvent * Event ) { Button->select(); - mUIMap->EditingObjMode( (UIMap::EDITING_OBJ_MODE)Button->getData() ); + mUIMap->setEditingObjMode( (UIMap::EDITING_OBJ_MODE)Button->getData() ); } void MapEditor::CreateUIMap() { @@ -472,12 +472,12 @@ void MapEditor::CreateUIMap() { mUIMap->addEventListener( UIEvent::EventOnSizeChange, cb::Make1( this, &MapEditor::OnMapSizeChange ) ); mUIMap->addEventListener( UIEvent::EventMouseDown, cb::Make1( this, &MapEditor::OnMapMouseDown ) ); mUIMap->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapEditor::OnMapMouseClick ) ); - mUIMap->SetLightSelectCb( cb::Make1( this, &MapEditor::OnLightSelect ) ); - mUIMap->SetLightRadiusChangeCb( cb::Make1( this, &MapEditor::OnLightRadiusChange ) ); - mUIMap->SetAddObjectCallback( cb::Make2( this, &MapEditor::OnAddObject ) ); - mUIMap->SetAlertCb( cb::Make2( this, &MapEditor::CreateAlert ) ); - mUIMap->SetUpdateScrollCb( cb::Make0( this, &MapEditor::UpdateScroll ) ); - mUIMap->SetTileBox( mTileBox ); + mUIMap->setLightSelectCb( cb::Make1( this, &MapEditor::OnLightSelect ) ); + mUIMap->setLightRadiusChangeCb( cb::Make1( this, &MapEditor::OnLightRadiusChange ) ); + mUIMap->setAddObjectCallback( cb::Make2( this, &MapEditor::OnAddObject ) ); + mUIMap->setAlertCb( cb::Make2( this, &MapEditor::CreateAlert ) ); + mUIMap->setUpdateScrollCb( cb::Make0( this, &MapEditor::UpdateScroll ) ); + mUIMap->setTileBox( mTileBox ); mMapHScroll = mTheme->createScrollBar( mWinContainer, Sizei( Params.Size.getWidth(), ScrollH ), Vector2i( 0, mWinContainer->getSize().getHeight() - ScrollH ), UI_ANCHOR_LEFT | UI_ANCHOR_RIGHT | UI_ANCHOR_BOTTOM | UI_AUTO_SIZE ); mMapHScroll->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &MapEditor::OnScrollMapH ) ); @@ -494,7 +494,7 @@ void MapEditor::OnAddObject( Uint32 Type, Polygon2f poly ) { return; } - if ( mCurLayer->Type() != MAP_LAYER_OBJECT ) { + if ( mCurLayer->getType() != MAP_LAYER_OBJECT ) { CreateAlert( "Wrong Layer", "Objects only can be added to an Object Layer" )->setFocus(); return; } @@ -506,46 +506,46 @@ void MapEditor::OnAddObject( Uint32 Type, Polygon2f poly ) { MapObjectLayer * OL = static_cast ( mCurLayer ); if ( GAMEOBJECT_TYPE_OBJECT == Type ) { - OL->AddGameObject( eeNew( GameObjectObject, ( mUIMap->Map()->GetNewObjectId(), poly.toAABB(), mCurLayer ) ) ); + OL->addGameObject( eeNew( GameObjectObject, ( mUIMap->Map()->getNewObjectId(), poly.toAABB(), mCurLayer ) ) ); } else if ( GAMEOBJECT_TYPE_POLYGON == Type ) { - OL->AddGameObject( eeNew( GameObjectPolygon, ( mUIMap->Map()->GetNewObjectId(), poly, mCurLayer ) ) ); + OL->addGameObject( eeNew( GameObjectPolygon, ( mUIMap->Map()->getNewObjectId(), poly, mCurLayer ) ) ); } else if ( GAMEOBJECT_TYPE_POLYLINE == Type ) { - OL->AddGameObject( eeNew( GameObjectPolyline, ( mUIMap->Map()->GetNewObjectId(), poly, mCurLayer ) ) ); + OL->addGameObject( eeNew( GameObjectPolyline, ( mUIMap->Map()->getNewObjectId(), poly, mCurLayer ) ) ); } } void MapEditor::OnLightTypeChange( const UIEvent * Event ) { - if ( NULL != mUIMap->GetSelectedLight() ) { - mUIMap->GetSelectedLight()->Type( mLightTypeChk->isActive() ? LIGHT_ISOMETRIC : LIGHT_NORMAL ); + if ( NULL != mUIMap->getSelectedLight() ) { + mUIMap->getSelectedLight()->setType( mLightTypeChk->isActive() ? LIGHT_ISOMETRIC : LIGHT_NORMAL ); } } void MapEditor::OnLightRadiusChangeVal( const UIEvent * Event ) { - if ( NULL != mUIMap->GetSelectedLight() ) { - mUIMap->GetSelectedLight()->Radius( mLightRadius->getValue() ); + if ( NULL != mUIMap->getSelectedLight() ) { + mUIMap->getSelectedLight()->setRadius( mLightRadius->getValue() ); } } void MapEditor::OnLightRadiusChange( MapLight * Light ) { - mLightRadius->setValue( Light->Radius() ); + mLightRadius->setValue( Light->getRadius() ); } void MapEditor::OnLightSelect( MapLight * Light ) { - ColorA Col( Light->Color() ); + ColorA Col( Light->getColor() ); mUIRedSlider->setValue( Col.r() ); mUIGreenSlider->setValue( Col.g() ); mUIBlueSlider->setValue( Col.b() ); - mLightRadius->setValue( Light->Radius() ); - mLightTypeChk->setActive( Light->Type() == LIGHT_ISOMETRIC ? true : false ); + mLightRadius->setValue( Light->getRadius() ); + mLightTypeChk->setActive( Light->getType() == LIGHT_ISOMETRIC ? true : false ); } void MapEditor::OnNewLight( const UIEvent * Event ) { const UIEventMouse * MEvent = reinterpret_cast ( Event ); if ( MEvent->getFlags() & EE_BUTTON_LMASK ) { - Vector2i Pos = mUIMap->Map()->GetMouseMapPos(); - mUIMap->AddLight( eeNew( MapLight, ( mLightRadius->getValue(), Pos.x, Pos.y, mUIBaseColor->getBackground()->getColor().toColor(), mLightTypeChk->isActive() ? LIGHT_ISOMETRIC : LIGHT_NORMAL ) ) ); + Vector2i Pos = mUIMap->Map()->getMouseMapPos(); + mUIMap->addLight( eeNew( MapLight, ( mLightRadius->getValue(), Pos.x, Pos.y, mUIBaseColor->getBackground()->getColor().toColor(), mLightTypeChk->isActive() ? LIGHT_ISOMETRIC : LIGHT_NORMAL ) ) ); } } @@ -555,10 +555,10 @@ void MapEditor::OnRedChange( const UIEvent * Event ) { mUIBaseColor->getBackground()->setColor( Col ); mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->getValue() ) ); - if ( NULL != mUIMap->GetSelectedLight() ) { - RGB lCol( mUIMap->GetSelectedLight()->Color() ); + if ( NULL != mUIMap->getSelectedLight() ) { + RGB lCol( mUIMap->getSelectedLight()->getColor() ); lCol.Red = Col.r(); - mUIMap->GetSelectedLight()->Color( lCol ); + mUIMap->getSelectedLight()->setColor( lCol ); } } @@ -568,10 +568,10 @@ void MapEditor::OnGreenChange( const UIEvent * Event ) { mUIBaseColor->getBackground()->setColor( Col ); mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->getValue() ) ); - if ( NULL != mUIMap->GetSelectedLight() ) { - RGB lCol( mUIMap->GetSelectedLight()->Color() ); + if ( NULL != mUIMap->getSelectedLight() ) { + RGB lCol( mUIMap->getSelectedLight()->getColor() ); lCol.Green = Col.g(); - mUIMap->GetSelectedLight()->Color( lCol ); + mUIMap->getSelectedLight()->setColor( lCol ); } } @@ -581,10 +581,10 @@ void MapEditor::OnBlueChange( const UIEvent * Event ) { mUIBaseColor->getBackground()->setColor( Col ); mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->getValue() ) ); - if ( NULL != mUIMap->GetSelectedLight() ) { - RGB lCol( mUIMap->GetSelectedLight()->Color() ); + if ( NULL != mUIMap->getSelectedLight() ) { + RGB lCol( mUIMap->getSelectedLight()->getColor() ); lCol.Blue = Col.b(); - mUIMap->GetSelectedLight()->Color( lCol ); + mUIMap->getSelectedLight()->setColor( lCol ); } } @@ -603,7 +603,7 @@ void MapEditor::ChkClickDI( const UIEvent * Event ) { } void MapEditor::ChkClickClampToTile( const UIEvent * Event ) { - mUIMap->ClampToTile( mChkClampToTile->isActive() ); + mUIMap->setClampToTile( mChkClampToTile->isActive() ); } void MapEditor::UpdateGfx() { @@ -706,7 +706,7 @@ void MapEditor::OnNewGOTypeAdded( std::string name, Uint32 hash ) { } mGOTypeList->getListBox()->addListBoxItem( name ); - mUIMap->Map()->AddVirtualObjectType( name ); + mUIMap->Map()->addVirtualObjectType( name ); } } @@ -779,7 +779,7 @@ void MapEditor::CreateNewMap() { } void MapEditor::CreateNewEmptyMap() { - mUIMap->Map()->Create( Sizei( 100, 100 ), 16, Sizei( 32, 32 ), MAP_EDITOR_DEFAULT_FLAGS | MAP_FLAG_LIGHTS_ENABLED, mUIMap->getSize() ); + mUIMap->Map()->create( Sizei( 100, 100 ), 16, Sizei( 32, 32 ), MAP_EDITOR_DEFAULT_FLAGS | MAP_FLAG_LIGHTS_ENABLED, mUIMap->getSize() ); } void MapEditor::MapCreated() { @@ -794,7 +794,7 @@ void MapEditor::MapCreated() { mMapVScroll->setValue( 0 ); OnMapSizeChange( NULL ); - mUIMap->ClearLights(); + mUIMap->clearLights(); CreateTabs(); } @@ -803,14 +803,14 @@ void MapEditor::OnMapSizeChange( const UIEvent *Event ) { if ( mMouseScrolling ) return; - Vector2i v( mUIMap->Map()->GetMaxOffset() ); + Vector2i v( mUIMap->Map()->getMaxOffset() ); mMapHScroll->setMinValue( 0 ); mMapHScroll->setMaxValue( v.x ); - mMapHScroll->setClickStep( mUIMap->Map()->TileSize().getWidth() * mUIMap->Map()->Scale() ); + mMapHScroll->setClickStep( mUIMap->Map()->getTileSize().getWidth() * mUIMap->Map()->getScale() ); mMapVScroll->setMinValue( 0 ); mMapVScroll->setMaxValue( v.y ); - mMapVScroll->setClickStep( mUIMap->Map()->TileSize().getHeight() * mUIMap->Map()->Scale() ); + mMapVScroll->setClickStep( mUIMap->Map()->getTileSize().getHeight() * mUIMap->Map()->getScale() ); } void MapEditor::OnScrollMapH( const UIEvent * Event ) { @@ -819,34 +819,34 @@ void MapEditor::OnScrollMapH( const UIEvent * Event ) { UIScrollBar * Scr = reinterpret_cast ( Event->getControl() ); - Vector2f Off = mUIMap->Map()->Offset(); + Vector2f Off = mUIMap->Map()->getOffset(); Off.x = -Scr->getValue(); - mUIMap->Map()->Offset( Off ) ; + mUIMap->Map()->setOffset( Off ) ; } void MapEditor::OnScrollMapV( const UIEvent * Event ) { UIScrollBar * Scr = reinterpret_cast ( Event->getControl() ); - Vector2f Off = mUIMap->Map()->Offset(); + Vector2f Off = mUIMap->Map()->getOffset(); Off.y = -Scr->getValue(); - mUIMap->Map()->Offset( Off ) ; + mUIMap->Map()->setOffset( Off ) ; } void MapEditor::UpdateScroll() { mMouseScrolling = true; - mMapHScroll->setValue( -mUIMap->Map()->Offset().x ); - mMapVScroll->setValue( -mUIMap->Map()->Offset().y ); + mMapHScroll->setValue( -mUIMap->Map()->getOffset().x ); + mMapVScroll->setValue( -mUIMap->Map()->getOffset().y ); mMouseScrolling = false; } void MapEditor::MapOpen( const UIEvent * Event ) { UICommonDialog * CDL = reinterpret_cast ( Event->getControl() ); - if ( mUIMap->Map()->Load( CDL->getFullPath() ) ) { + if ( mUIMap->Map()->load( CDL->getFullPath() ) ) { OnMapLoad(); } } @@ -854,7 +854,7 @@ void MapEditor::MapOpen( const UIEvent * Event ) { void MapEditor::OnMapLoad() { mCurLayer = NULL; - mUIMap->Map()->ViewSize( mUIMap->getSize() ); + mUIMap->Map()->setViewSize( mUIMap->getSize() ); MapCreated(); @@ -872,7 +872,7 @@ void MapEditor::MapSave( const UIEvent * Event ) { path += ".eem"; } - mUIMap->Map()->Save( path ); + mUIMap->Map()->save( path ); } void MapEditor::FileMenuClick( const UIEvent * Event ) { @@ -898,8 +898,8 @@ void MapEditor::FileMenuClick( const UIEvent * Event ) { TGDialog->center(); TGDialog->show(); } else if ( "Save" == txt ) { - if ( mUIMap->Map()->Path().size() ) { - mUIMap->Map()->Save( mUIMap->Map()->Path() ); + if ( mUIMap->Map()->getPath().size() ) { + mUIMap->Map()->save( mUIMap->Map()->getPath() ); } } else if ( "Close" == txt ) { UIMessageBox * MsgBox = mTheme->createMessageBox( MSGBOX_OKCANCEL, "Do you really want to close the current map?\nAll changes will be lost." ); @@ -933,43 +933,43 @@ void MapEditor::ViewMenuClick( const UIEvent * Event ) { const String& txt = reinterpret_cast ( Event->getControl() )->getText(); if ( "Show Grid" == txt ) { - mUIMap->Map()->DrawGrid( reinterpret_cast ( Event->getControl() )->isActive() ); + mUIMap->Map()->setDrawGrid( reinterpret_cast ( Event->getControl() )->isActive() ); } else if ( "Mark Tile Over" == txt ) { - mUIMap->Map()->DrawTileOver( reinterpret_cast ( Event->getControl() )->isActive() ); + mUIMap->Map()->setDrawTileOver( reinterpret_cast ( Event->getControl() )->isActive() ); } else if ( "Show Blocked" == txt ) { - mUIMap->Map()->ShowBlocked( reinterpret_cast ( Event->getControl() )->isActive() ); + mUIMap->Map()->setShowBlocked( reinterpret_cast ( Event->getControl() )->isActive() ); } else if ( "Zoom In" == txt ) { ZoomIn(); } else if ( "Zoom Out" == txt ) { ZoomOut(); } else if ( "Normal Size" == txt ) { - mUIMap->Map()->Scale( 1 ); + mUIMap->Map()->setScale( 1 ); } } void MapEditor::ZoomIn() { TileMap * Map = mUIMap->Map(); - Float S = mUIMap->Map()->Scale(); + Float S = mUIMap->Map()->getScale(); if ( S < 4 ) { if ( 0.0625f == S ) { - Map->Scale( 0.125f ); + Map->setScale( 0.125f ); } else if ( 0.125f == S ) { - Map->Scale( 0.25f ); + Map->setScale( 0.25f ); } else if ( 0.25f == S ) { - Map->Scale( 0.5f ); + Map->setScale( 0.5f ); } else if ( 0.5f == S ) { - Map->Scale( 0.75f ); + Map->setScale( 0.75f ); } else if ( 0.75f == S ) { - Map->Scale( 1.0f ); + Map->setScale( 1.0f ); } else if ( 1.0f == S ) { - Map->Scale( 1.5f ); + Map->setScale( 1.5f ); } else if ( 1.5f == S ) { - Map->Scale( 2.0f ); + Map->setScale( 2.0f ); } else if ( 2.0f == S ) { - Map->Scale( 3.0f ); + Map->setScale( 3.0f ); } else if ( 3.0f == S ) { - Map->Scale( 4.0f ); + Map->setScale( 4.0f ); } } @@ -978,27 +978,27 @@ void MapEditor::ZoomIn() { void MapEditor::ZoomOut() { TileMap * Map = mUIMap->Map(); - Float S = mUIMap->Map()->Scale(); + Float S = mUIMap->Map()->getScale(); if ( S > 0.0625f ) { if ( 0.125f == S ) { - Map->Scale( 0.0625f ); + Map->setScale( 0.0625f ); } else if ( 0.25f == S ) { - Map->Scale( 0.125f ); + Map->setScale( 0.125f ); } else if ( 0.5f == S ) { - Map->Scale( 0.25f ); + Map->setScale( 0.25f ); } else if ( 0.75f == S ) { - Map->Scale( 0.5f ); + Map->setScale( 0.5f ); } else if ( 1.0f == S ) { - Map->Scale( 0.75f ); + Map->setScale( 0.75f ); } else if ( 1.5f == S ) { - Map->Scale( 1.0f ); + Map->setScale( 1.0f ); } else if ( 2.0f == S ) { - Map->Scale( 1.5f ); + Map->setScale( 1.5f ); } else if ( 3.0f == S ) { - Map->Scale( 2.0f ); + Map->setScale( 2.0f ); } else if ( 4.0f == S ) { - Map->Scale( 3.0f ); + Map->setScale( 3.0f ); } } @@ -1054,11 +1054,11 @@ void MapEditor::LayerMenuClick( const UIEvent * Event ) { } } else if ( "Lights Enabled" == txt ) { if ( NULL != mCurLayer ) { - mCurLayer->LightsEnabled( !mCurLayer->LightsEnabled() ); + mCurLayer->setLightsEnabled( !mCurLayer->getLightsEnabled() ); } } else if ( "Visible" == txt ) { if ( NULL != mCurLayer ) { - mCurLayer->Visible( !mCurLayer->Visible() ); + mCurLayer->setVisible( !mCurLayer->isVisible() ); } } } @@ -1076,19 +1076,19 @@ UIMessageBox * MapEditor::CreateNoLayerAlert( const String title ) { } void MapEditor::MoveLayerUp() { - if ( mUIMap->Map()->MoveLayerUp( mCurLayer ) ) { + if ( mUIMap->Map()->moveLayerUp( mCurLayer ) ) { RefreshLayersList(); } } void MapEditor::MoveLayerDown() { - if ( mUIMap->Map()->MoveLayerDown( mCurLayer ) ) { + if ( mUIMap->Map()->moveLayerDown( mCurLayer ) ) { RefreshLayersList(); } } void MapEditor::RemoveLayer() { - if ( mUIMap->Map()->RemoveLayer( mCurLayer ) ) { + if ( mUIMap->Map()->removeLayer( mCurLayer ) ) { mCurLayer = NULL; RefreshLayersList(); @@ -1096,7 +1096,7 @@ void MapEditor::RemoveLayer() { } void MapEditor::RefreshGotyList() { - TileMap::GOTypesList& GOList = mUIMap->Map()->GetVirtualObjectTypes(); + TileMap::GOTypesList& GOList = mUIMap->Map()->getVirtualObjectTypes(); for ( TileMap::GOTypesList::iterator it = GOList.begin(); it != GOList.end(); it++ ) { mGOTypeList->getListBox()->addListBoxItem( (*it) ); @@ -1106,20 +1106,20 @@ void MapEditor::RefreshGotyList() { void MapEditor::RefreshLayersList() { mLayerList->getListBox()->clear(); - if ( mUIMap->Map()->LayerCount() ) { + if ( mUIMap->Map()->getLayerCount() ) { std::vector layers; - for ( Uint32 i = 0; i < mUIMap->Map()->LayerCount(); i++ ) { - layers.push_back( mUIMap->Map()->GetLayer(i)->Name() ); + for ( Uint32 i = 0; i < mUIMap->Map()->getLayerCount(); i++ ) { + layers.push_back( mUIMap->Map()->getLayer(i)->getName() ); } mLayerList->getListBox()->addListBoxItems( layers ); } if ( NULL != mCurLayer ) { - mLayerList->getListBox()->setSelected( mCurLayer->Name() ); + mLayerList->getListBox()->setSelected( mCurLayer->getName() ); } else { - if ( mUIMap->Map()->LayerCount() ) { + if ( mUIMap->Map()->getLayerCount() ) { mLayerList->getListBox()->setSelected(0); } } @@ -1148,28 +1148,28 @@ void MapEditor::TextureAtlasOpen( const UIEvent * Event ) { void MapEditor::OnLayerAdd( UIMapLayerNew * UILayer ) { bool SetSelected = ( 0 == mLayerList->getListBox()->getCount() ) ? true : false; - mLayerList->getListBox()->addListBoxItem( UILayer->Name() ); + mLayerList->getListBox()->addListBoxItem( UILayer->getName() ); if ( SetSelected ) { - mCurLayer = UILayer->Layer(); + mCurLayer = UILayer->getLayer(); - mUIMap->CurLayer( mCurLayer ); + mUIMap->setCurLayer( mCurLayer ); mLayerList->getListBox()->setSelected(0); } } void MapEditor::OnLayerSelect( const UIEvent * Event ) { - MapLayer * tLayer = mUIMap->Map()->GetLayer( mLayerList->getText() ); + MapLayer * tLayer = mUIMap->Map()->getLayer( mLayerList->getText() ); if ( NULL != tLayer ) { mCurLayer = tLayer; - mUIMap->CurLayer( mCurLayer ); + mUIMap->setCurLayer( mCurLayer ); - mLayerChkVisible->setActive( mCurLayer->Visible() ); + mLayerChkVisible->setActive( mCurLayer->isVisible() ); - mLayerChkLights->setActive( mCurLayer->LightsEnabled() ); + mLayerChkLights->setActive( mCurLayer->getLightsEnabled() ); } } @@ -1222,10 +1222,10 @@ void MapEditor::AddGameObjectToTile() { GameObject * tObj = CreateGameObject(); if ( NULL != tObj ) { - if ( tObj->Type() == GAMEOBJECT_TYPE_VIRTUAL ) - reinterpret_cast ( tObj )->SetLayer( tLayer ); + if ( tObj->getType() == GAMEOBJECT_TYPE_VIRTUAL ) + reinterpret_cast ( tObj )->setLayer( tLayer ); - tLayer->AddGameObject( tObj, tMap->GetMouseTilePos() ); + tLayer->addGameObject( tObj, tMap->getMouseTilePos() ); } } @@ -1233,7 +1233,7 @@ void MapEditor::RemoveGameObjectFromTile() { TileMapLayer * tLayer = reinterpret_cast ( mCurLayer ); TileMap * tMap = mUIMap->Map(); - tLayer->RemoveGameObject( tMap->GetMouseTilePos() ); + tLayer->removeGameObject( tMap->getMouseTilePos() ); } void MapEditor::AddGameObject() { @@ -1242,17 +1242,17 @@ void MapEditor::AddGameObject() { GameObject * tObj = CreateGameObject(); if ( NULL != tObj ) { - if ( tObj->Type() == GAMEOBJECT_TYPE_VIRTUAL ) - reinterpret_cast ( tObj )->SetLayer( tLayer ); + if ( tObj->getType() == GAMEOBJECT_TYPE_VIRTUAL ) + reinterpret_cast ( tObj )->setLayer( tLayer ); - Vector2i p( tMap->GetMouseMapPos() ); + Vector2i p( tMap->getMouseMapPos() ); if ( UIManager::instance()->getInput()->isKeyDown( KEY_LCTRL ) ) { - p = tMap->GetMouseTilePosCoords(); + p = tMap->getMouseTilePosCoords(); } - tObj->Pos( Vector2f( p.x, p.y ) ); - tLayer->AddGameObject( tObj ); + tObj->setPosition( Vector2f( p.x, p.y ) ); + tLayer->addGameObject( tObj ); } } @@ -1260,11 +1260,11 @@ void MapEditor::RemoveGameObject() { MapObjectLayer * tLayer = reinterpret_cast ( mCurLayer ); TileMap * tMap = mUIMap->Map(); - tLayer->RemoveGameObject( tMap->GetMouseMapPos() ); + tLayer->removeGameObject( tMap->getMouseMapPos() ); } GameObject * MapEditor::GetCurrentGOOver() { - return reinterpret_cast( mCurLayer )->GetGameObject( mUIMap->Map()->GetMouseTilePos() ); + return reinterpret_cast( mCurLayer )->getGameObject( mUIMap->Map()->getMouseTilePos() ); } void MapEditor::OnMapMouseClick( const UIEvent * Event ) { @@ -1279,33 +1279,33 @@ void MapEditor::OnMapMouseClick( const UIEvent * Event ) { } if ( MEvent->getFlags() & EE_BUTTON_LMASK ) { - if ( mCurLayer->Type() == MAP_LAYER_OBJECT ) + if ( mCurLayer->getType() == MAP_LAYER_OBJECT ) AddGameObject(); } else if ( MEvent->getFlags() & EE_BUTTON_RMASK ) { - if ( mCurLayer->Type() == MAP_LAYER_OBJECT ) + if ( mCurLayer->getType() == MAP_LAYER_OBJECT ) RemoveGameObject(); } else if ( MEvent->getFlags() & EE_BUTTON_MMASK ) { - if ( mCurLayer->Type() == MAP_LAYER_TILED ) { + if ( mCurLayer->getType() == MAP_LAYER_TILED ) { GameObject * tObj = GetCurrentGOOver(); if ( NULL != tObj ) { - tObj->Blocked( !tObj->Blocked() ); + tObj->setBlocked( !tObj->isBlocked() ); } } } else if ( MEvent->getFlags() & EE_BUTTON_WUMASK ) { - if ( mCurLayer->Type() == MAP_LAYER_TILED ) { + if ( mCurLayer->getType() == MAP_LAYER_TILED ) { GameObject * tObj = GetCurrentGOOver(); if ( NULL != tObj ) { - tObj->Mirrored( !tObj->Mirrored() ); + tObj->setMirrored( !tObj->isMirrored() ); } } } else if ( MEvent->getFlags() & EE_BUTTON_WDMASK ) { - if ( mCurLayer->Type() == MAP_LAYER_TILED ) { + if ( mCurLayer->getType() == MAP_LAYER_TILED ) { GameObject * tObj = GetCurrentGOOver(); if ( NULL != tObj ) { - tObj->Rotated( !tObj->Rotated() ); + tObj->setRotated( !tObj->isRotated() ); } } } @@ -1321,19 +1321,19 @@ void MapEditor::OnMapMouseDown( const UIEvent * Event ) { if ( MEvent->getFlags() & EE_BUTTON_LMASK ) { - if ( mCurLayer->Type() == MAP_LAYER_TILED ) + if ( mCurLayer->getType() == MAP_LAYER_TILED ) AddGameObjectToTile(); } else if ( MEvent->getFlags() & EE_BUTTON_RMASK ) { - if ( mCurLayer->Type() == MAP_LAYER_TILED ) + if ( mCurLayer->getType() == MAP_LAYER_TILED ) RemoveGameObjectFromTile(); } } } void MapEditor::SetViewOptions() { - mChkShowGrid->setActive( mUIMap->Map()->DrawGrid() ? true : false ); - mChkMarkTileOver->setActive( mUIMap->Map()->DrawTileOver() ? true : false ); - mChkShowBlocked->setActive( mUIMap->Map()->ShowBlocked() ? true : false ); + mChkShowGrid->setActive( mUIMap->Map()->getDrawGrid() ? true : false ); + mChkMarkTileOver->setActive( mUIMap->Map()->getDrawTileOver() ? true : false ); + mChkShowBlocked->setActive( mUIMap->Map()->getShowBlocked() ? true : false ); } }} diff --git a/src/eepp/gaming/mapeditor/maplayerproperties.cpp b/src/eepp/gaming/mapeditor/maplayerproperties.cpp index d5f56272d..b980b7008 100644 --- a/src/eepp/gaming/mapeditor/maplayerproperties.cpp +++ b/src/eepp/gaming/mapeditor/maplayerproperties.cpp @@ -21,7 +21,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) return; mUIWindow = mUITheme->createWindow( NULL, Sizei( 500, 500 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, Sizei( 500, 500 ) ); - mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapLayerProperties::WindowClose ) ); + mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapLayerProperties::onWindowClose ) ); mUIWindow->setTitle( "Layer Properties" ); Int32 InitialY = 16; @@ -29,8 +29,8 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) UITextBox * Txt = mUITheme->createTextBox( "Layer name:", mUIWindow->getContainer(), Sizei(), Vector2i( 50, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); - mUIInput->setText( mLayer->Name() ); - mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapLayerProperties::OKClick ) ); + mUIInput->setText( mLayer->getName() ); + mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapLayerProperties::onOKClick ) ); Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER; mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->getPosition().y + mUIInput->getSize().getHeight() + 12 ), TxtBoxFlags ); @@ -38,12 +38,12 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "ok" ) ); OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); - OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::OKClick ) ); + OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::onOKClick ) ); OKButton->setText( "OK" ); UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); - CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::CancelClick ) ); + CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::onCancelClick ) ); CancelButton->setText( "Cancel" ); UIGenericGrid::CreateParams GridParams; @@ -65,7 +65,7 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) Vector2i Pos( mGenGrid->getPosition().x + mGenGrid->getSize().getWidth() + 10, mGenGrid->getPosition().y ); UIPushButton * AddButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "add" ) ); - AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::AddCellClick ) ); + AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::onAddCellClick ) ); if ( NULL == AddButton->getIcon()->getSubTexture() ) AddButton->setText( "+" ); @@ -73,12 +73,12 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) Pos.y += AddButton->getSize().getHeight() + 5; UIPushButton * RemoveButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "remove" ) ); - RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::RemoveCellClick ) ); + RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapLayerProperties::onRemoveCellClick ) ); if ( NULL == RemoveButton->getIcon()->getSubTexture() ) RemoveButton->setText( "-" ); - CreateGridElems(); + createGridElems(); mUIWindow->center(); mUIWindow->show(); @@ -87,8 +87,8 @@ MapLayerProperties::MapLayerProperties( MapLayer * Map, RefreshLayerListCb Cb ) MapLayerProperties::~MapLayerProperties() { } -void MapLayerProperties::SaveProperties() { - mLayer->ClearProperties(); +void MapLayerProperties::saveProperties() { + mLayer->clearProperties(); for ( Uint32 i = 0; i < mGenGrid->getCount(); i++ ) { UIGridCell * Cell = mGenGrid->getCell( i ); @@ -97,16 +97,16 @@ void MapLayerProperties::SaveProperties() { UITextInput * Input2 = reinterpret_cast( Cell->getCell( 3 ) ); if ( NULL != Cell && Input->getText().size() && Input2->getText().size() ) { - mLayer->AddProperty( Input->getText(), Input2->getText() ); + mLayer->addProperty( Input->getText(), Input2->getText() ); } } } -void MapLayerProperties::LoadProperties() { - MapLayer::PropertiesMap& Proper = mLayer->GetProperties(); +void MapLayerProperties::loadProperties() { + MapLayer::PropertiesMap& Proper = mLayer->getProperties(); for ( MapLayer::PropertiesMap::iterator it = Proper.begin(); it != Proper.end(); it++ ) { - UIGridCell * Cell = CreateCell(); + UIGridCell * Cell = createCell(); UITextInput * Input = reinterpret_cast( Cell->getCell( 1 ) ); UITextInput * Input2 = reinterpret_cast( Cell->getCell( 3 ) ); @@ -118,10 +118,10 @@ void MapLayerProperties::LoadProperties() { } } -void MapLayerProperties::OKClick( const UIEvent * Event ) { - SaveProperties(); +void MapLayerProperties::onOKClick( const UIEvent * Event ) { + saveProperties(); - mLayer->Name( mUIInput->getText().toUtf8() ); + mLayer->setName( mUIInput->getText().toUtf8() ); if ( mRefreshCb.IsSet() ) { mRefreshCb(); @@ -130,16 +130,16 @@ void MapLayerProperties::OKClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void MapLayerProperties::CancelClick( const UIEvent * Event ) { +void MapLayerProperties::onCancelClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void MapLayerProperties::WindowClose( const UIEvent * Event ) { +void MapLayerProperties::onWindowClose( const UIEvent * Event ) { eeDelete( this ); } -void MapLayerProperties::AddCellClick( const UIEvent * Event ) { - mGenGrid->add( CreateCell() ); +void MapLayerProperties::onAddCellClick( const UIEvent * Event ) { + mGenGrid->add( createCell() ); Uint32 Index = mGenGrid->getItemSelectedIndex(); @@ -148,7 +148,7 @@ void MapLayerProperties::AddCellClick( const UIEvent * Event ) { } } -void MapLayerProperties::RemoveCellClick( const UIEvent * Event ) { +void MapLayerProperties::onRemoveCellClick( const UIEvent * Event ) { Uint32 Index = mGenGrid->getItemSelectedIndex(); if ( eeINDEX_NOT_FOUND != Index ) { @@ -165,17 +165,17 @@ void MapLayerProperties::RemoveCellClick( const UIEvent * Event ) { } } -void MapLayerProperties::CreateGridElems() { - LoadProperties(); +void MapLayerProperties::createGridElems() { + loadProperties(); if ( 0 == mGenGrid->getCount() ) { - AddCellClick( NULL ); + onAddCellClick( NULL ); } else { mGenGrid->getCell( 0 )->select(); } } -UIGridCell * MapLayerProperties::CreateCell() { +UIGridCell * MapLayerProperties::createCell() { UIGridCell::CreateParams CellParams; CellParams.setParent( mGenGrid->getContainer() ); diff --git a/src/eepp/gaming/mapeditor/maplayerproperties.hpp b/src/eepp/gaming/mapeditor/maplayerproperties.hpp index 2ca16a328..54147eec7 100644 --- a/src/eepp/gaming/mapeditor/maplayerproperties.hpp +++ b/src/eepp/gaming/mapeditor/maplayerproperties.hpp @@ -30,23 +30,23 @@ class EE_API MapLayerProperties { UITextInput * mUIInput; RefreshLayerListCb mRefreshCb; - void WindowClose( const UIEvent * Event ); + void onWindowClose( const UIEvent * Event ); - void CancelClick( const UIEvent * Event ); + void onCancelClick( const UIEvent * Event ); - void OKClick( const UIEvent * Event ); + void onOKClick( const UIEvent * Event ); - void AddCellClick( const UIEvent * Event ); + void onAddCellClick( const UIEvent * Event ); - void RemoveCellClick( const UIEvent * Event ); + void onRemoveCellClick( const UIEvent * Event ); - void CreateGridElems(); + void createGridElems(); - void SaveProperties(); + void saveProperties(); - void LoadProperties(); + void loadProperties(); - UIGridCell * CreateCell(); + UIGridCell * createCell(); }; }}} diff --git a/src/eepp/gaming/mapeditor/mapobjectproperties.cpp b/src/eepp/gaming/mapeditor/mapobjectproperties.cpp index c4f519f50..92ccc33f8 100644 --- a/src/eepp/gaming/mapeditor/mapobjectproperties.cpp +++ b/src/eepp/gaming/mapeditor/mapobjectproperties.cpp @@ -20,7 +20,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : return; mUIWindow = mUITheme->createWindow( NULL, Sizei( 500, 500 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, Sizei( 500, 500 ) ); - mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapObjectProperties::WindowClose ) ); + mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &MapObjectProperties::onWindowClose ) ); mUIWindow->setTitle( "Object Properties" ); Int32 InitialY = 16; @@ -28,13 +28,13 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : UITextBox * Txt = mUITheme->createTextBox( "Object name:", mUIWindow->getContainer(), Sizei(), Vector2i( 50, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIInput = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); - mUIInput->setText( mObj->Name() ); - mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::OKClick ) ); + mUIInput->setText( mObj->getName() ); + mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::onOKClick ) ); UITextBox * Txt2 = mUITheme->createTextBox( "Object type:", mUIWindow->getContainer(), Sizei(), Vector2i( 50+192, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIInput2 = mUITheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt2->getPosition().x + DistFromTitle, Txt2->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); - mUIInput2->setText( mObj->TypeName() ); - mUIInput2->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::OKClick ) ); + mUIInput2->setText( mObj->getTypeName() ); + mUIInput2->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &MapObjectProperties::onOKClick ) ); Uint32 TxtBoxFlags = UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_HALIGN_CENTER | UI_VALIGN_CENTER; mUITheme->createTextBox( "Property Name", mUIWindow->getContainer(), Sizei(192, 24), Vector2i( 50, mUIInput->getPosition().y + mUIInput->getSize().getHeight() + 12 ), TxtBoxFlags ); @@ -42,12 +42,12 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "ok" ) ); OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); - OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::OKClick ) ); + OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::onOKClick ) ); OKButton->setText( "OK" ); UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); - CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::CancelClick ) ); + CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::onCancelClick ) ); CancelButton->setText( "Cancel" ); UIGenericGrid::CreateParams GridParams; @@ -69,7 +69,7 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : Vector2i Pos( mGenGrid->getPosition().x + mGenGrid->getSize().getWidth() + 10, mGenGrid->getPosition().y ); UIPushButton * AddButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "add" ) ); - AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::AddCellClick ) ); + AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::onAddCellClick ) ); if ( NULL == AddButton->getIcon()->getSubTexture() ) AddButton->setText( "+" ); @@ -77,12 +77,12 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : Pos.y += AddButton->getSize().getHeight() + 5; UIPushButton * RemoveButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "remove" ) ); - RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::RemoveCellClick ) ); + RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &MapObjectProperties::onRemoveCellClick ) ); if ( NULL == RemoveButton->getIcon()->getSubTexture() ) RemoveButton->setText( "-" ); - CreateGridElems(); + createGridElems(); mUIWindow->center(); mUIWindow->show(); @@ -91,8 +91,8 @@ MapObjectProperties::MapObjectProperties( GameObjectObject * Obj ) : MapObjectProperties::~MapObjectProperties() { } -void MapObjectProperties::SaveProperties() { - mObj->ClearProperties(); +void MapObjectProperties::saveProperties() { + mObj->clearProperties(); for ( Uint32 i = 0; i < mGenGrid->getCount(); i++ ) { UIGridCell * Cell = mGenGrid->getCell( i ); @@ -101,16 +101,16 @@ void MapObjectProperties::SaveProperties() { UITextInput * Input2 = reinterpret_cast( Cell->getCell( 3 ) ); if ( NULL != Cell && Input->getText().size() && Input2->getText().size() ) { - mObj->AddProperty( Input->getText(), Input2->getText() ); + mObj->addProperty( Input->getText(), Input2->getText() ); } } } -void MapObjectProperties::LoadProperties() { - GameObjectObject::PropertiesMap& Proper = mObj->GetProperties(); +void MapObjectProperties::loadProperties() { + GameObjectObject::PropertiesMap& Proper = mObj->getProperties(); for ( GameObjectObject::PropertiesMap::iterator it = Proper.begin(); it != Proper.end(); it++ ) { - UIGridCell * Cell = CreateCell(); + UIGridCell * Cell = createCell(); UITextInput * Input = reinterpret_cast( Cell->getCell( 1 ) ); UITextInput * Input2 = reinterpret_cast( Cell->getCell( 3 ) ); @@ -122,25 +122,25 @@ void MapObjectProperties::LoadProperties() { } } -void MapObjectProperties::OKClick( const UIEvent * Event ) { - SaveProperties(); +void MapObjectProperties::onOKClick( const UIEvent * Event ) { + saveProperties(); - mObj->Name( mUIInput->getText().toUtf8() ); - mObj->TypeName( mUIInput2->getText().toUtf8() ); + mObj->setName( mUIInput->getText().toUtf8() ); + mObj->setTypeName( mUIInput2->getText().toUtf8() ); mUIWindow->CloseWindow(); } -void MapObjectProperties::CancelClick( const UIEvent * Event ) { +void MapObjectProperties::onCancelClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void MapObjectProperties::WindowClose( const UIEvent * Event ) { +void MapObjectProperties::onWindowClose( const UIEvent * Event ) { eeDelete( this ); } -void MapObjectProperties::AddCellClick( const UIEvent * Event ) { - mGenGrid->add( CreateCell() ); +void MapObjectProperties::onAddCellClick( const UIEvent * Event ) { + mGenGrid->add( createCell() ); Uint32 Index = mGenGrid->getItemSelectedIndex(); @@ -149,7 +149,7 @@ void MapObjectProperties::AddCellClick( const UIEvent * Event ) { } } -void MapObjectProperties::RemoveCellClick( const UIEvent * Event ) { +void MapObjectProperties::onRemoveCellClick( const UIEvent * Event ) { Uint32 Index = mGenGrid->getItemSelectedIndex(); if ( eeINDEX_NOT_FOUND != Index ) { @@ -166,17 +166,17 @@ void MapObjectProperties::RemoveCellClick( const UIEvent * Event ) { } } -void MapObjectProperties::CreateGridElems() { - LoadProperties(); +void MapObjectProperties::createGridElems() { + loadProperties(); if ( 0 == mGenGrid->getCount() ) { - AddCellClick( NULL ); + onAddCellClick( NULL ); } else { mGenGrid->getCell( 0 )->select(); } } -UIGridCell * MapObjectProperties::CreateCell() { +UIGridCell * MapObjectProperties::createCell() { UIGridCell::CreateParams CellParams; CellParams.setParent( mGenGrid->getContainer() ); diff --git a/src/eepp/gaming/mapeditor/mapobjectproperties.hpp b/src/eepp/gaming/mapeditor/mapobjectproperties.hpp index 7be5527c3..6bdcccbae 100644 --- a/src/eepp/gaming/mapeditor/mapobjectproperties.hpp +++ b/src/eepp/gaming/mapeditor/mapobjectproperties.hpp @@ -23,28 +23,28 @@ class MapObjectProperties { protected: UITheme * mUITheme; UIWindow * mUIWindow; - UIGenericGrid * mGenGrid; + UIGenericGrid * mGenGrid; GameObjectObject * mObj; UITextInput * mUIInput; UITextInput * mUIInput2; - void WindowClose( const UIEvent * Event ); + void onWindowClose( const UIEvent * Event ); - void CancelClick( const UIEvent * Event ); + void onCancelClick( const UIEvent * Event ); - void OKClick( const UIEvent * Event ); + void onOKClick( const UIEvent * Event ); - void AddCellClick( const UIEvent * Event ); + void onAddCellClick( const UIEvent * Event ); - void RemoveCellClick( const UIEvent * Event ); + void onRemoveCellClick( const UIEvent * Event ); - void CreateGridElems(); + void createGridElems(); - void SaveProperties(); + void saveProperties(); - void LoadProperties(); + void loadProperties(); - UIGridCell * CreateCell(); + UIGridCell * createCell(); }; }}} diff --git a/src/eepp/gaming/mapeditor/tilemapproperties.cpp b/src/eepp/gaming/mapeditor/tilemapproperties.cpp index 8e9345cf0..3a00e1ac4 100644 --- a/src/eepp/gaming/mapeditor/tilemapproperties.cpp +++ b/src/eepp/gaming/mapeditor/tilemapproperties.cpp @@ -19,13 +19,13 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : return; mUIWindow = mUITheme->createWindow( NULL, Sizei( 500, 500 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, Sizei( 500, 500 ) ); - mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &TileMapProperties::WindowClose ) ); + mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &TileMapProperties::onWindowClose ) ); mUIWindow->setTitle( "Map Properties" ); Uint32 DiffIfLights = 0; - if ( mMap->LightsEnabled() ) { + if ( mMap->getLightsEnabled() ) { DiffIfLights = 100; UITextBox * Txt = mUITheme->createTextBox( "Map Base Color:", mUIWindow->getContainer(), Sizei(), Vector2i( 50, 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); @@ -34,7 +34,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : ComParams.setParent( mUIWindow->getContainer() ); ComParams.setPosition( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 4 ); ComParams.setSize( 64, 64 ); - ComParams.Background.setColor( mMap->BaseColor() ); + ComParams.Background.setColor( mMap->getBaseColor() ); ComParams.Border.setColor( ColorA( 100, 100, 100, 200 ) ); ComParams.Flags |= UI_FILL_BACKGROUND | UI_BORDER; mUIBaseColor = eeNew( UIComplexControl, ( ComParams ) ); @@ -44,26 +44,26 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : Txt = mUITheme->createTextBox( "Red Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIBaseColor->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIRedSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( Txt->getPosition().x + Txt->getSize().getWidth() + 16, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIRedSlider->setMaxValue( 255 ); - mUIRedSlider->setValue( mMap->BaseColor().r() ); - mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnRedChange ) ); + mUIRedSlider->setValue( mMap->getBaseColor().r() ); + mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::onRedChange ) ); - mUIRedTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().r() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->getPosition().x + mUIRedSlider->getSize().getWidth() + 4, mUIRedSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIRedTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->getBaseColor().r() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->getPosition().x + mUIRedSlider->getSize().getWidth() + 4, mUIRedSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); Txt = mUITheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIRedSlider->getPosition().y + mUIRedSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIGreenSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->getPosition().x, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIGreenSlider->setMaxValue( 255 ); - mUIGreenSlider->setValue( mMap->BaseColor().g() ); - mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnGreenChange ) ); + mUIGreenSlider->setValue( mMap->getBaseColor().g() ); + mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::onGreenChange ) ); - mUIGreenTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().g() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->getPosition().x + mUIGreenSlider->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIGreenTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->getBaseColor().g() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->getPosition().x + mUIGreenSlider->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); Txt = mUITheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y + mUIGreenSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUIBlueSlider = mUITheme->createSlider( mUIWindow->getContainer(), Sizei( 255, 20 ), Vector2i( mUIRedSlider->getPosition().x, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIBlueSlider->setMaxValue( 255 ); - mUIBlueSlider->setValue( mMap->BaseColor().b() ); - mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::OnBlueChange ) ); + mUIBlueSlider->setValue( mMap->getBaseColor().b() ); + mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &TileMapProperties::onBlueChange ) ); - mUIBlueTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->BaseColor().b() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->getPosition().x + mUIBlueSlider->getSize().getWidth() + 4, mUIBlueSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); + mUIBlueTxt = mUITheme->createTextBox( String::toStr( (Uint32)mMap->getBaseColor().b() ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->getPosition().x + mUIBlueSlider->getSize().getWidth() + 4, mUIBlueSlider->getPosition().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; @@ -72,12 +72,12 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "ok" ) ); OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); - OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::OKClick ) ); + OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::onOKClick ) ); OKButton->setText( "OK" ); UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); - CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::CancelClick ) ); + CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::onCancelClick ) ); CancelButton->setText( "Cancel" ); UIGenericGrid::CreateParams GridParams; @@ -99,7 +99,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : Vector2i Pos( mGenGrid->getPosition().x + mGenGrid->getSize().getWidth() + 10, mGenGrid->getPosition().y ); UIPushButton * AddButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "add" ) ); - AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::AddCellClick ) ); + AddButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::onAddCellClick ) ); if ( NULL == AddButton->getIcon()->getSubTexture() ) AddButton->setText( "+" ); @@ -107,12 +107,12 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : Pos.y += AddButton->getSize().getHeight() + 5; UIPushButton * RemoveButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei(24,21), Pos, UI_CONTROL_ALIGN_CENTER | UI_AUTO_SIZE | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP, mUITheme->getIconByName( "remove" ) ); - RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::RemoveCellClick ) ); + RemoveButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &TileMapProperties::onRemoveCellClick ) ); if ( NULL == RemoveButton->getIcon()->getSubTexture() ) RemoveButton->setText( "-" ); - CreateGridElems(); + createGridElems(); mUIWindow->center(); mUIWindow->show(); @@ -121,42 +121,42 @@ TileMapProperties::TileMapProperties( TileMap * Map ) : TileMapProperties::~TileMapProperties() { } -void TileMapProperties::OnRedChange( const UIEvent * Event ) { +void TileMapProperties::onRedChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Red = (Uint8)mUIRedSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->getValue() ) ); - ColorA MapCol = mMap->BaseColor(); + ColorA MapCol = mMap->getBaseColor(); MapCol.Red = Col.Red; - mMap->BaseColor( MapCol ); + mMap->setBaseColor( MapCol ); } -void TileMapProperties::OnGreenChange( const UIEvent * Event ) { +void TileMapProperties::onGreenChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Green = (Uint8)mUIGreenSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->getValue() ) ); - ColorA MapCol = mMap->BaseColor(); + ColorA MapCol = mMap->getBaseColor(); MapCol.Green = Col.Green; - mMap->BaseColor( MapCol ); + mMap->setBaseColor( MapCol ); } -void TileMapProperties::OnBlueChange( const UIEvent * Event ) { +void TileMapProperties::onBlueChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Blue = (Uint8)mUIBlueSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->getValue() ) ); - ColorA MapCol = mMap->BaseColor(); + ColorA MapCol = mMap->getBaseColor(); MapCol.Blue = Col.Blue; - mMap->BaseColor( MapCol ); + mMap->setBaseColor( MapCol ); } -void TileMapProperties::SaveProperties() { - mMap->ClearProperties(); +void TileMapProperties::saveProperties() { + mMap->clearProperties(); for ( Uint32 i = 0; i < mGenGrid->getCount(); i++ ) { UIGridCell * Cell = mGenGrid->getCell( i ); @@ -165,16 +165,16 @@ void TileMapProperties::SaveProperties() { UITextInput * Input2 = reinterpret_cast( Cell->getCell( 3 ) ); if ( NULL != Cell && Input->getText().size() && Input2->getText().size() ) { - mMap->AddProperty( Input->getText(), Input2->getText() ); + mMap->addProperty( Input->getText(), Input2->getText() ); } } } -void TileMapProperties::LoadProperties() { - TileMap::PropertiesMap& Proper = mMap->GetProperties(); +void TileMapProperties::loadProperties() { + TileMap::PropertiesMap& Proper = mMap->getProperties(); for ( TileMap::PropertiesMap::iterator it = Proper.begin(); it != Proper.end(); it++ ) { - UIGridCell * Cell = CreateCell(); + UIGridCell * Cell = createCell(); UITextInput * Input = reinterpret_cast( Cell->getCell( 1 ) ); UITextInput * Input2 = reinterpret_cast( Cell->getCell( 3 ) ); @@ -186,22 +186,22 @@ void TileMapProperties::LoadProperties() { } } -void TileMapProperties::OKClick( const UIEvent * Event ) { - SaveProperties(); +void TileMapProperties::onOKClick( const UIEvent * Event ) { + saveProperties(); mUIWindow->CloseWindow(); } -void TileMapProperties::CancelClick( const UIEvent * Event ) { +void TileMapProperties::onCancelClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void TileMapProperties::WindowClose( const UIEvent * Event ) { +void TileMapProperties::onWindowClose( const UIEvent * Event ) { eeDelete( this ); } -void TileMapProperties::AddCellClick( const UIEvent * Event ) { - mGenGrid->add( CreateCell() ); +void TileMapProperties::onAddCellClick( const UIEvent * Event ) { + mGenGrid->add( createCell() ); Uint32 Index = mGenGrid->getItemSelectedIndex(); @@ -210,7 +210,7 @@ void TileMapProperties::AddCellClick( const UIEvent * Event ) { } } -void TileMapProperties::RemoveCellClick( const UIEvent * Event ) { +void TileMapProperties::onRemoveCellClick( const UIEvent * Event ) { Uint32 Index = mGenGrid->getItemSelectedIndex(); if ( eeINDEX_NOT_FOUND != Index ) { @@ -227,17 +227,17 @@ void TileMapProperties::RemoveCellClick( const UIEvent * Event ) { } } -void TileMapProperties::CreateGridElems() { - LoadProperties(); +void TileMapProperties::createGridElems() { + loadProperties(); if ( 0 == mGenGrid->getCount() ) { - AddCellClick( NULL ); + onAddCellClick( NULL ); } else { mGenGrid->getCell( 0 )->select(); } } -UIGridCell * TileMapProperties::CreateCell() { +UIGridCell * TileMapProperties::createCell() { UIGridCell::CreateParams CellParams; CellParams.setParent( mGenGrid->getContainer() ); diff --git a/src/eepp/gaming/mapeditor/tilemapproperties.hpp b/src/eepp/gaming/mapeditor/tilemapproperties.hpp index 550a30cce..d966818e7 100644 --- a/src/eepp/gaming/mapeditor/tilemapproperties.hpp +++ b/src/eepp/gaming/mapeditor/tilemapproperties.hpp @@ -21,39 +21,39 @@ class EE_API TileMapProperties { protected: UITheme * mUITheme; UIWindow * mUIWindow; - UIGenericGrid * mGenGrid; - TileMap * mMap; + UIGenericGrid * mGenGrid; + TileMap * mMap; UIComplexControl * mUIBaseColor; UISlider * mUIRedSlider; UISlider * mUIGreenSlider; UISlider * mUIBlueSlider; - UITextBox * mUIRedTxt; - UITextBox * mUIGreenTxt; - UITextBox * mUIBlueTxt; + UITextBox * mUIRedTxt; + UITextBox * mUIGreenTxt; + UITextBox * mUIBlueTxt; - void WindowClose( const UIEvent * Event ); + void onWindowClose( const UIEvent * Event ); - void CancelClick( const UIEvent * Event ); + void onCancelClick( const UIEvent * Event ); - void OKClick( const UIEvent * Event ); + void onOKClick( const UIEvent * Event ); - void AddCellClick( const UIEvent * Event ); + void onAddCellClick( const UIEvent * Event ); - void RemoveCellClick( const UIEvent * Event ); + void onRemoveCellClick( const UIEvent * Event ); - void OnRedChange( const UIEvent * Event ); + void onRedChange( const UIEvent * Event ); - void OnGreenChange( const UIEvent * Event ); + void onGreenChange( const UIEvent * Event ); - void OnBlueChange( const UIEvent * Event ); + void onBlueChange( const UIEvent * Event ); - void CreateGridElems(); + void createGridElems(); - void SaveProperties(); + void saveProperties(); - void LoadProperties(); + void loadProperties(); - UIGridCell * CreateCell(); + UIGridCell * createCell(); }; }}} diff --git a/src/eepp/gaming/mapeditor/uigotypenew.cpp b/src/eepp/gaming/mapeditor/uigotypenew.cpp index 88db36733..d52aab7ed 100644 --- a/src/eepp/gaming/mapeditor/uigotypenew.cpp +++ b/src/eepp/gaming/mapeditor/uigotypenew.cpp @@ -15,7 +15,7 @@ UIGOTypeNew::UIGOTypeNew( cb::Callback2 Cb ) : return; mUIWindow = mUITheme->createWindow( NULL, Sizei( 278, 114 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, Sizei( 278, 114 ) ); - mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIGOTypeNew::WindowClose ) ); + mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIGOTypeNew::onWindowClose ) ); mUIWindow->setTitle( "Add GameObject Type" ); Int32 InitialY = 16; @@ -27,13 +27,13 @@ UIGOTypeNew::UIGOTypeNew( cb::Callback2 Cb ) : UIPushButton * OKButton = mUITheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "add" ) ); OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); - OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::OKClick ) ); - mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIGOTypeNew::OKClick ) ); + OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::onOKClick ) ); + mUIInput->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIGOTypeNew::onOKClick ) ); OKButton->setText( "Add" ); UIPushButton * CancelButton = mUITheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mUITheme->getIconByName( "cancel" ) ); - CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::CancelClick ) ); + CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIGOTypeNew::onCancelClick ) ); CancelButton->setText( "Cancel" ); mUIWindow->center(); @@ -46,7 +46,7 @@ UIGOTypeNew::~UIGOTypeNew() { } -void UIGOTypeNew::OKClick( const UIEvent * Event ) { +void UIGOTypeNew::onOKClick( const UIEvent * Event ) { if ( mUIInput->getText().size() ) { if ( mCb.IsSet() ) mCb( mUIInput->getText().toUtf8(), String::hash( mUIInput->getText().toUtf8() ) ); @@ -55,11 +55,11 @@ void UIGOTypeNew::OKClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void UIGOTypeNew::CancelClick( const UIEvent * Event ) { +void UIGOTypeNew::onCancelClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void UIGOTypeNew::WindowClose( const UIEvent * Event ) { +void UIGOTypeNew::onWindowClose( const UIEvent * Event ) { eeDelete( this ); } diff --git a/src/eepp/gaming/mapeditor/uigotypenew.hpp b/src/eepp/gaming/mapeditor/uigotypenew.hpp index a09538cf5..8894af483 100644 --- a/src/eepp/gaming/mapeditor/uigotypenew.hpp +++ b/src/eepp/gaming/mapeditor/uigotypenew.hpp @@ -19,11 +19,11 @@ class EE_API UIGOTypeNew { UITextInput * mUIInput; cb::Callback2 mCb; - void WindowClose( const UIEvent * Event ); + void onWindowClose( const UIEvent * Event ); - void CancelClick( const UIEvent * Event ); + void onCancelClick( const UIEvent * Event ); - void OKClick( const UIEvent * Event ); + void onOKClick( const UIEvent * Event ); }; }}} diff --git a/src/eepp/gaming/mapeditor/uimap.cpp b/src/eepp/gaming/mapeditor/uimap.cpp index d8b5b1c8a..b74c8d1e1 100644 --- a/src/eepp/gaming/mapeditor/uimap.cpp +++ b/src/eepp/gaming/mapeditor/uimap.cpp @@ -29,10 +29,10 @@ UIMap::UIMap( const UIComplexControl::CreateParams& Params, UITheme * Theme, Til mMap = eeNew( TileMap, () ); } - mMap->BackColor( ColorA( 100, 100, 100, 100 ) ); - mMap->GridLinesColor( ColorA( 150, 150, 150, 150 ) ); + mMap->setBackColor( ColorA( 100, 100, 100, 100 ) ); + mMap->setGridLinesColor( ColorA( 150, 150, 150, 150 ) ); - mMap->SetDrawCallback( cb::Make0( this, &UIMap::MapDraw ) ); + mMap->setDrawCallback( cb::Make0( this, &UIMap::mapDraw ) ); mDragButton = EE_BUTTON_MMASK; setDragEnabled( true ); @@ -44,7 +44,7 @@ UIMap::~UIMap() { eeSAFE_DELETE( mMap ); } -Uint32 UIMap::OnDrag( const Vector2i& Pos ) { +Uint32 UIMap::onDrag( const Vector2i& Pos ) { if ( ( EDITING_OBJECT == mEditingMode && NULL != mSelObj ) || ( EDITING_LIGHT == mEditingMode && NULL != mSelLight ) ) { @@ -55,7 +55,7 @@ Uint32 UIMap::OnDrag( const Vector2i& Pos ) { Vector2i nPos( -( mDragPoint - Pos ) ); Vector2f nPosf( nPos.x, nPos.y ); - mMap->Move( nPosf ); + mMap->move( nPosf ); mDragPoint = Pos; @@ -66,7 +66,7 @@ Uint32 UIMap::OnDrag( const Vector2i& Pos ) { return 0; } -void UIMap::ReplaceMap( TileMap * newMap ) { +void UIMap::replaceMap( TileMap * newMap ) { eeSAFE_DELETE( mMap ); mMap = newMap; updateScreenPos(); @@ -80,7 +80,7 @@ void UIMap::draw() { UIComplexControl::draw(); if ( NULL != mMap ) { - mMap->Draw(); + mMap->draw(); } } @@ -88,7 +88,7 @@ void UIMap::updateScreenPos() { UIComplexControl::updateScreenPos(); if ( NULL != mMap ) { - mMap->Position( mScreenPos ); + mMap->setPosition( mScreenPos ); } } @@ -96,7 +96,7 @@ void UIMap::update() { UIComplexControl::update(); if ( NULL != mMap ) { - mMap->Update(); + mMap->update(); if ( mEnabled && mVisible && isMouseOver() ) { Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); @@ -105,23 +105,23 @@ void UIMap::update() { if ( NULL != mSelLight ) { if ( Flags & EE_BUTTONS_WUWD ) { if ( Flags & EE_BUTTON_WUMASK ) { - mSelLight->Radius( mSelLight->Radius() + 10 ); + mSelLight->setRadius( mSelLight->getRadius() + 10 ); } else if ( Flags & EE_BUTTON_WDMASK ) { - mSelLight->Radius( mSelLight->Radius() - 10 ); + mSelLight->setRadius( mSelLight->getRadius() - 10 ); } if ( mLightRadiusChangeCb.IsSet() ) mLightRadiusChangeCb( mSelLight ); } else if ( Flags & EE_BUTTON_RMASK ) { if ( mSelLight == mAddLight ) { - mMap->GetLightManager()->RemoveLight( mAddLight ); + mMap->getLightManager()->removeLight( mAddLight ); eeSAFE_DELETE( mAddLight ); mSelLight = NULL; } else if ( NULL != mSelLight ) { - if ( mSelLight->GetAABB().contains( mMap->GetMouseMapPosf() ) ) { - mMap->GetLightManager()->RemoveLight( mSelLight ); + if ( mSelLight->getAABB().contains( mMap->getMouseMapPosf() ) ) { + mMap->getLightManager()->removeLight( mSelLight ); eeSAFE_DELETE( mSelLight ); } @@ -130,54 +130,54 @@ void UIMap::update() { if ( mSelLight == mAddLight ) { mAddLight = NULL; } else { - TryToSelectLight(); + tryToSelectLight(); } } Flags = UIManager::instance()->getInput()->getPressTrigger(); if ( Flags & EE_BUTTON_MMASK ) { - mSelLight->Position( mMap->GetMouseMapPosf() ); + mSelLight->setPosition( mMap->getMouseMapPosf() ); } } else { if ( Flags & EE_BUTTON_LMASK ) { - TryToSelectLight(); + tryToSelectLight(); } } } else if ( EDITING_OBJECT == mEditingMode ) { - ManageObject( Flags ); + manageObject( Flags ); } } } } -Vector2f UIMap::GetMouseMapPos() { - Vector2f mp( mMap->GetMouseMapPosf() ); +Vector2f UIMap::getMouseMapPos() { + Vector2f mp( mMap->getMouseMapPosf() ); if ( mClampToTile ) { - Vector2i mpc( mMap->GetTileCoords( mMap->GetMouseTilePos() + 1 ) ); + Vector2i mpc( mMap->getTileCoords( mMap->getMouseTilePos() + 1 ) ); mp = Vector2f( mpc.x, mpc.y ); } return mp; } -void UIMap::SelectPolyObj() { - if ( NULL != mCurLayer && mCurLayer->Type() == MAP_LAYER_OBJECT ) { +void UIMap::selectPolyObj() { + if ( NULL != mCurLayer && mCurLayer->getType() == MAP_LAYER_OBJECT ) { MapObjectLayer * tLayer = reinterpret_cast( mCurLayer ); - GameObject * tObj = tLayer->GetObjectOver( mMap->GetMouseMapPos(), MapObjectLayer::SEARCH_POLY ); + GameObject * tObj = tLayer->getObjectOver( mMap->getMouseMapPos(), MapObjectLayer::SEARCH_POLY ); if ( NULL != tObj ) { if ( NULL != mSelObj ) { - mSelObj->Selected( false ); + mSelObj->setSelected( false ); } mSelObj = reinterpret_cast( tObj ); - mSelObj->Selected( true ); + mSelObj->setSelected( true ); } else { if ( NULL != mSelObj ) { - mSelObj->Selected( false ); + mSelObj->setSelected( false ); mSelObj = NULL; } } @@ -188,28 +188,28 @@ void UIMap::SelectPolyObj() { } } -void UIMap::SelectPolyPoint() { - if ( NULL != mCurLayer && mCurLayer->Type() == MAP_LAYER_OBJECT && NULL != mSelObj ) { - if ( mSelObj->PointInside( mMap->GetMouseMapPosf() ) ) { - mSelPointIndex = mSelObj->GetPolygon().closestPoint( mMap->GetMouseMapPosf() ); - SetPointRect( mSelObj->GetPolygon().getAt( mSelPointIndex ) ); +void UIMap::selectPolyPoint() { + if ( NULL != mCurLayer && mCurLayer->getType() == MAP_LAYER_OBJECT && NULL != mSelObj ) { + if ( mSelObj->pointInside( mMap->getMouseMapPosf() ) ) { + mSelPointIndex = mSelObj->getPolygon().closestPoint( mMap->getMouseMapPosf() ); + setPointRect( mSelObj->getPolygon().getAt( mSelPointIndex ) ); } } } -void UIMap::DragPoly( Uint32 Flags, Uint32 PFlags ) { +void UIMap::dragPoly( Uint32 Flags, Uint32 PFlags ) { if ( ( PFlags & EE_BUTTON_MMASK ) && NULL != mSelObj ) { - if ( mSelObj->PointInside( mMap->GetMouseMapPosf() ) ) { + if ( mSelObj->pointInside( mMap->getMouseMapPosf() ) ) { if ( !mObjDragging ) { mObjDragging = true; - mObjDragDist = GetMouseMapPos() - mSelObj->Pos(); + mObjDragDist = getMouseMapPos() - mSelObj->getPosition(); } } - mSelObj->Pos( GetMouseMapPos() - mObjDragDist ); + mSelObj->setPosition( getMouseMapPos() - mObjDragDist ); if ( EDIT_POLYGONS == mEditingObjMode ) { - SelectPolyPoint(); + selectPolyPoint(); } } else if ( Flags & EE_BUTTON_MMASK ) { if ( mObjDragging ) { @@ -219,7 +219,7 @@ void UIMap::DragPoly( Uint32 Flags, Uint32 PFlags ) { } } -void UIMap::ManageObject( Uint32 Flags ) { +void UIMap::manageObject( Uint32 Flags ) { Uint32 PFlags = UIManager::instance()->getInput()->getPressTrigger(); Uint32 LPFlags = UIManager::instance()->getInput()->getLastPressTrigger(); @@ -228,7 +228,7 @@ void UIMap::ManageObject( Uint32 Flags ) { case INSERT_OBJECT: { if ( PFlags & EE_BUTTON_LMASK ) { - Vector2f mp( GetMouseMapPos() ); + Vector2f mp( getMouseMapPos() ); if ( !mObjRECTEditing ) { mObjRECTEditing = true; @@ -253,7 +253,7 @@ void UIMap::ManageObject( Uint32 Flags ) { case INSERT_POLYGON: { if ( Flags & EE_BUTTON_LMASK ) { - mObjPoly.pushBack( GetMouseMapPos() ); + mObjPoly.pushBack( getMouseMapPos() ); } else if ( Flags & EE_BUTTON_RMASK ) { mAddObjectCallback( ( INSERT_POLYGON == mEditingObjMode ) ? GAMEOBJECT_TYPE_POLYGON : GAMEOBJECT_TYPE_POLYLINE, mObjPoly ); @@ -265,9 +265,9 @@ void UIMap::ManageObject( Uint32 Flags ) { case SELECT_OBJECTS: { if ( ( Flags & EE_BUTTON_LMASK ) ) { - SelectPolyObj(); + selectPolyObj(); } else { - DragPoly( Flags, PFlags ); + dragPoly( Flags, PFlags ); } break; @@ -276,22 +276,22 @@ void UIMap::ManageObject( Uint32 Flags ) { { if ( ( Flags & EE_BUTTON_LMASK ) ) { if ( !mSelPoint ) { - SelectPolyObj(); - SelectPolyPoint(); + selectPolyObj(); + selectPolyPoint(); } else { mSelPoint = false; } } else if ( !( LPFlags & EE_BUTTON_LMASK ) && ( PFlags & EE_BUTTON_LMASK ) ) { - if ( NULL != mSelObj && eeINDEX_NOT_FOUND != mSelPointIndex && mSelPointRect.contains( mMap->GetMouseMapPosf() ) ) { + if ( NULL != mSelObj && eeINDEX_NOT_FOUND != mSelPointIndex && mSelPointRect.contains( mMap->getMouseMapPosf() ) ) { mSelPoint = true; } } else if ( ( PFlags & EE_BUTTON_LMASK ) ) { if ( mSelPoint && NULL != mSelObj && eeINDEX_NOT_FOUND != mSelPointIndex ) { - mSelObj->SetPolygonPoint( mSelPointIndex, GetMouseMapPos() ); - SetPointRect( GetMouseMapPos() ); + mSelObj->setPolygonPoint( mSelPointIndex, getMouseMapPos() ); + setPointRect( getMouseMapPos() ); } } else { - DragPoly( Flags, PFlags ); + dragPoly( Flags, PFlags ); } break; @@ -302,13 +302,13 @@ void UIMap::ManageObject( Uint32 Flags ) { } } -void UIMap::SetPointRect( Vector2f p ) { +void UIMap::setPointRect( Vector2f p ) { mSelPointRect = Rectf( Vector2f( p.x - 10, p.y - 10 ), Sizef( 20, 20 ) ); } -void UIMap::TryToSelectLight() { +void UIMap::tryToSelectLight() { MapLight * tLight = mSelLight; - mSelLight = mMap->GetLightManager()->GetLightOver( mMap->GetMouseMapPosf(), mSelLight ); + mSelLight = mMap->getLightManager()->getLightOver( mMap->getMouseMapPosf(), mSelLight ); if ( NULL != mSelLight && mSelLight != tLight ) { if ( mLightSelCb.IsSet() ) @@ -318,8 +318,8 @@ void UIMap::TryToSelectLight() { void UIMap::onSizeChange() { if ( NULL != mMap ) { - mMap->Position( mScreenPos ); - mMap->ViewSize( mSize ); + mMap->setPosition( mScreenPos ); + mMap->setViewSize( mSize ); } UIComplexControl::onSizeChange(); @@ -328,12 +328,12 @@ void UIMap::onSizeChange() { Uint32 UIMap::onMouseMove( const Vector2i& Pos, const Uint32 Flags ) { if ( NULL != mMap ) { if ( EDITING_LIGHT == mEditingMode && NULL != mAddLight ) { - mAddLight->Position( mMap->GetMouseMapPosf() ); + mAddLight->setPosition( mMap->getMouseMapPosf() ); } } if ( NULL != mTileBox ) { - Vector2i mp( mMap->GetMouseTilePos() ); + Vector2i mp( mMap->getMouseTilePos() ); if ( mLastMouseTilePos != mp ) { mLastMouseTilePos = mp; @@ -344,10 +344,10 @@ Uint32 UIMap::onMouseMove( const Vector2i& Pos, const Uint32 Flags ) { return UIComplexControl::onMouseMove( Pos, Flags ); } -void UIMap::AddLight( MapLight * Light ) { - if ( NULL != mMap->GetLightManager() ) { +void UIMap::addLight( MapLight * Light ) { + if ( NULL != mMap->getLightManager() ) { if ( NULL != mAddLight ) { - mMap->GetLightManager()->RemoveLight( mAddLight ); + mMap->getLightManager()->removeLight( mAddLight ); eeSAFE_DELETE( mAddLight ); } @@ -356,20 +356,20 @@ void UIMap::AddLight( MapLight * Light ) { mSelLight = Light; - mMap->GetLightManager()->AddLight( Light ); + mMap->getLightManager()->addLight( Light ); if ( mLightSelCb.IsSet() ) mLightSelCb( mSelLight ); } } -void UIMap::MapDraw() { +void UIMap::mapDraw() { if ( EDITING_LIGHT == mEditingMode ) { if ( NULL != mSelLight ) { mP.setColor( ColorA( 255, 0, 0, (Uint8)mAlpha ) ); - Vector2f Pos( mSelLight->GetAABB().Left, mSelLight->GetAABB().Top ); - eeAABB AB( mSelLight->GetAABB() ); + Vector2f Pos( mSelLight->getAABB().Left, mSelLight->getAABB().Top ); + eeAABB AB( mSelLight->getAABB() ); mP.setFillMode( DRAW_LINE ); mP.drawRectangle( Rectf( Pos, AB.getSize() ) ); @@ -401,7 +401,7 @@ void UIMap::MapDraw() { mP.drawPolygon( mObjPoly ); Polygon2f polyN( mObjPoly ); - polyN.pushBack( GetMouseMapPos() ); + polyN.pushBack( getMouseMapPos() ); mP.setFillMode( DRAW_FILL ); mP.setColor( ColorA( 100, 100, 100, 100 ) ); @@ -420,7 +420,7 @@ void UIMap::MapDraw() { mP.drawPolygon( mObjPoly ); Polygon2f polyN( mObjPoly ); - polyN.pushBack( GetMouseMapPos() ); + polyN.pushBack( getMouseMapPos() ); mP.setFillMode( DRAW_LINE ); mP.setColor( ColorA( 255, 255, 0, 200 ) ); @@ -446,53 +446,53 @@ void UIMap::MapDraw() { } } -void UIMap::EditingLights( const bool& editing ) { +void UIMap::setEditingLights( const bool& editing ) { mEditingMode = ( editing ) ? EDITING_LIGHT : 0; - if ( editing && NULL != mMap->GetLightManager() && NULL != mAddLight ) { - mMap->GetLightManager()->RemoveLight( mAddLight ); + if ( editing && NULL != mMap->getLightManager() && NULL != mAddLight ) { + mMap->getLightManager()->removeLight( mAddLight ); mAddLight = NULL; } } -bool UIMap::EditingLights() { +bool UIMap::isEditingLights() { return EDITING_LIGHT == mEditingMode; } -void UIMap::EditingObjects( const bool& editing ) { +void UIMap::setEditingObjects( const bool& editing ) { mEditingMode = ( editing ) ? EDITING_OBJECT : 0; } -bool UIMap::EditingObjects() { +bool UIMap::isEditingObjects() { return EDITING_OBJECT == mEditingMode; } -void UIMap::EditingDisabled() { +void UIMap::editingDisable() { mEditingMode = 0; } -MapLight * UIMap::GetSelectedLight() { +MapLight * UIMap::getSelectedLight() { return mSelLight; } -MapLight * UIMap::GetAddLight() { +MapLight * UIMap::getAddLight() { return mAddLight; } -void UIMap::SetLightSelectCb( LightSelectCb Cb ) { +void UIMap::setLightSelectCb( LightSelectCb Cb ) { mLightSelCb = Cb; } -void UIMap::SetLightRadiusChangeCb( LightRadiusChangeCb Cb ) { +void UIMap::setLightRadiusChangeCb( LightRadiusChangeCb Cb ) { mLightRadiusChangeCb = Cb; } -void UIMap::SetAddObjectCallback( ObjAddCb Cb ) { +void UIMap::setAddObjectCallback( ObjAddCb Cb ) { mAddObjectCallback = Cb; } -void UIMap::ClearLights() { +void UIMap::clearLights() { mSelLight = NULL; mAddLight = NULL; } @@ -501,62 +501,62 @@ void UIMap::onAlphaChange() { UIComplexControl::onAlphaChange(); if ( NULL != mMap ) { - mMap->BackAlpha( (Uint8)mAlpha ); + mMap->setBackAlpha( (Uint8)mAlpha ); } } -void UIMap::ClampToTile( const bool& clamp ) { +void UIMap::setClampToTile( const bool& clamp ) { mClampToTile = clamp; } -const bool& UIMap::ClampToTile() const { +const bool& UIMap::getClampToTile() const { return mClampToTile; } -void UIMap::EditingObjMode( EDITING_OBJ_MODE mode ) { +void UIMap::setEditingObjMode( EDITING_OBJ_MODE mode ) { mObjPoly.clear(); mSelPointIndex = eeINDEX_NOT_FOUND; mEditingObjMode = mode; } -void UIMap::CurLayer( MapLayer * layer ) { +void UIMap::setCurLayer( MapLayer * layer ) { mCurLayer = layer; } -void UIMap::SetAlertCb( AlertCb Cb ) { +void UIMap::setAlertCb( AlertCb Cb ) { mAlertCb = Cb; } -void UIMap::SetUpdateScrollCb( UpdateScrollCb Cb ) { +void UIMap::setUpdateScrollCb( UpdateScrollCb Cb ) { mUpdateScrollCb = Cb; } Uint32 UIMap::onMessage( const UIMessage * Msg ) { if ( Msg->getMsg() == UIMessage::MsgClick && Msg->getSender() == this && ( Msg->getFlags() & EE_BUTTON_RMASK ) ) { - if ( SELECT_OBJECTS == mEditingObjMode && NULL != mSelObj && mSelObj->PointInside( mMap->GetMouseMapPosf() ) ) { - CreateObjPopUpMenu(); + if ( SELECT_OBJECTS == mEditingObjMode && NULL != mSelObj && mSelObj->pointInside( mMap->getMouseMapPosf() ) ) { + createObjPopUpMenu(); } } return 0; } -void UIMap::ObjItemClick( const UIEvent * Event ) { +void UIMap::objItemClick( const UIEvent * Event ) { if ( !Event->getControl()->isType( UI_TYPE_MENUITEM ) ) return; - if ( NULL != mSelObj && NULL != mCurLayer && mCurLayer->Type() == MAP_LAYER_OBJECT && mSelObj->Layer() == mCurLayer ) { + if ( NULL != mSelObj && NULL != mCurLayer && mCurLayer->getType() == MAP_LAYER_OBJECT && mSelObj->getLayer() == mCurLayer ) { const String& txt = reinterpret_cast ( Event->getControl() )->getText(); MapObjectLayer * tLayer = reinterpret_cast( mCurLayer ); if ( "Duplicate Object" == txt ) { - tLayer->AddGameObject( mSelObj->Copy() ); + tLayer->addGameObject( mSelObj->clone() ); } else if ( "Remove Object" == txt ) { - tLayer->RemoveGameObject( mSelObj ); + tLayer->removeGameObject( mSelObj ); - mSelObj->Selected( false ); + mSelObj->setSelected( false ); mSelObj = NULL; } else if ( "Object Properties..." == txt ) { eeNew( MapObjectProperties, ( mSelObj ) ); @@ -564,14 +564,14 @@ void UIMap::ObjItemClick( const UIEvent * Event ) { } } -void UIMap::CreateObjPopUpMenu() { +void UIMap::createObjPopUpMenu() { UIPopUpMenu * Menu = mTheme->createPopUpMenu(); Menu->add( "Duplicate Object" ); Menu->add( "Remove Object" ); Menu->addSeparator(); Menu->add( "Object Properties..." ); - Menu->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &UIMap::ObjItemClick ) ); + Menu->addEventListener( UIEvent::EventOnItemClicked, cb::Make1( this, &UIMap::objItemClick ) ); if ( Menu->show() ) { Vector2i Pos = UIManager::instance()->getInput()->getMousePos(); @@ -580,7 +580,7 @@ void UIMap::CreateObjPopUpMenu() { } } -void UIMap::SetTileBox( UITextBox * tilebox ) { +void UIMap::setTileBox( UITextBox * tilebox ) { mTileBox = tilebox; } diff --git a/src/eepp/gaming/mapeditor/uimap.hpp b/src/eepp/gaming/mapeditor/uimap.hpp index bdeb37fb7..3ffdd8a84 100644 --- a/src/eepp/gaming/mapeditor/uimap.hpp +++ b/src/eepp/gaming/mapeditor/uimap.hpp @@ -45,54 +45,54 @@ class EE_API UIMap : public UIComplexControl { TileMap * Map() const; - void EditingLights( const bool& editing ); + void setEditingLights( const bool& editing ); - bool EditingLights(); + bool isEditingLights(); - void EditingObjects( const bool& editing ); + void setEditingObjects( const bool& editing ); - void EditingDisabled(); + bool isEditingObjects(); - bool EditingObjects(); + void editingDisable(); - MapLight * GetSelectedLight(); + MapLight * getSelectedLight(); - MapLight * GetAddLight(); + MapLight * getAddLight(); - void AddLight( MapLight * Light ); + void addLight( MapLight * Light ); - void SetLightSelectCb( LightSelectCb Cb ); + void setLightSelectCb( LightSelectCb Cb ); - void SetLightRadiusChangeCb( LightRadiusChangeCb Cb ); + void setLightRadiusChangeCb( LightRadiusChangeCb Cb ); - void SetAddObjectCallback( ObjAddCb Cb ); + void setAddObjectCallback( ObjAddCb Cb ); - void SetAlertCb( AlertCb Cb ); + void setAlertCb( AlertCb Cb ); - void SetUpdateScrollCb( UpdateScrollCb Cb ); + void setUpdateScrollCb( UpdateScrollCb Cb ); - void ClearLights(); + void clearLights(); - void ClampToTile( const bool& clamp ); + void setClampToTile( const bool& clamp ); - const bool& ClampToTile() const; + const bool& getClampToTile() const; - void EditingObjMode( EDITING_OBJ_MODE mode ); + void setEditingObjMode( EDITING_OBJ_MODE mode ); - void CurLayer( MapLayer * layer ); + void setCurLayer( MapLayer * layer ); - void CreateObjPopUpMenu(); + void createObjPopUpMenu(); - void SetTileBox( UITextBox * tilebox ); + void setTileBox( UITextBox * tilebox ); - void ReplaceMap( TileMap * newMap ); + void replaceMap( TileMap * newMap ); protected: enum EDITING_MODE { EDITING_LIGHT = 1, EDITING_OBJECT }; - TileMap * mMap; + TileMap * mMap; MapLayer * mCurLayer; Uint32 mEditingMode; Primitives mP; @@ -126,7 +126,7 @@ class EE_API UIMap : public UIComplexControl { Rectf mSelPointRect; bool mSelPoint; - UITextBox * mTileBox; + UITextBox * mTileBox; Vector2i mLastMouseTilePos; UpdateScrollCb mUpdateScrollCb; @@ -141,25 +141,25 @@ class EE_API UIMap : public UIComplexControl { virtual void onAlphaChange(); - virtual Uint32 OnDrag( const Vector2i& getPosition ); + virtual Uint32 onDrag( const Vector2i& getPosition ); - void ObjItemClick( const UIEvent * Event ); + void objItemClick( const UIEvent * Event ); - void MapDraw(); + void mapDraw(); - void TryToSelectLight(); + void tryToSelectLight(); - void ManageObject( Uint32 flags ); + void manageObject( Uint32 flags ); - Vector2f GetMouseMapPos(); + Vector2f getMouseMapPos(); - void SelectPolyObj(); + void selectPolyObj(); - void SelectPolyPoint(); + void selectPolyPoint(); - void SetPointRect( Vector2f p ); + void setPointRect( Vector2f p ); - void DragPoly( Uint32 flags, Uint32 PFlags ); + void dragPoly( Uint32 flags, Uint32 PFlags ); }; }}} diff --git a/src/eepp/gaming/mapeditor/uimaplayernew.cpp b/src/eepp/gaming/mapeditor/uimaplayernew.cpp index 2408d6d3a..6f680c099 100644 --- a/src/eepp/gaming/mapeditor/uimaplayernew.cpp +++ b/src/eepp/gaming/mapeditor/uimaplayernew.cpp @@ -17,7 +17,7 @@ UIMapLayerNew::UIMapLayerNew( UIMap * Map, EE_LAYER_TYPE Type, NewLayerCb newLay return; mUIWindow = mTheme->createWindow( NULL, Sizei( 278, 114 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL, Sizei( 278, 114 ) ); - mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIMapLayerNew::WindowClose ) ); + mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIMapLayerNew::onWindowClose ) ); if ( MAP_LAYER_TILED == mType ) mUIWindow->setTitle( "New Tile Layer" ); @@ -30,20 +30,20 @@ UIMapLayerNew::UIMapLayerNew( UIMap * Map, EE_LAYER_TYPE Type, NewLayerCb newLay UITextBox * Txt = mTheme->createTextBox( "Layer Name", mUIWindow->getContainer(), Sizei(), Vector2i( 16, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); mUILayerName = mTheme->createTextInput( mUIWindow->getContainer(), Sizei( 120, 22 ), Vector2i( Txt->getPosition().x + DistFromTitle, Txt->getPosition().y + DistFromTitle ), UI_CONTROL_DEFAULT_FLAGS | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_AUTO_SIZE, true, 64 ); - mUILayerName->setText( "Layer " + String::toStr( mUIMap->Map()->LayerCount() + 1 ) ); + mUILayerName->setText( "Layer " + String::toStr( mUIMap->Map()->getLayerCount() + 1 ) ); UIPushButton * OKButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "add" ) ); OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); - OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::OKClick ) ); - mUILayerName->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIMapLayerNew::OKClick ) ); + OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::onOKClick ) ); + mUILayerName->addEventListener( UIEvent::EventOnPressEnter, cb::Make1( this, &UIMapLayerNew::onOKClick ) ); OKButton->setText( "Add" ); UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); - CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::CancelClick ) ); + CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapLayerNew::onCancelClick ) ); CancelButton->setText( "Cancel" ); - mUIWindow->addEventListener( UIEvent::EventKeyUp, cb::Make1( this, &UIMapLayerNew::OnKeyUp ) ); + mUIWindow->addEventListener( UIEvent::EventKeyUp, cb::Make1( this, &UIMapLayerNew::onOnKeyUp ) ); mUIWindow->center(); mUIWindow->show(); @@ -55,17 +55,17 @@ UIMapLayerNew::~UIMapLayerNew() { } -void UIMapLayerNew::OnKeyUp( const UIEvent * Event ) { +void UIMapLayerNew::onOnKeyUp( const UIEvent * Event ) { const UIEventKey * KeyEvent = reinterpret_cast ( Event ); if ( KeyEvent->getKeyCode() == KEY_ESCAPE ) { - CancelClick( Event ); + onCancelClick( Event ); } } -void UIMapLayerNew::OKClick( const UIEvent * Event ) { +void UIMapLayerNew::onOKClick( const UIEvent * Event ) { if ( mUILayerName->getText().size() ) { - mLayer = mUIMap->Map()->AddLayer( mType, LAYER_FLAG_VISIBLE | LAYER_FLAG_LIGHTS_ENABLED, mUILayerName->getText() ); + mLayer = mUIMap->Map()->addLayer( mType, LAYER_FLAG_VISIBLE | LAYER_FLAG_LIGHTS_ENABLED, mUILayerName->getText() ); if ( mNewLayerCb.IsSet() ) mNewLayerCb( this ); @@ -74,27 +74,27 @@ void UIMapLayerNew::OKClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void UIMapLayerNew::CancelClick( const UIEvent * Event ) { +void UIMapLayerNew::onCancelClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void UIMapLayerNew::WindowClose( const UIEvent * Event ) { +void UIMapLayerNew::onWindowClose( const UIEvent * Event ) { eeDelete( this ); } -const EE_LAYER_TYPE& UIMapLayerNew::Type() const { +const EE_LAYER_TYPE& UIMapLayerNew::getType() const { return mType; } -UITextInput * UIMapLayerNew::UILayerName() const { +UITextInput * UIMapLayerNew::getUILayerName() const { return mUILayerName; } -const String& UIMapLayerNew::Name() const { +const String& UIMapLayerNew::getName() const { return mUILayerName->getText(); } -MapLayer * UIMapLayerNew::Layer() const { +MapLayer * UIMapLayerNew::getLayer() const { return mLayer; } diff --git a/src/eepp/gaming/mapeditor/uimaplayernew.hpp b/src/eepp/gaming/mapeditor/uimaplayernew.hpp index e2088658c..f860e3978 100644 --- a/src/eepp/gaming/mapeditor/uimaplayernew.hpp +++ b/src/eepp/gaming/mapeditor/uimaplayernew.hpp @@ -17,13 +17,13 @@ class EE_API UIMapLayerNew { virtual ~UIMapLayerNew(); - const EE_LAYER_TYPE& Type() const; + const EE_LAYER_TYPE& getType() const; - UITextInput * UILayerName() const; + UITextInput * getUILayerName() const; - const String& Name() const; + const String& getName() const; - MapLayer * Layer() const; + MapLayer * getLayer() const; protected: UITheme * mTheme; UIMap * mUIMap; @@ -33,13 +33,13 @@ class EE_API UIMapLayerNew { UITextInput * mUILayerName; MapLayer * mLayer; - void WindowClose( const UIEvent * Event ); + void onWindowClose( const UIEvent * Event ); - void CancelClick( const UIEvent * Event ); + void onCancelClick( const UIEvent * Event ); - void OKClick( const UIEvent * Event ); + void onOKClick( const UIEvent * Event ); - void OnKeyUp( const UIEvent * Event ); + void onOnKeyUp( const UIEvent * Event ); }; }}} diff --git a/src/eepp/gaming/mapeditor/uimapnew.cpp b/src/eepp/gaming/mapeditor/uimapnew.cpp index aef9d610b..0e11b8fac 100644 --- a/src/eepp/gaming/mapeditor/uimapnew.cpp +++ b/src/eepp/gaming/mapeditor/uimapnew.cpp @@ -18,7 +18,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) return; mUIWindow = mTheme->createWindow( NULL, Sizei( 320, 380 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_CLOSE_BUTTON | UI_WIN_USE_DEFAULT_BUTTONS_ACTIONS | UI_WIN_SHARE_ALPHA_WITH_CHILDS | UI_WIN_MODAL, Sizei( 320, 380 ) ); - mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIMapNew::WindowClose ) ); + mUIWindow->addEventListener( UIEvent::EventOnWindowClose, cb::Make1( this, &UIMapNew::onWindowClose ) ); if ( !mResizeMap ) { mUIWindow->setTitle( "New Map" ); @@ -37,7 +37,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIMapWidth->setMinValue(1); if ( ResizeMap ) { - mUIMapWidth->setValue( mUIMap->Map()->Size().getWidth() ); + mUIMapWidth->setValue( mUIMap->Map()->getSize().getWidth() ); } Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); @@ -46,7 +46,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIMapHeight->setMinValue(1); if ( ResizeMap ) { - mUIMapHeight->setValue( mUIMap->Map()->Size().getHeight() ); + mUIMapHeight->setValue( mUIMap->Map()->getSize().getHeight() ); } Txt = mTheme->createTextBox( "Tile Size", mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->getSize().getWidth() / 2, InitialY ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); @@ -57,7 +57,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIMapTWidth->setMinValue(1); if ( ResizeMap ) { - mUIMapTWidth->setValue( mUIMap->Map()->TileSize().getWidth() ); + mUIMapTWidth->setValue( mUIMap->Map()->getTileSize().getWidth() ); } Txt = mTheme->createTextBox( "Height:", mUIWindow->getContainer(), Sizei( 46, 24 ), Vector2i( Txt->getPosition().x, Txt->getPosition().y + Txt->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW ); @@ -66,7 +66,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIMapTHeight->setMinValue(1); if ( ResizeMap ) { - mUIMapTHeight->setValue( mUIMap->Map()->TileSize().getHeight() ); + mUIMapTHeight->setValue( mUIMap->Map()->getTileSize().getHeight() ); } Txt = mTheme->createTextBox( "Max Layers", mUIWindow->getContainer(), Sizei(), Vector2i( 16, mUIMapTHeight->getPosition().y + mUIMapTHeight->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); @@ -81,7 +81,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUILightsEnabled->setActive( true ); if ( ResizeMap ) { - mUILightsEnabled->setActive( 0 != mUIMap->Map()->LightsEnabled() ); + mUILightsEnabled->setActive( 0 != mUIMap->Map()->getLightsEnabled() ); } mUILightsByVertex = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->getSize().getWidth() / 2, mUILightsEnabled->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); @@ -89,7 +89,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUILightsByVertex->setActive( true ); if ( ResizeMap ) { - mUILightsByVertex->setActive( 0 != mUIMap->Map()->LightsByVertex() ); + mUILightsByVertex->setActive( 0 != mUIMap->Map()->getLightsByVertex() ); } mUIClampBorders = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( Txt->getPosition().x + DistFromTitle, mUILightsEnabled->getPosition().y + mUILightsEnabled->getSize().getHeight() + 16 ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); @@ -97,7 +97,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIClampBorders->setActive( true ); if ( ResizeMap ) { - mUIClampBorders->setActive( 0 != mUIMap->Map()->ClampBorders() ); + mUIClampBorders->setActive( 0 != mUIMap->Map()->getClampBorders() ); } mUIClipArea = mTheme->createCheckBox( mUIWindow->getContainer(), Sizei(), Vector2i( mUIWindow->getContainer()->getSize().getWidth() / 2, mUIClampBorders->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); @@ -105,7 +105,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIClipArea->setActive( true ); if ( ResizeMap ) { - mUIClipArea->setActive( 0 != mUIMap->Map()->ClipedArea() ); + mUIClipArea->setActive( 0 != mUIMap->Map()->getClipedArea() ); } Txt = mTheme->createTextBox( "Map Base Color:", mUIWindow->getContainer(), Sizei(), Vector2i( Txt->getPosition().x, mUIClipArea->getPosition().y + mUIClipArea->getSize().getHeight() + 8 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); @@ -117,7 +117,7 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) ComParams.Background.setColor( ColorA( 255, 255, 255, 255 ) ); if ( ResizeMap ) { - ComParams.Background.setColor( mUIMap->Map()->BaseColor() ); + ComParams.Background.setColor( mUIMap->Map()->getBaseColor() ); } ComParams.Border.setColor( ColorA( 100, 100, 100, 200 ) ); @@ -131,12 +131,12 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIRedSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( Txt->getPosition().x + Txt->getSize().getWidth() + 16, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIRedSlider->setMaxValue( 255 ); mUIRedSlider->setValue( 255 ); - mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnRedChange ) ); + mUIRedSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::onRedChange ) ); mUIRedTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIRedSlider->getPosition().x + mUIRedSlider->getSize().getWidth() + 4, mUIRedSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { - mUIRedSlider->setValue( mUIMap->Map()->BaseColor().r() ); + mUIRedSlider->setValue( mUIMap->Map()->getBaseColor().r() ); } Txt = mTheme->createTextBox( "Green Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIRedSlider->getPosition().y + mUIRedSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); @@ -145,12 +145,12 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIGreenSlider->setMaxValue( 255 ); mUIGreenSlider->setValue( 255 ); - mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnGreenChange ) ); + mUIGreenSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::onGreenChange ) ); mUIGreenTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIGreenSlider->getPosition().x + mUIGreenSlider->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { - mUIGreenSlider->setValue( mUIMap->Map()->BaseColor().g() ); + mUIGreenSlider->setValue( mUIMap->Map()->getBaseColor().g() ); } Txt = mTheme->createTextBox( "Blue Color:", mUIWindow->getContainer(), Sizei(), Vector2i( mUIBaseColor->getPosition().x + mUIBaseColor->getSize().getWidth() + 4, mUIGreenSlider->getPosition().y + mUIGreenSlider->getSize().getHeight() + 4 ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); @@ -158,21 +158,21 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) mUIBlueSlider = mTheme->createSlider( mUIWindow->getContainer(), Sizei( 128, 20 ), Vector2i( mUIRedSlider->getPosition().x, Txt->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE ); mUIBlueSlider->setMaxValue( 255 ); mUIBlueSlider->setValue( 255 ); - mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::OnBlueChange ) ); + mUIBlueSlider->addEventListener( UIEvent::EventOnValueChange, cb::Make1( this, &UIMapNew::onBlueChange ) ); mUIBlueTxt = mTheme->createTextBox( String::toStr( 255 ), mUIWindow->getContainer(), Sizei(), Vector2i( mUIBlueSlider->getPosition().x + mUIBlueSlider->getSize().getWidth() + 4, mUIBlueSlider->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); if ( ResizeMap ) { - mUIBlueSlider->setValue( mUIMap->Map()->BaseColor().b() ); + mUIBlueSlider->setValue( mUIMap->Map()->getBaseColor().b() ); } UIPushButton * OKButton = mTheme->createPushButton( mUIWindow->getContainer(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "ok" ) ); OKButton->setPosition( mUIWindow->getContainer()->getSize().getWidth() - OKButton->getSize().getWidth() - 4, mUIWindow->getContainer()->getSize().getHeight() - OKButton->getSize().getHeight() - 4 ); - OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::OKClick ) ); + OKButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::onOKClick ) ); OKButton->setText( "OK" ); UIPushButton * CancelButton = mTheme->createPushButton( mUIWindow->getContainer(), OKButton->getSize(), Vector2i( OKButton->getPosition().x - OKButton->getSize().getWidth() - 4, OKButton->getPosition().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->getIconByName( "cancel" ) ); - CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::CancelClick ) ); + CancelButton->addEventListener( UIEvent::EventMouseClick, cb::Make1( this, &UIMapNew::onCancelClick ) ); CancelButton->setText( "Cancel" ); mUIWindow->center(); @@ -182,28 +182,28 @@ UIMapNew::UIMapNew( UIMap * Map, cb::Callback0 NewMapCb, bool ResizeMap ) UIMapNew::~UIMapNew() { } -void UIMapNew::OnRedChange( const UIEvent * Event ) { +void UIMapNew::onRedChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Red = (Uint8)mUIRedSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->getValue() ) ); } -void UIMapNew::OnGreenChange( const UIEvent * Event ) { +void UIMapNew::onGreenChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Green = (Uint8)mUIGreenSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->getValue() ) ); } -void UIMapNew::OnBlueChange( const UIEvent * Event ) { +void UIMapNew::onBlueChange( const UIEvent * Event ) { ColorA Col = mUIBaseColor->getBackground()->getColor(); Col.Blue = (Uint8)mUIBlueSlider->getValue(); mUIBaseColor->getBackground()->setColor( Col ); mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->getValue() ) ); } -void UIMapNew::OKClick( const UIEvent * Event ) { +void UIMapNew::onOKClick( const UIEvent * Event ) { Int32 w = static_cast( mUIMapWidth->getValue() ); Int32 h = static_cast( mUIMapHeight->getValue() ); Int32 tw = static_cast( mUIMapTWidth->getValue() ); @@ -226,22 +226,22 @@ void UIMapNew::OKClick( const UIEvent * Event ) { if ( w > 0 && h > 0 && tw > 0 && th > 0 && ml > 0 ) { if ( !mResizeMap ) { - mUIMap->Map()->Create( Sizei( w, h ), ml, Sizei( tw, th ), Flags, mUIMap->Map()->ViewSize() ); - mUIMap->Map()->BaseColor( mUIBaseColor->getBackground()->getColor() ); + mUIMap->Map()->create( Sizei( w, h ), ml, Sizei( tw, th ), Flags, mUIMap->Map()->getViewSize() ); + mUIMap->Map()->setBaseColor( mUIBaseColor->getBackground()->getColor() ); } else { - std::string oldPath( mUIMap->Map()->Path() ); + std::string oldPath( mUIMap->Map()->getPath() ); std::string mapPath( Sys::getTempPath() + "temp.eepp.map.eem" ); - mUIMap->Map()->Save( mapPath ); + mUIMap->Map()->save( mapPath ); TileMap * Map = eeNew( TileMap, () ); - Map->BackColor( ColorA( 100, 100, 100, 100 ) ); - Map->GridLinesColor( ColorA( 150, 150, 150, 150 ) ); - Map->ForceHeadersOnLoad( Sizei( w, h ), Sizei( tw, th ), ml, Flags ); - Map->Load( mapPath ); - Map->DisableForcedHeaders(); + Map->setBackColor( ColorA( 100, 100, 100, 100 ) ); + Map->setGridLinesColor( ColorA( 150, 150, 150, 150 ) ); + Map->forceHeadersOnLoad( Sizei( w, h ), Sizei( tw, th ), ml, Flags ); + Map->load( mapPath ); + Map->disableForcedHeaders(); Map->mPath = oldPath; - mUIMap->ReplaceMap( Map ); + mUIMap->replaceMap( Map ); FileSystem::fileRemove( mapPath ); } @@ -253,11 +253,11 @@ void UIMapNew::OKClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void UIMapNew::CancelClick( const UIEvent * Event ) { +void UIMapNew::onCancelClick( const UIEvent * Event ) { mUIWindow->CloseWindow(); } -void UIMapNew::WindowClose( const UIEvent * Event ) { +void UIMapNew::onWindowClose( const UIEvent * Event ) { eeDelete( this ); } diff --git a/src/eepp/gaming/mapeditor/uimapnew.hpp b/src/eepp/gaming/mapeditor/uimapnew.hpp index 20184474d..aaee2e9ab 100644 --- a/src/eepp/gaming/mapeditor/uimapnew.hpp +++ b/src/eepp/gaming/mapeditor/uimapnew.hpp @@ -40,17 +40,17 @@ class EE_API UIMapNew { Sizei mNewSize; bool mResizeMap; - void WindowClose( const UIEvent * Event ); + void onWindowClose( const UIEvent * Event ); - void CancelClick( const UIEvent * Event ); + void onCancelClick( const UIEvent * Event ); - void OKClick( const UIEvent * Event ); + void onOKClick( const UIEvent * Event ); - void OnRedChange( const UIEvent * Event ); + void onRedChange( const UIEvent * Event ); - void OnGreenChange( const UIEvent * Event ); + void onGreenChange( const UIEvent * Event ); - void OnBlueChange( const UIEvent * Event ); + void onBlueChange( const UIEvent * Event ); }; }}} diff --git a/src/eepp/gaming/maplayer.cpp b/src/eepp/gaming/maplayer.cpp index 7e841062e..b9bcfb13e 100644 --- a/src/eepp/gaming/maplayer.cpp +++ b/src/eepp/gaming/maplayer.cpp @@ -17,89 +17,89 @@ MapLayer::~MapLayer() { } -const Uint32& MapLayer::Flags() const { +const Uint32& MapLayer::getFlags() const { return mFlags; } -Uint32 MapLayer::FlagGet( const Uint32& Flag ) { +Uint32 MapLayer::getFlag( const Uint32& Flag ) { return mFlags & Flag; } -void MapLayer::FlagSet( const Uint32& Flag ) { +void MapLayer::setFlag( const Uint32& Flag ) { if ( !( mFlags & Flag ) ) { mFlags |= Flag; } } -void MapLayer::FlagClear( const Uint32& Flag ) { +void MapLayer::clearFlag( const Uint32& Flag ) { if ( mFlags & Flag ) { mFlags &= ~Flag; } } -const Uint32& MapLayer::Type() const { +const Uint32& MapLayer::getType() const { return mType; } -TileMap * MapLayer::Map() const { +TileMap * MapLayer::getMap() const { return mMap; } -const Vector2f& MapLayer::Offset() const { +const Vector2f& MapLayer::getOffset() const { return mOffset; } -void MapLayer::Offset( const Vector2f& offset ) { +void MapLayer::setOffset( const Vector2f& offset ) { mOffset = offset; } -void MapLayer::Name( const std::string& name ) { +void MapLayer::setName( const std::string& name ) { mName = name; mNameHash = String::hash( mName ); } -const std::string& MapLayer::Name() const { +const std::string& MapLayer::getName() const { return mName; } -const Uint32& MapLayer::Id() const { +const Uint32& MapLayer::getId() const { return mNameHash; } -void MapLayer::ClearProperties() { +void MapLayer::clearProperties() { mProperties.clear(); } -void MapLayer::AddProperty( std::string Text, std::string Value ) { +void MapLayer::addProperty( std::string Text, std::string Value ) { mProperties[ Text ] = Value; } -void MapLayer::EditProperty( std::string Text, std::string Value ) { +void MapLayer::editProperty( std::string Text, std::string Value ) { mProperties[ Text ] = Value; } -void MapLayer::RemoveProperty( std::string Text ) { +void MapLayer::removeProperty( std::string Text ) { mProperties.erase( Text ); } -MapLayer::PropertiesMap& MapLayer::GetProperties() { +MapLayer::PropertiesMap& MapLayer::getProperties() { return mProperties; } -void MapLayer::Visible( const bool& visible ) { - visible ? FlagSet( LAYER_FLAG_VISIBLE ) : FlagClear( LAYER_FLAG_VISIBLE ); +void MapLayer::setVisible( const bool& visible ) { + visible ? setFlag( LAYER_FLAG_VISIBLE ) : clearFlag( LAYER_FLAG_VISIBLE ); } -bool MapLayer::Visible() { - return 0 != FlagGet( LAYER_FLAG_VISIBLE ); +bool MapLayer::isVisible() { + return 0 != getFlag( LAYER_FLAG_VISIBLE ); } -bool MapLayer::LightsEnabled() { - return 0 != FlagGet( LAYER_FLAG_LIGHTS_ENABLED ); +bool MapLayer::getLightsEnabled() { + return 0 != getFlag( LAYER_FLAG_LIGHTS_ENABLED ); } -void MapLayer::LightsEnabled( const bool& enabled ) { - enabled ? FlagSet( LAYER_FLAG_LIGHTS_ENABLED ) : FlagClear( LAYER_FLAG_LIGHTS_ENABLED ); +void MapLayer::setLightsEnabled( const bool& enabled ) { + enabled ? setFlag( LAYER_FLAG_LIGHTS_ENABLED ) : clearFlag( LAYER_FLAG_LIGHTS_ENABLED ); } }} diff --git a/src/eepp/gaming/maplight.cpp b/src/eepp/gaming/maplight.cpp index 4c1b318fb..22d8d7a67 100755 --- a/src/eepp/gaming/maplight.cpp +++ b/src/eepp/gaming/maplight.cpp @@ -16,18 +16,18 @@ MapLight::~MapLight() { MapLight::MapLight( const Float& Radius, const Float& x, const Float& y, const RGB& Color, LIGHT_TYPE Type ) : mActive( true ) { - Create( Radius, x, y, Color, Type ); + create( Radius, x, y, Color, Type ); } -void MapLight::Create( const Float& Radius, const Float& x, const Float& y, const RGB& Color, LIGHT_TYPE Type ) { +void MapLight::create( const Float& Radius, const Float& x, const Float& y, const RGB& Color, LIGHT_TYPE Type ) { mRadius = Radius; mColor = Color; mType = Type; - UpdatePos( x, y ); + updatePos( x, y ); } -RGB MapLight::ProcessVertex( const Float& PointX, const Float& PointY, const RGB& VertexColor, const RGB& BaseColor ) { +RGB MapLight::processVertex( const Float& PointX, const Float& PointY, const RGB& VertexColor, const RGB& BaseColor ) { Float VertexDist; if ( mActive ) { @@ -67,7 +67,7 @@ RGB MapLight::ProcessVertex( const Float& PointX, const Float& PointY, const RGB return BaseColor; } -ColorA MapLight::ProcessVertex( const Float& PointX, const Float& PointY, const ColorA& VertexColor, const ColorA& BaseColor ) { +ColorA MapLight::processVertex( const Float& PointX, const Float& PointY, const ColorA& VertexColor, const ColorA& BaseColor ) { Float VertexDist; if ( mActive ) { @@ -107,80 +107,80 @@ ColorA MapLight::ProcessVertex( const Float& PointX, const Float& PointY, const return BaseColor; } -RGB MapLight::ProcessVertex( const Vector2f& Pos, const RGB& VertexColor, const RGB& BaseColor ) { - return ProcessVertex( Pos.x, Pos.y, VertexColor, BaseColor ); +RGB MapLight::processVertex( const Vector2f& Pos, const RGB& VertexColor, const RGB& BaseColor ) { + return processVertex( Pos.x, Pos.y, VertexColor, BaseColor ); } -ColorA MapLight::ProcessVertex( const Vector2f& Pos, const ColorA& VertexColor, const ColorA& BaseColor ) { - return ProcessVertex( Pos.x, Pos.y, VertexColor, BaseColor ); +ColorA MapLight::processVertex( const Vector2f& Pos, const ColorA& VertexColor, const ColorA& BaseColor ) { + return processVertex( Pos.x, Pos.y, VertexColor, BaseColor ); } -void MapLight::UpdatePos( const Float& x, const Float& y ) { +void MapLight::updatePos( const Float& x, const Float& y ) { mPos.x = x; mPos.y = y; - UpdateAABB(); + updateAABB(); } -void MapLight::Position( const Vector2f& newPos ) { - UpdatePos( newPos.x, newPos.y ); +void MapLight::setPosition( const Vector2f& newPos ) { + updatePos( newPos.x, newPos.y ); } -void MapLight::UpdatePos( const Vector2f& newPos ) { - UpdatePos( newPos.x, newPos.y ); +void MapLight::updatePos( const Vector2f& newPos ) { + updatePos( newPos.x, newPos.y ); } -void MapLight::Move( const Float& addtox, const Float& addtoy ) { - UpdatePos( mPos.x + addtox, mPos.y + addtoy ); +void MapLight::move( const Float& addtox, const Float& addtoy ) { + updatePos( mPos.x + addtox, mPos.y + addtoy ); } -eeAABB MapLight::GetAABB() const { +eeAABB MapLight::getAABB() const { return mAABB; } -void MapLight::UpdateAABB() { +void MapLight::updateAABB() { if ( mType == LIGHT_NORMAL ) mAABB = eeAABB( mPos.x - mRadius, mPos.y - mRadius, mPos.x + mRadius, mPos.y + mRadius ); else mAABB = eeAABB( mPos.x - mRadius, mPos.y - mRadius * 0.5f, mPos.x + mRadius, mPos.y + mRadius * 0.5f ); } -const Float& MapLight::Radius() const { +const Float& MapLight::getRadius() const { return mRadius; } -void MapLight::Radius( const Float& radius ) { +void MapLight::setRadius( const Float& radius ) { if ( radius > 0 ) { mRadius = radius; - UpdateAABB(); + updateAABB(); } } -const bool& MapLight::Active() const { +const bool& MapLight::isActive() const { return mActive; } -void MapLight::Active( const bool& active ) { +void MapLight::setActive( const bool& active ) { mActive = active; } -void MapLight::Color( const RGB& color ) { +void MapLight::setColor( const RGB& color ) { mColor = color; } -const RGB& MapLight::Color() const { +const RGB& MapLight::getColor() const { return mColor; } -void MapLight::Type( const LIGHT_TYPE& type ) { +void MapLight::setType( const LIGHT_TYPE& type ) { mType = type; - UpdateAABB(); + updateAABB(); } -const LIGHT_TYPE& MapLight::Type() const { +const LIGHT_TYPE& MapLight::getType() const { return mType; } -const Vector2f& MapLight::Position() const { +const Vector2f& MapLight::getPosition() const { return mPos; } diff --git a/src/eepp/gaming/maplightmanager.cpp b/src/eepp/gaming/maplightmanager.cpp index 0631cdb51..a546a2630 100644 --- a/src/eepp/gaming/maplightmanager.cpp +++ b/src/eepp/gaming/maplightmanager.cpp @@ -14,32 +14,32 @@ MapLightManager::MapLightManager( TileMap * Map, bool ByVertex ) : else mNumVertex = 1; - AllocateColors(); + allocateColors(); } MapLightManager::~MapLightManager() { - DeallocateColors(); - DestroyLights(); + deallocateColors(); + destroyLights(); } void MapLightManager::Update() { if ( mIsByVertex ) { - UpdateByVertex(); + updateByVertex(); } else { - UpdateByTile(); + updateByTile(); } } -const bool& MapLightManager::IsByVertex() const { +const bool& MapLightManager::isByVertex() const { return mIsByVertex; } -void MapLightManager::UpdateByVertex() { - Vector2i start = mMap->StartTile(); - Vector2i end = mMap->EndTile(); - eeAABB VisibleArea = mMap->GetViewAreaAABB(); - Sizei TileSize = mMap->TileSize(); - ColorA BaseColor = mMap->BaseColor(); +void MapLightManager::updateByVertex() { + Vector2i start = mMap->getStartTile(); + Vector2i end = mMap->getEndTile(); + eeAABB VisibleArea = mMap->getViewAreaAABB(); + Sizei TileSize = mMap->getTileSize(); + ColorA BaseColor = mMap->getBaseColor(); bool firstLight = true; Vector2i Pos; @@ -49,7 +49,7 @@ void MapLightManager::UpdateByVertex() { for ( LightsList::iterator it = mLights.begin(); it != mLights.end(); it++ ) { MapLight * Light = (*it); - if ( firstLight || VisibleArea.intersect( Light->GetAABB() ) ) { + if ( firstLight || VisibleArea.intersect( Light->getAABB() ) ) { for ( Int32 x = start.x; x < end.x; x++ ) { for ( Int32 y = start.y; y < end.y; y++ ) { if ( firstLight ) { @@ -63,20 +63,20 @@ void MapLightManager::UpdateByVertex() { eeAABB TileAABB( Pos.x, Pos.y, Pos.x + TileSize.x, Pos.y + TileSize.y ); - if ( TileAABB.intersect( Light->GetAABB() ) ) { + if ( TileAABB.intersect( Light->getAABB() ) ) { if ( y > 0 ) 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.getHeight(), *(mTileColors[x][y][1]), *(mTileColors[x][y][1]) ) ); + mTileColors[x][y][1]->assign( Light->processVertex( Pos.x, Pos.y + TileSize.getHeight(), *(mTileColors[x][y][1]), *(mTileColors[x][y][1]) ) ); - mTileColors[x][y][2]->assign( Light->ProcessVertex( Pos.x + TileSize.getWidth(), Pos.y + TileSize.getHeight(), *(mTileColors[x][y][2]), *(mTileColors[x][y][2]) ) ); + mTileColors[x][y][2]->assign( Light->processVertex( Pos.x + TileSize.getWidth(), Pos.y + TileSize.getHeight(), *(mTileColors[x][y][2]), *(mTileColors[x][y][2]) ) ); if ( y > 0 ) mTileColors[x][y][3]->assign( *mTileColors[x][y - 1][2] ); else - mTileColors[x][y][3]->assign( Light->ProcessVertex( Pos.x + TileSize.getWidth(), Pos.y, *(mTileColors[x][y][3]), *(mTileColors[x][y][3]) ) ); + mTileColors[x][y][3]->assign( Light->processVertex( Pos.x + TileSize.getWidth(), Pos.y, *(mTileColors[x][y][3]), *(mTileColors[x][y][3]) ) ); } } } @@ -86,13 +86,13 @@ void MapLightManager::UpdateByVertex() { } } -void MapLightManager::UpdateByTile() { - Vector2i start = mMap->StartTile(); - Vector2i end = mMap->EndTile(); - eeAABB VisibleArea = mMap->GetViewAreaAABB(); - Sizei TileSize = mMap->TileSize(); - Sizei HalfTileSize = mMap->TileSize() / 2; - ColorA BaseColor = mMap->BaseColor(); +void MapLightManager::updateByTile() { + Vector2i start = mMap->getStartTile(); + Vector2i end = mMap->getEndTile(); + eeAABB VisibleArea = mMap->getViewAreaAABB(); + Sizei TileSize = mMap->getTileSize(); + Sizei HalfTileSize = mMap->getTileSize() / 2; + ColorA BaseColor = mMap->getBaseColor(); bool firstLight = true; Vector2i Pos; @@ -102,7 +102,7 @@ void MapLightManager::UpdateByTile() { for ( LightsList::iterator it = mLights.begin(); it != mLights.end(); it++ ) { MapLight * Light = (*it); - if ( firstLight || VisibleArea.intersect( Light->GetAABB() ) ) { + if ( firstLight || VisibleArea.intersect( Light->getAABB() ) ) { for ( Int32 x = start.x; x < end.x; x++ ) { for ( Int32 y = start.y; y < end.y; y++ ) { if ( firstLight ) { @@ -116,8 +116,8 @@ 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.getWidth(), Pos.y + HalfTileSize.getHeight(), *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); + if ( TileAABB.intersect( Light->getAABB() ) ) { + mTileColors[x][y][0]->assign( Light->processVertex( Pos.x + HalfTileSize.getWidth(), Pos.y + HalfTileSize.getHeight(), *(mTileColors[x][y][0]), *(mTileColors[x][y][0]) ) ); } } } @@ -127,8 +127,8 @@ void MapLightManager::UpdateByTile() { } } -ColorA MapLightManager::GetColorFromPos( const Vector2f& Pos ) { - ColorA Col( mMap->BaseColor() ); +ColorA MapLightManager::getColorFromPos( const Vector2f& Pos ) { + ColorA Col( mMap->getBaseColor() ); if ( !mLights.size() ) return Col; @@ -136,30 +136,30 @@ ColorA MapLightManager::GetColorFromPos( const Vector2f& Pos ) { for ( LightsList::iterator it = mLights.begin(); it != mLights.end(); it++ ) { MapLight * Light = (*it); - if ( Light->GetAABB().contains( Pos ) ) { - Col = Light->ProcessVertex( Pos, Col, Col ); + if ( Light->getAABB().contains( Pos ) ) { + Col = Light->processVertex( Pos, Col, Col ); } } return Col; } -void MapLightManager::AddLight( MapLight * Light ) { +void MapLightManager::addLight( MapLight * Light ) { mLights.push_back( Light ); if ( mLights.size() == 1 ) Update(); } -void MapLightManager::RemoveLight( MapLight * Light ) { +void MapLightManager::removeLight( MapLight * Light ) { mLights.remove( Light ); } -void MapLightManager::RemoveLight( const Vector2f& OverPos ) { +void MapLightManager::removeLight( const Vector2f& OverPos ) { for ( LightsList::reverse_iterator it = mLights.rbegin(); it != mLights.rend(); it++ ) { MapLight * Light = (*it); - if ( Light->GetAABB().contains( OverPos ) ) { + if ( Light->getAABB().contains( OverPos ) ) { mLights.remove( Light ); eeSAFE_DELETE( Light ); break; @@ -167,26 +167,26 @@ void MapLightManager::RemoveLight( const Vector2f& OverPos ) { } } -const ColorA * MapLightManager::GetTileColor( const Vector2i& TilePos ) { +const ColorA * MapLightManager::getTileColor( const Vector2i& TilePos ) { eeASSERT( 1 == mNumVertex ); if ( !mLights.size() ) - return &mMap->BaseColor(); + return &mMap->getBaseColor(); return mTileColors[ TilePos.x ][ TilePos.y ][0]; } -const ColorA * MapLightManager::GetTileColor( const Vector2i& TilePos, const Uint32& Vertex ) { +const ColorA * MapLightManager::getTileColor( const Vector2i& TilePos, const Uint32& Vertex ) { eeASSERT( 4 == mNumVertex ); if ( !mLights.size() ) - return &mMap->BaseColor(); + return &mMap->getBaseColor(); return mTileColors[ TilePos.x ][ TilePos.y ][Vertex]; } -void MapLightManager::AllocateColors() { - Sizei Size = mMap->Size(); +void MapLightManager::allocateColors() { + Sizei Size = mMap->getSize(); mTileColors = eeNewArray( ColorA***, Size.getWidth() ); for ( Int32 x = 0; x < Size.x; x++ ) { @@ -202,8 +202,8 @@ void MapLightManager::AllocateColors() { } } -void MapLightManager::DeallocateColors() { - Sizei Size = mMap->Size(); +void MapLightManager::deallocateColors() { + Sizei Size = mMap->getSize(); for ( Int32 x = 0; x < Size.x; x++ ) { for ( Int32 y = 0; y < Size.y; y++ ) { @@ -220,22 +220,22 @@ void MapLightManager::DeallocateColors() { eeSAFE_DELETE_ARRAY( mTileColors ); } -void MapLightManager::DestroyLights() { +void MapLightManager::destroyLights() { for ( LightsList::iterator it = mLights.begin(); it != mLights.end(); it++ ) { MapLight * Light = (*it); eeSAFE_DELETE( Light ); } } -Uint32 MapLightManager::Count() { +Uint32 MapLightManager::getCount() { return (Uint32)mLights.size(); } -MapLightManager::LightsList& MapLightManager::GetLights() { +MapLightManager::LightsList& MapLightManager::getLights() { return mLights; } -MapLight * MapLightManager::GetLightOver( const Vector2f& OverPos, MapLight * LightCurrent ) { +MapLight * MapLightManager::getLightOver( const Vector2f& OverPos, MapLight * LightCurrent ) { MapLight * PivotLight = NULL; MapLight * LastLight = NULL; MapLight * FirstLight = NULL; @@ -243,7 +243,7 @@ MapLight * MapLightManager::GetLightOver( const Vector2f& OverPos, MapLight * Li for ( LightsList::reverse_iterator it = mLights.rbegin(); it != mLights.rend(); it++ ) { MapLight * Light = (*it); - if ( Light->GetAABB().contains( OverPos ) ) { + if ( Light->getAABB().contains( OverPos ) ) { if ( NULL == FirstLight ) { FirstLight = Light; } @@ -268,7 +268,7 @@ MapLight * MapLightManager::GetLightOver( const Vector2f& OverPos, MapLight * Li return FirstLight; } - if ( NULL == PivotLight && NULL != LightCurrent && LightCurrent->GetAABB().contains( OverPos ) ) { + if ( NULL == PivotLight && NULL != LightCurrent && LightCurrent->getAABB().contains( OverPos ) ) { return LightCurrent; } diff --git a/src/eepp/gaming/objectlayer.cpp b/src/eepp/gaming/mapobjectlayer.cpp similarity index 60% rename from src/eepp/gaming/objectlayer.cpp rename to src/eepp/gaming/mapobjectlayer.cpp index b02e8743c..96718d2c8 100644 --- a/src/eepp/gaming/objectlayer.cpp +++ b/src/eepp/gaming/mapobjectlayer.cpp @@ -16,20 +16,20 @@ MapObjectLayer::MapObjectLayer( TileMap * map, Uint32 flags, std::string name, V } MapObjectLayer::~MapObjectLayer() { - DeallocateLayer(); + deallocateLayer(); } -void MapObjectLayer::AllocateLayer() { +void MapObjectLayer::allocateLayer() { } -void MapObjectLayer::DeallocateLayer() { +void MapObjectLayer::deallocateLayer() { for ( ObjList::iterator it = mObjects.begin(); it != mObjects.end(); it++ ) { eeSAFE_DELETE( *it ); } } -void MapObjectLayer::Draw( const Vector2f &Offset ) { +void MapObjectLayer::draw( const Vector2f &Offset ) { GlobalBatchRenderer::instance()->draw(); ObjList::iterator it; @@ -38,19 +38,19 @@ void MapObjectLayer::Draw( const Vector2f &Offset ) { GLi->translatef( mOffset.x, mOffset.y, 0.0f ); for ( it = mObjects.begin(); it != mObjects.end(); it++ ) { - (*it)->Draw(); + (*it)->draw(); } - Texture * Tex = mMap->GetBlankTileTexture(); + Texture * Tex = mMap->getBlankTileTexture(); - if ( mMap->ShowBlocked() && NULL != Tex ) { + if ( mMap->getShowBlocked() && NULL != Tex ) { ColorA Col( 255, 0, 0, 200 ); for ( it = mObjects.begin(); it != mObjects.end(); it++ ) { GameObject * Obj = (*it); - if ( Obj->Blocked() ) { - Tex->drawEx( Obj->Pos().x, Obj->Pos().y, Obj->Size().getWidth(), Obj->Size().getHeight(), 0, Vector2f::One, Col, Col, Col, Col ); + if ( Obj->isBlocked() ) { + Tex->drawEx( Obj->getPosition().x, Obj->getPosition().y, Obj->getSize().getWidth(), Obj->getSize().getHeight(), 0, Vector2f::One, Col, Col, Col, Col ); } } } @@ -60,35 +60,35 @@ void MapObjectLayer::Draw( const Vector2f &Offset ) { GLi->popMatrix(); } -void MapObjectLayer::Update() { +void MapObjectLayer::update() { for ( ObjList::iterator it = mObjects.begin(); it != mObjects.end(); it++ ) { - (*it)->Update(); + (*it)->update(); } } -Uint32 MapObjectLayer::GetObjectCount() const { +Uint32 MapObjectLayer::getObjectCount() const { return mObjects.size(); } -void MapObjectLayer::AddGameObject( GameObject * obj ) { +void MapObjectLayer::addGameObject( GameObject * obj ) { mObjects.push_back( obj ); } -void MapObjectLayer::RemoveGameObject( GameObject * obj ) { +void MapObjectLayer::removeGameObject( GameObject * obj ) { mObjects.remove( obj ); eeSAFE_DELETE( obj ); } -void MapObjectLayer::RemoveGameObject( const Vector2i& pos ) { - GameObject * tObj = GetObjectOver( pos, SEARCH_OBJECT ); +void MapObjectLayer::removeGameObject( const Vector2i& pos ) { + GameObject * tObj = getObjectOver( pos, SEARCH_OBJECT ); if ( NULL != tObj ) { - RemoveGameObject( tObj ); + removeGameObject( tObj ); } } -GameObject * MapObjectLayer::GetObjectOver( const Vector2i& pos, SEARCH_TYPE type ) { +GameObject * MapObjectLayer::getObjectOver( const Vector2i& pos, SEARCH_TYPE type ) { GameObject * tObj; Vector2f tPos; Sizei tSize; @@ -97,16 +97,16 @@ GameObject * MapObjectLayer::GetObjectOver( const Vector2i& pos, SEARCH_TYPE typ tObj = (*it); if ( type & SEARCH_POLY ) { - if ( tObj->IsType( GAMEOBJECT_TYPE_OBJECT ) ) { + if ( tObj->isType( GAMEOBJECT_TYPE_OBJECT ) ) { GameObjectObject * tObjObj = reinterpret_cast ( tObj ); - if ( tObjObj->PointInside( Vector2f( pos.x, pos.y ) ) ) + if ( tObjObj->pointInside( Vector2f( pos.x, pos.y ) ) ) return tObj; } } else if ( type & SEARCH_OBJECT ) { - if ( !tObj->IsType( GAMEOBJECT_TYPE_OBJECT ) ) { - tPos = tObj->Pos(); - tSize = tObj->Size(); + if ( !tObj->isType( GAMEOBJECT_TYPE_OBJECT ) ) { + tPos = tObj->getPosition(); + tSize = tObj->getSize(); Recti objR( tPos.x, tPos.y, tPos.x + tSize.x, tPos.y + tSize.y ); @@ -114,14 +114,14 @@ GameObject * MapObjectLayer::GetObjectOver( const Vector2i& pos, SEARCH_TYPE typ return tObj; } } else { - if ( tObj->IsType( GAMEOBJECT_TYPE_OBJECT ) ) { + if ( tObj->isType( GAMEOBJECT_TYPE_OBJECT ) ) { GameObjectObject * tObjObj = reinterpret_cast ( tObj ); - if ( tObjObj->PointInside( Vector2f( pos.x, pos.y ) ) ) + if ( tObjObj->pointInside( Vector2f( pos.x, pos.y ) ) ) return tObj; } else { - tPos = tObj->Pos(); - tSize = tObj->Size(); + tPos = tObj->getPosition(); + tSize = tObj->getSize(); Recti objR( tPos.x, tPos.y, tPos.x + tSize.x, tPos.y + tSize.y ); @@ -134,7 +134,7 @@ GameObject * MapObjectLayer::GetObjectOver( const Vector2i& pos, SEARCH_TYPE typ return NULL; } -MapObjectLayer::ObjList& MapObjectLayer::GetObjectList() { +MapObjectLayer::ObjList& MapObjectLayer::getObjectList() { return mObjects; } diff --git a/src/eepp/gaming/tilemap.cpp b/src/eepp/gaming/tilemap.cpp index fdd7a946e..d515897dd 100644 --- a/src/eepp/gaming/tilemap.cpp +++ b/src/eepp/gaming/tilemap.cpp @@ -43,15 +43,15 @@ TileMap::TileMap() : mLastObjId( 0 ), mForcedHeaders( NULL ) { - ViewSize( mViewSize ); + setViewSize( mViewSize ); } TileMap::~TileMap() { DeleteLayers(); - DisableForcedHeaders(); + disableForcedHeaders(); } -void TileMap::Reset() { +void TileMap::reset() { DeleteLayers(); mWindow = NULL; @@ -64,12 +64,12 @@ void TileMap::Reset() { mBaseColor = ColorA( 255, 255, 255, 255 ); } -void TileMap::ForceHeadersOnLoad( Sizei mapSize, Sizei tileSize, Uint32 numLayers, Uint32 flags ) { - DisableForcedHeaders(); +void TileMap::forceHeadersOnLoad( Sizei mapSize, Sizei tileSize, Uint32 numLayers, Uint32 flags ) { + disableForcedHeaders(); mForcedHeaders = eeNew( ForcedHeaders, ( mapSize, tileSize, numLayers, flags ) ); } -void TileMap::DisableForcedHeaders() { +void TileMap::disableForcedHeaders() { eeSAFE_DELETE( mForcedHeaders ); } @@ -84,8 +84,8 @@ void TileMap::DeleteLayers() { mLayerCount = 0; } -void TileMap::Create( Sizei Size, Uint32 MaxLayers, Sizei TileSize, Uint32 Flags, Sizei viewSize, EE::Window::Window * Window ) { - Reset(); +void TileMap::create( Sizei Size, Uint32 MaxLayers, Sizei TileSize, Uint32 Flags, Sizei viewSize, EE::Window::Window * Window ) { + reset(); mWindow = Window; @@ -99,13 +99,13 @@ void TileMap::Create( Sizei Size, Uint32 MaxLayers, Sizei TileSize, Uint32 Flags mPixelSize = Size * TileSize; mLayers = eeNewArray( MapLayer*, mMaxLayers ); - if ( LightsEnabled() ) + if ( getLightsEnabled() ) CreateLightManager(); for ( Uint32 i = 0; i < mMaxLayers; i++ ) mLayers[i] = NULL; - ViewSize( viewSize ); + setViewSize( viewSize ); CreateEmptyTile(); } @@ -159,7 +159,7 @@ void TileMap::CreateEmptyTile() { } } -MapLayer * TileMap::AddLayer( Uint32 Type, Uint32 flags, std::string name ) { +MapLayer * TileMap::addLayer( Uint32 Type, Uint32 flags, std::string name ) { eeASSERT( NULL != mLayers ); if ( mLayerCount >= mMaxLayers ) @@ -181,21 +181,21 @@ MapLayer * TileMap::AddLayer( Uint32 Type, Uint32 flags, std::string name ) { return mLayers[ mLayerCount - 1 ]; } -MapLayer* TileMap::GetLayer( Uint32 index ) { +MapLayer* TileMap::getLayer( Uint32 index ) { eeASSERT( index < mLayerCount ); return mLayers[ index ]; } -MapLayer* TileMap::GetLayerByHash( Uint32 hash ) { +MapLayer* TileMap::getLayerByHash( Uint32 hash ) { for ( Uint32 i = 0; i < mLayerCount; i++ ) { - if ( mLayers[i]->Id() == hash ) + if ( mLayers[i]->getId() == hash ) return mLayers[i]; } return NULL; } -Uint32 TileMap::GetLayerIndex( MapLayer * Layer ) { +Uint32 TileMap::getLayerIndex( MapLayer * Layer ) { if ( NULL != Layer ) { for ( Uint32 i = 0; i < mLayerCount; i++ ) { if ( mLayers[i] == Layer ) @@ -206,18 +206,18 @@ Uint32 TileMap::GetLayerIndex( MapLayer * Layer ) { return EE_MAP_LAYER_UNKNOWN; } -MapLayer* TileMap::GetLayer( const std::string& name ) { - return GetLayerByHash( String::hash( name ) ); +MapLayer* TileMap::getLayer( const std::string& name ) { + return getLayerByHash( String::hash( name ) ); } -void TileMap::Draw() { +void TileMap::draw() { GlobalBatchRenderer::instance()->draw(); - if ( ClipedArea() ) { + if ( getClipedArea() ) { mWindow->clipEnable( mScreenPos.x, mScreenPos.y, mViewSize.x, mViewSize.y ); } - if ( DrawBackground() ) { + if ( getDrawBackground() ) { Primitives P; Uint8 Alpha = static_cast( (Float)mBackColor.a() * ( (Float)mBackAlpha / 255.f ) ); @@ -237,8 +237,8 @@ void TileMap::Draw() { GridDraw(); for ( Uint32 i = 0; i < mLayerCount; i++ ) { - if ( mLayers[i]->Visible() ) - mLayers[i]->Draw(); + if ( mLayers[i]->isVisible() ) + mLayers[i]->draw(); } MouseOverDraw(); @@ -251,20 +251,20 @@ void TileMap::Draw() { GLi->popMatrix(); GLi->loadMatrixf( oldM ); - if ( ClipedArea() ) { + if ( getClipedArea() ) { mWindow->clipDisable(); } } void TileMap::MouseOverDraw() { - if ( !DrawTileOver() || NULL == mTileTex ) + if ( !getDrawTileOver() || NULL == mTileTex ) return; mTileTex->draw( mMouseOverTileFinal.x * mTileSize.x, mMouseOverTileFinal.y * mTileSize.y, 0, Vector2f::One, mTileOverColor ); } void TileMap::GridDraw() { - if ( !DrawGrid() ) + if ( !getDrawGrid() ) return; if ( 0 == mSize.x || 0 == mSize.y || NULL == mTileTex ) @@ -272,8 +272,8 @@ void TileMap::GridDraw() { GlobalBatchRenderer::instance()->draw(); - Vector2i start = StartTile(); - Vector2i end = EndTile(); + Vector2i start = getStartTile(); + Vector2i end = getEndTile(); Float tx, ty; ColorA TileTexCol( 255, 255, 255, mBackAlpha ); @@ -284,20 +284,20 @@ void TileMap::GridDraw() { ty = y * mTileSize.y; - if ( LightsEnabled() ) { + if ( getLightsEnabled() ) { Vector2i TPos( x, y ); - if ( mLightManager->IsByVertex() ) { - ColorA TileTexCol0( *mLightManager->GetTileColor( TPos, 0 ) ); - ColorA TileTexCol1( *mLightManager->GetTileColor( TPos, 1 ) ); - ColorA TileTexCol2( *mLightManager->GetTileColor( TPos, 2 ) ); - ColorA TileTexCol3( *mLightManager->GetTileColor( TPos, 3 ) ); + if ( mLightManager->isByVertex() ) { + ColorA TileTexCol0( *mLightManager->getTileColor( TPos, 0 ) ); + ColorA TileTexCol1( *mLightManager->getTileColor( TPos, 1 ) ); + ColorA TileTexCol2( *mLightManager->getTileColor( TPos, 2 ) ); + ColorA TileTexCol3( *mLightManager->getTileColor( TPos, 3 ) ); TileTexCol0.Alpha = TileTexCol1.Alpha = TileTexCol2.Alpha = TileTexCol3.Alpha = mBackAlpha; mTileTex->drawEx( tx, ty, 0, 0, 0, Vector2f::One, TileTexCol0, TileTexCol1, TileTexCol2, TileTexCol3 ); } else { - TileTexCol = *mLightManager->GetTileColor( TPos ); + TileTexCol = *mLightManager->getTileColor( TPos ); TileTexCol.Alpha = mBackAlpha; mTileTex->draw( tx, ty, 0, Vector2f::One, TileTexCol ); @@ -311,7 +311,7 @@ void TileMap::GridDraw() { GlobalBatchRenderer::instance()->draw(); } -const bool& TileMap::IsMouseOver() const { +const bool& TileMap::isMouseOver() const { return mMouseOver; } @@ -365,7 +365,7 @@ void TileMap::CalcTilesClip() { } void TileMap::Clamp() { - if ( !ClampBorders() ) + if ( !getClampBorders() ) return; if ( mOffset.x > 0 ) @@ -404,7 +404,7 @@ void TileMap::Clamp() { mOffset.y = 0; } -void TileMap::Offset( const Vector2f& offset ) { +void TileMap::setOffset( const Vector2f& offset ) { mOffset = offset; Clamp(); @@ -412,7 +412,7 @@ void TileMap::Offset( const Vector2f& offset ) { CalcTilesClip(); } -Vector2i TileMap::GetMaxOffset() { +Vector2i TileMap::getMaxOffset() { Vector2i v( ( mTileSize.x * mSize.x * mScale ) - mViewSize.x, ( mTileSize.y * mSize.y * mScale ) - mViewSize.y ); @@ -422,25 +422,25 @@ Vector2i TileMap::GetMaxOffset() { return v; } -const Float& TileMap::Scale() const { +const Float& TileMap::getScale() const { return mScale; } -void TileMap::Scale( const Float& scale ) { +void TileMap::setScale( const Float& scale ) { mScale = scale; - Offset( mOffset ); + setOffset( mOffset ); } void TileMap::UpdateScreenAABB() { mScreenAABB = eeAABB( -mOffset.x, -mOffset.y, -mOffset.x + mViewSize.getWidth(), -mOffset.y + mViewSize.getHeight() ); } -const eeAABB& TileMap::GetViewAreaAABB() const { +const eeAABB& TileMap::getViewAreaAABB() const { return mScreenAABB; } -void TileMap::Update() { +void TileMap::update() { GetMouseOverTile(); UpdateScreenAABB(); @@ -449,41 +449,41 @@ void TileMap::Update() { mLightManager->Update(); for ( Uint32 i = 0; i < mLayerCount; i++ ) - mLayers[i]->Update(); + mLayers[i]->update(); if ( mUpdateCb.IsSet() ) mUpdateCb(); } -const Sizei& TileMap::ViewSize() const { +const Sizei& TileMap::getViewSize() const { return mViewSize; } -const Vector2i& TileMap::GetMouseTilePos() const { +const Vector2i& TileMap::getMouseTilePos() const { return mMouseOverTileFinal; } -const Vector2i& TileMap::GetRealMouseTilePos() const { +const Vector2i& TileMap::getRealMouseTilePos() const { return mMouseOverTile; } -const Vector2i& TileMap::GetMouseMapPos() const { +const Vector2i& TileMap::getMouseMapPos() const { return mMouseMapPos; } -Vector2f TileMap::GetMouseMapPosf() const { +Vector2f TileMap::getMouseMapPosf() const { return Vector2f( (Float)mMouseMapPos.x, (Float)mMouseMapPos.y ); } -Vector2i TileMap::GetMouseTilePosCoords() { - return GetTileCoords( GetMouseTilePos() ); +Vector2i TileMap::getMouseTilePosCoords() { + return getTileCoords( getMouseTilePos() ); } -Vector2i TileMap::GetTileCoords( const Vector2i& TilePos ) { +Vector2i TileMap::getTileCoords( const Vector2i& TilePos ) { return ( TilePos * mTileSize ); } -void TileMap::ViewSize( const Sizei& viewSize ) { +void TileMap::setViewSize( const Sizei& viewSize ) { mViewSize = viewSize; Clamp(); @@ -491,111 +491,111 @@ void TileMap::ViewSize( const Sizei& viewSize ) { CalcTilesClip(); } -const Vector2i& TileMap::Position() const { +const Vector2i& TileMap::getPosition() const { return mScreenPos; } -void TileMap::Position( const Vector2i& position ) { +void TileMap::setPosition( const Vector2i& position ) { mScreenPos = position; } -const Vector2f& TileMap::Offset() const { +const Vector2f& TileMap::getOffset() const { return mOffset; } -const Vector2i& TileMap::StartTile() const { +const Vector2i& TileMap::getStartTile() const { return mStartTile; } -const Vector2i& TileMap::EndTile() const { +const Vector2i& TileMap::getEndTile() const { return mEndTile; } -void TileMap::ExtraTiles( const Vector2i& extra ) { +void TileMap::setExtraTiles( const Vector2i& extra ) { mExtraTiles = extra; } -const Vector2i& TileMap::ExtraTiles() const { +const Vector2i& TileMap::getExtraTiles() const { return mExtraTiles; } -void TileMap::BaseColor( const ColorA& color ) { +void TileMap::setBaseColor( const ColorA& color ) { mBaseColor = color; } -const ColorA& TileMap::BaseColor() const { +const ColorA& TileMap::getBaseColor() const { return mBaseColor; } -void TileMap::DrawGrid( const bool& draw ) { +void TileMap::setDrawGrid( const bool& draw ) { BitOp::setBitFlagValue( &mFlags, MAP_FLAG_DRAW_GRID, draw ? 1 : 0 ); } -Uint32 TileMap::DrawGrid() const { +Uint32 TileMap::getDrawGrid() const { return mFlags & MAP_FLAG_DRAW_GRID; } -void TileMap::DrawBackground( const bool& draw ) { +void TileMap::setDrawBackground( const bool& draw ) { BitOp::setBitFlagValue( &mFlags, MAP_FLAG_DRAW_BACKGROUND, draw ? 1 : 0 ); } -void TileMap::ShowBlocked( const bool& show ) { +void TileMap::setShowBlocked( const bool& show ) { BitOp::setBitFlagValue( &mFlags, MAP_FLAG_SHOW_BLOCKED, show ? 1 : 0 ); } -Uint32 TileMap::ShowBlocked() const { +Uint32 TileMap::getShowBlocked() const { return mFlags & MAP_FLAG_SHOW_BLOCKED; } -Uint32 TileMap::DrawBackground() const { +Uint32 TileMap::getDrawBackground() const { return mFlags & MAP_FLAG_DRAW_BACKGROUND; } -bool TileMap::ClipedArea() const { +bool TileMap::getClipedArea() const { return 0 != ( mFlags & MAP_FLAG_CLIP_AREA ); } -void TileMap::ClipedArea( const bool& clip ) { +void TileMap::setClipedArea( const bool& clip ) { BitOp::setBitFlagValue( &mFlags, MAP_FLAG_CLIP_AREA, clip ? 1 : 0 ); } -bool TileMap::ClampBorders() const { +bool TileMap::getClampBorders() const { return 0 != ( mFlags & MAP_FLAG_CLAMP_BORDERS ); } -void TileMap::ClampBorders( const bool& clamp ) { +void TileMap::setClampBorders( const bool& clamp ) { BitOp::setBitFlagValue( &mFlags, MAP_FLAG_CLAMP_BORDERS, clamp ? 1 : 0 ); } -Uint32 TileMap::DrawTileOver() const { +Uint32 TileMap::getDrawTileOver() const { return 0 != ( mFlags & MAP_FLAG_DRAW_TILE_OVER ); } -void TileMap::DrawTileOver( const bool& draw ) { +void TileMap::setDrawTileOver( const bool& draw ) { BitOp::setBitFlagValue( &mFlags, MAP_FLAG_DRAW_TILE_OVER, draw ? 1 : 0 ); } -bool TileMap::LightsEnabled() { +bool TileMap::getLightsEnabled() { return 0 != ( mFlags & MAP_FLAG_LIGHTS_ENABLED ); } -void TileMap::LightsEnabled( const bool& enabled ) { +void TileMap::setLightsEnabled( const bool& enabled ) { BitOp::setBitFlagValue( &mFlags, MAP_FLAG_LIGHTS_ENABLED, enabled ? 1 : 0 ); } -bool TileMap::LightsByVertex() { +bool TileMap::getLightsByVertex() { return 0 != ( mFlags & MAP_FLAG_LIGHTS_BYVERTEX ); } -void TileMap::Move( const Vector2f& offset ) { - Move( offset.x, offset.y ); +void TileMap::move( const Vector2f& offset ) { + move( offset.x, offset.y ); } -void TileMap::Move( const Float& offsetx, const Float& offsety ) { - Offset( Vector2f( mOffset.x + offsetx, mOffset.y + offsety ) ); +void TileMap::move( const Float& offsetx, const Float& offsety ) { + setOffset( Vector2f( mOffset.x + offsetx, mOffset.y + offsety ) ); } -GameObjectPolyData& TileMap::GetPolyObjData( Uint32 Id ) { +GameObjectPolyData& TileMap::getPolyObjData( Uint32 Id ) { return mPolyObjs[ Id ]; } @@ -605,7 +605,7 @@ GameObject * TileMap::CreateGameObject( const Uint32& Type, const Uint32& Flags, { GameObjectSubTexture * tSubTexture = eeNew( GameObjectSubTexture, ( Flags, Layer ) ); - tSubTexture->DataId( DataId ); + tSubTexture->setDataId( DataId ); return tSubTexture; } @@ -613,7 +613,7 @@ GameObject * TileMap::CreateGameObject( const Uint32& Type, const Uint32& Flags, { GameObjectSubTextureEx * tSubTextureEx = eeNew( GameObjectSubTextureEx, ( Flags, Layer ) ); - tSubTextureEx->DataId( DataId ); + tSubTextureEx->setDataId( DataId ); return tSubTextureEx; } @@ -621,7 +621,7 @@ GameObject * TileMap::CreateGameObject( const Uint32& Type, const Uint32& Flags, { GameObjectSprite * tSprite = eeNew( GameObjectSprite, ( Flags, Layer ) ); - tSprite->DataId( DataId ); + tSprite->setDataId( DataId ); return tSprite; } @@ -629,7 +629,7 @@ GameObject * TileMap::CreateGameObject( const Uint32& Type, const Uint32& Flags, case GAMEOBJECT_TYPE_POLYGON: case GAMEOBJECT_TYPE_POLYLINE: { - GameObjectPolyData& ObjData = GetPolyObjData( DataId ); + GameObjectPolyData& ObjData = getPolyObjData( DataId ); GameObjectObject * tObject = NULL; @@ -642,9 +642,9 @@ GameObject * TileMap::CreateGameObject( const Uint32& Type, const Uint32& Flags, } if ( NULL != tObject ) { - tObject->Name( ObjData.Name ); - tObject->TypeName( ObjData.Type ); - tObject->SetProperties( ObjData.Properties ); + tObject->setName( ObjData.Name ); + tObject->setTypeName( ObjData.Type ); + tObject->setProperties( ObjData.Properties ); } return tObject; @@ -671,32 +671,32 @@ GameObject * TileMap::CreateGameObject( const Uint32& Type, const Uint32& Flags, return NULL; } -MapLightManager * TileMap::GetLightManager() const { +MapLightManager * TileMap::getLightManager() const { return mLightManager; } -const Sizei& TileMap::TotalSize() const { +const Sizei& TileMap::getTotalSize() const { return mPixelSize; } -const Sizei& TileMap::TileSize() const { +const Sizei& TileMap::getTileSize() const { return mTileSize; } -const Sizei& TileMap::Size() const { +const Sizei& TileMap::getSize() const { return mSize; } -const Uint32& TileMap::LayerCount() const { +const Uint32& TileMap::getLayerCount() const { return mLayerCount; } -const Uint32& TileMap::MaxLayers() const { +const Uint32& TileMap::getMaxLayers() const { return mMaxLayers; } -bool TileMap::MoveLayerUp( MapLayer * Layer ) { - Uint32 Lindex = GetLayerIndex( Layer ); +bool TileMap::moveLayerUp( MapLayer * Layer ) { + Uint32 Lindex = getLayerIndex( Layer ); if ( Lindex != EE_MAP_LAYER_UNKNOWN && mLayerCount > 1 && ( Lindex < mLayerCount - 1 ) && ( Lindex + 1 < mLayerCount ) ) { MapLayer * tLayer = mLayers[ Lindex + 1 ]; @@ -710,8 +710,8 @@ bool TileMap::MoveLayerUp( MapLayer * Layer ) { return false; } -bool TileMap::MoveLayerDown( MapLayer * Layer ) { - Uint32 Lindex = GetLayerIndex( Layer ); +bool TileMap::moveLayerDown( MapLayer * Layer ) { + Uint32 Lindex = getLayerIndex( Layer ); if ( Lindex != EE_MAP_LAYER_UNKNOWN && mLayerCount > 1 && Lindex >= 1 ) { MapLayer * tLayer = mLayers[ Lindex - 1 ]; @@ -725,8 +725,8 @@ bool TileMap::MoveLayerDown( MapLayer * Layer ) { return false; } -bool TileMap::RemoveLayer( MapLayer * Layer ) { - Uint32 Lindex = GetLayerIndex( Layer ); +bool TileMap::removeLayer( MapLayer * Layer ) { + Uint32 Lindex = getLayerIndex( Layer ); if ( Lindex != EE_MAP_LAYER_UNKNOWN ) { eeSAFE_DELETE( mLayers[ Lindex ] ); @@ -751,48 +751,48 @@ bool TileMap::RemoveLayer( MapLayer * Layer ) { return false; } -void TileMap::ClearProperties() { +void TileMap::clearProperties() { mProperties.clear(); } -void TileMap::AddProperty( std::string Text, std::string Value ) { +void TileMap::addProperty( std::string Text, std::string Value ) { mProperties[ Text ] = Value; } -void TileMap::EditProperty( std::string Text, std::string Value ) { +void TileMap::editProperty( std::string Text, std::string Value ) { mProperties[ Text ] = Value; } -void TileMap::RemoveProperty( std::string Text ) { +void TileMap::removeProperty( std::string Text ) { mProperties.erase( Text ); } -TileMap::PropertiesMap& TileMap::GetProperties() { +TileMap::PropertiesMap& TileMap::getProperties() { return mProperties; } -void TileMap::AddVirtualObjectType( const std::string& name ) { +void TileMap::addVirtualObjectType( const std::string& name ) { mObjTypes.push_back( name ); mObjTypes.unique(); } -void TileMap::RemoveVirtualObjectType( const std::string& name ) { +void TileMap::removeVirtualObjectType( const std::string& name ) { mObjTypes.remove( name ); } -void TileMap::ClearVirtualObjectTypes() { +void TileMap::clearVirtualObjectTypes() { mObjTypes.clear(); } -TileMap::GOTypesList& TileMap::GetVirtualObjectTypes() { +TileMap::GOTypesList& TileMap::getVirtualObjectTypes() { return mObjTypes; } -void TileMap::SetCreateGameObjectCallback( const CreateGOCb& Cb ) { +void TileMap::setCreateGameObjectCallback( const CreateGOCb& Cb ) { mCreateGOCb = Cb; } -bool TileMap::LoadFromStream( IOStream& IOS ) { +bool TileMap::loadFromStream( IOStream& IOS ) { sMapHdr MapHdr; Uint32 i, z; @@ -801,12 +801,12 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { if ( MapHdr.Magic == EE_MAP_MAGIC ) { if ( NULL == mForcedHeaders ) { - Create( Sizei( MapHdr.SizeX, MapHdr.SizeY ), MapHdr.MaxLayers, Sizei( MapHdr.TileSizeX, MapHdr.TileSizeY ), MapHdr.Flags ); + create( Sizei( MapHdr.SizeX, MapHdr.SizeY ), MapHdr.MaxLayers, Sizei( MapHdr.TileSizeX, MapHdr.TileSizeY ), MapHdr.Flags ); } else { - Create( mForcedHeaders->MapSize, mForcedHeaders->NumLayers, mForcedHeaders->TileSize, mForcedHeaders->Flags ); + create( mForcedHeaders->MapSize, mForcedHeaders->NumLayers, mForcedHeaders->TileSize, mForcedHeaders->Flags ); } - BaseColor( ColorA( MapHdr.BaseColor ) ); + setBaseColor( ColorA( MapHdr.BaseColor ) ); //! Load Properties if ( MapHdr.PropertyCount ) { @@ -815,7 +815,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { 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 ) ); + addProperty( std::string( tProp[i].Name ), std::string( tProp[i].Value ) ); } eeSAFE_DELETE_ARRAY( tProp ); @@ -856,7 +856,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { IOS.read( (char*)&tVObj[0], sizeof(sVirtualObj) * MapHdr.VirtualObjectTypesCount ); for ( i = 0; i < MapHdr.VirtualObjectTypesCount; i++ ) { - AddVirtualObjectType( std::string( tVObj[i].Name ) ); + addVirtualObjectType( std::string( tVObj[i].Name ) ); } eeSAFE_DELETE_ARRAY( tVObj ); @@ -872,17 +872,17 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { tLayerHdr = &(tLayersHdr[i]); - MapLayer * tLayer = AddLayer( tLayerHdr->Type, tLayerHdr->Flags, std::string( tLayerHdr->Name ) ); + MapLayer * tLayer = addLayer( tLayerHdr->Type, tLayerHdr->Flags, std::string( tLayerHdr->Name ) ); if ( NULL != tLayer ) { - tLayer->Offset( Vector2f( (Float)tLayerHdr->OffsetX, (Float)tLayerHdr->OffsetY ) ); + tLayer->setOffset( Vector2f( (Float)tLayerHdr->OffsetX, (Float)tLayerHdr->OffsetY ) ); sPropertyHdr * tProps = eeNewArray( 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 ) ); + tLayer->addProperty( std::string( tProps[z].Name ), std::string( tProps[z].Value ) ); } eeSAFE_DELETE_ARRAY( tProps ); @@ -892,7 +892,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { bool ThereIsTiled = false; for ( i = 0; i < mLayerCount; i++ ) { - if ( NULL != mLayers[i] && mLayers[i]->Type() == MAP_LAYER_TILED ) { + if ( NULL != mLayers[i] && mLayers[i]->getType() == MAP_LAYER_TILED ) { ThereIsTiled = true; } } @@ -925,7 +925,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { tGO = CreateGameObject( tTGOHdr.Type, tTGOHdr.Flags, mLayers[i], tTGOHdr.Id ); - tTLayer->AddGameObject( tGO, Vector2i( x, y ) ); + tTLayer->addGameObject( tGO, Vector2i( x, y ) ); } } } @@ -940,7 +940,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { MapObjectLayer * tOLayer; for ( i = 0; i < mLayerCount; i++ ) { - if ( NULL != mLayers[i] && mLayers[i]->Type() == MAP_LAYER_OBJECT ) { + if ( NULL != mLayers[i] && mLayers[i]->getType() == MAP_LAYER_OBJECT ) { tLayerHdr = &( tLayersHdr[i] ); tOLayer = reinterpret_cast ( mLayers[i] ); @@ -990,9 +990,9 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { tGO = CreateGameObject( tOGOHdr.Type, tOGOHdr.Flags, mLayers[i], tOGOHdr.Id ); - tGO->Pos( Vector2f( tOGOHdr.PosX, tOGOHdr.PosY ) ); + tGO->setPosition( Vector2f( tOGOHdr.PosX, tOGOHdr.PosY ) ); - tOLayer->AddGameObject( tGO ); + tOLayer->addGameObject( tGO ); } } } @@ -1012,7 +1012,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { ColorA color( tLightHdr->Color ); RGB rgb( color.toColor() ); - mLightManager->AddLight( + mLightManager->addLight( eeNew( MapLight, ( tLightHdr->Radius, tLightHdr->PosX, tLightHdr->PosY, rgb, (LIGHT_TYPE)tLightHdr->Type ) ) ); } @@ -1034,49 +1034,49 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { return false; } -const std::string& TileMap::Path() const { +const std::string& TileMap::getPath() const { return mPath; } -bool TileMap::Load( const std::string& path ) { +bool TileMap::load( const std::string& path ) { if ( FileSystem::fileExists( path ) ) { mPath = path; IOStreamFile IOS( mPath, std::ios::in | std::ios::binary ); - return LoadFromStream( IOS ); + return loadFromStream( IOS ); } else if ( PackManager::instance()->isFallbackToPacksActive() ) { std::string tPath( path ); Pack * tPack = PackManager::instance()->exists( tPath ) ; if ( NULL != tPack ) { mPath = tPath; - return LoadFromPack( tPack, tPath ); + return loadFromPack( tPack, tPath ); } } return false; } -bool TileMap::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { +bool TileMap::loadFromPack( Pack * Pack, const std::string& FilePackPath ) { if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( FilePackPath ) ) { SafeDataPointer PData; Pack->extractFileToMemory( FilePackPath, PData ); - return LoadFromMemory( reinterpret_cast ( PData.Data ), PData.DataSize ); + return loadFromMemory( reinterpret_cast ( PData.Data ), PData.DataSize ); } return false; } -bool TileMap::LoadFromMemory( const char * Data, const Uint32& DataSize ) { +bool TileMap::loadFromMemory( const char * Data, const Uint32& DataSize ) { IOStreamMemory IOS( Data, DataSize ); - return LoadFromStream( IOS ); + return loadFromStream( IOS ); } -void TileMap::SaveToStream( IOStream& IOS ) { +void TileMap::saveToStream( IOStream& IOS ) { Uint32 i; sMapHdr MapHdr; MapLayer * tLayer; @@ -1096,8 +1096,8 @@ void TileMap::SaveToStream( IOStream& IOS ) { 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(); - if ( LightsEnabled() && NULL != mLightManager ) - MapHdr.LightsCount = mLightManager->Count(); + if ( getLightsEnabled() && NULL != mLightManager ) + MapHdr.LightsCount = mLightManager->getCount(); else MapHdr.LightsCount = 0; @@ -1147,19 +1147,19 @@ 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->getName().c_str(), LAYER_NAME_SIZE ); - tLayerH.Type = tLayer->Type(); - tLayerH.Flags = tLayer->Flags(); - tLayerH.OffsetX = tLayer->Offset().x; - tLayerH.OffsetY = tLayer->Offset().y; + tLayerH.Type = tLayer->getType(); + tLayerH.Flags = tLayer->getFlags(); + tLayerH.OffsetX = tLayer->getOffset().x; + tLayerH.OffsetY = tLayer->getOffset().y; if ( MAP_LAYER_OBJECT == tLayerH.Type ) - tLayerH.ObjectCount = reinterpret_cast ( tLayer )->GetObjectCount(); + tLayerH.ObjectCount = reinterpret_cast ( tLayer )->getObjectCount(); else tLayerH.ObjectCount = 0; - MapLayer::PropertiesMap& tLayerProp = tLayer->GetProperties(); + MapLayer::PropertiesMap& tLayerProp = tLayer->getProperties(); tLayerH.PropertyCount = tLayerProp.size(); @@ -1183,7 +1183,7 @@ void TileMap::SaveToStream( IOStream& IOS ) { bool ThereIsTiled = false; for ( i = 0; i < mLayerCount; i++ ) { - if ( NULL != mLayers[i] && mLayers[i]->Type() == MAP_LAYER_TILED ) { + if ( NULL != mLayers[i] && mLayers[i]->getType() == MAP_LAYER_TILED ) { ThereIsTiled = true; } } @@ -1212,10 +1212,10 @@ void TileMap::SaveToStream( IOStream& IOS ) { for ( i = 0; i < mLayerCount; i++ ) { tLayer = mLayers[i]; - if ( NULL != tLayer && tLayer->Type() == MAP_LAYER_TILED ) { + if ( NULL != tLayer && tLayer->getType() == MAP_LAYER_TILED ) { tTLayer = reinterpret_cast ( tLayer ); - tObj = tTLayer->GetGameObject( Vector2i( x, y ) ); + tObj = tTLayer->getGameObject( Vector2i( x, y ) ); if ( NULL != tObj ) { tReadFlag |= 1 << i; @@ -1236,18 +1236,18 @@ void TileMap::SaveToStream( IOStream& IOS ) { sMapTileGOHdr tTGOHdr; //! The DataId should be the SubTexture hash name ( at least in the cases of type SubTexture, SubTextureEx and Sprite. - tTGOHdr.Id = tObj->DataId(); + tTGOHdr.Id = tObj->getDataId(); //! If the object type is virtual, means that the real type is stored elsewhere. - if ( tObj->Type() != GAMEOBJECT_TYPE_VIRTUAL ) { - tTGOHdr.Type = tObj->Type(); + if ( tObj->getType() != GAMEOBJECT_TYPE_VIRTUAL ) { + tTGOHdr.Type = tObj->getType(); } else { GameObjectVirtual * tObjV = reinterpret_cast ( tObj ); - tTGOHdr.Type = tObjV->RealType(); + tTGOHdr.Type = tObjV->getRealType(); } - tTGOHdr.Flags = tObj->Flags(); + tTGOHdr.Flags = tObj->getFlags(); IOS.write( (const char*)&tTGOHdr, sizeof(sMapTileGOHdr) ); } @@ -1262,10 +1262,10 @@ void TileMap::SaveToStream( IOStream& IOS ) { for ( i = 0; i < mLayerCount; i++ ) { tLayer = mLayers[i]; - if ( NULL != tLayer && tLayer->Type() == MAP_LAYER_OBJECT ) { + if ( NULL != tLayer && tLayer->getType() == MAP_LAYER_OBJECT ) { tOLayer = reinterpret_cast ( tLayer ); - MapObjectLayer::ObjList ObjList = tOLayer->GetObjectList(); + MapObjectLayer::ObjList ObjList = tOLayer->getObjectList(); for ( MapObjectLayer::ObjList::iterator MapObjIt = ObjList.begin(); MapObjIt != ObjList.end(); MapObjIt++ ) { tObj = (*MapObjIt); @@ -1274,40 +1274,40 @@ void TileMap::SaveToStream( IOStream& IOS ) { //! The DataId should be the SubTexture hash name ( at least in the cases of type SubTexture, SubTextureEx and Sprite. //! And for the Poly Obj should be an arbitrary value assigned by the map on the moment of creation - tOGOHdr.Id = tObj->DataId(); + tOGOHdr.Id = tObj->getDataId(); //! If the object type is virtual, means that the real type is stored elsewhere. - if ( tObj->Type() != GAMEOBJECT_TYPE_VIRTUAL ) { - tOGOHdr.Type = tObj->Type(); + if ( tObj->getType() != GAMEOBJECT_TYPE_VIRTUAL ) { + tOGOHdr.Type = tObj->getType(); } else { GameObjectVirtual * tObjV = reinterpret_cast ( tObj ); - tOGOHdr.Type = tObjV->RealType(); + tOGOHdr.Type = tObjV->getRealType(); } - tOGOHdr.Flags = tObj->Flags(); + tOGOHdr.Flags = tObj->getFlags(); - tOGOHdr.PosX = (Int32)tObj->Pos().x; + tOGOHdr.PosX = (Int32)tObj->getPosition().x; - tOGOHdr.PosY = (Int32)tObj->Pos().y; + tOGOHdr.PosY = (Int32)tObj->getPosition().y; 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 || - tObj->Type() == GAMEOBJECT_TYPE_POLYGON || - tObj->Type() == GAMEOBJECT_TYPE_POLYLINE ) + if ( tObj->getType() == GAMEOBJECT_TYPE_OBJECT || + tObj->getType() == GAMEOBJECT_TYPE_POLYGON || + tObj->getType() == GAMEOBJECT_TYPE_POLYLINE ) { GameObjectObject * tObjObj = reinterpret_cast( tObj ); - Polygon2f tPoly = tObjObj->GetPolygon(); - GameObjectObject::PropertiesMap tObjObjProp = tObjObj->GetProperties(); + Polygon2f tPoly = tObjObj->getPolygon(); + GameObjectObject::PropertiesMap tObjObjProp = tObjObj->getProperties(); sMapObjObjHdr tObjObjHdr; 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->getName().c_str(), MAP_PROPERTY_SIZE ); + String::strCopy( tObjObjHdr.Type, tObjObj->getTypeName().c_str(), MAP_PROPERTY_SIZE ); tObjObjHdr.PointCount = tPoly.getSize(); tObjObjHdr.PropertyCount = tObjObjProp.size(); @@ -1342,18 +1342,18 @@ void TileMap::SaveToStream( IOStream& IOS ) { //! Saves the lights if ( MapHdr.LightsCount && NULL != mLightManager ) { - MapLightManager::LightsList& Lights = mLightManager->GetLights(); + MapLightManager::LightsList& Lights = mLightManager->getLights(); for ( MapLightManager::LightsList::iterator LightsIt = Lights.begin(); LightsIt != Lights.end(); LightsIt++ ) { MapLight * Light = (*LightsIt); sMapLightHdr tLightHdr; - tLightHdr.Radius = Light->Radius(); - tLightHdr.PosX = (Int32)Light->Position().x; - tLightHdr.PosY = (Int32)Light->Position().y; - tLightHdr.Color = ColorA( Light->Color() ).getValue(); - tLightHdr.Type = Light->Type(); + tLightHdr.Radius = Light->getRadius(); + tLightHdr.PosX = (Int32)Light->getPosition().x; + tLightHdr.PosY = (Int32)Light->getPosition().y; + tLightHdr.Color = ColorA( Light->getColor() ).getValue(); + tLightHdr.Type = Light->getType(); IOS.write( (const char*)&tLightHdr, sizeof(sMapLightHdr) ); } @@ -1361,11 +1361,11 @@ void TileMap::SaveToStream( IOStream& IOS ) { } } -void TileMap::Save( const std::string& path ) { +void TileMap::save( const std::string& path ) { if ( !FileSystem::isDirectory( path ) ) { IOStreamFile IOS( path, std::ios::out | std::ios::binary ); - SaveToStream( IOS ); + saveToStream( IOS ); mPath = path; } @@ -1389,28 +1389,28 @@ std::vector TileMap::GetTextureAtlases() { return items; } -void TileMap::SetDrawCallback( MapDrawCb Cb ) { +void TileMap::setDrawCallback( MapDrawCb Cb ) { mDrawCb = Cb; } -void TileMap::SetUpdateCallback( MapUpdateCb Cb ) { +void TileMap::setUpdateCallback( MapUpdateCb Cb ) { mUpdateCb = Cb; } -Texture * TileMap::GetBlankTileTexture() { +Texture * TileMap::getBlankTileTexture() { return mTileTex; } -bool TileMap::IsTileBlocked( const Vector2i& TilePos ) { +bool TileMap::isTileBlocked( const Vector2i& TilePos ) { TileMapLayer * TLayer; GameObject * TObj; for ( Uint32 i = 0; i < mLayerCount; i++ ) { - if ( mLayers[i]->Type() == MAP_LAYER_TILED ) { + if ( mLayers[i]->getType() == MAP_LAYER_TILED ) { TLayer = static_cast( mLayers[i] ); - TObj = TLayer->GetGameObject( TilePos ); + TObj = TLayer->getGameObject( TilePos ); - if ( NULL != TObj && TObj->Blocked() ) { + if ( NULL != TObj && TObj->isBlocked() ) { return true; } } @@ -1419,11 +1419,11 @@ bool TileMap::IsTileBlocked( const Vector2i& TilePos ) { return false; } -void TileMap::Data( void * value ) { +void TileMap::setData( void * value ) { mData = value; } -void * TileMap::Data() const { +void * TileMap::getData() const { return mData; } @@ -1432,12 +1432,12 @@ void TileMap::OnMapLoaded() { GameObject * TileMap::IsTypeInTilePos( const Uint32& Type, const Vector2i& TilePos ) { for ( Uint32 i = 0; i < mLayerCount; i++ ) { - if ( mLayers[i]->Type() == MAP_LAYER_TILED ) { + if ( mLayers[i]->getType() == MAP_LAYER_TILED ) { TileMapLayer * tLayer = reinterpret_cast ( mLayers[i] ); GameObject * tObj = NULL; - if ( ( tObj = tLayer->GetGameObject( TilePos ) ) ) { - if ( tObj->IsType( Type ) ) { + if ( ( tObj = tLayer->getGameObject( TilePos ) ) ) { + if ( tObj->isType( Type ) ) { return tObj; } } @@ -1447,31 +1447,31 @@ GameObject * TileMap::IsTypeInTilePos( const Uint32& Type, const Vector2i& TileP return NULL; } -const Uint8& TileMap::BackAlpha() const { +const Uint8& TileMap::getBackAlpha() const { return mBackAlpha; } -void TileMap::BackAlpha( const Uint8& alpha ) { +void TileMap::setBackAlpha( const Uint8& alpha ) { mBackAlpha = alpha; } -const ColorA& TileMap::BackColor() const { +const ColorA& TileMap::getBackColor() const { return mBackColor; } -void TileMap::BackColor( const ColorA& col ) { +void TileMap::setBackColor( const ColorA& col ) { mBackColor = col; } -Uint32 TileMap::GetNewObjectId() { +Uint32 TileMap::getNewObjectId() { return ++mLastObjId; } -void TileMap::GridLinesColor( const ColorA& Col ) { +void TileMap::setGridLinesColor( const ColorA& Col ) { mGridLinesColor = Col; } -const ColorA& TileMap::GridLinesColor() const { +const ColorA& TileMap::setGridLinesColor() const { return mGridLinesColor; } diff --git a/src/eepp/gaming/tilemaplayer.cpp b/src/eepp/gaming/tilemaplayer.cpp index dd5187742..d160c0cad 100644 --- a/src/eepp/gaming/tilemaplayer.cpp +++ b/src/eepp/gaming/tilemaplayer.cpp @@ -12,21 +12,21 @@ TileMapLayer::TileMapLayer( TileMap * map, Sizei size, Uint32 flags, std::string MapLayer( map, MAP_LAYER_TILED, flags, name, offset ), mSize( size ) { - AllocateLayer(); + allocateLayer(); } TileMapLayer::~TileMapLayer() { - DeallocateLayer(); + deallocateLayer(); } -void TileMapLayer::Draw( const Vector2f& Offset ) { +void TileMapLayer::draw( const Vector2f& Offset ) { GlobalBatchRenderer::instance()->draw(); GLi->pushMatrix(); GLi->translatef( mOffset.x, mOffset.y, 0.0f ); - Vector2i start = mMap->StartTile(); - Vector2i end = mMap->EndTile(); + Vector2i start = mMap->getStartTile(); + Vector2i end = mMap->getEndTile(); for ( Int32 x = start.x; x < end.x; x++ ) { for ( Int32 y = start.y; y < end.y; y++ ) { @@ -34,19 +34,19 @@ void TileMapLayer::Draw( const Vector2f& Offset ) { mCurTile.y = y; if ( NULL != mTiles[x][y] ) { - mTiles[x][y]->Draw(); + mTiles[x][y]->draw(); } } } - Texture * Tex = mMap->GetBlankTileTexture(); + Texture * Tex = mMap->getBlankTileTexture(); - if ( mMap->ShowBlocked() && NULL != Tex ) { + if ( mMap->getShowBlocked() && NULL != Tex ) { for ( Int32 x = start.x; x < end.x; x++ ) { for ( Int32 y = start.y; y < end.y; y++ ) { if ( NULL != mTiles[x][y] ) { - if ( mTiles[x][y]->Blocked() ) { - Tex->draw( x * mMap->TileSize().x, y * mMap->TileSize().y, 0 , Vector2f::One, ColorA( 255, 0, 0, 200 ) ); + if ( mTiles[x][y]->isBlocked() ) { + Tex->draw( x * mMap->getTileSize().x, y * mMap->getTileSize().y, 0 , Vector2f::One, ColorA( 255, 0, 0, 200 ) ); } } } @@ -58,9 +58,9 @@ void TileMapLayer::Draw( const Vector2f& Offset ) { GLi->popMatrix(); } -void TileMapLayer::Update() { - Vector2i start = mMap->StartTile(); - Vector2i end = mMap->EndTile(); +void TileMapLayer::update() { + Vector2i start = mMap->getStartTile(); + Vector2i end = mMap->getEndTile(); for ( Int32 x = start.x; x < end.x; x++ ) { for ( Int32 y = start.y; y < end.y; y++ ) { @@ -68,13 +68,13 @@ void TileMapLayer::Update() { mCurTile.y = y; if ( NULL != mTiles[x][y] ) { - mTiles[x][y]->Update(); + mTiles[x][y]->update(); } } } } -void TileMapLayer::AllocateLayer() { +void TileMapLayer::allocateLayer() { mTiles = eeNewArray( GameObject**, mSize.getWidth() ); for ( Int32 x = 0; x < mSize.x; x++ ) { @@ -86,7 +86,7 @@ void TileMapLayer::AllocateLayer() { } } -void TileMapLayer::DeallocateLayer() { +void TileMapLayer::deallocateLayer() { for ( Int32 x = 0; x < mSize.x; x++ ) { for ( Int32 y = 0; y < mSize.y; y++ ) { eeSAFE_DELETE( mTiles[x][y] ); @@ -98,19 +98,19 @@ void TileMapLayer::DeallocateLayer() { eeSAFE_DELETE_ARRAY( mTiles ); } -void TileMapLayer::AddGameObject( GameObject * obj, const Vector2i& TilePos ) { +void TileMapLayer::addGameObject( GameObject * obj, const Vector2i& TilePos ) { eeASSERT( TilePos.x >= 0 && TilePos.y >= 0 ); if ( TilePos.x < mSize.x && TilePos.y < mSize.y ) { - RemoveGameObject( TilePos ); + removeGameObject( TilePos ); mTiles[ TilePos.x ][ TilePos.y ] = obj; - obj->Pos( Vector2f( TilePos.x * mMap->TileSize().x, TilePos.y * mMap->TileSize().y ) ); + obj->setPosition( Vector2f( TilePos.x * mMap->getTileSize().x, TilePos.y * mMap->getTileSize().y ) ); } } -void TileMapLayer::RemoveGameObject( const Vector2i& TilePos ) { +void TileMapLayer::removeGameObject( const Vector2i& TilePos ) { eeASSERT( TilePos.x >= 0 && TilePos.y >= 0 ); if ( TilePos.x < mSize.x && TilePos.y < mSize.y ) { @@ -120,8 +120,8 @@ void TileMapLayer::RemoveGameObject( const Vector2i& TilePos ) { } } -void TileMapLayer::MoveTileObject( const Vector2i& FromPos, const Vector2i& ToPos ) { - RemoveGameObject( ToPos ); +void TileMapLayer::moveTileObject( const Vector2i& FromPos, const Vector2i& ToPos ) { + removeGameObject( ToPos ); GameObject * tObj = mTiles[ FromPos.x ][ FromPos.y ]; @@ -130,20 +130,20 @@ void TileMapLayer::MoveTileObject( const Vector2i& FromPos, const Vector2i& ToPo mTiles[ ToPos.x ][ ToPos.y ] = tObj; } -GameObject * TileMapLayer::GetGameObject( const Vector2i& TilePos ) { +GameObject * TileMapLayer::getGameObject( const Vector2i& TilePos ) { return mTiles[ TilePos.x ][ TilePos.y ]; } -const Vector2i& TileMapLayer::GetCurrentTile() const { +const Vector2i& TileMapLayer::getCurrentTile() const { return mCurTile; } -Vector2i TileMapLayer::GetTilePosFromPos( const Vector2f& Pos ) { - return Vector2i( ( (Int32)Pos.x + mOffset.x ) / mMap->TileSize().getWidth(), ( (Int32)Pos.y + mOffset.y ) / mMap->TileSize().getHeight() ); +Vector2i TileMapLayer::getTilePosFromPos( const Vector2f& Pos ) { + return Vector2i( ( (Int32)Pos.x + mOffset.x ) / mMap->getTileSize().getWidth(), ( (Int32)Pos.y + mOffset.y ) / mMap->getTileSize().getHeight() ); } -Vector2f TileMapLayer::GetPosFromTilePos( const Vector2i& TilePos ) { - return Vector2f( TilePos.x * mMap->TileSize().getWidth() + mOffset.x, TilePos.y * mMap->TileSize().getHeight() + mOffset.y ); +Vector2f TileMapLayer::getPosFromTilePos( const Vector2i& TilePos ) { + return Vector2f( TilePos.x * mMap->getTileSize().getWidth() + mOffset.x, TilePos.y * mMap->getTileSize().getHeight() + mOffset.y ); } }} diff --git a/src/eepp/ui/uidragable.cpp b/src/eepp/ui/uidragable.cpp index f81e0e3c8..17465ceee 100644 --- a/src/eepp/ui/uidragable.cpp +++ b/src/eepp/ui/uidragable.cpp @@ -65,7 +65,7 @@ void UIDragable::update() { Vector2i Pos( UIManager::instance()->getMousePos() ); if ( mDragPoint != Pos ) { - if ( OnDrag( Pos ) ) { + if ( onDrag( Pos ) ) { mPos += -( mDragPoint - Pos ); mDragPoint = Pos; @@ -78,7 +78,7 @@ void UIDragable::update() { } } -Uint32 UIDragable::OnDrag( const Vector2i& Pos ) { +Uint32 UIDragable::onDrag( const Vector2i& Pos ) { return 1; } diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index e4aa76bea..1af00cf2d 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -244,7 +244,7 @@ void EETest::onShowMenu( const UIEvent * Event ) { } void EETest::onWindowResize(EE::Window::Window * win) { - Map.ViewSize( win->getSize() ); + Map.setViewSize( win->getSize() ); } void EETest::createUI() { @@ -930,11 +930,11 @@ void EETest::loadTextures() { eePRINTL( "Textures loading time: %4.3f ms.", TE.getElapsed().asMilliseconds() ); - Map.Load( MyPath + "maps/test.eem" ); - Map.DrawGrid( false ); - Map.ClipedArea( false ); - Map.DrawBackground( false ); - Map.ViewSize( mWindow->getSize() ); + Map.load( MyPath + "maps/test.eem" ); + Map.setDrawGrid( false ); + Map.setClipedArea( false ); + Map.setDrawBackground( false ); + Map.setViewSize( mWindow->getSize() ); eePRINTL( "Map creation time: %4.3f ms.", TE.getElapsed().asMilliseconds() ); } @@ -960,8 +960,8 @@ void EETest::updateParticles() { } void EETest::screen1() { - Map.Update(); - Map.Draw(); + Map.update(); + Map.draw(); } void EETest::screen2() { @@ -1440,36 +1440,36 @@ void EETest::input() { Uint8 hat = Joy->getHat(); if ( HAT_LEFT == hat || HAT_LEFTDOWN == hat || HAT_LEFTUP == hat ) - Map.Move( (mWindow->getElapsed().asMilliseconds() * 0.2f), 0 ); + Map.move( (mWindow->getElapsed().asMilliseconds() * 0.2f), 0 ); if ( HAT_RIGHT == hat || HAT_RIGHTDOWN == hat || HAT_RIGHTUP == hat ) - Map.Move( -mWindow->getElapsed().asMilliseconds() * 0.2f, 0 ); + Map.move( -mWindow->getElapsed().asMilliseconds() * 0.2f, 0 ); if ( HAT_UP == hat || HAT_LEFTUP == hat || HAT_RIGHTUP == hat ) - Map.Move( 0, (mWindow->getElapsed().asMilliseconds() * 0.2f) ); + Map.move( 0, (mWindow->getElapsed().asMilliseconds() * 0.2f) ); if ( HAT_DOWN == hat || HAT_LEFTDOWN == hat || HAT_RIGHTDOWN == hat ) - Map.Move( 0, -mWindow->getElapsed().asMilliseconds() * 0.2f ); + Map.move( 0, -mWindow->getElapsed().asMilliseconds() * 0.2f ); } if ( KM->isKeyDown(KEY_LEFT) ) { - Map.Move( mWindow->getElapsed().asMilliseconds() * 0.2f, 0 ); + Map.move( mWindow->getElapsed().asMilliseconds() * 0.2f, 0 ); } if ( KM->isKeyDown(KEY_RIGHT) ) { - Map.Move( -mWindow->getElapsed().asMilliseconds() * 0.2f, 0 ); + Map.move( -mWindow->getElapsed().asMilliseconds() * 0.2f, 0 ); } if ( KM->isKeyDown(KEY_UP) ) { - Map.Move( 0, mWindow->getElapsed().asMilliseconds() * 0.2f ); + Map.move( 0, mWindow->getElapsed().asMilliseconds() * 0.2f ); } if ( KM->isKeyDown(KEY_DOWN) ) { - Map.Move( 0, -mWindow->getElapsed().asMilliseconds() * 0.2f ); + Map.move( 0, -mWindow->getElapsed().asMilliseconds() * 0.2f ); } if ( KM->isKeyUp(KEY_F8) ) - Map.Reset(); + Map.reset(); break; case 2: