diff --git a/include/eepp/graphics/batchrenderer.hpp b/include/eepp/graphics/batchrenderer.hpp index 2e9884d0f..8be8d4dec 100755 --- a/include/eepp/graphics/batchrenderer.hpp +++ b/include/eepp/graphics/batchrenderer.hpp @@ -32,205 +32,205 @@ class EE_API BatchRenderer { BatchRenderer( const unsigned int& Prealloc ); /** Allocate space for vertexs */ - void AllocVertexs( const unsigned int& size ); + void allocVertexs( const unsigned int& size ); /** Set the current texture to render on the batch ( if you change the texture and you have batched something, this will be renderer immediately ) */ - void SetTexture( const Texture * Tex ); + void setTexture( const Texture * Tex ); /** Set the predefined blending function to use on the batch */ - void SetBlendMode( const EE_BLEND_MODE& Blend ); + void setBlendMode( const EE_BLEND_MODE& Blend ); /** Set if every batch call have to be immediately rendered */ - void BatchForceRendering( const bool& force ) { mForceRendering = force; } + void batchForceRendering( const bool& force ) { mForceRendering = force; } /** Get if the rendering is force on every batch call */ - bool BatchForceRendering() const { return mForceRendering; } + bool batchForceRendering() const { return mForceRendering; } /** Force the batch rendering */ - void Draw(); + void draw(); /** Force the batch rendering only if BatchForceRendering is enable */ - void DrawOpt(); + void drawOpt(); /** Set the rotation of the rendered vertex. */ - void BatchRotation( const Float& Rotation ) { mRotation = Rotation; } + void batchRotation( const Float& Rotation ) { mRotation = Rotation; } /** Get the rotation of the rendered vertex. */ - Float BatchRotation() const { return mRotation; } + Float batchRotation() const { return mRotation; } /** Set the scale of the rendered vertex. */ - void BatchScale( const Vector2f& Scale ) { mScale = Scale; } + void batchScale( const Vector2f& Scale ) { mScale = Scale; } /** Set the scale of the rendered vertex. */ - void BatchScale( const Float& Scale ) { mScale = Vector2f( Scale, Scale ); } + void batchScale( const Float& Scale ) { mScale = Vector2f( Scale, Scale ); } /** Get the scale of the rendered vertex. */ - Vector2f BatchScale() const { return mScale; } + Vector2f batchScale() const { return mScale; } /** The batch position */ - void BatchPosition( const Vector2f Pos ) { mPosition = Pos; } + void batchPosition( const Vector2f Pos ) { mPosition = Pos; } /** @return The batch position */ - Vector2f BatchPosition() const { return mPosition; } + Vector2f batchPosition() const { return mPosition; } /** This will set a center position for rotating and scaling the batched vertex. */ - void BatchCenter( const Vector2f Pos ) { mCenter = Pos; } + void batchCenter( const Vector2f Pos ) { mCenter = Pos; } /** @return The batch center position */ - Vector2f BatchCenter() const { return mCenter; } + Vector2f batchCenter() const { return mCenter; } /** Add to the batch a quad ( this will change your batch rendering method to DM_QUADS, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchQuadEx( Float x, Float y, Float width, Float height, Float angle = 0.0f, Vector2f scale = Vector2f::One, OriginPoint originPoint = OriginPoint(OriginPoint::OriginCenter) ); + void batchQuadEx( Float x, Float y, Float width, Float height, Float angle = 0.0f, Vector2f scale = Vector2f::One, OriginPoint originPoint = OriginPoint(OriginPoint::OriginCenter) ); /** Add to the batch a quad ( this will change your batch rendering method to DM_QUADS, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchQuad( const Float& x, const Float& y, const Float& width, const Float& height, const Float& angle = 0.0f ); + void batchQuad( const Float& x, const Float& y, const Float& width, const Float& height, const Float& angle = 0.0f ); /** Add to the batch a quad with the vertex freely seted ( this will change your batch rendering method to DM_QUADS, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchQuadFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ); + void batchQuadFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ); /** Add to the batch a quad with the vertex freely seted ( this will change your batch rendering method to DM_QUADS, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchQuadFreeEx( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3, const Float& Angle = 0.0f, const Float& Scale = 1.0f ); + void batchQuadFreeEx( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3, const Float& Angle = 0.0f, const Float& Scale = 1.0f ); /** This will set as the default batch rendering to GL_QUADS. WIll reset the texture subset rendering to the whole texture. Will reset the default color rendering to ColorA(255,255,255,255). */ - void QuadsBegin(); + void quadsBegin(); /** Set the texture sector to be rendered */ - void QuadsSetSubset( const Float& tl_u, const Float& tl_v, const Float& br_u, const Float& br_v ); + void quadsSetSubset( const Float& tl_u, const Float& tl_v, const Float& br_u, const Float& br_v ); /** Set the texture sector to be rendered but freely seted */ - void QuadsSetSubsetFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ); + void quadsSetSubsetFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ); /** Set the quad color */ - void QuadsSetColor( const ColorA& Color ); + void quadsSetColor( const ColorA& Color ); /** Set the quad color per vertex */ - void QuadsSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ); + void quadsSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ); /** This will set as the default batch rendering to DM_POINTS. And will reset the point color to ColorA(255,255,255,255). */ - void PointsBegin(); + void pointsBegin(); /** Set the point color */ - void PointSetColor( const ColorA& Color ); + void pointSetColor( const ColorA& Color ); /** Add to the batch a point ( this will change your batch rendering method to DM_POINTS, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchPoint( const Float& x, const Float& y ); + void batchPoint( const Float& x, const Float& y ); /** This will set as the default batch rendering to DM_LINES. And will reset the line color to ColorA(255,255,255,255). */ - void LinesBegin(); + void linesBegin(); /** Set the line color */ - void LinesSetColor( const ColorA& Color ); + void linesSetColor( const ColorA& Color ); /** Set the line color, per vertex */ - void LinesSetColorFree( const ColorA& Color0, const ColorA& Color1 ); + void linesSetColorFree( const ColorA& Color0, const ColorA& Color1 ); /** Add to the batch a line ( this will change your batch rendering method to DM_LINES, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchLine( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ); + void batchLine( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ); /** This will set as the default batch rendering to GL_LINE_LOOP. And will reset the line color to ColorA(255,255,255,255). */ - void LineLoopBegin(); + void lineLoopBegin(); /** Set the line color */ - void LineLoopSetColor( const ColorA& Color ); + void lineLoopSetColor( const ColorA& Color ); /** Set the line color, per vertex */ - void LineLoopSetColorFree( const ColorA& Color0, const ColorA& Color1 ); + void lineLoopSetColorFree( const ColorA& Color0, const ColorA& Color1 ); /** Add to the batch a line ( this will change your batch rendering method to DM_LINE_LOOP, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchLineLoop( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ); + void batchLineLoop( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ); /** Add to the batch a point to the line loop batch ( this will change your batch rendering method to DM_LINE_LOOP, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchLineLoop( const Float& x0, const Float& y0 ); + void batchLineLoop( const Float& x0, const Float& y0 ); /** Add to the batch a line ( this will change your batch rendering method to DM_LINE_LOOP, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchLineLoop( const Vector2f& vector1, const Vector2f& vector2 ); + void batchLineLoop( const Vector2f& vector1, const Vector2f& vector2 ); /** Add to the batch a point to the line loop batch ( this will change your batch rendering method to DM_LINE_LOOP, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchLineLoop( const Vector2f& vector1 ); + void batchLineLoop( const Vector2f& vector1 ); /** This will set as the default batch rendering to DM_LINE_STRIP. And will reset the line color to ColorA(255,255,255,255). */ - void LineStripBegin(); + void lineStripBegin(); /** Set the line color */ - void LineStripSetColor( const ColorA& Color ); + void lineStripSetColor( const ColorA& Color ); /** Set the line color, per vertex */ - void LineStripSetColorFree( const ColorA& Color0, const ColorA& Color1 ); + void lineStripSetColorFree( const ColorA& Color0, const ColorA& Color1 ); /** Add to the batch a line ( this will change your batch rendering method to DM_LINE_STRIP, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchLineStrip( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ); + void batchLineStrip( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ); /** Add to the batch a point to the line strip batch ( this will change your batch rendering method to DM_LINE_STRIP, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchLineStrip( const Float& x0, const Float& y0 ); + void batchLineStrip( const Float& x0, const Float& y0 ); /** Add to the batch a line ( this will change your batch rendering method to DM_LINE_STRIP, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchLineStrip( const Vector2f& vector1, const Vector2f& vector2 ); + void batchLineStrip( const Vector2f& vector1, const Vector2f& vector2 ); /** Add to the batch a point to the line strip batch ( this will change your batch rendering method to DM_LINE_STRIP, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchLineStrip( const Vector2f& vector1 ); + void batchLineStrip( const Vector2f& vector1 ); /** This will set as the default batch rendering to DM_TRIANGLE_FAN. And will reset the line color to ColorA(255,255,255,255). */ - void TriangleFanBegin(); + void triangleFanBegin(); /** Set the triangle fan color */ - void TriangleFanSetColor( const ColorA& Color ); + void triangleFanSetColor( const ColorA& Color ); /** Set the triangle fan color, per vertex */ - void TriangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ); + void triangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ); /** Set the texture sector to be rendered but freely seted */ - void TriangleFanSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); + void triangleFanSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); /** Add to the batch a triangle fan ( this will change your batch rendering method to DM_TRIANGLE_FAN, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchTriangleFan( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); + void batchTriangleFan( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); /** Add to the batch a triangle fan ( this will change your batch rendering method to DM_TRIANGLE_FAN, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchTriangleFan( const Float& x0, const Float& y0 ); + void batchTriangleFan( const Float& x0, const Float& y0 ); /** This will set as the default batch rendering to DM_TRIANGLES. And will reset the line color to ColorA(255,255,255,255). */ - void TrianglesBegin(); + void trianglesBegin(); /** Set the triangles color */ - void TrianglesSetColor( const ColorA& Color ); + void trianglesSetColor( const ColorA& Color ); /** Set the triangles color, per vertex */ - void TrianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ); + void trianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ); /** Set the texture sector to be rendered but freely seted */ - void TrianglesSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); + void trianglesSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); /** Add to the batch a triangle ( this will change your batch rendering method to DM_TRIANGLES, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchTriangle( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); + void batchTriangle( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ); /** Set the polygon color */ - void PolygonSetColor( const ColorA& Color ); + void polygonSetColor( const ColorA& Color ); /** Add to the batch a polygon ( this will change your batch rendering method to DM_POLYGON, so if you were using another one will Draw all the batched vertexs first ) */ - void BatchPolygon( const Polygon2f& Polygon ); + void batchPolygon( const Polygon2f& Polygon ); /** Set the line width */ - void SetLineWidth( const Float& lineWidth ); + void setLineWidth( const Float& lineWidth ); /** @return The current line width */ - Float GetLineWidth(); + Float getLineWidth(); /** Set the point size */ - void SetPointSize( const Float& pointSize ); + void setPointSize( const Float& pointSize ); /** @return The current point size */ - Float GetPointSize(); + Float getPointSize(); /** Batch a poligon adding one by one vector */ - void BatchPolygonByPoint( const Float& x, const Float& y ); + void batchPolygonByPoint( const Float& x, const Float& y ); /** Batch a poligon adding one by one vector */ - void BatchPolygonByPoint( const Vector2f& Vector ); + void batchPolygonByPoint( const Vector2f& Vector ); /** Foce the blending mode change, ignoring if it's the same that before ( so you can change the blend mode and restore it without problems ) */ - void ForceBlendModeChange( const bool& Force ); + void forceBlendModeChange( const bool& Force ); /** @return If the blending mode switch is forced */ - const bool& ForceBlendModeChange() const; + const bool& forceBlendModeChange() const; protected: eeVertex * mVertex; unsigned int mVertexSize; @@ -254,15 +254,15 @@ class EE_API BatchRenderer { bool mForceRendering; bool mForceBlendMode; - void Flush(); + void flush(); - void Init(); + void init(); - void AddVertexs( const unsigned int& num ); + void addVertexs( const unsigned int& num ); - void Rotate( const Vector2f& center, Vector2f* point, const Float& angle ); + void rotate( const Vector2f& center, Vector2f* point, const Float& angle ); - void SetBlendMode( EE_DRAW_MODE Mode, const bool& Force ); + void setBlendMode( EE_DRAW_MODE Mode, const bool& Force ); }; }} diff --git a/include/eepp/graphics/console.hpp b/include/eepp/graphics/console.hpp index 921ab12f1..3bb8e3793 100755 --- a/include/eepp/graphics/console.hpp +++ b/include/eepp/graphics/console.hpp @@ -22,69 +22,69 @@ class EE_API Console : protected LogReaderInterface { Console( EE::Window::Window * window = NULL ); /** Creates the console */ - Console( Font* Font, const bool& MakeDefaultCommands = true, const bool& AttachToLog = true, const unsigned int& MaxLogLines = 1024, const Uint32& TextureId = 0, EE::Window::Window * window = NULL ); + Console( Font* Font, const bool& MakeDefaultCommands = true, const bool& AttachToLog = true, const unsigned int& MaxLogLines = 1024, const Uint32& textureId = 0, EE::Window::Window * window = NULL ); ~Console(); /** Set the Console Height when it's Minimized ( Not Maximized ) */ - void ConsoleMinimizedHeight( const Float& MinHeight ) { mHeightMin = MinHeight; if (mVisible && !mExpand) mCurHeight = mHeightMin; } + void consoleMinimizedHeight( const Float& MinHeight ) { mHeightMin = MinHeight; if (mVisible && !mExpand) mCurHeight = mHeightMin; } /** Get the Console Height when it's Minimized ( Not Maximized ) */ - Float ConsoleMinimizedHeight() const { return mHeightMin; } + Float consoleMinimizedHeight() const { return mHeightMin; } /** Set the Texture Id for the Background, 0 will disable texture background */ - void TextureId( const Uint32& TexId ) { mTexId = TexId; } + void textureId( const Uint32& TexId ) { mTexId = TexId; } /** Get the Background Texture Id */ - Uint32 TextureId() const { return mTexId; } + Uint32 textureId() const { return mTexId; } /** Set the Console Background Color */ - void BackgroundColor( const ColorA& BackColor ) { mConColor = BackColor; } + void backgroundColor( const ColorA& BackColor ) { mConColor = BackColor; } /** Get the Console Background Color */ - const ColorA& BackgroundColor() const { return mConColor; } + const ColorA& backgroundColor() const { return mConColor; } /** Set the Console Border Line Background Color */ - void BackgroundLineColor( const ColorA& BackColor ) { mConLineColor = BackColor; } + void backgroundLineColor( const ColorA& BackColor ) { mConLineColor = BackColor; } /** Get the Console Border Line Background Color */ - const ColorA& BackgroundLineColor() const { return mConLineColor; } + const ColorA& backgroundLineColor() const { return mConLineColor; } /** Set the Console Font Color */ - void FontColor( const ColorA& FntColor ) { mFontColor = FntColor; } + void fontColor( const ColorA& FntColor ) { mFontColor = FntColor; } /** Get the Console Font Color */ - const ColorA& FontColor() const { return mFontColor; } + const ColorA& fontColor() const { return mFontColor; } /** Set the Console Client Input ( Writeable Line ) Font Color */ - void FontLineColor( const ColorA& FntColor ) { mFontLineColor = FntColor; } + void fontLineColor( const ColorA& FntColor ) { mFontLineColor = FntColor; } /** Get the Console Client Input ( Writeable Line ) Font Color */ - const ColorA& FontLineColor() const { return mFontLineColor; } + const ColorA& fontLineColor() const { return mFontLineColor; } /** Toogle the console between visible and hided with Fade In or Fade Out effect. */ - void Toggle(); + void toggle(); /** Make visible the console */ - void FadeIn(); + void fadeIn(); /** Hide the console */ - void FadeOut(); + void fadeOut(); /** @return If Console Active ( Visible ) */ - bool Active() const { return mVisible; } + bool active() const { return mVisible; } /** Maximize or Minimize the Console */ - void Expand(const bool& Exp) { mExpand = Exp; } + void expand(const bool& Exp) { mExpand = Exp; } /** @return If console is maximized */ - bool Expand() const { return mExpand; } + bool expand() const { return mExpand; } /** Set the fade time */ - void FadeSpeed( const Time& fadespeed ) { mFadeSpeed = fadespeed; } + void fadeSpeed( const Time& fadespeed ) { mFadeSpeed = fadespeed; } /** @return The fading speed in ms */ - const Time& FadeSpeed() const { return mFadeSpeed; } + const Time& fadeSpeed() const { return mFadeSpeed; } /** @brief Creates the new console * @param Font The Font pointer to class @@ -93,34 +93,34 @@ class EE_API Console : protected LogReaderInterface { * @param MaxLogLines Maximun number of lines stored on the console * @param TextureId Background texture id ( 0 for no texture ) */ - void Create( Font* Font, const bool& MakeDefaultCommands = true, const bool& AttachToLog = true, const unsigned int& MaxLogLines = 1024, const Uint32& TextureId = 0 ); + void create( Font* Font, const bool& MakeDefaultCommands = true, const bool& AttachToLog = true, const unsigned int& MaxLogLines = 1024, const Uint32& textureId = 0 ); /** Add Text to Console */ - void PushText( const String& str ); + void pushText( const String& str ); /** Add formated Text to console */ - void PushText( const char* format, ... ); + void pushText( const char* format, ... ); /** Adds a new Command * @param Command The Command Name ( raise the event ) * @param CB The Callback for the Command */ - void AddCommand( const String& Command, ConsoleCallback CB ); + void addCommand( const String& Command, ConsoleCallback CB ); /** Draw the Console ( allways call it, visible or not ) */ - void Draw(); + void draw(); /** Set the line height ( distance between lines ) */ - void SetLineHeight( const Float& LineHeight ) { mFontSize = LineHeight; } + void setLineHeight( const Float& LineHeight ) { mFontSize = LineHeight; } /** Use this if you need to ignore some char to activate the console, for example '~'. A common char to activate a console. */ - void IgnoreCharOnPrompt( const Uint32& ch ); + void ignoreCharOnPrompt( const Uint32& ch ); /** @return If the console is rendering the FPS count. */ - const bool& IsShowingFps() const; + const bool& isShowingFps() const; /** Activate/Deactive fps rendering */ - void ShowFps( const bool& Show ); + void showFps( const bool& Show ); protected: std::map < String, ConsoleCallback > mCallbacks; std::deque < String > mCmdLog; @@ -175,83 +175,83 @@ class EE_API Console : protected LogReaderInterface { bool mShowFps; bool mCurSide; - void CreateDefaultCommands(); + void createDefaultCommands(); - void Fade(); + void fade(); /** Internal Callback for default command ( clear ) */ - void CmdClear ( const std::vector < String >& params ); + void cmdClear ( const std::vector < String >& params ); /** Internal Callback for default command ( maximize ) */ - void CmdMaximize ( const std::vector < String >& params ); + void cmdMaximize ( const std::vector < String >& params ); /** Internal Callback for default command ( minimize ) */ - void CmdMinimize ( const std::vector < String >& params ); + void cmdMinimize ( const std::vector < String >& params ); /** Internal Callback for default command ( quit ) */ - void CmdQuit ( const std::vector < String >& params ); + void cmdQuit ( const std::vector < String >& params ); /** Internal Callback for default command ( cmdlist ) */ - void CmdCmdList ( const std::vector < String >& params ); + void cmdCmdList ( const std::vector < String >& params ); /** Internal Callback for default command ( showcursor ) */ - void CmdShowCursor ( const std::vector < String >& params ); + void cmdShowCursor ( const std::vector < String >& params ); /** Internal Callback for default command ( setfpslimit ) */ - void CmdFrameLimit ( const std::vector < String >& params ); + void cmdFrameLimit ( const std::vector < String >& params ); /** Internal Callback for default command ( getlog ) */ - void CmdGetLog ( const std::vector < String >& params ); + void cmdGetLog ( const std::vector < String >& params ); /** Internal Callback for default command ( setgamma ) */ - void CmdSetGamma( const std::vector < String >& params ); + void cmdSetGamma( const std::vector < String >& params ); /** Internal Callback for default command ( setvolume ) */ - void CmdSetVolume( const std::vector < String >& params ); + void cmdSetVolume( const std::vector < String >& params ); /** Internal Callback for default command ( getgpuextensions ) */ - void CmdGetGpuExtensions( const std::vector < String >& params ); + void cmdGetGpuExtensions( const std::vector < String >& params ); /** Internal Callback for default command ( dir and ls ) */ - void CmdDir( const std::vector < String >& params ); + void cmdDir( const std::vector < String >& params ); /** Internal Callback for default command ( showfps ) */ - void CmdShowFps( const std::vector < String >& params ); + void cmdShowFps( const std::vector < String >& params ); /** Internal Callback for default command ( gettexturememory ) */ - void CmdGetTextureMemory( const std::vector < String >& params ); + void cmdGetTextureMemory( const std::vector < String >& params ); /** Internal Callback for default command ( hide ) */ - void CmdHideConsole( const std::vector < String >& params ); + void cmdHideConsole( const std::vector < String >& params ); /** The Default Commands Callbacks for the Console ( don't call it ) */ - void PrivInputCallback( InputEvent * Event ); + void privInputCallback( InputEvent * Event ); /** Clear the Console */ - void CmdClear(); + void cmdClear(); /** Add the current log to the console */ - void CmdGetLog(); + void cmdGetLog(); /** Add the GPU Extensions supported to the console */ - void CmdGetGpuExtensions(); + void cmdGetGpuExtensions(); /** Internal Callback to Process the new line ( when return pressed ) */ - void ProcessLine(); + void processLine(); - void PrivPushText( const String& str ); + void privPushText( const String& str ); - void PrintCommandsStartingWith( const String& start ); + void printCommandsStartingWith( const String& start ); - void PrivVideoResize( EE::Window::Window * win ); + void privVideoResize( EE::Window::Window * win ); - void WriteLog( const std::string& Text ); + void writeLog( const std::string& Text ); - void GetFilesFrom( std::string txt, const Uint32& curPos ); + void getFilesFrom( std::string txt, const Uint32& curPos ); - Int32 LinesInScreen(); + Int32 linesInScreen(); - String GetLastCommonSubStr( std::list& cmds ); + String getLastCommonSubStr( std::list& cmds ); }; }} diff --git a/include/eepp/graphics/font.hpp b/include/eepp/graphics/font.hpp index 102d9c783..e0ef08e96 100755 --- a/include/eepp/graphics/font.hpp +++ b/include/eepp/graphics/font.hpp @@ -16,52 +16,52 @@ class EE_API Font { /** Set a text to render * @param Text The Text */ - void SetText( const String& Text ); + void setText( const String& Text ); /** @return The width of the string rendered */ - Float GetTextWidth(); + Float getTextWidth(); /** @return Assign a new text and then returns his width */ - Float GetTextWidth( const String& Text ); + Float getTextWidth( const String& Text ); /** @return The current text height */ - Float GetTextHeight(); + Float getTextHeight(); /** @return The number of lines of the current text */ - virtual int GetNumLines(); + virtual int getNumLines(); /** @return The Font Color */ - const ColorA& Color() const; + const ColorA& color() const; /** Set the color of the string rendered */ - void Color(const ColorA& Color); + void color(const ColorA& color); /** @return The Shadow Font Color */ - const ColorA& ShadowColor() const; + const ColorA& shadowColor() const; /** Set the shadow color of the string rendered */ - void ShadowColor(const ColorA& Color); + void shadowColor(const ColorA& color); /** @return The current font size */ - Uint32 GetFontSize() const; + Uint32 getFontSize() const; /** @return The current font height */ - Uint32 GetFontHeight() const; + Uint32 getFontHeight() const; /** @return The recommended line spacing */ - Int32 GetLineSkip() const; + Int32 getLineSkip() const; /** @return The font highest ascent (height above base) */ - Int32 GetFontAscent() const; + Int32 getFontAscent() const; /** @return The font lowest descent (height below base) */ - Int32 GetFontDescent() const; + Int32 getFontDescent() const; /** @return The current text */ - String GetText(); + String getText(); /** @return The last text rendered or setted lines width */ - const std::vector& GetLinesWidth(); + const std::vector& getLinesWidth(); /** Draw a String on the screen * @param Text The text to draw @@ -72,7 +72,7 @@ class EE_API Font { * @param Angle The angle of the string rendered * @param Effect Set the Blend Mode ( default ALPHA_NORMAL ) */ - void Draw( const String& Text, const Float& X, const Float& Y, const Uint32& Flags = FONT_DRAW_LEFT, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, const EE_BLEND_MODE& Effect = ALPHA_NORMAL ); + void draw( const String& Text, const Float& X, const Float& Y, const Uint32& Flags = FONT_DRAW_LEFT, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, const EE_BLEND_MODE& Effect = ALPHA_NORMAL ); /** Draw the string seted on the screen * @param X The start x position @@ -82,7 +82,7 @@ class EE_API Font { * @param Angle The angle of the string rendered * @param Effect Set the Blend Mode ( default ALPHA_NORMAL ) */ - void Draw( const Float& X, const Float& Y, const Uint32& Flags = FONT_DRAW_LEFT, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, const EE_BLEND_MODE& Effect = ALPHA_NORMAL ); + void draw( const Float& X, const Float& Y, const Uint32& Flags = FONT_DRAW_LEFT, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, const EE_BLEND_MODE& Effect = ALPHA_NORMAL ); /** Draw a string on the screen from a cached text * @param TextCache The cached text @@ -93,46 +93,46 @@ class EE_API Font { * @param Angle The angle of the string rendered * @param Effect Set the Blend Mode ( default ALPHA_NORMAL ) */ - void Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uint32& Flags = FONT_DRAW_LEFT, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, const EE_BLEND_MODE& Effect = ALPHA_NORMAL ); + void draw( TextCache& TextCache, const Float& X, const Float& Y, const Uint32& Flags = FONT_DRAW_LEFT, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, const EE_BLEND_MODE& Effect = ALPHA_NORMAL ); /** Shrink the String to a max width * @param Str The string to shrink * @param MaxWidth The Max Width posible */ - void ShrinkText( String& Str, const Uint32& MaxWidth ); + void shrinkText( String& Str, const Uint32& MaxWidth ); /** Shrink the string to a max width * @param Str The string to shrink * @param MaxWidth The Max Width posible */ - void ShrinkText( std::string& Str, const Uint32& MaxWidth ); + void shrinkText( std::string& Str, const Uint32& MaxWidth ); /** Cache the with of the current text */ - void CacheWidth( const String& Text, std::vector& LinesWidth, Float& CachedWidth, int& NumLines, int& LargestLineCharCount ); + void cacheWidth( const String& Text, std::vector& LinesWidth, Float& CachedWidth, int& NumLines, int& LargestLineCharCount ); /** @return The font texture id */ - const Uint32& GetTexId() const; + const Uint32& getTexId() const; /** @return The type of the instance of the font, can be FONT_TYPE_TTF ( true type font ) or FONT_TYPE_TEX ( texture font ) */ - const Uint32& Type() const; + const Uint32& getType() const; /** @return The font name */ - const std::string& Name() const; + const std::string& getName() const; /** Change the font name ( and id, because it's the font name hash ) */ - void Name( const std::string& name ); + void setName( const std::string& setName ); /** @return The font id */ - const Uint32& Id(); + const Uint32& getId(); /** Finds the closest cursor position to the point position */ - Int32 FindClosestCursorPosFromPoint( const String & Text, const Vector2i& pos ); + Int32 findClosestCursorPosFromPoint( const String & Text, const Vector2i& pos ); /** Simulates a selection request and return the initial and end cursor position when the selection worked. Otherwise both parameters will be -1. */ - void SelectSubStringFromCursor( const String& Text, const Int32& CurPos, Int32& InitCur, Int32& EndCur ); + void selectSubStringFromCursor( const String& Text, const Int32& CurPos, Int32& InitCur, Int32& EndCur ); /** @return The cursor position inside the string */ - Vector2i GetCursorPos( const String& Text, const Uint32& Pos ); + Vector2i getCursorPos( const String& Text, const Uint32& Pos ); protected: Uint32 mType; std::string mFontName; @@ -149,9 +149,9 @@ class EE_API Font { TextCache mTextCache; - Font( const Uint32& Type, const std::string& Name ); + Font( const Uint32& Type, const std::string& setName ); - void CacheWidth(); + void cacheWidth(); }; }} diff --git a/include/eepp/graphics/framebuffer.hpp b/include/eepp/graphics/framebuffer.hpp index 02c667dba..c3ff80de2 100644 --- a/include/eepp/graphics/framebuffer.hpp +++ b/include/eepp/graphics/framebuffer.hpp @@ -27,40 +27,40 @@ class EE_API FrameBuffer { /** @brief Enables the off-screen rendering. ** From this moment any rendered primitive will be rendered to the frame buffer. ** Anything rendered since the frame buffer is binded will use the fram buffer coordinates, so position 0,0 means 0,0 point in the frame buffer, not the screen. */ - virtual void Bind() = 0; + virtual void bind() = 0; /** @brief Disables the off-screen rendering. ** Anything rendered after this will be rendered to the back-buffer. */ - virtual void Unbind() = 0; + virtual void unbind() = 0; /** @brief Clears the frame buffer pixels to the default frame buffer clear color. */ - void Clear(); + void clear(); /** @brief Recreates the frame buffer ( delete the current and creates a new one ). ** This is needed by the engine to recover any context lost. */ - virtual void Reload() = 0; + virtual void reload() = 0; /** @return The frame buffer texture. Everything is rendered to this texture. ** To render the frame buffer you just need to draw the texture as any other texture. ** The frame buffer must be unbinded before any rendering is done outside the frame buffer. - ** For example MyFrameBufferPtr->GetTexture()->Draw(0,0); + ** For example MyFrameBufferPtr->getTexture()->Draw(0,0); */ - Texture * GetTexture() const; + Texture * getTexture() const; /** @brief Sets the frame buffer clear color. */ - void ClearColor( ColorAf Color ); + void clearColor( ColorAf Color ); /** @return The clear color used for the frame buffer. */ - ColorAf ClearColor() const; + ColorAf clearColor() const; /** @return The frame buffer width. */ - const Int32& GetWidth() const; + const Int32& getWidth() const; /** @return The frame buffer height. */ - const Int32& GetHeight() const; + const Int32& getHeight() const; /** @return True if the frame buffer has a depth buffer. */ - const bool& HasDepthBuffer() const; + const bool& hasDepthBuffer() const; protected: EE::Window::Window * mWindow; Int32 mWidth; @@ -73,11 +73,11 @@ class EE_API FrameBuffer { FrameBuffer( EE::Window::Window * window ); - virtual bool Create( const Uint32& Width, const Uint32& Height ) = 0; + virtual bool create( const Uint32& Width, const Uint32& Height ) = 0; - void SetBufferView(); + void setBufferView(); - void RecoverView(); + void recoverView(); }; }} diff --git a/include/eepp/graphics/image.hpp b/include/eepp/graphics/image.hpp index 112f59256..06683b09f 100644 --- a/include/eepp/graphics/image.hpp +++ b/include/eepp/graphics/image.hpp @@ -22,19 +22,19 @@ namespace EE { namespace Graphics { class EE_API Image { public: /** @return The current Jpeg save quality */ - static Uint32 JpegQuality(); + static Uint32 jpegQuality(); /** Set the save quality of Jpeg files ( between 0 and 100 ) */ - static void JpegQuality( Uint32 level ); + static void jpegQuality( Uint32 level ); /** @return The File Extension of a Save Type */ - static std::string SaveTypeToExtension( const Int32& Format ); + static std::string saveTypeToExtension( const Int32& Format ); /** @return The save type from a given extension ( example: "png" => SAVE_TYPE_PNG ) */ - static EE_SAVE_TYPE ExtensionToSaveType( const std::string& Extension ); + static EE_SAVE_TYPE extensionToSaveType( const std::string& Extension ); /** @return Convert the number of channels to a pixel format */ - static EE_PIXEL_FORMAT ChannelsToPixelFormat( const Uint32& channels ); + static EE_PIXEL_FORMAT channelsToPixelFormat( const Uint32& channels ); /** @return True if success to get the info. * @param path the image path @@ -42,15 +42,15 @@ class EE_API Image { * @param height the var to store the image height * @param channels the var to store the image channels count */ - static bool GetInfo( const std::string& path, int * width, int * height, int * channels ); + static bool getInfo( const std::string& path, int * width, int * height, int * channels ); /** @return True if the file is a valid image * @param path the image path */ - static bool IsImage( const std::string& path ); + static bool isImage( const std::string& path ); /** @return The last failure image loading/info reason */ - static std::string GetLastFailureReason(); + static std::string getLastFailureReason(); Image(); @@ -58,13 +58,13 @@ class EE_API Image { Image( Graphics::Image * image ); /** Use an existing image ( and appropriates the data passed ) */ - Image( Uint8* data, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels ); + Image( Uint8* data, const unsigned int& width, const unsigned int& height, const unsigned int& channels ); /** Copy a image data to create the image */ - Image( const Uint8* data, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels ); + Image( const Uint8* data, const unsigned int& width, const unsigned int& height, const unsigned int& channels ); /** Create an empty image */ - Image( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor = ColorA(0,0,0,0), const bool& initWithDefaultColor = true ); + Image( const Uint32& width, const Uint32& height, const Uint32& channels, const ColorA& DefaultColor = ColorA(0,0,0,0), const bool& initWithDefaultColor = true ); /** Load an image from path * @param Path The path to the file. @@ -82,94 +82,94 @@ class EE_API Image { virtual ~Image(); /** Create an empty image data */ - void Create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA &DefaultColor = ColorA(0,0,0,0), const bool& initWithDefaultColor = true ); + void Create( const Uint32& width, const Uint32& height, const Uint32& channels, const ColorA &DefaultColor = ColorA(0,0,0,0), const bool& initWithDefaultColor = true ); /** Return the pixel color from the image. \n You must have a copy of the image on local memory. For that you need to Lock the image first. */ - virtual ColorA GetPixel(const unsigned int& x, const unsigned int& y); + virtual ColorA getPixel(const unsigned int& x, const unsigned int& y); /** Set the pixel color to the image. \n You must have a copy of the image on local memory. For that you need to Lock the image first. */ - virtual void SetPixel(const unsigned int& x, const unsigned int& y, const ColorA& Color); + virtual void setPixel(const unsigned int& x, const unsigned int& y, const ColorA& Color); /** Assign a new array of pixels to the image in local memory ( it has to be exactly of the same size of the image ) */ - virtual void SetPixels( const Uint8* data ); + virtual void setPixels( const Uint8* data ); /** @return A pointer to the first pixel of the image. */ - virtual const Uint8* GetPixelsPtr(); + virtual const Uint8* getPixelsPtr(); /** Return the pointer to the array containing the image */ - Uint8 * GetPixels() const; + Uint8 * getPixels() const; /** Set the image Width */ - void Width( const unsigned int& width ); + void width( const unsigned int& width ); /** @return The image Width */ - unsigned int Width() const; + unsigned int width() const; /** Set the image Height */ - void Height( const unsigned int& height ); + void height( const unsigned int& height ); /** @return The image Height */ - unsigned int Height() const; + unsigned int height() const; /** @return The number of channels used by the image */ - unsigned int Channels() const; + unsigned int channels() const; /** Set the number of channels of the image */ - void Channels( const unsigned int& channels ); + void channels( const unsigned int& channels ); /** Clears the current image cache if exists */ - void ClearCache(); + void clearCache(); /** @return The Image Size on Memory (in bytes) */ - unsigned int MemSize() const; + unsigned int memSize() const; /** @return The image dimensions */ - Sizei Size(); + Sizei getSize(); /** Save the Image to a new File in a specific format */ - virtual bool SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ); + virtual bool saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ); /** Create an Alpha mask from a Color */ - virtual void CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ); + virtual void createMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ); /** Create an Alpha mask from a Color */ - void CreateMaskFromColor( const RGB& ColorKey, Uint8 Alpha ); + void createMaskFromColor( const RGB& ColorKey, Uint8 Alpha ); /** Replace a color on the image */ - virtual void ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ); + virtual void replaceColor( const ColorA& ColorKey, const ColorA& NewColor ); /** Fill the image with a color */ - virtual void FillWithColor( const ColorA& Color ); + virtual void fillWithColor( const ColorA& Color ); /** Copy the image to this image data, starting from the position x,y */ - virtual void CopyImage( Graphics::Image * image, const Uint32& x = 0, const Uint32& y = 0 ); + virtual void copyImage( Graphics::Image * image, const Uint32& x = 0, const Uint32& y = 0 ); /** Scale the image */ - virtual void Scale( const Float& scale, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); + virtual void scale( const Float& scale, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); /** Resize the image */ - virtual void Resize( const Uint32& newWidth, const Uint32& newHeight, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); + virtual void resize( const Uint32& newWidth, const Uint32& newHeight, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); /** Flip the image ( rotate the image 90º ) */ - virtual void Flip(); + virtual void flip(); /** Create a thumnail of the image */ - Graphics::Image * Thumbnail( const Uint32& maxWidth, const Uint32& maxHeight, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); + Graphics::Image * thumbnail( const Uint32& maxWidth, const Uint32& maxHeight, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); /** Creates a cropped image from the current image */ - Graphics::Image * Crop( Recti rect ); + Graphics::Image * crop( Recti rect ); /** Set as true if you dont want to free the image data in the Image destruction ( false as default ). */ - void AvoidFreeImage( const bool& AvoidFree ); + void avoidFreeImage( const bool& AvoidFree ); /** Blit the image passed onto the current image ** @param image The source image to blit onto the image ** @param x The x position to start drawing the image ** @param y The y position to start drawing the image */ - void Blit( Graphics::Image * image, const Uint32& x = 0, const Uint32& y = 0 ); + void blit( Graphics::Image * image, const Uint32& x = 0, const Uint32& y = 0 ); /** @return A copy of the original image */ - Graphics::Image * Copy(); + Graphics::Image * copy(); /** Overload the assigment operator to ensure the image copy */ Graphics::Image& operator =(const Image& right); @@ -184,9 +184,9 @@ class EE_API Image { bool mAvoidFree; bool mLoadedFromStbi; - void Allocate( const Uint32& size, ColorA DefaultColor = ColorA(0,0,0,0), bool memsetData = true ); + void allocate( const Uint32& getSize, ColorA DefaultColor = ColorA(0,0,0,0), bool memsetData = true ); - void LoadFromPack( Pack * Pack, const std::string& FilePackPath ); + void loadFromPack( Pack * Pack, const std::string& FilePackPath ); }; }} diff --git a/include/eepp/graphics/particle.hpp b/include/eepp/graphics/particle.hpp index c92b9c4d8..da45f9624 100755 --- a/include/eepp/graphics/particle.hpp +++ b/include/eepp/graphics/particle.hpp @@ -12,16 +12,16 @@ class EE_API Particle{ Particle(); ~Particle(); - void Color(ColorAf Color, Float AlphaDecay); + void Color(ColorAf Color, Float alphaDecay); ColorAf Color() const { return mColor; } - Float R() { return mColor.r(); } - Float G() { return mColor.g(); } - Float B() { return mColor.b(); } - Float A() { return mColor.a(); } + Float r() { return mColor.r(); } + Float g() { return mColor.g(); } + Float b() { return mColor.b(); } + Float a() { return mColor.a(); } - void Reset(const Float &x, const Float &y, const Float &xspeed, const Float &yspeed, const Float &xacc, const Float &yacc, const Float size = 16); - void Update(const Float &pTime); + void reset(const Float &x, const Float &y, const Float &xspeed, const Float &yspeed, const Float &xacc, const Float &yacc, const Float size = 16); + void update(const Float &pTime); void X(const Float x) { mX = x; } Float X() const { return mX; } @@ -29,29 +29,29 @@ class EE_API Particle{ void Y(const Float y) { mY = y; } Float Y() const { return mY; } - void Speed(const Float xspeed) { mXSpeed = xspeed; } - Float XSpeed() const { return mXSpeed; } + void xSpeed(const Float xspeed) { mXSpeed = xspeed; } + Float xSpeed() const { return mXSpeed; } - void YSpeed(const Float yspeed) { mYSpeed = yspeed; } - Float YSpeed() const { return mYSpeed; } + void ySpeed(const Float yspeed) { mYSpeed = yspeed; } + Float ySpeed() const { return mYSpeed; } - void XAcc(const Float xacc) { mXAcc = xacc; } - Float XAcc() const { return mXAcc; } + void xAcc(const Float xacc) { mXAcc = xacc; } + Float xAcc() const { return mXAcc; } - void YAcc(const Float yacc) { mYAcc = yacc; } - Float YAcc() const { return mYAcc; } + void yAcc(const Float yacc) { mYAcc = yacc; } + Float yAcc() const { return mYAcc; } - void AlphaDecay(const Float alphadecay) { mAlphaDecay = alphadecay; } - Float AlphaDecay() const { return mAlphaDecay; } + void alphaDecay(const Float alphadecay) { mAlphaDecay = alphadecay; } + Float alphaDecay() const { return mAlphaDecay; } - void Size(const Float size) { if (size>0) mSize = size; } - Float Size() const { return mSize; } + void size(const Float size) { if (size>0) mSize = size; } + Float size() const { return mSize; } - void Used(const bool used) { mUsed = used; } - bool Used() const { return mUsed; } + void used(const bool used) { mUsed = used; } + bool used() const { return mUsed; } - void Id(const Uint32 Id) { mId = Id; } - Uint32 Id() const { return mId; } + void id(const Uint32 id) { mId = id; } + Uint32 id() const { return mId; } private: Float mX, mY; ColorAf mColor; diff --git a/include/eepp/graphics/particlesystem.hpp b/include/eepp/graphics/particlesystem.hpp index 26402790f..eca1cbd1f 100755 --- a/include/eepp/graphics/particlesystem.hpp +++ b/include/eepp/graphics/particlesystem.hpp @@ -53,7 +53,7 @@ class EE_API ParticleSystem { * @param Speed The speed on x axis (used for NoFx) * @param Acc The acceleration of the particle (used for NoFx) */ - void Create( + void create( const EE_PARTICLE_EFFECT& Effect, const Uint32& NumParticles, const Uint32& TexId, @@ -61,95 +61,95 @@ class EE_API ParticleSystem { const Float& PartSize = 16.0f, const bool& AnimLoop = false, const Uint32& NumLoops = 1, - const ColorAf& Color = ColorAf( 1.0f, 1.0f, 1.0f, 1.0f ), + const ColorAf& color = ColorAf( 1.0f, 1.0f, 1.0f, 1.0f ), const Vector2f& Pos2 = Vector2f( 0, 0 ), - const Float& AlphaDecay = 0.01f, - const Vector2f& Speed = Vector2f( 0.1f, 0.1f ), + const Float& alphaDecay = 0.01f, + const Vector2f& speed = Vector2f( 0.1f, 0.1f ), const Vector2f& Acc = Vector2f( 0.1f, 0.1f ) ); /** Draw the particles effect */ - void Draw(); + void draw(); /** Update the particles effect * @param Time The time transcurred between the last update. */ - void Update(const Time &time ); + void update(const Time& time); /** Update the particles effect taking the elapsed time from Engine */ - void Update(); + void update(); /** Stop using the effect but wait to end the animation */ - void End(); + void end(); /** Start using the effect and reset it */ - void ReUse(); + void reuse(); /** Stop immediately the effect */ - void Kill(); + void kill(); /** Change the default time modifier. Default 0.01f */ - void Time( const Float& time ); + void time( const Float& time ); /** Get the time modifier */ - Float Time() const; + Float time() const; /** Set if the effect it's in use */ - void Using( const bool& inuse ); + void setUsing( const bool& inuse ); /** @return It's used or no */ - bool Using() const; + bool isUsing() const; /** Update the effect position */ - void Position( const Float& x, const Float& y ); + void position( const Float& x, const Float& y ); /** Update the effect position */ - void Position( const Vector2f& Pos ); + void position( const Vector2f& Pos ); /** @return The effect position */ - const Vector2f& Position() const; + const Vector2f& position() const; /** Update the effect position 2 */ - void Position2( const Float& x, const Float& y ); + void position2( const Float& x, const Float& y ); /** Update the effect position 2 */ - void Position2( const Vector2f& Pos ); + void position2( const Vector2f& Pos ); /** @return The effect position 2 */ - const Vector2f& Position2() const; + const Vector2f& position2() const; /** Set a callback function for the reset effect of the particles. \n The reset it's where do you create the effect for every single particle. */ - void SetCallbackReset( const ParticleCallback& pc ); + void setCallbackReset( const ParticleCallback& pc ); /** @return The effect blend mode */ - const EE_BLEND_MODE& BlendMode() const; + const EE_BLEND_MODE& blendMode() const; /** Set the effect blend mode */ - void BlendMode( const EE_BLEND_MODE& mode ); + void blendMode( const EE_BLEND_MODE& mode ); /** @return The color of the effect */ - const ColorAf& Color() const; + const ColorAf& color() const; /** Set the color of the effect */ - void Color( const ColorAf& Col ); + void color( const ColorAf& Col ); /** @return The alpha decay of the effect */ - const Float& AlphaDecay() const; + const Float& alphaDecay() const; /** Set the alpha decay of the effect */ - void AlphaDecay( const Float& Decay ); + void alphaDecay( const Float& Decay ); /** @return The Speed of the effect */ - const Vector2f& Speed() const; + const Vector2f& speed() const; /** Set the Speed of the effect */ - void Speed( const Vector2f& speed ); + void speed( const Vector2f& speed ); /** @return The Acceleration of the effect */ - const Vector2f& Acceleration() const; + const Vector2f& acceleration() const; /** Set The Acceleration of the effect */ - void Acceleration( const Vector2f& acc ); + void acceleration( const Vector2f& acc ); private: Particle * mParticle; Uint32 mPCount; @@ -178,9 +178,9 @@ class EE_API ParticleSystem { bool mUsed; bool mPointsSup; - void Begin(); + void begin(); - virtual void Reset( Particle * P ); + virtual void reset( Particle * P ); ParticleCallback mPC; }; diff --git a/include/eepp/graphics/pixelperfect.hpp b/include/eepp/graphics/pixelperfect.hpp index b4caecd44..e1a36cd2d 100644 --- a/include/eepp/graphics/pixelperfect.hpp +++ b/include/eepp/graphics/pixelperfect.hpp @@ -17,7 +17,7 @@ namespace EE { namespace Graphics { * @warning Stress the CPU easily. \n Creates a copy of the texture on the app contex. \n It will not work with scaled or rotated textures. * @return True if collided */ -bool EE_API PixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned int& y1, Texture * Tex2, const unsigned int& x2, const unsigned int& y2, const Rectu& Tex1_SrcRECT = Rectu(0,0,0,0), const Rectu& Tex2_SrcRECT = Rectu(0,0,0,0) ); +bool EE_API pixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned int& y1, Texture * Tex2, const unsigned int& x2, const unsigned int& y2, const Rectu& Tex1_SrcRECT = Rectu(0,0,0,0), const Rectu& Tex2_SrcRECT = Rectu(0,0,0,0) ); /** Pixel Perfect Collition implementation between texture and a point * @param Tex First Texture Id @@ -28,7 +28,7 @@ bool EE_API PixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const u * @param Tex1_SrcRECT The sector of the texture from TexId_1 that you are rendering, the sector you want to collide ( on Sprite the SprSrcRECT ) * @return True if collided */ -bool EE_API PixelPerfectCollide( Texture * Tex, const unsigned int& x1, const unsigned int& y1, const unsigned int& x2, const unsigned int& y2, const Rectu& Tex1_SrcRECT = Rectu(0,0,0,0) ); +bool EE_API pixelPerfectCollide( Texture * Tex, const unsigned int& x1, const unsigned int& y1, const unsigned int& x2, const unsigned int& y2, const Rectu& Tex1_SrcRECT = Rectu(0,0,0,0) ); }} diff --git a/include/eepp/graphics/primitives.hpp b/include/eepp/graphics/primitives.hpp index d3775440f..5158e2f52 100755 --- a/include/eepp/graphics/primitives.hpp +++ b/include/eepp/graphics/primitives.hpp @@ -17,12 +17,12 @@ class EE_API Primitives { * @param p The coordinates * @param pointSize Point Size (default 1.0f ) */ - void DrawPoint( const Vector2f& p, const Float& pointSize = 1.0f ); + void drawPoint( const Vector2f& p, const Float& pointSize = 1.0f ); /** Draw a Line on screen * @param line The line */ - void DrawLine( const Line2f& line ); + void drawLine( const Line2f& line ); /** Draw an arc on the screen @@ -30,19 +30,19 @@ class EE_API Primitives { * @param radius The Circle Radius * @param segmentsCount Number of segments to represent the circle. */ - void DrawArc( const Vector2f& p, const Float& radius, Uint32 segmentsCount = 0, const Float& arcAngle = 360.f , const Float& arcStartAngle = 0.f ); + void drawArc( const Vector2f& p, const Float& radius, Uint32 segmentsCount = 0, const Float& arcAngle = 360.f , const Float& arcStartAngle = 0.f ); /** Draw a circle on the screen * @param p The coordinates ( x and y represents the center of the circle ) * @param radius The Circle Radius * @param segmentsCount Number of segments to represent the circle. If segmentsCount is equal to 0 by default will use an optimized circle rendering ( precached coordinates ). */ - void DrawCircle( const Vector2f& p, const Float& radius, Uint32 segmentsCount = 0 ); + void drawCircle( const Vector2f& p, const Float& radius, Uint32 segmentsCount = 0 ); /** Draw a triangle on the screen * @param t The Triangle (Triangle2f) */ - void DrawTriangle( const Triangle2f& t ); + void drawTriangle( const Triangle2f& t ); /** Draw a triangle on the screen setting per vertex color * @param t The Triangle (Triangle2f) @@ -50,14 +50,14 @@ class EE_API Primitives { * @param Color2 Second Point Color * @param Color3 Third Point Color */ - void DrawTriangle( const Triangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ); + void drawTriangle( const Triangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ); /** Draw a rectangle on the screen * @param R The Rectangle Rectf * @param Angle Rectangle Angle * @param Scale Rectangle Scale ( default 1.0f ) */ - void DrawRectangle( const Rectf& R, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One ); + void drawRectangle( const Rectf& R, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One ); /** Draw a rounded rectangle on the screen * @param R The Rectangle Rectf @@ -65,7 +65,7 @@ class EE_API Primitives { * @param Scale Rectangle Scale ( default 1.0f ) * @param Corners Number of vertices per corner ( how rounded is each corner ) */ - void DrawRoundedRectangle( const Rectf& R, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One, const unsigned int& Corners = 8 ); + void drawRoundedRectangle( const Rectf& R, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One, const unsigned int& Corners = 8 ); /** Draw a rectangle on the screen setting per vertex color * @param R The Rectangle Rectf @@ -76,7 +76,7 @@ class EE_API Primitives { * @param Angle Rectangle Angle * @param Scale Rectangle Scale ( default 1.0f ) */ - void DrawRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One ); + void drawRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One ); /** Draw a rounded rectangle on the screen setting per vertex color * @param R The Rectangle Rectf @@ -88,14 +88,14 @@ class EE_API Primitives { * @param Scale Rectangle Scale ( default 1.0f ) * @param Corners Number of vertices per corner ( how rounded is each corner ) */ - void DrawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One, const unsigned int& Corners = 8 ); + void drawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle = 0, const Vector2f& Scale = Vector2f::One, const unsigned int& Corners = 8 ); /** Draw a four edges polygon on screen * @param q The Quad * @param OffsetX X offset for the quad * @param OffsetY Y offset for the quad */ - void DrawQuad( const Quad2f& q, const Float& OffsetX = 0, const Float& OffsetY = 0 ); + void drawQuad( const Quad2f& q, const Float& OffsetX = 0, const Float& OffsetY = 0 ); /** Draw a four edges polygon on screen * @param q The Quad @@ -106,41 +106,41 @@ class EE_API Primitives { * @param OffsetX X offset for the quad * @param OffsetY Y offset for the quad */ - void DrawQuad( const Quad2f& q, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const ColorA& Color4, const Float& OffsetX = 0, const Float& OffsetY = 0 ); + void drawQuad( const Quad2f& q, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const ColorA& Color4, const Float& OffsetX = 0, const Float& OffsetY = 0 ); /** Draw a polygon on screen * @param p The Polygon */ - void DrawPolygon( const Polygon2f& p ); + void drawPolygon( const Polygon2f& p ); /** Set the current color for drawing primitives */ - void SetColor( const ColorA& Color ); + void setColor( const ColorA& Color ); /** Forcing the draw, will force the batch renderer to draw the batched vertexs immediately ( active by default ). */ - void ForceDraw( const bool& force ); + void forceDraw( const bool& force ); - const bool& ForceDraw() const; + const bool& forceDraw() const; /** Force to draw the batched vertexs. */ - void DrawBatch(); + void drawBatch(); /** Set the fill mode used to draw primitives */ - void FillMode( const EE_FILL_MODE& Mode ); + void fillMode( const EE_FILL_MODE& Mode ); /** @return The fill mode used to draw primitives */ - const EE_FILL_MODE& FillMode() const; + const EE_FILL_MODE& fillMode() const; /** Set the blend mode used to draw primitives */ - void BlendMode( const EE_BLEND_MODE& Mode ); + void blendMode( const EE_BLEND_MODE& Mode ); /** @return The blend mode used to draw primitives */ - const EE_BLEND_MODE& BlendMode() const; + const EE_BLEND_MODE& blendMode() const; /** Set the line width to draw primitives */ - void LineWidth( const Float& width ); + void lineWidth( const Float& width ); /** @return The line with to draw primitives */ - const Float& LineWidth() const; + const Float& lineWidth() const; private: ColorA mColor; EE_FILL_MODE mFillMode; diff --git a/include/eepp/graphics/renderer/gl.hpp b/include/eepp/graphics/renderer/gl.hpp index b87f0cae2..b1e418bb5 100644 --- a/include/eepp/graphics/renderer/gl.hpp +++ b/include/eepp/graphics/renderer/gl.hpp @@ -39,178 +39,178 @@ class EE_API cGL { virtual ~cGL(); - virtual void Init(); + virtual void init(); /** @return The company responsible for this GL implementation. */ - std::string GetVendor(); + std::string getVendor(); /** @return The name of the renderer.\n This name is typically specific to a particular configuration of a hardware platform. */ - std::string GetRenderer(); + std::string getRenderer(); /** @return A GL version or release number. */ - std::string GetVersion(); + std::string getVersion(); /** @return The shading language version */ - std::string GetShadingLanguageVersion(); + std::string getShadingLanguageVersion(); /** @return If the extension passed is supported by the GPU */ - bool IsExtension( const std::string& name ); + bool isExtension( const std::string& name ); /** @return If the extension from the EEGL_extensions is present on the GPU. */ - bool IsExtension( EEGL_extensions name ); + bool isExtension( EEGL_extensions name ); - bool PointSpriteSupported(); + bool pointSpriteSupported(); - bool ShadersSupported(); + bool shadersSupported(); - Uint32 GetTextureParamEnum( const EE_TEXTURE_PARAM& Type ); + Uint32 getTextureParamEnum( const EE_TEXTURE_PARAM& Type ); - Uint32 GetTextureFuncEnum( const EE_TEXTURE_FUNC& Type ); + Uint32 getTextureFuncEnum( const EE_TEXTURE_FUNC& Type ); - Uint32 GetTextureSourceEnum( const EE_TEXTURE_SOURCE& Type ); + Uint32 getTextureSourceEnum( const EE_TEXTURE_SOURCE& Type ); - Uint32 GetTextureOpEnum( const EE_TEXTURE_OP& Type ); + Uint32 getTextureOpEnum( const EE_TEXTURE_OP& Type ); - void Clear ( unsigned int mask ); + void clear ( unsigned int mask ); - void ClearColor ( float red, float green, float blue, float alpha ); + void clearColor ( float red, float green, float blue, float alpha ); - void Scissor ( int x, int y, int width, int height ); + void scissor ( int x, int y, int width, int height ); - void PolygonMode( unsigned int face, unsigned int mode ); + void polygonMode( unsigned int face, unsigned int mode ); - std::string GetExtensions(); + std::string getExtensions(); - const char * GetString( unsigned int name ); + const char * getString( unsigned int name ); - void DrawArrays ( unsigned int mode, int first, int count ); + void drawArrays ( unsigned int mode, int first, int count ); - void DrawElements( unsigned int mode, int count, unsigned int type, const void *indices ); + void drawElements( unsigned int mode, int count, unsigned int type, const void *indices ); - void BindTexture ( unsigned int target, unsigned int texture ); + void bindTexture( unsigned int target, unsigned int texture ); - void ActiveTexture( unsigned int texture ); + void activeTexture( unsigned int texture ); - void BlendFunc ( unsigned int sfactor, unsigned int dfactor ); + void blendFunc( unsigned int sfactor, unsigned int dfactor ); - void Viewport ( int x, int y, int width, int height ); + void viewport( int x, int y, int width, int height ); - void LineSmooth( const bool& Enable ); + void lineSmooth( const bool& enable ); - void LineWidth ( float width ); + void lineWidth( float width ); /** Reapply the line smooth state */ - void LineSmooth(); + void lineSmooth(); - bool IsLineSmooth(); + bool isLineSmooth(); /** Set the polygon fill mode ( wireframe or filled ) */ - void PolygonMode( const EE_FILL_MODE& Mode ); + void polygonMode( const EE_FILL_MODE& Mode ); /** Reapply the polygon mode */ - void PolygonMode(); + void polygonMode(); - void PixelStorei (unsigned int pname, int param); + void pixelStorei (unsigned int pname, int param); - RendererGL * GetRendererGL(); + RendererGL * getRendererGL(); - RendererGL3 * GetRendererGL3(); + RendererGL3 * getRendererGL3(); - RendererGL3CP * GetRendererGL3CP(); + RendererGL3CP * getRendererGL3CP(); - RendererGLES2 * GetRendererGLES2(); + RendererGLES2 * getRendererGLES2(); - virtual void PointSize( float size ) = 0; + virtual void pointSize( float size ) = 0; - virtual float PointSize() = 0; + virtual float pointSize() = 0; - virtual void ClientActiveTexture( unsigned int texture ) = 0; + virtual void clientActiveTexture( unsigned int texture ) = 0; - virtual void Disable ( unsigned int cap ); + virtual void disable( unsigned int cap ); - virtual void Enable( unsigned int cap ); + virtual void enable( unsigned int cap ); - virtual EEGL_version Version() = 0; + virtual EEGL_version version() = 0; - virtual std::string VersionStr() = 0; + virtual std::string versionStr() = 0; - virtual void PushMatrix() = 0; + virtual void pushMatrix() = 0; - virtual void PopMatrix() = 0; + virtual void popMatrix() = 0; - virtual void LoadIdentity() = 0; + virtual void loadIdentity() = 0; - virtual void Translatef( float x, float y, float z ) = 0; + virtual void translatef( float x, float y, float z ) = 0; - virtual void Rotatef( float angle, float x, float y, float z ) = 0; + virtual void rotatef( float angle, float x, float y, float z ) = 0; - virtual void Scalef( float x, float y, float z ) = 0; + virtual void scalef( float x, float y, float z ) = 0; - virtual void MatrixMode ( unsigned int mode ) = 0; + virtual void matrixMode ( unsigned int mode ) = 0; - virtual void Ortho ( float left, float right, float bottom, float top, float zNear, float zFar ) = 0; + virtual void ortho( float left, float right, float bottom, float top, float zNear, float zFar ) = 0; - virtual void LookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) = 0; + virtual void lookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) = 0; - virtual void Perspective ( float fovy, float aspect, float zNear, float zFar ) = 0; + virtual void perspective( float fovy, float aspect, float zNear, float zFar ) = 0; - virtual void EnableClientState( unsigned int array ) = 0; + virtual void enableClientState( unsigned int array ) = 0; - virtual void DisableClientState( unsigned int array ) = 0; + virtual void disableClientState( unsigned int array ) = 0; - virtual void VertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) = 0; + virtual void vertexPointer( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) = 0; - virtual void ColorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) = 0; + virtual void colorPointer( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) = 0; - virtual void TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) = 0; + virtual void texCoordPointer( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) = 0; - virtual void SetShader( ShaderProgram * Shader ); + virtual void setShader( ShaderProgram * Shader ); - virtual void Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) = 0; + virtual void clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) = 0; - virtual void Clip2DPlaneDisable() = 0; + virtual void clip2DPlaneDisable() = 0; - virtual void MultMatrixf ( const float *m ) = 0; + virtual void multMatrixf( const float *m ) = 0; - virtual void ClipPlane( unsigned int plane, const double *equation ) = 0; + virtual void clipPlane( unsigned int plane, const double *equation ) = 0; - virtual void TexEnvi( unsigned int target, unsigned int pname, int param ) = 0; + virtual void texEnvi( unsigned int target, unsigned int pname, int param ) = 0; - virtual void LoadMatrixf( const float *m ) = 0; + virtual void loadMatrixf( const float *m ) = 0; - virtual void Frustum( float left, float right, float bottom, float top, float near_val, float far_val ) = 0; + virtual void frustum( float left, float right, float bottom, float top, float near_val, float far_val ) = 0; - virtual void GetCurrentMatrix( unsigned int mode, float * m ) = 0; + virtual void getCurrentMatrix( unsigned int mode, float * m ) = 0; - virtual unsigned int GetCurrentMatrixMode() = 0; + virtual unsigned int getCurrentMatrixMode() = 0; - void GetViewport( int * viewport ); + void getViewport( int * viewport ); - virtual int Project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) = 0; + virtual int project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) = 0; - virtual int UnProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) = 0; + virtual int unProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) = 0; - Vector3f ProjectCurrent( const Vector3f& point ); + Vector3f projectCurrent( const Vector3f& point ); - Vector3f UnProjectCurrent( const Vector3f& point ); + Vector3f unProjectCurrent( const Vector3f& point ); - void StencilFunc( unsigned int func, int ref, unsigned int mask ); + void stencilFunc( unsigned int func, int ref, unsigned int mask ); - void StencilOp( unsigned int fail, unsigned int zfail, unsigned int zpass ); + void stencilOp( unsigned int fail, unsigned int zfail, unsigned int zpass ); - void StencilMask ( unsigned int mask ); + void stencilMask( unsigned int mask ); - void ColorMask ( Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha ); + void colorMask( Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha ); - void BindVertexArray ( unsigned int array ); + void bindVertexArray( unsigned int array ); - void DeleteVertexArrays ( int n, const unsigned int *arrays ); + void deleteVertexArrays( int n, const unsigned int *arrays ); - void GenVertexArrays ( int n, unsigned int *arrays ); + void genVertexArrays( int n, unsigned int *arrays ); - const bool& QuadsSupported() const; + const bool& quadsSupported() const; - const int& QuadVertexs() const; + const int& quadVertexs() const; protected: enum GLStateFlags { GLSF_LINE_SMOOTH = 0, @@ -228,7 +228,7 @@ class EE_API cGL { std::list mPlanesClipped; private: - void WriteExtension( Uint8 Pos, Uint32 BitWrite ); + void writeExtension( Uint8 Pos, Uint32 BitWrite ); }; extern EE_API cGL * GLi; diff --git a/include/eepp/graphics/renderer/renderergl.hpp b/include/eepp/graphics/renderer/renderergl.hpp index 46ae8e347..dc7d84905 100644 --- a/include/eepp/graphics/renderer/renderergl.hpp +++ b/include/eepp/graphics/renderer/renderergl.hpp @@ -14,67 +14,67 @@ class EE_API RendererGL : public cGL { ~RendererGL(); - EEGL_version Version(); + EEGL_version version(); - std::string VersionStr(); + std::string versionStr(); - void ClientActiveTexture( unsigned int texture ); + void clientActiveTexture( unsigned int texture ); - void PointSize( float size ); + void pointSize( float size ); - float PointSize(); + float pointSize(); - void PushMatrix(); + void pushMatrix(); - void PopMatrix(); + void popMatrix(); - void LoadIdentity(); + void loadIdentity(); - void Translatef( float x, float y, float z ); + void translatef( float x, float y, float z ); - void Rotatef( float angle, float x, float y, float z ); + void rotatef( float angle, float x, float y, float z ); - void Scalef( float x, float y, float z ); + void scalef( float x, float y, float z ); - void MatrixMode (unsigned int mode); + void matrixMode (unsigned int mode); - void Ortho ( float left, float right, float bottom, float top, float zNear, float zFar ); + void ortho ( float left, float right, float bottom, float top, float zNear, float zFar ); - void LookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ); + void lookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ); - void Perspective ( float fovy, float aspect, float zNear, float zFar ); + void perspective ( float fovy, float aspect, float zNear, float zFar ); - void EnableClientState( unsigned int array ); + void enableClientState( unsigned int array ); - void DisableClientState( unsigned int array ); + void disableClientState( unsigned int array ); - void VertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void vertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void ColorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void colorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void texCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void ClipPlane( unsigned int plane, const double *equation ); + void clipPlane( unsigned int plane, const double *equation ); - void Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); + void clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); - void Clip2DPlaneDisable(); + void clip2DPlaneDisable(); - void TexEnvi( unsigned int target, unsigned int pname, int param ); + void texEnvi( unsigned int target, unsigned int pname, int param ); - void MultMatrixf ( const float *m ); + void multMatrixf ( const float *m ); - void LoadMatrixf( const float *m ); + void loadMatrixf( const float *m ); - void Frustum( float left, float right, float bottom, float top, float near_val, float far_val ); + void frustum( float left, float right, float bottom, float top, float near_val, float far_val ); - void GetCurrentMatrix( unsigned int mode, float * m ); + void getCurrentMatrix( unsigned int mode, float * m ); - unsigned int GetCurrentMatrixMode(); + unsigned int getCurrentMatrixMode(); - int Project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ); + int project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ); - int UnProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ); + int unProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ); protected: }; diff --git a/include/eepp/graphics/renderer/renderergl3.hpp b/include/eepp/graphics/renderer/renderergl3.hpp index 836125717..db1763431 100644 --- a/include/eepp/graphics/renderer/renderergl3.hpp +++ b/include/eepp/graphics/renderer/renderergl3.hpp @@ -22,85 +22,85 @@ class EE_API RendererGL3 : public cGL { ~RendererGL3(); - EEGL_version Version(); + EEGL_version version(); - std::string VersionStr(); + std::string versionStr(); - void Init(); + void init(); - void PointSize( float size ); + void pointSize( float size ); - float PointSize(); + float pointSize(); - void PushMatrix(); + void pushMatrix(); - void PopMatrix(); + void popMatrix(); - void LoadIdentity(); + void loadIdentity(); - void Disable ( unsigned int cap ); + void disable ( unsigned int cap ); - void Enable( unsigned int cap ); + void enable( unsigned int cap ); - void Translatef( float x, float y, float z ); + void translatef( float x, float y, float z ); - void Rotatef( float angle, float x, float y, float z ); + void rotatef( float angle, float x, float y, float z ); - void Scalef( float x, float y, float z ); + void scalef( float x, float y, float z ); - void MatrixMode (unsigned int mode); + void matrixMode (unsigned int mode); - void Ortho ( float left, float right, float bottom, float top, float zNear, float zFar ); + void ortho ( float left, float right, float bottom, float top, float zNear, float zFar ); - void LookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ); + void lookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ); - void Perspective ( float fovy, float aspect, float zNear, float zFar ); + void perspective ( float fovy, float aspect, float zNear, float zFar ); - void EnableClientState( unsigned int array ); + void enableClientState( unsigned int array ); - void DisableClientState( unsigned int array ); + void disableClientState( unsigned int array ); - void VertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void vertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void ColorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void colorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void texCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void ClientActiveTexture( unsigned int texture ); + void clientActiveTexture( unsigned int texture ); - unsigned int BaseShaderId(); + unsigned int baseShaderId(); - void SetShader( ShaderProgram * Shader ); + void setShader( ShaderProgram * Shader ); - void SetShader( const EEGL3_SHADERS& Shader ); + void setShader( const EEGL3_SHADERS& Shader ); - int GetStateIndex( const Uint32& State ); + int getStateIndex( const Uint32& State ); - void Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); + void clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); - void Clip2DPlaneDisable(); + void clip2DPlaneDisable(); - void MultMatrixf ( const float *m ); + void multMatrixf ( const float *m ); - void ClipPlane( unsigned int plane, const double *equation ); + void clipPlane( unsigned int plane, const double *equation ); - void TexEnvi( unsigned int target, unsigned int pname, int param ); + void texEnvi( unsigned int target, unsigned int pname, int param ); - void LoadMatrixf( const float *m ); + void loadMatrixf( const float *m ); - void Frustum( float left, float right, float bottom, float top, float near_val, float far_val ); + void frustum( float left, float right, float bottom, float top, float near_val, float far_val ); - void GetCurrentMatrix( unsigned int mode, float * m ); + void getCurrentMatrix( unsigned int mode, float * m ); - unsigned int GetCurrentMatrixMode(); + unsigned int getCurrentMatrixMode(); - std::string GetBaseVertexShader(); + std::string getBaseVertexShader(); - int Project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ); + int project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ); - int UnProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ); + int unProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ); - void ReloadCurrentShader(); + void reloadCurrentShader(); protected: Private::MatrixStack * mStack; int mProjectionMatrix_id; // cpu-side hook to shader uniform @@ -124,11 +124,11 @@ class EE_API RendererGL3 : public cGL { bool mLoaded; std::string mBaseVertexShader; - void UpdateMatrix(); + void updateMatrix(); - void PlaneStateCheck( bool tryEnable ); + void planeStateCheck( bool tryEnable ); - void ReloadShader( ShaderProgram * Shader ); + void reloadShader( ShaderProgram * Shader ); }; }} diff --git a/include/eepp/graphics/renderer/renderergl3cp.hpp b/include/eepp/graphics/renderer/renderergl3cp.hpp index 2c50c338a..55a8858eb 100644 --- a/include/eepp/graphics/renderer/renderergl3cp.hpp +++ b/include/eepp/graphics/renderer/renderergl3cp.hpp @@ -22,87 +22,87 @@ class EE_API RendererGL3CP : public cGL { ~RendererGL3CP(); - EEGL_version Version(); + EEGL_version version(); - std::string VersionStr(); + std::string versionStr(); - void Init(); + void init(); - void PointSize( float size ); + void pointSize( float size ); - float PointSize(); + float pointSize(); - void PushMatrix(); + void pushMatrix(); - void PopMatrix(); + void popMatrix(); - void LoadIdentity(); + void loadIdentity(); - void Disable ( unsigned int cap ); + void disable ( unsigned int cap ); - void Enable( unsigned int cap ); + void enable( unsigned int cap ); - void Translatef( float x, float y, float z ); + void translatef( float x, float y, float z ); - void Rotatef( float angle, float x, float y, float z ); + void rotatef( float angle, float x, float y, float z ); - void Scalef( float x, float y, float z ); + void scalef( float x, float y, float z ); - void MatrixMode (unsigned int mode); + void matrixMode (unsigned int mode); - void Ortho ( float left, float right, float bottom, float top, float zNear, float zFar ); + void ortho ( float left, float right, float bottom, float top, float zNear, float zFar ); - void LookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ); + void lookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ); - void Perspective ( float fovy, float aspect, float zNear, float zFar ); + void perspective ( float fovy, float aspect, float zNear, float zFar ); - void EnableClientState( unsigned int array ); + void enableClientState( unsigned int array ); - void DisableClientState( unsigned int array ); + void disableClientState( unsigned int array ); - void VertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void vertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void ColorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void colorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void texCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void ClientActiveTexture( unsigned int texture ); + void clientActiveTexture( unsigned int texture ); - unsigned int BaseShaderId(); + unsigned int baseShaderId(); - void SetShader( ShaderProgram * Shader ); + void setShader( ShaderProgram * Shader ); - void SetShader( const EEGL3CP_SHADERS& Shader ); + void setShader( const EEGL3CP_SHADERS& Shader ); - int GetStateIndex( const Uint32& State ); + int getStateIndex( const Uint32& State ); - void Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); + void clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); - void Clip2DPlaneDisable(); + void clip2DPlaneDisable(); - void MultMatrixf ( const float *m ); + void multMatrixf ( const float *m ); - void ClipPlane( unsigned int plane, const double *equation ); + void clipPlane( unsigned int plane, const double *equation ); - void TexEnvi( unsigned int target, unsigned int pname, int param ); + void texEnvi( unsigned int target, unsigned int pname, int param ); - void LoadMatrixf( const float *m ); + void loadMatrixf( const float *m ); - void Frustum( float left, float right, float bottom, float top, float near_val, float far_val ); + void frustum( float left, float right, float bottom, float top, float near_val, float far_val ); - void GetCurrentMatrix( unsigned int mode, float * m ); + void getCurrentMatrix( unsigned int mode, float * m ); - unsigned int GetCurrentMatrixMode(); + unsigned int getCurrentMatrixMode(); - void BindGlobalVAO(); + void bindGlobalVAO(); - std::string GetBaseVertexShader(); + std::string getBaseVertexShader(); - int Project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ); + int project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ); - int UnProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ); + int unProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ); - void ReloadCurrentShader(); + void reloadCurrentShader(); protected: Private::MatrixStack * mStack; int mProjectionMatrix_id; // cpu-side hook to shader uniform @@ -131,13 +131,13 @@ class EE_API RendererGL3CP : public cGL { bool mLoaded; std::string mBaseVertexShader; - void UpdateMatrix(); + void updateMatrix(); - void PlaneStateCheck( bool tryEnable ); + void planeStateCheck( bool tryEnable ); - void ReloadShader( ShaderProgram * Shader ); + void reloadShader( ShaderProgram * Shader ); - void AllocateBuffers( const Uint32& size ); + void allocateBuffers( const Uint32& size ); }; }} diff --git a/include/eepp/graphics/renderer/renderergles2.hpp b/include/eepp/graphics/renderer/renderergles2.hpp index 44ce6b1d2..6bf4068ee 100644 --- a/include/eepp/graphics/renderer/renderergles2.hpp +++ b/include/eepp/graphics/renderer/renderergles2.hpp @@ -25,85 +25,85 @@ class EE_API RendererGLES2 : public cGL { ~RendererGLES2(); - EEGL_version Version(); + EEGL_version version(); - std::string VersionStr(); + std::string versionStr(); - void Init(); + void init(); - void PointSize( float size ); + void pointSize( float size ); - float PointSize(); + float pointSize(); - void PushMatrix(); + void pushMatrix(); - void PopMatrix(); + void popMatrix(); - void LoadIdentity(); + void loadIdentity(); - void Disable ( unsigned int cap ); + void disable ( unsigned int cap ); - void Enable( unsigned int cap ); + void enable( unsigned int cap ); - void Translatef( float x, float y, float z ); + void translatef( float x, float y, float z ); - void Rotatef( float angle, float x, float y, float z ); + void rotatef( float angle, float x, float y, float z ); - void Scalef( float x, float y, float z ); + void scalef( float x, float y, float z ); - void MatrixMode (unsigned int mode); + void matrixMode (unsigned int mode); - void Ortho ( float left, float right, float bottom, float top, float zNear, float zFar ); + void ortho ( float left, float right, float bottom, float top, float zNear, float zFar ); - void LookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ); + void lookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ); - void Perspective ( float fovy, float aspect, float zNear, float zFar ); + void perspective ( float fovy, float aspect, float zNear, float zFar ); - void EnableClientState( unsigned int array ); + void enableClientState( unsigned int array ); - void DisableClientState( unsigned int array ); + void disableClientState( unsigned int array ); - void VertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void vertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void ColorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void colorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); + void texCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ); - void ClientActiveTexture( unsigned int texture ); + void clientActiveTexture( unsigned int texture ); - unsigned int BaseShaderId(); + unsigned int baseShaderId(); - void SetShader( ShaderProgram * Shader ); + void setShader( ShaderProgram * Shader ); - void SetShader( const EEGLES2_SHADERS& Shader ); + void setShader( const EEGLES2_SHADERS& Shader ); - int GetStateIndex( const Uint32& State ); + int getStateIndex( const Uint32& State ); - void Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); + void clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ); - void Clip2DPlaneDisable(); + void clip2DPlaneDisable(); - void MultMatrixf ( const float *m ); + void multMatrixf ( const float *m ); - void ClipPlane( unsigned int plane, const double *equation ); + void clipPlane( unsigned int plane, const double *equation ); - void TexEnvi( unsigned int target, unsigned int pname, int param ); + void texEnvi( unsigned int target, unsigned int pname, int param ); - void LoadMatrixf( const float *m ); + void loadMatrixf( const float *m ); - void Frustum( float left, float right, float bottom, float top, float near_val, float far_val ); + void frustum( float left, float right, float bottom, float top, float near_val, float far_val ); - void GetCurrentMatrix( unsigned int mode, float * m ); + void getCurrentMatrix( unsigned int mode, float * m ); - unsigned int GetCurrentMatrixMode(); + unsigned int getCurrentMatrixMode(); - std::string GetBaseVertexShader(); + std::string getBaseVertexShader(); - int Project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ); + int project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ); - int UnProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ); + int unProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ); - void ReloadCurrentShader(); + void reloadCurrentShader(); protected: Private::MatrixStack * mStack; int mProjectionMatrix_id; // cpu-side hook to shader uniform @@ -129,13 +129,13 @@ class EE_API RendererGLES2 : public cGL { bool mCurShaderLocal; std::string mBaseVertexShader; - void UpdateMatrix(); + void updateMatrix(); - void PlaneStateCheck( bool tryEnable ); + void planeStateCheck( bool tryEnable ); - void ReloadShader( ShaderProgram * Shader ); + void reloadShader( ShaderProgram * Shader ); - void CheckLocalShader(); + void checkLocalShader(); }; }} diff --git a/include/eepp/graphics/scrollparallax.hpp b/include/eepp/graphics/scrollparallax.hpp index b297859ec..2e212febf 100755 --- a/include/eepp/graphics/scrollparallax.hpp +++ b/include/eepp/graphics/scrollparallax.hpp @@ -23,7 +23,7 @@ class EE_API ScrollParallax { * @param Speed Speed of movement ( in Pixels Per Second ) * @param Color The Texture Color * @param Blend The Blend Mode ( default ALPHA_NORMAL ) */ - ScrollParallax( Graphics::SubTexture * SubTexture, const Vector2f& Position = Vector2f(), const Sizef& Size = Sizef(), const Vector2f& Speed = Vector2f(), const ColorA& Color = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); + ScrollParallax( Graphics::SubTexture * subTexture, const Vector2f& position = Vector2f(), const Sizef& size = Sizef(), const Vector2f& speed = Vector2f(), const ColorA& color = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); /** Create's the Scroll Parallax * @param SubTexture The SubTexture to Draw @@ -34,48 +34,48 @@ class EE_API ScrollParallax { * @param Blend The Blend Mode ( default ALPHA_NORMAL ) * @return True if success */ - bool Create( Graphics::SubTexture * SubTexture, const Vector2f& Position = Vector2f(), const Sizef& Size = Sizef(), const Vector2f& Speed = Vector2f(), const ColorA& Color = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); + bool create( Graphics::SubTexture * subTexture, const Vector2f& position = Vector2f(), const Sizef& size = Sizef(), const Vector2f& speed = Vector2f(), const ColorA& color = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); /** Set the parallax texture color. */ - void Color( const ColorA& Color ) { mColor = Color; } + void color( const ColorA& Color ) { mColor = Color; } /** Get the parallax texture color. */ - ColorA Color() const { return mColor; } + ColorA color() const { return mColor; } /** Set the Blend Mode used. */ - void BlendMode( const EE_BLEND_MODE& Blend ) { mBlend = Blend; } + void blendMode( const EE_BLEND_MODE& Blend ) { mBlend = Blend; } /** @return The Blend Mode used for the parallax. */ - const EE_BLEND_MODE& BlendMode() const { return mBlend; } + const EE_BLEND_MODE& blendMode() const { return mBlend; } /** Draw the Scroll Parallax. */ - void Draw(); + void draw(); /** Change the size of the current parallax * @param size The new size */ - void Size( const Sizef& size ); + void size( const Sizef& size ); /** @return Size */ - const Sizef& Size() const; + const Sizef& size() const; /** Change the Parallax position * @param Pos The new parallax position */ - void Position( const Vector2f& Pos ); + void position( const Vector2f& Pos ); /** @return The parallax position */ - const Vector2f& Position() const; + const Vector2f& position() const; /** @return The SubTexture used for the parallax.*/ - Graphics::SubTexture * SubTexture() const; + Graphics::SubTexture * subTexture() const; /** Set Change the SubTexture used for the parallax. */ - void SubTexture( Graphics::SubTexture * subTexture ); + void subTexture( Graphics::SubTexture * subTexture ); /** Set the parallax speed movement. */ - void Speed( const Vector2f& speed ); + void speed( const Vector2f& speed ); /** @return The parallax movement speed. */ - const Vector2f& Speed() const; + const Vector2f& speed() const; private: Graphics::SubTexture * mSubTexture; EE_BLEND_MODE mBlend; @@ -90,9 +90,9 @@ class EE_API ScrollParallax { Rectf mAABB; Sizef mRealSize; - void SetSubTexture(); + void setSubTexture(); - void SetAABB(); + void setAABB(); }; }} diff --git a/include/eepp/graphics/shader.hpp b/include/eepp/graphics/shader.hpp index f80d79c0c..566c83f3b 100644 --- a/include/eepp/graphics/shader.hpp +++ b/include/eepp/graphics/shader.hpp @@ -9,10 +9,10 @@ namespace EE { namespace Graphics { class EE_API Shader { public: /** Activates/Deactivates shader convertion from fixed pipeline to programmable pipeline ( activated by default ) */ - static void Ensure( bool ensure ); + static void ensure( bool ensure ); /** @return If automatic Shader conversion is activated */ - static bool Ensure(); + static bool ensure(); /** Constructor with type of shader, next you'll need to set the source and compile it. */ Shader( const Uint32& Type ); @@ -32,37 +32,37 @@ class EE_API Shader { virtual ~Shader(); /** Set the shader source */ - void SetSource( const std::string& Source ); + void setSource( const std::string& Source ); /** Set the shader source */ - void SetSource( const std::vector& Source ); + void setSource( const std::vector& Source ); /** Set the shader source */ - void SetSource( const char * Data, const Uint32& DataSize ); + void setSource( const char * Data, const Uint32& DataSize ); /** Set the shader source */ - void SetSource( const char** Data, const Uint32& NumLines ); + void setSource( const char** Data, const Uint32& NumLines ); /** Compile the shader */ - bool Compile(); + bool compile(); /** @return If the shader is valid */ - bool IsValid() const; + bool isValid() const; /** @return If the shader is compiled */ - bool IsCompiled() const; + bool isCompiled() const; /** @return The log of the compilation */ - std::string CompileLog() const; + std::string compileLog() const; /** @return The Shader Type */ - Uint32 GetType() const; + Uint32 getType() const; /** @return The Shader Id */ - Uint32 GetId() const; + Uint32 getId() const; /** Reloads the Shader. */ - void Reload(); + void reload(); protected: friend class RendererGL3; static bool sEnsure; @@ -76,9 +76,9 @@ class EE_API Shader { void Init( const Uint32& Type ); - std::string GetName(); + std::string getName(); - void EnsureVersion(); + void ensureVersion(); }; /** @brief Prebuild Vertex Shader class */ diff --git a/include/eepp/graphics/shaderprogram.hpp b/include/eepp/graphics/shaderprogram.hpp index 7ed284d09..57c36e2ac 100644 --- a/include/eepp/graphics/shaderprogram.hpp +++ b/include/eepp/graphics/shaderprogram.hpp @@ -13,124 +13,124 @@ namespace EE { namespace Graphics { class EE_API ShaderProgram { public: /** Creates an empty shader program */ - static ShaderProgram * New( const std::string& name = "" ); + static ShaderProgram * New( const std::string& getName = "" ); /** Creates a program shader with a vector of shaders and link them. */ - static ShaderProgram * New( const std::vector& Shaders, const std::string& name = "" ); + static ShaderProgram * New( const std::vector& Shaders, const std::string& getName = "" ); /** Creates a VertexShader from file and a Fragment Shader from file, and link them. */ - static ShaderProgram * New( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& name = "" ); + static ShaderProgram * New( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& getName = "" ); /** Creates a VertexShader from memory and a Fragment Shader from memory, and link them. */ - static ShaderProgram * New( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& name = "" ); + static ShaderProgram * New( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& getName = "" ); /** Creates the vertex shader and fragment shader from two files inside a pack */ - static ShaderProgram * New( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name = "" ); + static ShaderProgram * New( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& getName = "" ); /** Creates the vertex and fragment shader from an array of strings */ - static ShaderProgram * New( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& name = "" ); + static ShaderProgram * New( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& getName = "" ); typedef cb::Callback1 ShaderProgramReloadCb; virtual ~ShaderProgram(); /** Add a new shader */ - void AddShader( Shader* Shader ); + void addShader( Shader* Shader ); /** Add a vector of shaders */ - void AddShaders( const std::vector& Shaders ); + void addShaders( const std::vector& Shaders ); virtual bool Link(); /** @return If the shader program is valid */ - bool IsValid() const { return mValid; } + bool isValid() const { return mValid; } /** @return THe link log */ - std::string GetLinkLog() const { return mLinkLog; } + std::string getLinkLog() const { return mLinkLog; } /** Binds the shader program so that it will be used for anything that is rendered */ - virtual void Bind() const; + virtual void bind() const; /** Unbind the program. Anything rendered after Unbind() call will be rendered using the fixed-function pipeline */ - virtual void Unbind() const; + virtual void unbind() const; /** @return The location of the location name */ - Int32 UniformLocation( const std::string& Name ); + Int32 uniformLocation( const std::string& getName ); /** @return The location of the attribute name */ - Int32 AttributeLocation( const std::string& Name ); + Int32 attributeLocation( const std::string& getName ); /** Clear the locations */ - void InvalidateLocations(); + void invalidateLocations(); /** Sets the uniform with the given name to the given value and returns true. * If there is no uniform with such name then false is returned. * Note that the program has to be bound before this method can be used. */ - bool SetUniform( const std::string& Name, float Value ); + bool setUniform( const std::string& getName, float Value ); /** @overload */ - bool SetUniform( const std::string& Name, Vector2ff Value ); + bool setUniform( const std::string& getName, Vector2ff Value ); /** @overload */ - bool SetUniform( const std::string& Name, Vector3ff Value ); + bool setUniform( const std::string& getName, Vector3ff Value ); /** @overload */ - bool SetUniform( const std::string& Name, float x, float y, float z, float w ); + bool setUniform( const std::string& getName, float x, float y, float z, float w ); /** @overload */ - bool SetUniform( const std::string& Name, Int32 Value ); + bool setUniform( const std::string& getName, Int32 Value ); /** @overload */ - bool SetUniform( const Int32& Location, Int32 Value ); + bool setUniform( const Int32& Location, Int32 Value ); /** @overload */ - bool SetUniform( const Int32& Location, float Value ); + bool setUniform( const Int32& Location, float Value ); /** @overload */ - bool SetUniform( const Int32& Location, Vector2ff Value ); + bool setUniform( const Int32& Location, Vector2ff Value ); /** @overload */ - bool SetUniform( const Int32& Location, Vector3ff Value ); + bool setUniform( const Int32& Location, Vector3ff Value ); /** @overload */ - bool SetUniform( const Int32& Location, float x, float y, float z, float w ); + bool setUniform( const Int32& Location, float x, float y, float z, float w ); /** Sets an uniform matrix from its name. */ - bool SetUniformMatrix( const std::string Name, const float * Value ); + bool setUniformMatrix( const std::string getName, const float * Value ); /** Sets an uniform matrix from its location. */ - bool SetUniformMatrix( const Int32& Location, const float * Value ); + bool setUniformMatrix( const Int32& Location, const float * Value ); /** @return The id of the program (the handle) */ - const Uint32& Handler() const { return mHandler; } + const Uint32& getHandler() const { return mHandler; } /** @return The Id of the program ( hash of the program name ) */ - const Uint32& Id() const { return mId; } + const Uint32& getId() const { return mId; } /** Reloads the shaders */ - void Reload(); + void reload(); /** @return Name of the shader program */ - const std::string& Name() const; + const std::string& getName() const; /** Set the name of the shader program */ - void Name( const std::string& name ); + void setName( const std::string& getName ); /** Set a reload callback ( needed to reset shader states ). */ - void SetReloadCb( ShaderProgramReloadCb Cb ); + void setReloadCb( ShaderProgramReloadCb Cb ); /** Enable a vertex attribute array */ - void EnableVertexAttribArray( const std::string& Name ); + void enableVertexAttribArray( const std::string& getName ); /** Enable a vertex attribute array */ - void EnableVertexAttribArray( const Int32& Location ); + void enableVertexAttribArray( const Int32& Location ); /** Disable a vertex attribute array */ - void DisableVertexAttribArray( const std::string& Name ); + void disableVertexAttribArray( const std::string& getName ); /** Disable a vertex attribute array */ - void DisableVertexAttribArray( const Int32& Location ); + void disableVertexAttribArray( const Int32& Location ); protected: std::string mName; Uint32 mHandler; @@ -145,29 +145,29 @@ class EE_API ShaderProgram { ShaderProgramReloadCb mReloadCb; - void Init(); + void init(); - void AddToManager( const std::string& name ); + void addToManager( const std::string& getName ); - void RemoveFromManager(); + void removeFromManager(); /** Creates an empty shader program */ - ShaderProgram( const std::string& name = "" ); + ShaderProgram( const std::string& getName = "" ); /** Construct a program shader with a vector of shaders and link them. */ - ShaderProgram( const std::vector& Shaders, const std::string& name = "" ); + ShaderProgram( const std::vector& Shaders, const std::string& getName = "" ); /** Constructor that creates a VertexShader from file and a Fragment Shader from file, and link them. */ - ShaderProgram( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& name = "" ); + ShaderProgram( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& getName = "" ); /** Constructor that creates a VertexShader from memory and a Fragment Shader from memory, and link them. */ - ShaderProgram( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& name = "" ); + ShaderProgram( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& getName = "" ); /** Constructor that creates the vertex shader and fragment shader from two files inside a pack */ - ShaderProgram( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name = "" ); + ShaderProgram( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& getName = "" ); /** Constructor that creates the vertex and fragment shader from an array of strings */ - ShaderProgram( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& name = "" ); + ShaderProgram( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& getName = "" ); }; }} diff --git a/include/eepp/graphics/shaderprogrammanager.hpp b/include/eepp/graphics/shaderprogrammanager.hpp index b689f1310..0441dbe2f 100644 --- a/include/eepp/graphics/shaderprogrammanager.hpp +++ b/include/eepp/graphics/shaderprogrammanager.hpp @@ -14,7 +14,7 @@ class EE_API ShaderProgramManager : public ResourceManager { public: virtual ~ShaderProgramManager(); - void Reload(); + void reload(); protected: ShaderProgramManager(); }; diff --git a/include/eepp/graphics/sprite.hpp b/include/eepp/graphics/sprite.hpp index 2e5e87f8d..ec7a2c1bb 100755 --- a/include/eepp/graphics/sprite.hpp +++ b/include/eepp/graphics/sprite.hpp @@ -45,42 +45,42 @@ class EE_API Sprite { * @param Offset The offset added to the position of the frame ( the SubTexture ) * @param TexSector The sector of the texture used by the SubTexture to be rendered */ - Sprite( const Uint32& TexId, const Sizef &DestSize = Sizef(0,0), const Vector2i &Offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); + Sprite( const Uint32& TexId, const Sizef &DestSize = Sizef(0,0), const Vector2i &offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); virtual ~Sprite(); Sprite& operator =( const Sprite& Other ); /** Set the x axis position */ - void X( const Float& X ); + void x( const Float& x ); /** @return The x axis position */ - Float X() const; + Float x() const; /** Set the y axis position */ - void Y( const Float& Y ); + void y( const Float& y ); /** @return The y axis position */ - Float Y() const; + Float y() const; /** Set the Angle for the rendered sprite */ - void Angle( const Float& Angle ); + void angle( const Float& angle ); /** @return The Angle for the rendered sprite */ - Float Angle() const; + Float angle() const; /** Rotates the sprite. Adds the new angle to the current rotation. Same as: ** @code sprite.Angle( sprite.Angle() + angle ); @endcode */ - void Rotate( const Float& angle ); + void rotate( const Float& angle ); /** Set the Scale for the rendered sprite */ - void Scale( const Float& Scale ); + void scale( const Float& scale ); /** Set the Scale for the rendered sprite */ - void Scale( const Vector2f& Scale ); + void scale( const Vector2f& scale ); /** @return The Scale for the rendered sprite */ - const Vector2f& Scale() const; + const Vector2f& scale() const; /** @brief Set the local origin of the sprite ** The origin of an object defines the center point for @@ -88,100 +88,100 @@ class EE_API Sprite { ** The coordinates of this point must be relative to the ** top-left corner of the sprite. ** The default origin point is the center of the sprite. */ - void Origin( const OriginPoint& origin ); + void origin( const OriginPoint& origin ); /** @return The local origin of the sprite */ - const OriginPoint& Origin() const; + const OriginPoint& origin() const; /** Set the Frame Number Sprite Size * @param Size The new size * @param FrameNum If the Frame Number is 0 it will use the Current Frame Number * @param SubFrame If the Sub Frame Number is 0 it will use the Current Sub Frame Number */ - void Size( const Sizef& Size, const unsigned int& FrameNum, const unsigned int& SubFrame ); + void size( const Sizef& size, const unsigned int& FrameNum, const unsigned int& SubFrame ); /** Set the current SubTexture Size ( destination size ) */ - void Size( const Sizef& Size ); + void size( const Sizef& size ); /** @return the Frame Number Sprite Size * @param FrameNum If the Frame Number is 0 it will use the Current Frame Number * @param SubFrame If the Sub Frame Number is 0 it will use the Current Sub Frame Number */ - Sizef Size( const unsigned int& FrameNum, const unsigned int& SubFrame ); + Sizef size( const unsigned int& FrameNum, const unsigned int& SubFrame ); /** @return The current Frame Size */ - Sizef Size(); + Sizef size(); /** Set the sprite animation speed ( AnimSpeed equals to Animation Frames per Second ) */ - void AnimSpeed( const Float& AnimSpeed ); + void animSpeed( const Float& animSpeed ); /** @return The sprite animation speed ( AnimSpeed equals to Animation Frames per Second ) */ - Float AnimSpeed() const; + Float animSpeed() const; /** @return If the animation is paused */ - bool AnimPaused() const; + bool animPaused() const; /** Set the animation paused or not */ - void AnimPaused( const bool& Pause ); + void animPaused( const bool& Pause ); /** Set the sprite color */ - void Color( const ColorA& Color); + void color( const ColorA& color); /** @return The sprite color */ - const ColorA& Color() const; + const ColorA& color() const; /** Set the sprite Color Alpha */ - void Alpha( const Uint8& Alpha ); + void alpha( const Uint8& alpha ); /** @return The sprite Color Alpha */ - const Uint8& Alpha() const; + const Uint8& alpha() const; /** Set the Current Frame */ - void CurrentFrame( unsigned int CurFrame ); + void currentFrame( unsigned int CurFrame ); /** @return The Current Frame */ - const unsigned int& CurrentFrame() const; + const unsigned int& currentFrame() const; /** @return The Exact Current FrameData * @return The Float fpoint of the current frame, the exact position of the interpolation. */ - const Float& ExactCurrentFrame() const; + const Float& exactCurrentFrame() const; /** Set the exact current FrameData */ - void ExactCurrentFrame( const Float& CurrentFrame ); + void exactCurrentFrame( const Float& currentFrame ); /** Set the Current Sub Frame */ - void CurrentSubFrame( const unsigned int &CurSubFrame ); + void currentSubFrame( const unsigned int &CurSubFrame ); /** @return The Current Sub Frame */ - const unsigned int& CurrentSubFrame() const; + const unsigned int& currentSubFrame() const; /** Set the Render Type */ - void RenderMode( const EE_RENDER_MODE& Effect ); + void renderMode( const EE_RENDER_MODE& Effect ); /** @return The Render Type */ - const EE_RENDER_MODE& RenderMode() const; + const EE_RENDER_MODE& renderMode() const; /** Set the Blend Mode */ - void BlendMode( const EE_BLEND_MODE& Blend ); + void blendMode( const EE_BLEND_MODE& Blend ); /** @return The Blend Mode */ - const EE_BLEND_MODE& BlendMode() const; + const EE_BLEND_MODE& blendMode() const; /** Reset the sprite as a new one. */ - void Reset(); + void reset(); /** @return The AABB (axis-aligned bounding box) */ - eeAABB GetAABB(); + eeAABB getAABB(); /** Set the sprite position */ - void Position( const Float& x, const Float& y ); + void position( const Float& x, const Float& y ); /** Set the sprite position from a Vector */ - void Position( const Vector2f& NewPos ); + void position( const Vector2f& NewPos ); /** @return The Position of the sprite */ - const Vector2f Position() const; + const Vector2f position() const; /** Update the colors of every vertex rendered of the sprite ( this will override the default color ) * @param Color0 The Left - Top vertex color @@ -189,16 +189,16 @@ class EE_API Sprite { * @param Color2 The Right - Bottom vertex color * @param Color3 The Right - Top vertex color */ - void UpdateVertexColors( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ); + void updateVertexColors( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ); /** This will disable the vertex colors */ - void DisableVertexColors(); + void disableVertexColors(); /** Creates an static sprite (no animation) * @param SubTexture The sprite SubTexture * @return True if success */ - bool CreateStatic( SubTexture * SubTexture ); + bool createStatic( SubTexture * SubTexture ); /** Creates an static sprite (no animation). It creates a new SubTexture. * @param TexId The internal Texture Id @@ -207,12 +207,12 @@ class EE_API Sprite { * @param TexSector The texture sector to be rendered ( default all the texture ) * @return True if success */ - bool CreateStatic(const Uint32& TexId, const Sizef &DestSize = Sizef(0,0), const Vector2i &Offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); + bool createStatic(const Uint32& TexId, const Sizef &DestSize = Sizef(0,0), const Vector2i &offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); /** Creates an animated sprite * @param SubFramesNum The number of subframes of the sprite */ - void CreateAnimation( const unsigned int& SubFramesNum = 1 ); + void createAnimation( const unsigned int& SubFramesNum = 1 ); /** Add a frame to the sprite (on the current sub frame) * @param TexId The internal Texture Id @@ -221,23 +221,23 @@ class EE_API Sprite { * @param TexSector The texture sector to be rendered ( default all the texture ) * @return The frame position or 0 if fails */ - unsigned int AddFrame( const Uint32& TexId, const Sizef& DestSize = Sizef(0,0), const Vector2i& Offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); + unsigned int addFrame( const Uint32& TexId, const Sizef& DestSize = Sizef(0,0), const Vector2i& offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); /** Add a frame to the sprite (on the current sub frame) * @param SubTexture The SubTexture used in the frame * @return The frame position or 0 if fails */ - unsigned int AddFrame( SubTexture * SubTexture ); + unsigned int addFrame( SubTexture * SubTexture ); /** Add a vector of SubTexture as an animation. * @param SubTextures The Frames */ - bool AddFrames( const std::vector SubTextures ); + bool addFrames( const std::vector SubTextures ); /** @see TextureAtlasManager::GetSubTexturesByPattern */ - bool AddFramesByPattern( const std::string& name, const std::string& extension = "", TextureAtlas * SearchInTextureAtlas = NULL ); + bool addFramesByPattern( const std::string& name, const std::string& extension = "", TextureAtlas * SearchInTextureAtlas = NULL ); - bool AddFramesByPatternId( const Uint32& SubTextureId, const std::string& extension, TextureAtlas * SearchInTextureAtlas ); + bool addFramesByPatternId( const Uint32& SubTextureId, const std::string& extension, TextureAtlas * SearchInTextureAtlas ); /** Add a frame on an specific subframe to the sprite * @param TexId The internal Texture Id @@ -248,7 +248,7 @@ class EE_API Sprite { * @param TexSector The texture sector to be rendered ( default all the texture ) * @return True if success */ - bool AddSubFrame( const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize = Sizef(0,0), const Vector2i& Offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); + bool addSubFrame( const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize = Sizef(0,0), const Vector2i& offset = Vector2i(0,0), const Recti& TexSector = Recti(0,0,0,0) ); /** Add a frame on an specific subframe to the sprite * @param SubTexture The SubTexture used in the frame @@ -256,99 +256,99 @@ class EE_API Sprite { * @param NumSubFrame The Sub Frame Number * @return True if success */ - bool AddSubFrame( SubTexture * SubTexture, const unsigned int& NumFrame, const unsigned int& NumSubFrame ); + bool addSubFrame( SubTexture * SubTexture, const unsigned int& NumFrame, const unsigned int& NumSubFrame ); /** Draw the sprite to the screen */ - void Draw(); + void draw(); /** Draw the sprite to the screen forcing the Blend Mode and the Render Type * @param Blend The Blend Mode * @param Effect The Render Type */ - void Draw( const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect ); + void draw( const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect ); /** Draw the sprite to the screen forcing the Blend Mode * @param Blend The Blend Mode */ - void Draw( const EE_BLEND_MODE& Blend ); + void draw( const EE_BLEND_MODE& Blend ); /** Draw the sprite to the screen forcing the Render Type * @param Effect The Render Type */ - void Draw( const EE_RENDER_MODE& Effect ); + void draw( const EE_RENDER_MODE& Effect ); - /** Set the number of repeations of the animation. Any number below 0 the animation will loop. */ - void SetRepeations( const int& Repeations ); + /** Set the number of repetitions of the animation. Any number below 0 the animation will loop. */ + void setRepetitions( const int& Repeations ); /** Set if the class auto-animate the sprite ( default it's active ) */ - void AutoAnimate( const bool& Autoanim ); + void autoAnimate( const bool& Autoanim ); /** @return If the class is auto-animated */ - bool AutoAnimate() const; + bool autoAnimate() const; /** @return The four vertex position of the Sprite */ - Quad2f GetQuad(); + Quad2f getQuad(); /** @return The Offset of the current frame */ - Vector2i Offset(); + Vector2i offset(); /** Set the Offset of the current frame */ - void Offset( const Vector2i& offset ); + void offset( const Vector2i& offset ); /** Reverse the animation from last frame to first mFrames. */ - void ReverseAnim( const bool& Reverse ); + void reverseAnim( const bool& Reverse ); /** @return If the animation is reversed */ - bool ReverseAnim() const; + bool reverseAnim() const; /** @return The current last frame */ - unsigned int GetEndFrame(); + unsigned int getEndFrame(); /** @return The number of frames */ - Uint32 GetNumFrames(); + Uint32 getNumFrames(); /** Will set Reverse active and set the first frame as the last frame */ - void SetReverseFromStart(); + void setReverseFromStart(); /** @return The Current SubTexture */ - SubTexture * GetCurrentSubTexture(); + SubTexture * getCurrentSubTexture(); /** @return The SubTexture Frame from the current sub frame */ - SubTexture * GetSubTexture( const unsigned int& frame ); + SubTexture * getSubTexture( const unsigned int& frame ); /** @return The SubTexture Frame from the SubFrame */ - SubTexture * GetSubTexture( const unsigned int& frame, const unsigned int& SubFrame ); + SubTexture * getSubTexture( const unsigned int& frame, const unsigned int& SubFrame ); /** Start playing from ** @param GoTo Frame that goes from 1 to Number of Frames */ - void GoToAndPlay( Uint32 GoTo ); + void goToAndPlay( Uint32 GoTo ); /** Go to a frame and stop ** @param GoTo Frame that goes from 1 to Number of Frames */ - void GoToAndStop( Uint32 GoTo ); + void goToAndStop( Uint32 GoTo ); /** Animate to frame and when reach the frame stops */ - void AnimToFrameAndStop( Uint32 GoTo ); + void animToFrameAndStop( Uint32 GoTo ); /** Set the sprite events callback */ - void SetEventsCallback( const SpriteCallback& Cb, void * UserData = NULL ); + void setEventsCallback( const SpriteCallback& Cb, void * UserData = NULL ); /** Removes the current callback */ - void ClearCallback(); + void clearCallback(); /** Creates a copy of the current sprite and return it */ - Sprite * Copy(); + Sprite * copy(); /** Update the sprite animation */ - void Update( const Time& ElapsedTime ); + void update( const Time& ElapsedTime ); /** Update the sprite animation using the current elapsed time provided by Engine */ - void Update(); + void update(); /** Fire a User Event in the sprite */ - void FireEvent( const Uint32& Event ); + void fireEvent( const Uint32& Event ); protected: enum SpriteFlags { SPRITE_FLAG_AUTO_ANIM = ( 1 << 0 ), @@ -388,13 +388,13 @@ class EE_API Sprite { }; std::vector mFrames; - unsigned int FramePos(); + unsigned int framePos(); - void ClearFrame(); + void clearFrame(); - unsigned int GetFrame( const unsigned int& FrameNum ); + unsigned int getFrame( const unsigned int& FrameNum ); - unsigned int GetSubFrame( const unsigned int& SubFrame ); + unsigned int getSubFrame( const unsigned int& SubFrame ); }; }} diff --git a/include/eepp/graphics/subtexture.hpp b/include/eepp/graphics/subtexture.hpp index 695a00b4a..18682dc08 100644 --- a/include/eepp/graphics/subtexture.hpp +++ b/include/eepp/graphics/subtexture.hpp @@ -17,14 +17,14 @@ class EE_API SubTexture { * @param TexId The texture id * @param Name The texture name ( if any ) */ - SubTexture( const Uint32& TexId, const std::string& Name = "" ); + SubTexture( const Uint32& TexId, const std::string& getName = "" ); /** Creates a SubTexture of the indicated part of the texture. * @param TexId The texture id * @param SrcRect The texture part that will be used as the SubTexture. * @param Name The texture name ( if any ) */ - SubTexture( const Uint32& TexId, const Recti& SrcRect, const std::string& Name = "" ); + SubTexture( const Uint32& TexId, const Recti& srcRect, const std::string& getName = "" ); /** Creates a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -32,7 +32,7 @@ class EE_API SubTexture { * @param DestSize The destination size that the SubTexture will have when rendered. * @param Name The texture name ( if any ) */ - SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name = "" ); + SubTexture( const Uint32& TexId, const Recti& srcRect, const Sizef& destSize, const std::string& getName = "" ); /** Creates a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -41,108 +41,108 @@ class EE_API SubTexture { * @param Offset The offset that will be added to the position passed when any Draw call is used. * @param Name The texture name ( if any ) */ - SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name = "" ); + SubTexture( const Uint32& TexId, const Recti& srcRect, const Sizef& destSize, const Vector2i& offset, const std::string& getName = "" ); virtual ~SubTexture(); /** @return The SubTexture Id. The Id is the String::Hash of the SubTexture name. */ - const Uint32& Id() const; + const Uint32& getId() const; /** @return The SubTexture Name. */ - const std::string Name() const; + const std::string getName() const; /** Sets the SubTexture Name, it will also change the Id. */ - void Name( const std::string& name ); + void setName( const std::string& name ); /** @return The Texture Id that holds the SubTexture. */ - const Uint32& Texture(); + const Uint32& texture(); /** Set the Texture Id that holds the SubTexture. */ - void Texture( const Uint32& TexId ); + void texture( const Uint32& TexId ); /** @return The Texture sector that represents the SubTexture */ - const Recti& SrcRect() const; + const Recti& srcRect() const; /** Sets the Texture sector that represents the SubTexture */ - void SrcRect( const Recti& Rect ); + void srcRect( const Recti& Rect ); /** @return The Destination Size of the SubTexture. */ - const Sizef& DestSize() const; + const Sizef& destSize() const; /** Sets the Destination Size of the SubTexture. * The size can be different from the original size of the SubTexture. * For example if the SubTexture width is 32 pixels, by default the destination width is 32 pixels, but it can be changed to anything wanted. */ - void DestSize( const Sizef& destSize ); + void destSize( const Sizef& destSize ); /** @return The SubTexture default offset. The offset is added to the position passed when is drawed. */ - const Vector2i& Offset() const; + const Vector2i& offset() const; /** Set the SubTexture offset. */ - void Offset( const Vector2i& offset ); + void offset( const Vector2i& offset ); - void Draw( const Float& X, const Float& Y, const ColorA& Color = ColorA(), const Float& Angle = 0.f, const Vector2f& Scale = Vector2f::One, const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter) ); + void draw( const Float& X, const Float& Y, const ColorA& Color = ColorA(), const Float& Angle = 0.f, const Vector2f& Scale = Vector2f::One, const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter) ); - void Draw( const Float& X, const Float& Y, const Float& Angle, const Vector2f& Scale, const ColorA& Color0 = ColorA(), const ColorA& Color1 = ColorA(), const ColorA& Color2 = ColorA(), const ColorA& Color3 = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter) ); + void draw( const Float& X, const Float& Y, const Float& Angle, const Vector2f& Scale, const ColorA& Color0 = ColorA(), const ColorA& Color1 = ColorA(), const ColorA& Color2 = ColorA(), const ColorA& Color3 = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL, const EE_RENDER_MODE& Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter) ); - void Draw( const Quad2f Q, const Vector2f& Offset = Vector2f(), const Float& Angle = 0.f, const Vector2f& Scale = Vector2f::One, const ColorA& Color0 = ColorA(), const ColorA& Color1 = ColorA(), const ColorA& Color2 = ColorA(), const ColorA& Color3 = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); + void draw( const Quad2f Q, const Vector2f& offset = Vector2f(), const Float& Angle = 0.f, const Vector2f& Scale = Vector2f::One, const ColorA& Color0 = ColorA(), const ColorA& Color1 = ColorA(), const ColorA& Color2 = ColorA(), const ColorA& Color3 = ColorA(), const EE_BLEND_MODE& Blend = ALPHA_NORMAL ); /** @return The texture instance used by the SubTexture. */ - Graphics::Texture * GetTexture(); + Graphics::Texture * getTexture(); /** Replaces a color in the SubTexture ( needs Lock() ) */ - void ReplaceColor( ColorA ColorKey, ColorA NewColor ); + void replaceColor( ColorA ColorKey, ColorA NewColor ); /** Creates a mask from a color. */ - void CreateMaskFromColor( ColorA ColorKey, Uint8 Alpha ); + void createMaskFromColor( ColorA ColorKey, Uint8 Alpha ); /** Creates a mask from a color. */ - void CreateMaskFromColor( RGB ColorKey, Uint8 Alpha ); + void createMaskFromColor( RGB ColorKey, Uint8 Alpha ); /** Creates a copy of the alpha mask to memory from the texture loaded in VRAM. */ - void CacheAlphaMask(); + void cacheAlphaMask(); /** Creates a copy in memory from the texture loaded in VRAM. */ - void CacheColors(); + void cacheColors(); /** @return The alpha value that corresponds to the position indicated in the SubTexture. * If the SubTexture wasn't locked before this call, it will be locked automatically. */ - Uint8 GetAlphaAt( const Int32& X, const Int32& Y ); + Uint8 getAlphaAt( const Int32& X, const Int32& Y ); /** @return The color that corresponds to the position indicated in the SubTexture. * If the SubTexture wasn't locked before this call, it will be locked automatically. */ - ColorA GetColorAt( const Int32& X, const Int32& Y ); + ColorA getColorAt( const Int32& X, const Int32& Y ); /** @brief Set a color to the position indicated in the SubTexture. * If the SubTexture wasn't locked before this call, it will be locked automatically. */ - void SetColorAt( const Int32& X, const Int32& Y, const ColorA& Color ); + void setColorAt( const Int32& X, const Int32& Y, const ColorA& Color ); /** Deletes the texture buffer from memory ( not from VRAM ) if it was cached before ( using Lock() ). */ - void ClearCache(); + void clearCache(); /** @brief Locks the texture to be able to perform read/write operations. * @see Texture::Lock */ - Uint8 * Lock(); + Uint8 * lock(); /** @brief Unlocks the current texture locked. * @see Texture::Unlock */ - bool Unlock( const bool& KeepData = false, const bool& Modified = false ); + bool unlock( const bool& KeepData = false, const bool& Modified = false ); /** @return The SubTexture size in the texture. This is the source rect size. */ - Sizei RealSize(); + Sizei realSize(); /** @return This is the same as Destination Size but with the values rounded as integers. */ - Sizei Size(); + Sizei size(); /** @return A pixel pointer to the texture loaded in memory ( downloaded from VRAM doing Lock()/Unlock() ). */ - const Uint8* GetPixelsPtr(); + const Uint8* getPixelsPtr(); /** Saves the SubTexture to a file in the file format specified. * This will get the Texture from VRAM ( it will not work with OpenGL ES ) */ - bool SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ); + bool saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ); /** Sets the Destination Size as the Source Rect Size ( the real size of the SubTexture ). */ - void ResetDestSize(); + void resetDestSize(); protected: Uint8 * mPixels; Uint8 * mAlpha; @@ -154,7 +154,7 @@ class EE_API SubTexture { Sizef mDestSize; Vector2i mOffset; - void CreateUnnamed(); + void createUnnamed(); }; }} diff --git a/include/eepp/graphics/textcache.hpp b/include/eepp/graphics/textcache.hpp index a71e3ec08..a30b1d98f 100644 --- a/include/eepp/graphics/textcache.hpp +++ b/include/eepp/graphics/textcache.hpp @@ -19,72 +19,72 @@ class EE_API TextCache { ~TextCache(); /** Create a text from a font */ - void Create( Graphics::Font * font, const String& text = "", ColorA FontColor = ColorA(255,255,255,255), ColorA FontShadowColor = ColorA(0,0,0,255) ); + void create( Graphics::Font * font, const String& text = "", ColorA FontColor = ColorA(255,255,255,255), ColorA FontShadowColor = ColorA(0,0,0,255) ); /** @return The font used for the text cache */ - Graphics::Font * Font() const; + Graphics::Font * font() const; /** Change the font used for the text cache */ - void Font( Graphics::Font * font ); + void font( Graphics::Font * font ); /** @return The text cached */ - String& Text(); + String& text(); /** Set the text to be cached */ - void Text( const String& text ); + void text( const String& text ); /** @return The cached text width */ - Float GetTextWidth(); + Float getTextWidth(); /** @return The cached text height */ - Float GetTextHeight(); + Float getTextHeight(); /** @return Every cached text line width */ - const std::vector& LinesWidth(); + const std::vector& linesWidth(); /** @return The vertex coordinates cached */ - std::vector& VertextCoords(); + std::vector& vertextCoords(); /** @return The text colors cached */ - std::vector& Colors(); + std::vector& colors(); /** Draw the cached text on screen */ - void Draw( const Float& X, const Float& Y, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, EE_BLEND_MODE Effect = ALPHA_NORMAL ); + void draw( const Float& X, const Float& Y, const Vector2f& Scale = Vector2f::One, const Float& Angle = 0, EE_BLEND_MODE Effect = ALPHA_NORMAL ); /** @return The Font Color */ - const ColorA& Color() const; + const ColorA& color() const; /** Set the color of the string rendered */ - void Color(const ColorA& color); + void color(const ColorA& color); /** @see Set the alpha of each individual character. ** This doesn't break any custom color per-character setted. */ - void Alpha( const Uint8& alpha ); + void alpha( const Uint8& alpha ); /** Set the color of the substring * @param color The color * @param from The first char to change the color * @param to The last char to change the color */ - void Color(const ColorA& color, Uint32 from, Uint32 to ); + void color(const ColorA& color, Uint32 from, Uint32 to ); /** @return The Shadow Font Color */ - const ColorA& ShadowColor() const; + const ColorA& shadowColor() const; /** Set the shadow color of the string rendered */ - void ShadowColor(const ColorA& color); + void shadowColor(const ColorA& color); /** @return The number of lines that the cached text contains */ - const int& GetNumLines() const; + const int& getNumLines() const; /** Set the font draw flags */ - void Flags( const Uint32& flags ); + void flags( const Uint32& flags ); /** @return The font draw flags */ - const Uint32& Flags() const; + const Uint32& flags() const; /** Force to cache the width of the current text */ - void Cache(); + void cache(); protected: friend class Font; @@ -107,15 +107,15 @@ class EE_API TextCache { std::vector mRenderCoords; std::vector mColors; - void UpdateCoords(); + void updateCoords(); - const bool& CachedCoords() const; + const bool& cachedCoords() const; - void CachedCoords( const bool& cached ); + void cachedCoords( const bool& cached ); - const unsigned int& CachedVerts() const; + const unsigned int& cachedVerts() const; - void CachedVerts( const unsigned int& num ); + void cachedVerts( const unsigned int& num ); }; }} diff --git a/include/eepp/graphics/texture.hpp b/include/eepp/graphics/texture.hpp index 4b0396b4c..0bff10cf9 100755 --- a/include/eepp/graphics/texture.hpp +++ b/include/eepp/graphics/texture.hpp @@ -12,78 +12,78 @@ namespace EE { namespace Graphics { class EE_API Texture : public Image, private NonCopyable { public: /** Set the OpenGL Texture Id (texture handle) */ - void Handle( const int& texture ) { mTexture = texture; } + void handle( const int& texture ) { mTexture = texture; } /** @return The OpenGL Texture Id (texture handle) */ - int Handle() const { return mTexture; } + int handle() const { return mTexture; } /** @return The hash of the filename */ - const Uint32& HashName() const; + const Uint32& hashName() const; /** Set the Texture File Path */ - void Filepath( const std::string& filepath ) { mFilepath = filepath; } + void filepath( const std::string& filepath ) { mFilepath = filepath; } /** @return The Texture File Path */ - std::string Filepath() const { return mFilepath; } + std::string filepath() const { return mFilepath; } /** @return The Image Width */ - unsigned int ImgWidth() const { return mImgWidth; } + unsigned int imgWidth() const { return mImgWidth; } /** @return The Image Height */ - unsigned int ImgHeight() const { return mImgHeight; } + unsigned int imgHeight() const { return mImgHeight; } /** Set if the Texture use Mipmaps */ - void Mipmap( const bool& UseMipmap ); + void mipmap( const bool& UseMipmap ); /** @return If the texture use Mipmaps */ - bool Mipmap() const; + bool mipmap() const; /** Set the Texture Clamp Mode */ - void ClampMode( const EE_CLAMP_MODE& clampmode ); + void clampMode( const EE_CLAMP_MODE& clampmode ); /** @return The Texture Clamp Mode */ - EE_CLAMP_MODE ClampMode() const { return mClampMode; } + EE_CLAMP_MODE clampMode() const { return mClampMode; } /** Lock the Texture for direct access. ** It is needed to have any read/write access to the texture. This feature is not supported in OpenGL ES. */ - Uint8 * Lock( const bool& ForceRGBA = false ); + Uint8 * lock( const bool& ForceRGBA = false ); /** @brief Unlock the previously locked Texture. * Unlocking the texture will upload the local copy of the texture ( that could have been modified ) to the GPU. * @param KeepData If true keeps the local copy of the texture un memory, otherwise it will be released. * @param Modified The flag indicates of the texture was modified between the Lock and Unlock calls. This is to force reloading the texture from memory to VRAM. In the case that the texture in ram was modified using the Texture methods to do this, it will already know that this is true, so it will upload the changes to the GPU. */ - bool Unlock(const bool& KeepData = false, const bool& Modified = false); + bool unlock(const bool& KeepData = false, const bool& Modified = false); /** @return A pointer to the first pixel of the texture ( keeped with a local copy ). \n You must have a copy of the texture on local memory. For that you need to Lock the texture first. */ - const Uint8* GetPixelsPtr(); + const Uint8* getPixelsPtr(); /** Set the Texture Filter Mode */ - void Filter( const EE_TEX_FILTER& filter ); + void filter( const EE_TEX_FILTER& filter ); /** @return The texture filter used by the texture */ - const EE_TEX_FILTER& Filter() const; + const EE_TEX_FILTER& filter() const; /** Save the Texture to a new File */ - bool SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ); + bool saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ); /** Replace a color on the texture */ - void ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor); + void replaceColor( const ColorA& ColorKey, const ColorA& NewColor); /** Create an Alpha mask from a Color */ - void CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ); + void createMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ); /** Fill a texture with a color */ - void FillWithColor( const ColorA& Color ); + void fillWithColor( const ColorA& Color ); /** Resize the texture */ - void Resize( const Uint32& newWidth, const Uint32& newHeight, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); + void resize( const Uint32& newWidth, const Uint32& newHeight, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); /** Scale the texture */ - void Scale( const Float& scale, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); + void scale( const Float& scale, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); /** Copy an image inside the texture */ - void CopyImage( Image * image, const Uint32& x, const Uint32& y ); + void copyImage( Image * image, const Uint32& x, const Uint32& y ); /** @brief Update a part of the texture from an array of pixels ** The size of the @a pixel array must match the @a width and @@ -99,7 +99,7 @@ class EE_API Texture : public Image, private NonCopyable { ** @param x X offset in the texture where to copy the source pixels ** @param y Y offset in the texture where to copy the source pixels ** @param pf The pixel format of the @a pixel */ - void Update( const Uint8* pixels, Uint32 width, Uint32 height, Uint32 x = 0, Uint32 y = 0, EE_PIXEL_FORMAT pf = PF_RGBA ); + void update( const Uint8* pixels, Uint32 width, Uint32 height, Uint32 x = 0, Uint32 y = 0, EE_PIXEL_FORMAT pf = PF_RGBA ); /** @brief Update the whole texture from an array of pixels ** The @a pixel array is assumed to have the same size as @@ -110,7 +110,7 @@ class EE_API Texture : public Image, private NonCopyable { ** This function does nothing if @a pixels is null or if the ** texture was not previously created. ** @param pixels Array of pixels to copy to the texture */ - void Update( const Uint8* pixels ); + void update( const Uint8* pixels ); /** @brief Update a part of the texture from an image ** The pixel format is automatically detected @@ -122,25 +122,25 @@ class EE_API Texture : public Image, private NonCopyable { ** @param image Image to copy to the texture ** @param x X offset in the texture where to copy the source image ** @param y Y offset in the texture where to copy the source image */ - void Update( Image * image, Uint32 x = 0, Uint32 y = 0 ); + void update( Image * image, Uint32 x = 0, Uint32 y = 0 ); /** Flip the texture ( rotate the texture 90º ). Warning: This is flipped in memory, a real flipping. */ - void Flip(); + void flip(); /** @return If the Texture has a copy on the local memory */ - bool LocalCopy(); + bool localCopy(); /** Unload the Texture from Memory */ - void DeleteTexture(); + void deleteTexture(); /** Set if the Texture is Grabed */ - void Grabed( const bool& isGrabed ); + void grabed( const bool& isGrabed ); /** @return If the texture is Grabed */ - bool Grabed() const; + bool grabed() const; /** @return If the texture was compressed on load (DXT compression) */ - bool IsCompressed() const; + bool isCompressed() const; /** Render the texture on screen ( with less internal mess, a little bit faster way ) * @param x The x position on screen @@ -152,7 +152,7 @@ class EE_API Texture : public Image, private NonCopyable { * @param width The width of the texture rendered * @param height The height of the texture rendered */ - void DrawFast( const Float& x, const Float& y, const Float& Angle = 0.0f, const Vector2f& Scale = Vector2f::One, const ColorA& Color = ColorA(), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Float &width = 0, const Float &height = 0 ); + void drawFast( const Float& x, const Float& y, const Float& Angle = 0.0f, const Vector2f& scale = Vector2f::One, const ColorA& Color = ColorA(), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Float &width = 0, const Float &height = 0 ); /** Render the texture on screen * @param x The x position on screen @@ -165,7 +165,7 @@ class EE_API Texture : public Image, private NonCopyable { * @param Center The rotation and scaling center. The center point is relative to the top-left corner of the object. * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void Draw( const Float &x, const Float &y, const Float &Angle = 0, const Vector2f &Scale = Vector2f::One, const ColorA& Color = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); + void draw( const Float &x, const Float &y, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const ColorA& Color = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); /** Render the texture on screen. Extended because can set the vertex colors individually * @param x The x position on screen @@ -183,7 +183,7 @@ class EE_API Texture : public Image, private NonCopyable { * @param Center The rotation and scaling center. The center point is relative to the top-left corner of the object. * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void DrawEx( Float x, Float y, Float width = 0.0f, Float height = 0.0f, const Float &Angle = 0, const Vector2f &Scale = Vector2f::One, const ColorA& Color0 = ColorA(255,255,255,255), const ColorA& Color1 = ColorA(255,255,255,255), const ColorA& Color2 = ColorA(255,255,255,255), const ColorA& Color3 = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); + void drawEx( Float x, Float y, Float width = 0.0f, Float height = 0.0f, const Float &Angle = 0, const Vector2f &scale = Vector2f::One, const ColorA& Color0 = ColorA(255,255,255,255), const ColorA& Color1 = ColorA(255,255,255,255), const ColorA& Color2 = ColorA(255,255,255,255), const ColorA& Color3 = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const EE_RENDER_MODE &Effect = RN_NORMAL, OriginPoint Center = OriginPoint(OriginPoint::OriginCenter), const Recti& texSector = Recti(0,0,0,0) ); /** Render a quad on Screen * @param Q The Quad2f @@ -194,7 +194,7 @@ class EE_API Texture : public Image, private NonCopyable { * @param Blend Set the Blend Mode ( default ALPHA_NORMAL ) * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void DrawQuad( const Quad2f& Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &Scale = Vector2f::One, const ColorA& Color = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Recti& texSector = Recti(0,0,0,0) ); + void drawQuad( const Quad2f& Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const ColorA& Color = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, const Recti& texSector = Recti(0,0,0,0) ); /** Render a quad on Screen * @param Q The Quad2f @@ -208,22 +208,22 @@ class EE_API Texture : public Image, private NonCopyable { * @param Blend Set the Blend Mode ( default ALPHA_NORMAL ) * @param texSector The texture sector to render. You can render only a part of the texture. ( default render all the texture ) */ - void DrawQuadEx( Quad2f Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &Scale = Vector2f::One, const ColorA& Color0 = ColorA(255,255,255,255), const ColorA& Color1 = ColorA(255,255,255,255), const ColorA& Color2 = ColorA(255,255,255,255), const ColorA& Color3 = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, Recti texSector = Recti(0,0,0,0) ); + void drawQuadEx( Quad2f Q, const Vector2f& Offset = Vector2f(), const Float &Angle = 0.0f, const Vector2f &scale = Vector2f::One, const ColorA& Color0 = ColorA(255,255,255,255), const ColorA& Color1 = ColorA(255,255,255,255), const ColorA& Color2 = ColorA(255,255,255,255), const ColorA& Color3 = ColorA(255,255,255,255), const EE_BLEND_MODE &Blend = ALPHA_NORMAL, Recti texSector = Recti(0,0,0,0) ); /** Set the texture factory internal id of the texture */ - void Id( const Uint32& id ); + void setId( const Uint32& id ); /** @return The texture factory internal id of the texture */ - const Uint32& Id() const; + const Uint32& getId() const; /** Reload the texture from the current local copy. */ - void Reload(); + void reload(); /** Set a pixel to the locked texture. */ - void SetPixel( const unsigned int& x, const unsigned int& y, const ColorA& Color ); + void setPixel( const unsigned int& x, const unsigned int& y, const ColorA& Color ); /** Bind the texture. Activate the texture for rendering. */ - void Bind(); + void bind(); virtual ~Texture(); protected: @@ -240,11 +240,11 @@ class EE_API Texture : public Image, private NonCopyable { Texture(); - Texture( const Uint32& texture, const unsigned int& width, const unsigned int& height, const unsigned int& imgwidth, const unsigned int& imgheight, const bool& UseMipmap, const unsigned int& Channels, const std::string& filepath, const EE_CLAMP_MODE& ClampMode, const bool& CompressedTexture, const Uint32& MemSize = 0, const Uint8* data = NULL ); + Texture( const Uint32& texture, const unsigned int& width, const unsigned int& height, const unsigned int& imgwidth, const unsigned int& imgheight, const bool& UseMipmap, const unsigned int& channels, const std::string& filepath, const EE_CLAMP_MODE& clampMode, const bool& CompressedTexture, const Uint32& memSize = 0, const Uint8* data = NULL ); - Texture( const Texture& Copy ); + Texture( const Texture& copy ); - void Create( const Uint32& texture, const unsigned int& width, const unsigned int& height, const unsigned int& imgwidth, const unsigned int& imgheight, const bool& UseMipmap, const unsigned int& Channels, const std::string& filepath, const EE_CLAMP_MODE& ClampMode, const bool& CompressedTexture, const Uint32& MemSize = 0, const Uint8* data = NULL ); + void create( const Uint32& texture, const unsigned int& width, const unsigned int& height, const unsigned int& imgwidth, const unsigned int& imgheight, const bool& UseMipmap, const unsigned int& channels, const std::string& filepath, const EE_CLAMP_MODE& clampMode, const bool& CompressedTexture, const Uint32& memSize = 0, const Uint8* data = NULL ); std::string mFilepath; @@ -262,7 +262,7 @@ class EE_API Texture : public Image, private NonCopyable { int mInternalFormat; - void ApplyClampMode(); + void applyClampMode(); Uint8 * iLock( const bool& ForceRGBA, const bool& KeepFormat ); diff --git a/include/eepp/graphics/textureatlas.hpp b/include/eepp/graphics/textureatlas.hpp index 39a764bfd..6e6e69131 100644 --- a/include/eepp/graphics/textureatlas.hpp +++ b/include/eepp/graphics/textureatlas.hpp @@ -23,14 +23,14 @@ class EE_API TextureAtlas : public ResourceManager { * @param TexId The texture id * @param Name The texture name ( if any ) */ - SubTexture * add( const Uint32& TexId, const std::string& Name = "" ); + SubTexture * add( const Uint32& TexId, const std::string& getName = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id * @param SrcRect The texture part that will be used as the SubTexture. * @param Name The texture name ( if any ) */ - SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name = "" ); + SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const std::string& getName = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -38,7 +38,7 @@ class EE_API TextureAtlas : public ResourceManager { * @param DestSize The destination size that the SubTexture will have when rendered. * @param Name The texture name ( if any ) */ - SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name = "" ); + SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& getName = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -47,22 +47,22 @@ class EE_API TextureAtlas : public ResourceManager { * @param Offset The offset that will be added to the position passed when any Draw call is used. * @param Name The texture name ( if any ) */ - SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name = "" ); + SubTexture * add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& getName = "" ); /** @return The texture atlas name. */ - const std::string& Name() const; + const std::string& getName() const; /** Sets the texture atlas name. */ - void Name( const std::string& name ); + void setName( const std::string& name ); /** @return The texture atlas path. */ - const std::string& Path() const; + const std::string& path() const; /** Sets the texture atlas path. */ - void Path( const std::string& path ); + void path( const std::string& path ); /** @return The texture atlas Id. The Id is the String::Hash of the texture atlas name. */ - const Uint32& Id() const; + const Uint32& getId() const; /** @return The number of SubTextures inside the texture atlas. */ Uint32 count(); @@ -73,10 +73,10 @@ class EE_API TextureAtlas : public ResourceManager { * The texture atlases loaded from a file always will be linked to a texture. \n * The Global Texture Atlas for example doesn't have any texture linked to it. */ - Texture * GetTexture( const Uint32& texnum = 0 ) const; + Texture * getTexture( const Uint32& texnum = 0 ) const; /** @return The number of textures linked to the texture atlas. */ - Uint32 GetTexturesCount(); + Uint32 getTexturesCount(); protected: friend class TextureAtlasLoader; @@ -85,7 +85,7 @@ class EE_API TextureAtlas : public ResourceManager { std::string mPath; std::vector mTextures; - void SetTextures( std::vector textures ); + void setTextures( std::vector textures ); }; }} diff --git a/include/eepp/graphics/textureatlasloader.hpp b/include/eepp/graphics/textureatlasloader.hpp index 1a5b3f754..e6d9d924e 100644 --- a/include/eepp/graphics/textureatlasloader.hpp +++ b/include/eepp/graphics/textureatlasloader.hpp @@ -28,7 +28,7 @@ class EE_API TextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - TextureAtlasLoader( const std::string& TextureAtlasPath, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); + TextureAtlasLoader( const std::string& TextureAtlasPath, const bool& threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); /** Loads a texture atlas from memory. * If the loader is not threaded, it will load the atlas immediately. @@ -38,7 +38,7 @@ class EE_API TextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - TextureAtlasLoader( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); + TextureAtlasLoader( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName, const bool& threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); /** Loads a texture atlas from a pack file. * If the loader is not threaded, it will load the atlas immediately. @@ -47,7 +47,7 @@ class EE_API TextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - TextureAtlasLoader( Pack * Pack, const std::string& FilePackPath, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); + TextureAtlasLoader( Pack * Pack, const std::string& FilePackPath, const bool& threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); /** Loads a texture atlas from a io stream. * If the loader is not threaded, it will load the atlas immediately. @@ -55,24 +55,24 @@ class EE_API TextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - TextureAtlasLoader( IOStream& IOS, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); + TextureAtlasLoader( IOStream& IOS, const bool& threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); ~TextureAtlasLoader(); /** In the case that the loader is threaded, to know if the texture atlas was loaded, the main thread must call Update to update the state of the load. And finish the job. */ - void Update(); + void update(); /** Loads a texture atlas from its path ( the texture atlas binary is expected, not the texture, the ".eta" file ). * If the loader is not threaded, it will load the atlas immediately. * @param TextureAtlasPath The texture atlas path. */ - void Load( const std::string& TextureAtlasPath = "" ); + void load( const std::string& TextureAtlasPath = "" ); /** Loads a texture atlas from a io stream. * If the loader is not threaded, it will load the atlas immediately. * @param IOS The io stream to use for the loading. */ - void LoadFromStream( IOStream& IOS ); + void loadFromStream( IOStream& IOS ); /** Loads a texture atlas from memory. * If the loader is not threaded, it will load the atlas immediately. @@ -80,48 +80,48 @@ class EE_API TextureAtlasLoader { * @param DataSize The texture atlas buffer pointer size * @param TextureAtlasName Since the texture atlas is loaded from memory, the name can't be obtained from the file name. So it needs to be indicated manually. */ - void LoadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ); + void loadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ); /** Loads a texture atlas from a pack file. * If the loader is not threaded, it will load the atlas immediately. * @param Pack The pointer of the pack instance to be used to load the file. * @param FilePackPath The path of the file inside the pack. */ - void LoadFromPack( Pack * Pack, const std::string& FilePackPath ); + void loadFromPack( Pack * Pack, const std::string& FilePackPath ); /** @return If the loader is threaded ( asynchronous ). */ - bool Threaded() const; + bool threaded() const; /** If threaded is true sets the loader as asynchronous. This must be called before the loading is done. */ - void Threaded( const bool& threaded ); + void threaded( const bool& threaded ); /** @return True if the texture atlas is loaded. */ - const bool& IsLoaded() const; + const bool& isLoaded() const; /** @return True if the texture atlas is loading. */ - const bool& IsLoading() const; + const bool& isLoading() const; /** @brief The function will check if the texture atlas is updated. Checks if all the images inside the images path are inside the texture atlas, and if they have the same date and size, otherwise it will recreate or update the texture atlas. */ - bool UpdateTextureAtlas( std::string TextureAtlasPath, std::string ImagesPath ); + bool updateTextureAtlas( std::string TextureAtlasPath, std::string ImagesPath ); /** Rewrites the texture atlas file. Usefull if the SubTextures where modified and need to be updated inside the texture atlas. */ - bool UpdateTextureAtlas(); + bool updateTextureAtlas(); /** @return The texture that corresponds to the texture atlas. * @param texnum The texture index. A texture atlas can use more than one texture, so it can be 0 to GetTexturesLoadedCount(). Usually a texture atlas corresponds to only one texture, so the texture index is 0. */ - Texture * GetTexture( const Uint32& texnum = 0 ) const; + Texture * getTexture( const Uint32& texnum = 0 ) const; /** @return The number of textures linked to the texture atlas. */ - Uint32 GetTexturesLoadedCount(); + Uint32 getTexturesLoadedCount(); /** @return The texture atlas instance pointer ( NULL if the atlas isn't loaded yet ). */ - TextureAtlas * GetTextureAtlas() const; + TextureAtlas * getTextureAtlas() const; /** Sets a load notification callback. */ - void SetLoadCallback( GLLoadCallback LoadCallback ); + void setLoadCallback( GLLoadCallback LoadCallback ); protected: ResourceLoader mRL; std::string mTextureAtlasPath; @@ -142,7 +142,7 @@ class EE_API TextureAtlasLoader { sTextureAtlasHdr mTexGrHdr; std::vector mTempAtlass; - void CreateSubTextures(); + void createSubTextures(); }; }} diff --git a/include/eepp/graphics/textureatlasmanager.hpp b/include/eepp/graphics/textureatlasmanager.hpp index c1370f15d..cb2f3a0bc 100644 --- a/include/eepp/graphics/textureatlasmanager.hpp +++ b/include/eepp/graphics/textureatlasmanager.hpp @@ -16,24 +16,24 @@ class EE_API TextureAtlasManager : public ResourceManager { virtual ~TextureAtlasManager(); /** Loads a texture atlas from its path ( the texture atlas binary is expected, not the texture, the ".eta" file ). */ - TextureAtlas * Load( const std::string& TextureAtlasPath ); + TextureAtlas * load( const std::string& TextureAtlasPath ); /** Loads a texture atlas from a io stream. */ - TextureAtlas * LoadFromStream( IOStream& IOS ); + TextureAtlas * loadFromStream( IOStream& IOS ); /** Loads a texture atlas from memory. */ - TextureAtlas * LoadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ); + TextureAtlas * loadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ); /** Loads a texture atlas from a pack file. */ - TextureAtlas * LoadFromPack( Pack * Pack, const std::string& FilePackPath ); + TextureAtlas * loadFromPack( Pack * Pack, const std::string& FilePackPath ); /** It will search for a SubTexture Name in the texture atlases loaded. * @return The first SubTexture found with the given name in any atlas. */ - SubTexture * GetSubTextureByName( const std::string& Name ); + SubTexture * getSubTextureByName( const std::string& Name ); /** It will search for a SubTexture Id in the texture atlases loaded. * @return The first SubTexture found with the given id in any atlas. */ - SubTexture * GetSubTextureById( const Uint32& Id ); + SubTexture * getSubTextureById( const Uint32& Id ); /** Search for a pattern name * For example search for name "car" with extensions "png", i will try to find car00.png car01.png car02.png, and so on, it will continue if find something, otherwise it will stop ( it will always search at least for car00.png and car01.png ) @@ -42,22 +42,22 @@ class EE_API TextureAtlasManager : public ResourceManager { * @param SearchInTextureAtlas If you want only to search in a especific atlas ( NULL if you want to search in all atlases ) * @note Texture atlases saves the SubTextures names without extension by default. */ - std::vector GetSubTexturesByPattern( const std::string& name, const std::string& extension = "", TextureAtlas * SearchInTextureAtlas = NULL ); + std::vector getSubTexturesByPattern( const std::string& name, const std::string& extension = "", TextureAtlas * SearchInTextureAtlas = NULL ); /** Search for a pattern id. * This will look for the SubTexture with the id passed, and it will try to find any pattern by the SubTexture name. * @see GetSubTexturesByPattern */ - std::vector GetSubTexturesByPatternId( const Uint32& SubTextureId, const std::string& extension = "", TextureAtlas * SearchInTextureAtlas = NULL ); + std::vector getSubTexturesByPatternId( const Uint32& SubTextureId, const std::string& extension = "", TextureAtlas * SearchInTextureAtlas = NULL ); /** Prints all the resources name to the screen. */ - void PrintResources(); + void printResources(); /** Sets if the warnings for not finding a resource must be printed in screen. */ - void PrintWarnings( const bool& warn ); + void printWarnings( const bool& warn ); /** @return If warnings are being printed. */ - const bool& PrintWarnings() const; + const bool& printWarnings() const; protected: bool mWarnings; diff --git a/include/eepp/graphics/texturefactory.hpp b/include/eepp/graphics/texturefactory.hpp index 652fc7669..f176ff3ac 100755 --- a/include/eepp/graphics/texturefactory.hpp +++ b/include/eepp/graphics/texturefactory.hpp @@ -24,7 +24,7 @@ class EE_API TextureFactory : protected Mutex { * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @return Internal Texture Id */ - Uint32 CreateEmptyTexture( const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels = 4, const ColorA& DefaultColor = ColorA(0,0,0,255), const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + Uint32 createEmptyTexture( const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels = 4, const ColorA& DefaultColor = ColorA(0,0,0,255), const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Loads a RAW Texture from Memory * @param Pixels The Texture array @@ -38,7 +38,7 @@ class EE_API TextureFactory : protected Mutex { * @param FileName A filename to recognize the texture ( the path in case that was loaded from outside the texture factory ). * @return Internal Texture Id */ - Uint32 LoadFromPixels( const unsigned char * Pixels, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false, const std::string& FileName = std::string("") ); + Uint32 loadFromPixels( const unsigned char * Pixels, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false, const std::string& FileName = std::string("") ); /** Load a texture from Pack file * @param Pack Pointer to the pack instance @@ -49,7 +49,7 @@ class EE_API TextureFactory : protected Mutex { * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @return Internal Texture Id */ - Uint32 LoadFromPack( Pack* Pack, const std::string& FilePackPath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + Uint32 loadFromPack( Pack* Pack, const std::string& FilePackPath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Load a texture from memory * @param ImagePtr The image data in RAM just as if it were still in a file @@ -60,7 +60,7 @@ class EE_API TextureFactory : protected Mutex { * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @return The internal Texture Id */ - Uint32 LoadFromMemory( const unsigned char* ImagePtr, const unsigned int& Size, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + Uint32 loadFromMemory( const unsigned char* ImagePtr, const unsigned int& Size, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Load a Texture from stream * @param Stream The IOStream instance @@ -70,7 +70,7 @@ class EE_API TextureFactory : protected Mutex { * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @return The internal Texture Id */ - Uint32 LoadFromStream( IOStream& Stream, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + Uint32 loadFromStream( IOStream& Stream, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Load a Texture from a file path * @param Filepath The path for the texture @@ -80,87 +80,87 @@ class EE_API TextureFactory : protected Mutex { * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @return The internal Texture Id */ - Uint32 Load( const std::string& Filepath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + Uint32 load( const std::string& Filepath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Remove and Unload the Texture Id * @param TexId * @return True if was removed */ - bool Remove( Uint32 TexId ); + bool remove( Uint32 TexId ); /** Reload all loaded textures to recover the OpenGL context */ - void ReloadAllTextures(); + void reloadAllTextures(); /** Bind the the internal Texture Id indicated. This is useful if you are rendering a texture outside this class. * @param TexId The internal Texture Id * @param TextureUnit The Texture Unit binded */ - void Bind( const Uint32& TexId, const Uint32& TextureUnit = 0 ); + void bind( const Uint32& TexId, const Uint32& TextureUnit = 0 ); /** Bind the the Texture indicated. This is useful if you are rendering a texture outside this class. * @param Tex The Texture Pointer * @param TextureUnit The Texture Unit binded */ - void Bind( const Texture* Tex, const Uint32& TextureUnit = 0 ); + void bind( const Texture* Tex, const Uint32& TextureUnit = 0 ); /** * @param TexId The internal Texture Id * @return The OpenGL Texture Id (texture handler) */ - Uint32 GetTextureId( const Uint32& TexId ); + Uint32 getTextureId( const Uint32& TexId ); /** * @return The real current texture id (OpenGL Texture Id) * @param TextureUnit The Texture Unit binded */ - int GetCurrentTexture( const Uint32& TextureUnit = 0 ) const; + int getCurrentTexture( const Uint32& TextureUnit = 0 ) const; /** Set the current internal texture id. This will set the TexId as the current texture binded. * @param TexId The real current texture id (OpenGL Texture Id) * @param TextureUnit The Texture Unit binded */ - void SetCurrentTexture( const int& TexId, const Uint32& TextureUnit ); + void setCurrentTexture( const int& TexId, const Uint32& TextureUnit ); /** Returns the number of textures loaded */ - Uint32 GetNumTextures() const { return (Uint32)mTextures.size(); } + Uint32 getNumTextures() const { return (Uint32)mTextures.size(); } /** Set the texture enviroment * @param Param The texture param * @param Val The EE_TEXTURE_OP or EE_TEXTURE_FUNC or EE_TEXTURE_SOURCE */ - void SetTextureEnv( const EE_TEXTURE_PARAM& Param, const Int32& Val ); + void setTextureEnv( const EE_TEXTURE_PARAM& Param, const Int32& Val ); /** Active a texture unit */ - void SetActiveTextureUnit( const Uint32& Unit ); + void setActiveTextureUnit( const Uint32& Unit ); /** * @param Size * @return A valid texture size for the video card (checks if support non power of two textures) */ - unsigned int GetValidTextureSize( const unsigned int& Size ); + unsigned int getValidTextureSize( const unsigned int& Size ); /** Saves an image from an array of unsigned chars to disk * @return False if failed, otherwise returns True */ - bool SaveImage( const std::string& filepath, const EE_SAVE_TYPE& Format, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const unsigned char* data ); + bool saveImage( const std::string& filepath, const EE_SAVE_TYPE& Format, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const unsigned char* data ); /** Determine if the TextureId passed exists */ - bool TextureIdExists( const Uint32& TexId ); + bool textureIdExists( const Uint32& TexId ); /** @return A pointer to the Texture */ - Texture* GetTexture( const Uint32& TexId ); + Texture* getTexture( const Uint32& TexId ); /** Get a local copy for all the textures */ - void GrabTextures(); + void grabTextures(); /** Reload all the grabed textures */ - void UngrabTextures(); + void ungrabTextures(); /** Allocate space for Textures (only works if EE_ALLOC_TEXTURES_ON_VECTOR is defined) */ - void Allocate( const unsigned int& size ); + void allocate( const unsigned int& size ); /** @return The memory used by the textures (in bytes) */ - unsigned int MemorySize() { return mMemSize; } + unsigned int memorySize() { return mMemSize; } /** It's possible to create textures outside the texture factory loader, but the library will need to know of this texture, so it's necessary to push the texture to the factory. * @param Filepath The Texture path ( if exists ) @@ -176,19 +176,19 @@ class EE_API TextureFactory : protected Mutex { * @param LocalCopy If keep a local copy in memory of the texture * @param MemSize The size of the texture in memory ( just if you need to specify the real size in memory, just useful to calculate the total texture memory ). */ - Uint32 PushTexture( const std::string& Filepath, const Uint32& TexId, const unsigned int& Width, const unsigned int& Height, const unsigned int& ImgWidth, const unsigned int& ImgHeight, const bool& Mipmap, const unsigned int& Channels, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& LocalCopy = false, const Uint32& MemSize = 0 ); + Uint32 pushTexture( const std::string& Filepath, const Uint32& TexId, const unsigned int& Width, const unsigned int& Height, const unsigned int& ImgWidth, const unsigned int& ImgHeight, const bool& Mipmap, const unsigned int& Channels, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& LocalCopy = false, const Uint32& MemSize = 0 ); /** Return a texture by it file path name * @param Name File path name * @return The texture, NULL if not exists. */ - Texture * GetByName( const std::string& Name ); + Texture * getByName( const std::string& Name ); /** Return a texture by it hash path name * @param Hash The file path hash * @return The texture, NULL if not exists */ - Texture * GetByHash( const Uint32& Hash ); + Texture * getByHash( const Uint32& Hash ); ~TextureFactory(); protected: @@ -206,15 +206,15 @@ class EE_API TextureFactory : protected Mutex { std::list mVectorFreeSlots; - void UnloadTextures(); + void unloadTextures(); - Uint32 FindFreeSlot(); + Uint32 findFreeSlot(); bool mErasing; - const bool& IsErasing() const; + const bool& isErasing() const; - void RemoveReference( Texture * Tex ); + void removeReference( Texture * Tex ); }; }} diff --git a/include/eepp/graphics/texturefont.hpp b/include/eepp/graphics/texturefont.hpp index 61c59d61d..092d86cb3 100755 --- a/include/eepp/graphics/texturefont.hpp +++ b/include/eepp/graphics/texturefont.hpp @@ -13,7 +13,7 @@ class EE_API TextureFont : public Font { /** Creates an instance of a texture font */ static TextureFont * New( const std::string FontName ); - /** The destructor will not unload the texture from memory. If you want that you'll have to remove it manually ( TextureFactory::instance()->Remove( MyFontInstance->GetTexId() ) ). */ + /** The destructor will not unload the texture from memory. If you want that you'll have to remove it manually ( TextureFactory::instance()->remove( MyFontInstance->GetTexId() ) ). */ virtual ~TextureFont(); /** Load's a texture font @@ -25,14 +25,14 @@ class EE_API TextureFont : public Font { * @param NumChars The number of characters to read from the texture * @return True if success */ - bool Load( const Uint32& TexId, const unsigned int& StartChar = 0, const unsigned int& Spacing = 0, const unsigned int& TexColumns = 16, const unsigned int& TexRows = 16, const Uint16& NumChars = 256 ); + bool load( const Uint32& TexId, const unsigned int& StartChar = 0, const unsigned int& Spacing = 0, const unsigned int& TexColumns = 16, const unsigned int& TexRows = 16, const Uint16& NumChars = 256 ); /** Load's a texture font and then load's the character coordinates file ( generated by the TTFFont class ) * @param TexId The texture id returned by TextureFactory * @param CoordinatesDatPath The character coordinates file * @return True if success */ - bool Load( const Uint32& TexId, const std::string& CoordinatesDatPath ); + bool load( const Uint32& TexId, const std::string& CoordinatesDatPath ); /** * @param TexId The texture id returned by TextureFactory @@ -40,7 +40,7 @@ class EE_API TextureFont : public Font { * @param FilePackPath The path of the file inside the pack * @return True success */ - bool LoadFromPack( const Uint32& TexId, Pack * Pack, const std::string& FilePackPath ); + bool loadFromPack( const Uint32& TexId, Pack * Pack, const std::string& FilePackPath ); /** Load's a texture font and then load's the character coordinates file previously loaded on memory ( generated by the TTFFont class ) * @param TexId The texture id returned by TextureFactory @@ -48,14 +48,14 @@ class EE_API TextureFont : public Font { * @param CoordDataSize The size of CoordData * @return True if success */ - bool LoadFromMemory( const Uint32& TexId, const char* CoordData, const Uint32& CoordDataSize ); + bool loadFromMemory( const Uint32& TexId, const char* CoordData, const Uint32& CoordDataSize ); /** Load's a texture font and then load's the character coordinates from a IO stream file ( generated by the TTFFont class ) * @param TexId The texture id returned by TextureFactory * @param IOS IO stream file for the coordinates * @return True if success */ - bool LoadFromStream( const Uint32& TexId, IOStream& IOS ); + bool loadFromStream( const Uint32& TexId, IOStream& IOS ); private: unsigned int mStartChar; unsigned int mTexColumns; @@ -72,9 +72,9 @@ class EE_API TextureFont : public Font { TextureFont( const std::string FontName ); - void BuildFont(); + void buildFont(); - void BuildFromGlyphs(); + void buildFromGlyphs(); }; }} diff --git a/include/eepp/graphics/texturefontloader.hpp b/include/eepp/graphics/texturefontloader.hpp index 74d2add38..b6b7c5d3d 100644 --- a/include/eepp/graphics/texturefontloader.hpp +++ b/include/eepp/graphics/texturefontloader.hpp @@ -57,10 +57,10 @@ class EE_API TextureFontLoader : public ObjectLoader { void unload(); /** @return The font name */ - const std::string& Id() const; + const std::string& getId() const; /** @return The instance of the font created after loading it. ( NULL if was not created yet ) */ - Graphics::Font * Font() const; + Graphics::Font * getFont() const; protected: enum TEXTURE_FONT_LOAD_TYPE { @@ -97,11 +97,11 @@ class EE_API TextureFontLoader : public ObjectLoader { bool mTexLoaded; bool mFontLoaded; - void LoadFont(); - void LoadFromPath(); - void LoadFromMemory(); - void LoadFromPack(); - void LoadFromTex(); + void loadFont(); + void loadFromPath(); + void loadFromMemory(); + void loadFromPack(); + void loadFromTex(); }; }} diff --git a/include/eepp/graphics/textureloader.hpp b/include/eepp/graphics/textureloader.hpp index bc8500aef..e54594176 100644 --- a/include/eepp/graphics/textureloader.hpp +++ b/include/eepp/graphics/textureloader.hpp @@ -29,7 +29,7 @@ class EE_API TextureLoader : public ObjectLoader { * @param CompressTexture If use the DXT compression on the texture loading ( if the card can display them, will convert RGB to DXT1, RGBA to DXT5 ) * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) */ - TextureLoader( const std::string& Filepath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + TextureLoader( const std::string& filepath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Load a texture from memory * @param ImagePtr The image data in memory just as if it were still in a file @@ -67,7 +67,7 @@ class EE_API TextureLoader : public ObjectLoader { virtual ~TextureLoader(); /** A color key can be set to be transparent in the texture. This must be set before the loading is done. */ - void SetColorKey( RGB Color ); + void setColorKey( RGB Color ); /** This must be called for the asynchronous mode to update the texture data to the GPU, the call must be done from the same thread that the GL context was created ( the main thread ). ** @see ObjectLoader::Update */ @@ -77,13 +77,13 @@ class EE_API TextureLoader : public ObjectLoader { void unload(); /** @return The file path to the texture ( if any ) */ - const std::string& Filepath() const; + const std::string& filepath() const; /** @return The texture internal id */ - const Uint32& Id() const; + const Uint32& getId() const; /** @return The texture instance ( if it was loaded ). */ - Texture * GetTexture() const; + Texture * getTexture() const; protected: Uint32 mLoadType; // From memory, from path, from pack Uint8 * mPixels; // Texture Info @@ -118,12 +118,12 @@ class EE_API TextureLoader : public ObjectLoader { Clock mTE; - void LoadFile(); - void LoadFromPath(); - void LoadFromMemory(); - void LoadFromPack(); - void LoadFromPixels(); - void LoadFromStream(); + void loadFile(); + void loadFromPath(); + void loadFromMemory(); + void loadFromPack(); + void loadFromPixels(); + void loadFromStream(); }; }} diff --git a/include/eepp/graphics/texturepacker.hpp b/include/eepp/graphics/texturepacker.hpp index 2d6519dbc..37960b9f6 100644 --- a/include/eepp/graphics/texturepacker.hpp +++ b/include/eepp/graphics/texturepacker.hpp @@ -28,7 +28,7 @@ /*! NOTE by Martin Lucas Golini ** This implementation is based on the John W. Ratcliff texture atlas implementation. -** Implementation differ from the original, but i use the base texture atlas algorithm. +** Implementation differs from the original, but i used the base texture atlas algorithm. */ #include @@ -62,16 +62,16 @@ class EE_API TexturePacker { /** Adds a image/texture from its path to the texture atlas. * @param TexturePath The image path. */ - bool AddTexture( const std::string& TexturePath ); + bool addTexture( const std::string& TexturePath ); /** Adds a image to the texture atlas. The image instance must remain in memory until the texture atlas is saved. */ - bool AddImage( Image * Img, const std::string& Name ); + bool addImage( Image * Img, const std::string& Name ); /** Adds a directory with images. It will try to add all the images inside that directory to the texture atlas. */ - bool AddTexturesPath( std::string TexturesPath ); + bool addTexturesPath( std::string TexturesPath ); /** After adding all the images that will be used to create the texture atlas. Packing the textures will generate the texture atlas information ( it will fit the images inside the texture atlas, etc ). */ - Int32 PackTextures(); + Int32 packTextures(); /** @brief Save the texture atlas to a file, in the indicated format. * If PackTexture() has not been called, it will be called automatically by the function ( so you don't need to call it ). @@ -79,10 +79,10 @@ class EE_API TexturePacker { * @param Format The image format of the new texture atlas. * @param SaveExtensions Indicates if the extensions of the image files must be saved. Usually you wan't to find the SubTextures by its name without extension, but this can be changed here. */ - void Save( const std::string& Filepath, const EE_SAVE_TYPE& Format = SAVE_TYPE_PNG, const bool& SaveExtensions = false ); + void save( const std::string& Filepath, const EE_SAVE_TYPE& Format = SAVE_TYPE_PNG, const bool& SaveExtensions = false ); /** Clear all the textures added */ - void Close(); + void close(); /** First of all you need to set at least the max dimensions of the texture atlas. * If the instance of the texture packer was created without indicating this data, this must be called before adding any texture or image. @@ -92,16 +92,16 @@ class EE_API TexturePacker { * @param PixelBorder Indicates how many pixels will be added to separate one image to another in the texture atlas. Usefull to avoid artifacts when rendered scaled SubTextures. Use at least 1 pixel to separate images if you will scale any SubTexture. * @param AllowFlipping Indicates if the images can be flipped inside the texture atlas. This is not compatible with eepp ( since it can't flip the textures back to the original orientation ). So avoid it for eepp. */ - void SetOptions( const Uint32& MaxWidth, const Uint32& MaxHeight, const bool& ForcePowOfTwo = true, const Uint32& PixelBorder = 0, const bool& AllowFlipping = false ); + void setOptions( const Uint32& MaxWidth, const Uint32& MaxHeight, const bool& ForcePowOfTwo = true, const Uint32& PixelBorder = 0, const bool& AllowFlipping = false ); /** @return The texture atlas to generate width. */ - const Int32& Width() const; + const Int32& width() const; /** @return The texture atlas to generate height */ - const Int32& Height() const; + const Int32& height() const; /** @return If the texture atlas has already been saved, returns the file path to the texture atlas. */ - const std::string& GetFilepath() const; + const std::string& getFilepath() const; protected: enum PackStrategy { PackBig, @@ -129,47 +129,47 @@ class EE_API TexturePacker { bool mSaveExtensions; EE_SAVE_TYPE mFormat; - TexturePacker * GetChild() const; + TexturePacker * getChild() const; - TexturePacker * GetParent() const; + TexturePacker * getParent() const; - std::list * GetTexturePackPtr(); + std::list * getTexturePackPtr(); - void ChildSave( const EE_SAVE_TYPE& Format ); + void childSave( const EE_SAVE_TYPE& Format ); - void SaveSubTextures(); + void saveSubTextures(); - void NewFree( Int32 x, Int32 y, Int32 width, Int32 height ); + void newFree( Int32 x, Int32 y, Int32 width, Int32 height ); - bool MergeNodes(); + bool mergeNodes(); - void Validate(); + void validate(); - TexturePackerTex * GetLonguestEdge(); + TexturePackerTex * getLonguestEdge(); - TexturePackerTex * GetShortestEdge(); + TexturePackerTex * getShortestEdge(); - Int32 GetChildCount(); + Int32 getChildCount(); - const Int32& GetWidth() const; + const Int32& getWidth() const; - const Int32& GetHeight() const; + const Int32& getHeight() const; - const Int32& GetPlacedCount() const; + const Int32& getPlacedCount() const; - sTextureHdr CreateTextureHdr( TexturePacker * Packer ); + sTextureHdr createTextureHdr( TexturePacker * Packer ); - void CreateSubTexturesHdr( TexturePacker * Packer, std::vector& SubTextures ); + void createSubTexturesHdr( TexturePacker * Packer, std::vector& SubTextures ); - TexturePackerNode * GetBestFit( TexturePackerTex * t, TexturePackerNode ** prevBestFit, Int32 * EdgeCount ); + TexturePackerNode * getBestFit( TexturePackerTex * t, TexturePackerNode ** prevBestFit, Int32 * EdgeCount ); - void InsertTexture( TexturePackerTex * t, TexturePackerNode * bestFit, Int32 edgeCount, TexturePackerNode * previousBestFit ); + void insertTexture( TexturePackerTex * t, TexturePackerNode * bestFit, Int32 edgeCount, TexturePackerNode * previousBestFit ); - void AddBorderToTextures( const Int32& BorderSize ); + void addBorderToTextures( const Int32& BorderSize ); - void CreateChild(); + void createChild(); - bool AddPackerTex( TexturePackerTex * TPack ); + bool addPackerTex( TexturePackerTex * TPack ); }; }} diff --git a/include/eepp/graphics/ttffont.hpp b/include/eepp/graphics/ttffont.hpp index 6a404fa87..a2eb3990b 100755 --- a/include/eepp/graphics/ttffont.hpp +++ b/include/eepp/graphics/ttffont.hpp @@ -26,7 +26,7 @@ class EE_API TTFFont : public Font { /** Creates an instance of a true type font */ static TTFFont * New( const std::string FontName ); - /** The destructor will not unload the texture from memory. If you want that you'll have to remove it manually ( TextureFactory::instance()->Remove( MyFontInstance->GetTexId() ) ). */ + /** The destructor will not unload the texture from memory. If you want that you'll have to remove it manually ( TextureFactory::instance()->remove( MyFontInstance->GetTexId() ) ). */ virtual ~TTFFont(); /** Loads a True Type Font from path @@ -40,7 +40,7 @@ class EE_API TTFFont : public Font { * @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling * @return If success */ - bool Load( const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true ); + bool load( const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true ); /** Loads a True Type Font from pack * @param Pack Pointer to the pack instance @@ -54,7 +54,7 @@ class EE_API TTFFont : public Font { * @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling * @return If success */ - bool LoadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true ); + bool loadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true ); /** Loads a True Type Font from memory * @param TTFData The pointer to the data @@ -68,16 +68,16 @@ class EE_API TTFFont : public Font { * @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling * @return If success */ - bool LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true ); + bool loadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style = TTF_STYLE_NORMAL, const Uint16& NumCharsToGen = 512, const RGB& FontColor = RGB(), const Uint8& OutlineSize = 0, const RGB& OutlineColor = RGB(0,0,0), const bool& AddPixelSeparator = true ); /** Save the texture generated from the TTF file to disk */ - bool SaveTexture( const std::string& Filepath, const EE_SAVE_TYPE& Format = SAVE_TYPE_PNG ); + bool saveTexture( const std::string& Filepath, const EE_SAVE_TYPE& Format = SAVE_TYPE_PNG ); /** Save the characters coordinates to use it later to load the Texture Font */ - bool SaveCoordinates( const std::string& Filepath ); + bool saveCoordinates( const std::string& Filepath ); /** Save the texture generated from the TTF file and the character coordinates. */ - bool Save( const std::string& TexturePath, const std::string& CoordinatesDatPath, const EE_SAVE_TYPE& Format = SAVE_TYPE_PNG ); + bool save( const std::string& TexturePath, const std::string& CoordinatesDatPath, const EE_SAVE_TYPE& Format = SAVE_TYPE_PNG ); protected: friend class TTFFontLoader; @@ -103,17 +103,17 @@ class EE_API TTFFont : public Font { TTFFont( const std::string FontName ); - bool ThreadedLoading() const; + bool threadedLoading() const; - void ThreadedLoading( const bool& isThreaded ); + void threadedLoading( const bool& isThreaded ); - void UpdateLoading(); + void updateLoading(); bool iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, Uint8 OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ); - void MakeOutline( Uint8 *in, Uint8 *out, Int16 w, Int16 h, Int16 OutlineSize ); + void makeOutline( Uint8 *in, Uint8 *out, Int16 w, Int16 h, Int16 OutlineSize ); - void RebuildFromGlyphs(); + void rebuildFromGlyphs(); }; }} diff --git a/include/eepp/graphics/ttffontloader.hpp b/include/eepp/graphics/ttffontloader.hpp index 162de99da..ba2db6888 100644 --- a/include/eepp/graphics/ttffontloader.hpp +++ b/include/eepp/graphics/ttffontloader.hpp @@ -65,10 +65,10 @@ class EE_API TTFFontLoader : public ObjectLoader { void unload(); /** @return The font name. */ - const std::string& Id() const; + const std::string& getId() const; /** @return The font instance if already exists, otherwise returns NULL. */ - Graphics::Font * Font() const; + Graphics::Font * getFont() const; protected: enum TTF_LOAD_TYPE { @@ -100,10 +100,10 @@ class EE_API TTFFontLoader : public ObjectLoader { private: bool mFontLoaded; - void LoadFromPath(); - void LoadFromMemory(); - void LoadFromPack(); - void Create(); + void loadFromPath(); + void loadFromMemory(); + void loadFromPack(); + void create(); }; }} diff --git a/include/eepp/graphics/vertexbuffer.hpp b/include/eepp/graphics/vertexbuffer.hpp index 32ca604de..493943b65 100644 --- a/include/eepp/graphics/vertexbuffer.hpp +++ b/include/eepp/graphics/vertexbuffer.hpp @@ -25,99 +25,99 @@ class EE_API VertexBuffer { /** @brief Adds a vertex of the type indicated to the buffer * @param Type Can be the position or texture coordinates. * @param Vertex The vexter data */ - void AddVertex( const Uint32& Type, const Vector2f& Vertex ); + void addVertex( const Uint32& Type, const Vector2f& Vertex ); /** @brief Adds a vertex position to the buffer * @param Vertex The vexter data */ - void AddVertex( const Vector2f& Vertex ); + void addVertex( const Vector2f& Vertex ); /** @brief Adds a vertex texture coordinate. * @param VertexCoord The vertex texture coordinate. * @param TextureLevel Indicates the texture level if it's using multitextures. */ - void AddVertexCoord( const Vector2f& VertexCoord, const Uint32& TextureLevel = 0 ); + void addVertexCoord( const Vector2f& VertexCoord, const Uint32& TextureLevel = 0 ); /** @brief Adds a color to the buffer. * @param Color The color value. */ - void AddColor( const ColorA& Color ); + void addColor( const ColorA& Color ); /** @brief Adds an index to the buffer. * @param Index The index value. */ - void AddIndex( const Uint32& Index ); + void addIndex( const Uint32& Index ); /** @brief Resizes the array of the type indicated. * @param Type The type must be one of the vertex flags ( EE_VERTEX_FLAGS ). * @param Size The size to be resized */ - void ResizeArray( const Uint32& Type, const Uint32& Size ); + void resizeArray( const Uint32& Type, const Uint32& Size ); /** @brief Resizes the indices array. * @param Size The new size */ - void ResizeIndices( const Uint32& Size ); + void resizeIndices( const Uint32& Size ); /** @return the pointer to the array of the type indicated. * @param Type The type must be one of the vertex flags ( EE_VERTEX_FLAGS ). */ - Float * GetArray( const Uint32& Type ); + Float * getArray( const Uint32& Type ); /** @return The color array pointer. */ - Uint8 * GetColorArray(); + Uint8 * getColorArray(); /** @return The indices array pointer. */ - Uint32 * GetIndices(); + Uint32 * getIndices(); /** @return The number of vertex added. */ - Uint32 GetVertexCount(); + Uint32 getVertexCount(); /** @return The number of indexes added. */ - Uint32 GetIndexCount(); + Uint32 getIndexCount(); /** @return The vector data of the type indicated. * @param Type Can be the position or texture coordinates. * @param Index The position in the buffer. */ - Vector2f GetVector2( const Uint32& Type, const Uint32& Index ); + Vector2f getVector2( const Uint32& Type, const Uint32& Index ); /** @return The color at the buffer position. * @param Index The position in the buffer. */ - ColorA GetColor( const Uint32& Index ); + ColorA getColor( const Uint32& Index ); /** @return The index at the buffer position. * @param Index The position in the buffer. */ - Uint32 GetIndex( const Uint32& Index ); + Uint32 getIndex( const Uint32& Index ); /** @brief Sets the number of elements to draw. If not set, it will draw all the elements. */ - void SetElementNum( Int32 Num ); + void setElementNum( Int32 Num ); /** @return The number of elements added. */ - const Int32& GetElementNum() const; + const Int32& getElementNum() const; /** @brief Activates the vertex buffer. */ - virtual void Bind() = 0; + virtual void bind() = 0; /** @brief Deactivates the vertex buffer. */ - virtual void Unbind() = 0; + virtual void unbind() = 0; /** @brief Draw the vertex buffer. */ - virtual void Draw() = 0; + virtual void draw() = 0; /** @brief Compile the vertex buffer. * After adding all the vertex buffer data Compile() must be called to upload the data to the GPU. */ - virtual bool Compile() = 0; + virtual bool compile() = 0; /** @brief Update is used in the case of some data is modified and need to be reuploaded to the GPU. */ - virtual void Update( const Uint32& Types, bool Indices ) = 0; + virtual void update( const Uint32& Types, bool Indices ) = 0; /** @brief Reupload all the data to the GPU. */ - virtual void Reload() = 0; + virtual void reload() = 0; /** Clear the cached data and destroy the buffers */ - virtual void Clear(); + virtual void clear(); protected: Uint32 mVertexFlags; EE_DRAW_MODE mDrawType; @@ -129,7 +129,7 @@ class EE_API VertexBuffer { VertexBuffer( const Uint32& VertexFlags = VERTEX_FLAGS_DEFAULT, EE_DRAW_MODE DrawType = DM_QUADS, const Int32& ReserveVertexSize = 0, const Int32& ReserveIndexSize = 0, EE_VBO_USAGE_TYPE UsageType = VBO_USAGE_TYPE_STATIC ); - virtual void SetVertexStates() = 0; + virtual void setVertexStates() = 0; }; }} @@ -142,33 +142,33 @@ class EE_API VertexBuffer { * Some example usage of this class: * @code // Creates a rounded rectangle. - Polygon2f Poly = Polygon2f::CreateRoundedRectangle( 0, 0, 256, 50 ); + Polygon2f Poly = Polygon2f::createRoundedRectangle( 0, 0, 256, 50 ); VertexBuffer * VBO = VertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); if ( NULL != VBO ) { // Upload the rounded rectangle data to the vertex buffer. for ( Uint32 i = 0; i < Poly.Size(); i++ ) { - VBO->AddVertex( Poly[i] ); // Adds the vertex position - VBO->AddColor( ColorA( 255, 255, 255, 255 ) ); // Adds the vertex color + VBO->addVertex( Poly[i] ); // Adds the vertex position + VBO->addColor( ColorA( 255, 255, 255, 255 ) ); // Adds the vertex color } // Compiles the buffered data - VBO->Compile(); + VBO->compile(); } // ... in the main loop draw the VBO - while ( win->Running() ) + while ( win->isRunning() ) { ... - VBO->Bind(); // First must be binded. - VBO->Draw(); // Then rendered. - VBO->Unbind(); // Then unbinded to allow render other things. + VBO->bind(); // First must be binded. + VBO->draw(); // Then rendered. + VBO->unbind(); // Then unbinded to allow render other things. ... - win->Display() + win->display() } * @endcode * diff --git a/include/eepp/graphics/vertexbufferogl.hpp b/include/eepp/graphics/vertexbufferogl.hpp index a2c121ced..845ea0ec2 100644 --- a/include/eepp/graphics/vertexbufferogl.hpp +++ b/include/eepp/graphics/vertexbufferogl.hpp @@ -14,19 +14,19 @@ class EE_API VertexBufferOGL : public VertexBuffer { virtual ~VertexBufferOGL(); - void Bind(); + void bind(); - void Draw(); + void draw(); - bool Compile(); + bool compile(); - void Update( const Uint32& Types, bool Indices ); + void update( const Uint32& Types, bool Indices ); - void Reload(); + void reload(); - void Unbind(); + void unbind(); protected: - void SetVertexStates(); + void setVertexStates(); }; diff --git a/include/eepp/graphics/vertexbuffervbo.hpp b/include/eepp/graphics/vertexbuffervbo.hpp index 602ac3bdc..d674f6ce1 100644 --- a/include/eepp/graphics/vertexbuffervbo.hpp +++ b/include/eepp/graphics/vertexbuffervbo.hpp @@ -15,19 +15,19 @@ class EE_API VertexBufferVBO : public VertexBuffer { virtual ~VertexBufferVBO(); - void Bind(); + void bind(); - void Draw(); + void draw(); - bool Compile(); + bool compile(); - void Update( const Uint32& Types, bool Indices ); + void update( const Uint32& Types, bool Indices ); - void Reload(); + void reload(); - void Unbind(); + void unbind(); - void Clear(); + void clear(); protected: bool mCompiled; bool mBuffersSet; @@ -36,7 +36,7 @@ class EE_API VertexBufferVBO : public VertexBuffer { Uint32 mElementHandle; Uint32 mArrayHandle[ VERTEX_FLAGS_COUNT ]; - void SetVertexStates(); + void setVertexStates(); }; }} diff --git a/include/eepp/system/log.hpp b/include/eepp/system/log.hpp index 5a0285657..070dcc4a4 100755 --- a/include/eepp/system/log.hpp +++ b/include/eepp/system/log.hpp @@ -13,7 +13,7 @@ namespace EE { namespace System { /** @brief The reader interface is useful if you want to keep track of what is write in the log, for example for a console. */ class LogReaderInterface { public: - virtual void WriteLog( const std::string& Text ) = 0; + virtual void writeLog( const std::string& Text ) = 0; }; /** @brief Global log file. The engine will log everything in this file. */ diff --git a/include/eepp/system/packmanager.hpp b/include/eepp/system/packmanager.hpp index 20231c0ba..64f453640 100644 --- a/include/eepp/system/packmanager.hpp +++ b/include/eepp/system/packmanager.hpp @@ -30,7 +30,7 @@ class EE_API PackManager : public Container { /** @brief Sets if the files that failed to be loaded from the file system should try to be loaded from the currently open packs. ** For example if you try to load a texture from the file system a fails it will search the same path in the opened packs, and load it from there. - ** TextureFactory::instance()->Load( "mytexture.png" ); + ** TextureFactory::instance()->load( "mytexture.png" ); ** If the file is not in the file system, it will be searched in the opened packs, and loaded if is found. ** In case that the process path is appended to the path... like Sys::GetProcessPath() + "mytexture.png", the process path will be removed from the file path. */ diff --git a/include/eepp/system/resourcemanager.hpp b/include/eepp/system/resourcemanager.hpp index b563e0fb8..023ed5477 100644 --- a/include/eepp/system/resourcemanager.hpp +++ b/include/eepp/system/resourcemanager.hpp @@ -113,18 +113,18 @@ template T * ResourceManager::add( T * Resource ) { if ( NULL != Resource ) { if ( mUniqueId ) { - Uint32 c = count( Resource->Id() ); + Uint32 c = count( Resource->getId() ); if ( 0 == c ) { mResources.push_back( Resource ); return Resource; } else { - std::string RealName( Resource->Name() ); + std::string RealName( Resource->getName() ); - while ( count( Resource->Id() ) ) { + while ( count( Resource->getId() ) ) { c++; - Resource->Name( RealName + String::toStr( c ) ); + Resource->setName( RealName + String::toStr( c ) ); } return add( Resource ); @@ -173,7 +173,7 @@ bool ResourceManager::existsId( const Uint32& Id ) { typename std::list::iterator it; for ( it = mResources.begin() ; it != mResources.end(); it++ ) - if ( (*it)->Id() == Id ) + if ( (*it)->getId() == Id ) return true; return false; @@ -193,7 +193,7 @@ T * ResourceManager::getById( const Uint32& id ) { for ( it = mResources.rbegin(); it != mResources.rend(); it++ ) { sp = (*it); - if ( id == sp->Id() ) + if ( id == sp->getId() ) return sp; } @@ -209,7 +209,7 @@ void ResourceManager::printNames() { for ( it = mResources.rbegin(); it != mResources.rend(); it++ ) { sp = (*it); - eePRINT( "'%s'\n", sp->Name().c_str() ); + eePRINT( "'%s'\n", sp->getName().c_str() ); } } @@ -224,7 +224,7 @@ Uint32 ResourceManager::count( const Uint32& Id ) { Uint32 Count = 0; for ( it = mResources.begin() ; it != mResources.end(); it++ ) - if ( (*it)->Id() == Id ) + if ( (*it)->getId() == Id ) Count++; return Count; diff --git a/include/eepp/system/thread.hpp b/include/eepp/system/thread.hpp index d8f1d92ff..7bdfad325 100755 --- a/include/eepp/system/thread.hpp +++ b/include/eepp/system/thread.hpp @@ -107,7 +107,7 @@ class EE_API Thread : NonCopyable { void terminate(); /** @return The id of the thread */ - Uint32 Id(); + Uint32 getId(); protected: Thread(); private: diff --git a/include/eepp/ui/uidefaulttheme.hpp b/include/eepp/ui/uidefaulttheme.hpp index 92e16e3b8..6266795f2 100644 --- a/include/eepp/ui/uidefaulttheme.hpp +++ b/include/eepp/ui/uidefaulttheme.hpp @@ -7,7 +7,7 @@ namespace EE { namespace UI { class EE_API UIDefaultTheme : public UITheme { public: - UIDefaultTheme( const std::string& Name, const std::string& Abbr, Graphics::Font * DefaultFont = NULL ); + UIDefaultTheme( const std::string& getName, const std::string& Abbr, Graphics::Font * DefaultFont = NULL ); virtual UIPopUpMenu * CreatePopUpMenu( UIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS | UI_AUTO_SIZE | UI_AUTO_PADDING, Uint32 RowHeight = 0, Recti PaddingContainer = Recti(), Uint32 MinWidth = 100, Uint32 MinSpaceForIcons = 16, Uint32 MinRightMargin = 8 ); diff --git a/include/eepp/ui/uiskin.hpp b/include/eepp/ui/uiskin.hpp index 024c98f46..7920506cf 100644 --- a/include/eepp/ui/uiskin.hpp +++ b/include/eepp/ui/uiskin.hpp @@ -22,7 +22,7 @@ class EE_API UISkin { static const char * GetSkinStateName( const Uint32& State ); - UISkin( const std::string& Name, const Uint32& Type ); + UISkin( const std::string& getName, const Uint32& Type ); virtual ~UISkin(); @@ -38,11 +38,11 @@ class EE_API UISkin { virtual void SetSkins(); - const std::string& Name() const; + const std::string& getName() const; - void Name( const std::string& name ); + void setName( const std::string& name ); - const Uint32& Id() const; + const Uint32& getId() const; UITheme * Theme() const; diff --git a/include/eepp/ui/uiskincomplex.hpp b/include/eepp/ui/uiskincomplex.hpp index 6a7caf2e2..46514e6fc 100644 --- a/include/eepp/ui/uiskincomplex.hpp +++ b/include/eepp/ui/uiskincomplex.hpp @@ -23,7 +23,7 @@ class EE_API UISkinComplex : public UISkin { SideCount }; - UISkinComplex( const std::string& Name ); + UISkinComplex( const std::string& getName ); virtual ~UISkinComplex(); diff --git a/include/eepp/ui/uiskinsimple.hpp b/include/eepp/ui/uiskinsimple.hpp index bf8362336..91b495bb3 100644 --- a/include/eepp/ui/uiskinsimple.hpp +++ b/include/eepp/ui/uiskinsimple.hpp @@ -8,7 +8,7 @@ namespace EE { namespace UI { class EE_API UISkinSimple : public UISkin { public: - UISkinSimple( const std::string& Name ); + UISkinSimple( const std::string& getName ); virtual ~UISkinSimple(); diff --git a/include/eepp/ui/uitheme.hpp b/include/eepp/ui/uitheme.hpp index 16147446d..3128a347f 100644 --- a/include/eepp/ui/uitheme.hpp +++ b/include/eepp/ui/uitheme.hpp @@ -52,23 +52,23 @@ class EE_API UITheme : protected ResourceManager { static UITheme * LoadFromPath( UITheme * tTheme, const std::string& Path, const std::string ImgExt = "png" ); - static UITheme * LoadFromTextureAtlas( Graphics::TextureAtlas * TextureAtlas, const std::string& Name, const std::string NameAbbr ); + static UITheme * LoadFromTextureAtlas( Graphics::TextureAtlas * TextureAtlas, const std::string& getName, const std::string NameAbbr ); - static UITheme * LoadFromPath( const std::string& Path, const std::string& Name, const std::string& NameAbbr, const std::string ImgExt = "png" ); + static UITheme * LoadFromPath( const std::string& Path, const std::string& getName, const std::string& NameAbbr, const std::string ImgExt = "png" ); void AddThemeElement( const std::string& Element ); void AddThemeIcon( const std::string& Icon ); - UITheme( const std::string& Name, const std::string& Abbr, Graphics::Font * DefaultFont = NULL ); + UITheme( const std::string& getName, const std::string& Abbr, Graphics::Font * DefaultFont = NULL ); virtual ~UITheme(); - const std::string& Name() const; + const std::string& getName() const; - void Name( const std::string& name ); + void setName( const std::string& name ); - const Uint32& Id() const; + const Uint32& getId() const; const std::string& Abbr() const; diff --git a/include/eepp/window/engine.hpp b/include/eepp/window/engine.hpp index 7062eff8f..5eb88f062 100755 --- a/include/eepp/window/engine.hpp +++ b/include/eepp/window/engine.hpp @@ -116,7 +116,7 @@ class EE_API Engine { void enableSharedGLContext(); /** Disable the Shared GL Context - ** @see EnableSharedGLContext() + ** @see enableSharedGLContext() */ void disableSharedGLContext(); @@ -138,14 +138,10 @@ class EE_API Engine { void destroy(); - Backend::WindowBackend * createSDLBackend( const WindowSettings& Settings ); - Backend::WindowBackend * createSDL2Backend( const WindowSettings& Settings ); Backend::WindowBackend * createSFMLBackend( const WindowSettings& Settings ); - EE::Window::Window * createSDLWindow( const WindowSettings& Settings, const ContextSettings& Context ); - EE::Window::Window * createSDL2Window( const WindowSettings& Settings, const ContextSettings& Context ); EE::Window::Window * createSFMLWindow( const WindowSettings& Settings, const ContextSettings& Context ); diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index 4af0f8255..912fe5f44 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -34,7 +34,6 @@ namespace WindowStyle { namespace WindowBackend { enum { - SDL, SDL2, SFML, Default diff --git a/premake4.lua b/premake4.lua index 799a0ddea..d1976eab7 100644 --- a/premake4.lua +++ b/premake4.lua @@ -147,11 +147,11 @@ newoption { trigger = "with-gles1", description = "Compile with GLES1 support" } newoption { trigger = "use-frameworks", description = "In Mac OS X it will try to link the external libraries from its frameworks. For example, instead of linking against SDL2 it will link agains SDL2.framework." } newoption { trigger = "with-backend", - description = "Select the backend to use for window and input handling.\n\t\t\tIf no backend is selected or if the selected is not installed the script will search for a backend present in the system, and will use it.\n\t\t\tIt's possible to build with more than one backend support.\n\t\t\t\tUse comma to separate the backends to build ( you can't mix SDL and SDL2, you'll get random crashes ).\n\t\t\t\tExample: --with-backend=SDL2+SFML", + description = "Select the backend to use for window and input handling.\n\t\t\tIf no backend is selected or if the selected is not installed the script will search for a backend present in the system, and will use it.", allowed = { - { "SDL", "SDL 1.2" }, { "SDL2", "SDL2 (default and recommended)" }, - { "SFML", "SFML2 ( SFML 1.6 not supported )" } + { "SFML", "SFML2 ( SFML 1.6 not supported )" }, + { "SDL2,SFML", "SDL2+SFML" } } } @@ -492,6 +492,7 @@ function add_static_links() links { "haikuttf-static" } if _OPTIONS["with-static-freetype"] or not os_findlib("freetype") then + print("Enabled static freetype") links { "freetype-static" } end @@ -532,14 +533,6 @@ function add_sdl2() end end -function add_sdl() - print("Using SDL backend"); - --- SDL is LGPL. It can't be build as static library - table.insert( link_list, get_backend_link_name( "SDL" ) ) - files { "src/eepp/window/backend/SDL/*.cpp" } - defines { "EE_BACKEND_SDL_ACTIVE", "EE_SDL_VERSION_1_2" } -end - function add_sfml() print("Using SFML backend"); files { "src/eepp/window/backend/SFML/*.cpp" } @@ -605,7 +598,7 @@ function set_ios_config() end end -function backend_is( name ) +function backend_is( name, libname ) if not _OPTIONS["with-backend"] then _OPTIONS["with-backend"] = "SDL2" end @@ -616,7 +609,7 @@ function backend_is( name ) local backend_sel = table.contains( backends, name ) - local ret_val = os_findlib( name ) and backend_sel + local ret_val = os_findlib( libname ) and backend_sel if os.is_real("mingw32") or os.is_real("emscripten") then ret_val = backend_sel @@ -630,25 +623,21 @@ function backend_is( name ) end function select_backend() - if backend_is( "SDL2" ) then + if backend_is("SDL2", "SDL2") then + print("Selected SDL2") add_sdl2() end - - if backend_is( "SDL" ) then - add_sdl() - end - if backend_is( "SFML" ) then + if backend_is("SFML", "sfml-window") then + print("Selected SFML") add_sfml() end - + -- If the selected backend is not present, try to find one present if not backend_selected then - if os_findlib("SDL") then - add_sdl() - elseif os_findlib("SDL2") then + if os_findlib("SDL2", "SDL2") then add_sdl2() - elseif os_findlib("SFML") then + elseif os_findlib("SFML", "sfml-window") then add_sfml() else print("ERROR: Couldnt find any backend. Forced SDL2.") @@ -659,6 +648,7 @@ end function check_ssl_support() if _OPTIONS["with-ssl"] then + print("Enabled SSL support") if os.is("windows") then table.insert( link_list, get_backend_link_name( "libssl" ) ) table.insert( link_list, get_backend_link_name( "libcrypto" ) ) @@ -720,6 +710,7 @@ function build_eepp( build_name ) end if _OPTIONS["with-libsndfile"] then + print("Enabled libsndfile") defines { "EE_LIBSNDFILE_ENABLED" } if os.is("windows") then diff --git a/projects/linux/ee.config b/projects/linux/ee.config index e065aa72b..5fd12afea 100644 --- a/projects/linux/ee.config +++ b/projects/linux/ee.config @@ -1,9 +1,4 @@ -#define EE_BACKEND_SDL_ACTIVE -#define EE_BACKEND_SFML_ACTIVE #define EE_SDL_VERSION_2 -#define EE_SDL_VERSION_1_2 -#define EE_BACKEND_SDL2 -#define EE_BACKEND_SDL_1_2 #define EE_X11_PLATFORM #define EE_DEBUG #define EE_LIBSNDFILE_ENABLED @@ -13,3 +8,5 @@ #define EE_GLEW_AVAILABLE #define EE_SSL_SUPPORT #define EE_OPENSSL +#define EE_BACKEND_SFML_ACTIVE +#define EE_BACKEND_SDL2 diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index c48dde6de..709ab09c2 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -29,7 +29,7 @@ 2 - System + UTF-8 false 4 false @@ -40,6 +40,7 @@ true false 0 + true false 0 4 @@ -53,7 +54,9 @@ ProjectExplorer.Project.PluginSettings - + + + ProjectExplorer.Project.Target.0 @@ -61,7 +64,7 @@ Desktop Desktop {388e5431-b31b-42b3-b9ad-9002d279d75d} - 12 + 10 0 0 @@ -158,7 +161,7 @@ true - --with-static-backend --with-ssl gmake + --with-static-backend --with-ssl --with-backend=SDL2,SFML gmake premake4 %{buildDir}../../../ Custom Process Step @@ -965,6 +968,11 @@ 1 + false + false + 0 + + true false false @@ -1016,6 +1024,11 @@ false + false + false + 0 + + true false false @@ -1053,10 +1066,10 @@ 2 - %{buildDir}../../../bin/eetest-release + %{buildDir}../../../bin/eetest false %{buildDir}../../../bin/ - Run %{buildDir}../../../bin/eetest-release + Run %{buildDir}../../../bin/eetest eetest-release ProjectExplorer.CustomExecutableRunConfiguration 3768 @@ -1067,6 +1080,11 @@ false + false + false + 0 + + true false false @@ -1118,6 +1136,11 @@ true + false + false + 0 + + true false false @@ -1169,6 +1192,11 @@ true + false + false + 0 + + true false false @@ -1220,6 +1248,11 @@ true + false + false + 0 + + true false false @@ -1271,6 +1304,11 @@ false + false + false + 0 + + true false false @@ -1308,10 +1346,10 @@ 2 - %{buildDir}../../../bin/eeew-release + %{buildDir}../../../bin/eeew false %{buildDir}../../../bin/ - Run %{buildDir}../../../bin/eeew-release + Run %{buildDir}../../../bin/eeew eeew-release ProjectExplorer.CustomExecutableRunConfiguration 3768 @@ -1322,6 +1360,11 @@ false + false + false + 0 + + true false false @@ -1373,6 +1416,11 @@ true + false + false + 0 + + true false false @@ -1410,10 +1458,10 @@ 2 - %{buildDir}../../../bin/eees-release + %{buildDir}../../../bin/eees false %{buildDir}../../../bin/ - Run %{buildDir}../../../bin/eees-release + Run %{buildDir}../../../bin/eees eees-release ProjectExplorer.CustomExecutableRunConfiguration 3768 @@ -1424,6 +1472,11 @@ true + false + false + 0 + + true false false @@ -1475,6 +1528,11 @@ true + false + false + 0 + + true false false @@ -1526,6 +1584,11 @@ true + false + false + 0 + + true false false @@ -1577,6 +1640,11 @@ true + false + false + 0 + + true false false @@ -1630,16 +1698,131 @@ 13 + + ProjectExplorer.Project.Target.1 + + Android ARM + Android ARM + {c56c34f8-2eb8-43f6-b2b6-c1a99b989f1a} + 0 + -1 + 0 + + /home/programming/eepp/projects/linux + + + + all + + false + + + true + Make + + GenericProjectManager.GenericMakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + + + true + Make + + GenericProjectManager.GenericMakeStep + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Default + Default + GenericProjectManager.GenericBuildConfiguration + + 1 + 0 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + -1 + + + + %{buildDir} + Custom Executable + + ProjectExplorer.CustomExecutableRunConfiguration + 3768 + false + true + false + false + true + + 1 + + ProjectExplorer.Project.TargetCount - 1 + 2 ProjectExplorer.Project.Updater.FileVersion - 16 + 18 Version - 16 + 18 diff --git a/src/eepp/gaming/gameobjectobject.cpp b/src/eepp/gaming/gameobjectobject.cpp index 4acc7181b..545b3faf1 100644 --- a/src/eepp/gaming/gameobjectobject.cpp +++ b/src/eepp/gaming/gameobjectobject.cpp @@ -39,13 +39,13 @@ void GameObjectObject::Draw() { Int32 colFill = 100 + selAdd; Primitives P; - P.FillMode( DRAW_FILL ); - P.SetColor( ColorA( colFill, colFill, colFill, colFill ) ); - P.DrawRectangle( mRect ); + P.fillMode( DRAW_FILL ); + P.setColor( ColorA( colFill, colFill, colFill, colFill ) ); + P.drawRectangle( mRect ); - P.FillMode( DRAW_LINE ); - P.SetColor( ColorA( 255, 255, 0, 200 ) ); - P.DrawRectangle( mRect ); + P.fillMode( DRAW_LINE ); + P.setColor( ColorA( 255, 255, 0, 200 ) ); + P.drawRectangle( mRect ); } Vector2f GameObjectObject::Pos() const { diff --git a/src/eepp/gaming/gameobjectpolygon.cpp b/src/eepp/gaming/gameobjectpolygon.cpp index 6fbc9ef8f..e5242ac7c 100644 --- a/src/eepp/gaming/gameobjectpolygon.cpp +++ b/src/eepp/gaming/gameobjectpolygon.cpp @@ -32,13 +32,13 @@ void GameObjectPolygon::Draw() { Int32 colFill = 100 + selAdd; Primitives P; - P.FillMode( DRAW_FILL ); - P.SetColor( ColorA( colFill, colFill, colFill, colFill ) ); - P.DrawPolygon( mPoly ); + P.fillMode( DRAW_FILL ); + P.setColor( ColorA( colFill, colFill, colFill, colFill ) ); + P.drawPolygon( mPoly ); - P.FillMode( DRAW_LINE ); - P.SetColor( ColorA( 255, 255, 0, 200 ) ); - P.DrawPolygon( mPoly ); + P.fillMode( DRAW_LINE ); + P.setColor( ColorA( 255, 255, 0, 200 ) ); + P.drawPolygon( mPoly ); } void GameObjectPolygon::SetPolygonPoint( Uint32 index, Vector2f p ) { diff --git a/src/eepp/gaming/gameobjectpolyline.cpp b/src/eepp/gaming/gameobjectpolyline.cpp index c23136ded..c7ab8431c 100644 --- a/src/eepp/gaming/gameobjectpolyline.cpp +++ b/src/eepp/gaming/gameobjectpolyline.cpp @@ -26,14 +26,14 @@ void GameObjectPolyline::Draw() { Primitives P; if ( mSelected ) { - P.FillMode( DRAW_FILL ); - P.SetColor( ColorA( 150, 150, 150, 150 ) ); - P.DrawPolygon( mPoly ); + P.fillMode( DRAW_FILL ); + P.setColor( ColorA( 150, 150, 150, 150 ) ); + P.drawPolygon( mPoly ); } - P.FillMode( DRAW_LINE ); - P.SetColor( ColorA( 255, 255, 0, 200 ) ); - P.DrawPolygon( mPoly ); + P.fillMode( DRAW_LINE ); + P.setColor( ColorA( 255, 255, 0, 200 ) ); + P.drawPolygon( mPoly ); } GameObjectObject * GameObjectPolyline::Copy() { diff --git a/src/eepp/gaming/gameobjectsprite.cpp b/src/eepp/gaming/gameobjectsprite.cpp index 1e334536f..1fae6ade1 100644 --- a/src/eepp/gaming/gameobjectsprite.cpp +++ b/src/eepp/gaming/gameobjectsprite.cpp @@ -11,7 +11,7 @@ GameObjectSprite::GameObjectSprite( const Uint32& Flags, MapLayer * Layer, Graph mSprite( Sprite ) { if ( NULL != mSprite ) - mSprite->RenderMode( RenderModeFromFlags() ); + mSprite->renderMode( RenderModeFromFlags() ); AssignTilePos(); } @@ -30,7 +30,7 @@ bool GameObjectSprite::IsType( const Uint32& type ) { void GameObjectSprite::Draw() { if ( NULL != mSprite ) { - mSprite->Angle( GetAngle() ); + mSprite->angle( GetAngle() ); if ( mLayer->Map()->LightsEnabled() && mLayer->LightsEnabled() ) { MapLightManager * LM = mLayer->Map()->GetLightManager(); @@ -39,45 +39,45 @@ void GameObjectSprite::Draw() { Vector2i Tile = reinterpret_cast ( mLayer )->GetCurrentTile(); if ( LM->IsByVertex() ) { - mSprite->UpdateVertexColors( + mSprite->updateVertexColors( *LM->GetTileColor( Tile, 0 ), *LM->GetTileColor( Tile, 1 ), *LM->GetTileColor( Tile, 2 ), *LM->GetTileColor( Tile, 3 ) ); } else { - mSprite->Color( *LM->GetTileColor( Tile ) ); + mSprite->color( *LM->GetTileColor( Tile ) ); } } else { if ( LM->IsByVertex() ) { - Quad2f Q = mSprite->GetQuad(); + Quad2f Q = mSprite->getQuad(); - mSprite->UpdateVertexColors( + mSprite->updateVertexColors( LM->GetColorFromPos( Q.V[0] ), LM->GetColorFromPos( Q.V[1] ), LM->GetColorFromPos( Q.V[2] ), LM->GetColorFromPos( Q.V[3] ) ); } else { - mSprite->Color( LM->GetColorFromPos( mSprite->Position() ) ); + mSprite->color( LM->GetColorFromPos( mSprite->position() ) ); } } } - mSprite->Draw(); + mSprite->draw(); } } Vector2f GameObjectSprite::Pos() const { if ( NULL != mSprite ) - return mSprite->Position(); + return mSprite->position(); return Vector2f(); } void GameObjectSprite::Pos( Vector2f pos ) { if ( NULL != mSprite ) { - mSprite->Position( pos ); + mSprite->position( pos ); GameObject::Pos( pos ); } } @@ -92,7 +92,7 @@ void GameObjectSprite::TilePos( Vector2i pos ) { Sizei GameObjectSprite::Size() { if ( NULL != mSprite ) - return mSprite->GetSubTexture(0)->RealSize(); + return mSprite->getSubTexture(0)->realSize(); return Sizei(); } @@ -104,35 +104,35 @@ Graphics::Sprite * GameObjectSprite::Sprite() const { void GameObjectSprite::Sprite( Graphics::Sprite * sprite ) { eeSAFE_DELETE( mSprite ); mSprite = sprite; - mSprite->RenderMode( RenderModeFromFlags() ); + mSprite->renderMode( RenderModeFromFlags() ); } void GameObjectSprite::FlagSet( const Uint32& Flag ) { if ( NULL != mSprite ) - mSprite->RenderMode( RenderModeFromFlags() ); + mSprite->renderMode( RenderModeFromFlags() ); GameObject::FlagSet( Flag ); } Uint32 GameObjectSprite::DataId() { - return mSprite->GetSubTexture(0)->Id(); + return mSprite->getSubTexture(0)->getId(); } void GameObjectSprite::DataId( Uint32 Id ) { Graphics::Sprite * tSprite = NULL; if ( mFlags & GObjFlags::GAMEOBJECT_ANIMATED ) { - std::vector tSubTextureVec = TextureAtlasManager::instance()->GetSubTexturesByPatternId( Id ); + std::vector tSubTextureVec = TextureAtlasManager::instance()->getSubTexturesByPatternId( Id ); if ( tSubTextureVec.size() ) { tSprite = eeNew( Graphics::Sprite, () ); - tSprite->CreateAnimation(); - tSprite->AddFrames( tSubTextureVec ); + tSprite->createAnimation(); + tSprite->addFrames( tSubTextureVec ); Sprite( tSprite ); } } else { - Graphics::SubTexture * tSubTexture = TextureAtlasManager::instance()->GetSubTextureById( Id ); + Graphics::SubTexture * tSubTexture = TextureAtlasManager::instance()->getSubTextureById( Id ); if ( NULL != tSubTexture ) { Sprite( eeNew( Graphics::Sprite, ( tSubTexture ) ) ); diff --git a/src/eepp/gaming/gameobjectsubtexture.cpp b/src/eepp/gaming/gameobjectsubtexture.cpp index 5cbaaa2b4..e07e4a297 100644 --- a/src/eepp/gaming/gameobjectsubtexture.cpp +++ b/src/eepp/gaming/gameobjectsubtexture.cpp @@ -34,7 +34,7 @@ void GameObjectSubTexture::Draw() { Vector2i Tile = reinterpret_cast ( mLayer )->GetCurrentTile(); if ( LM->IsByVertex() ) { - mSubTexture->Draw( + mSubTexture->draw( mPos.x, mPos.y, GetAngle(), @@ -47,28 +47,28 @@ void GameObjectSubTexture::Draw() { RenderModeFromFlags() ); } 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 ), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); } } else { if ( LM->IsByVertex() ) { - mSubTexture->Draw( + mSubTexture->draw( mPos.x, mPos.y, GetAngle(), Vector2f::One, LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->DestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->DestSize().x, mPos.y + mSubTexture->DestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->DestSize().y, mPos.y ) ), + LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->destSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().x, mPos.y + mSubTexture->destSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().y, mPos.y ) ), ALPHA_NORMAL, RenderModeFromFlags() ); } 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 ) ), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); } } } else { - mSubTexture->Draw( mPos.x, mPos.y, ColorA(), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, ColorA(), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); } } } @@ -92,7 +92,7 @@ void GameObjectSubTexture::TilePos( Vector2i pos ) { Sizei GameObjectSubTexture::Size() { if ( NULL != mSubTexture ) - return mSubTexture->RealSize(); + return mSubTexture->realSize(); return Sizei(); } @@ -106,11 +106,11 @@ void GameObjectSubTexture::SubTexture( Graphics::SubTexture * subTexture ) { } Uint32 GameObjectSubTexture::DataId() { - return mSubTexture->Id(); + return mSubTexture->getId(); } void GameObjectSubTexture::DataId( Uint32 Id ) { - SubTexture( TextureAtlasManager::instance()->GetSubTextureById( Id ) ); + SubTexture( TextureAtlasManager::instance()->getSubTextureById( Id ) ); } }} diff --git a/src/eepp/gaming/gameobjectsubtextureex.cpp b/src/eepp/gaming/gameobjectsubtextureex.cpp index 06de5b4f7..18b5d6e79 100644 --- a/src/eepp/gaming/gameobjectsubtextureex.cpp +++ b/src/eepp/gaming/gameobjectsubtextureex.cpp @@ -40,7 +40,7 @@ void GameObjectSubTextureEx::Draw() { Vector2i Tile = reinterpret_cast ( mLayer )->GetCurrentTile(); if ( LM->IsByVertex() ) { - mSubTexture->Draw( + mSubTexture->draw( mPos.x, mPos.y, mAngle, @@ -53,31 +53,31 @@ void GameObjectSubTextureEx::Draw() { 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() ) { - mSubTexture->Draw( + mSubTexture->draw( mPos.x, mPos.y, mAngle, mScale, LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->DestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->DestSize().x, mPos.y + mSubTexture->DestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->DestSize().x, mPos.y ) ), + LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->destSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().x, mPos.y + mSubTexture->destSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().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 { if ( NULL != mVertexColors ) { - mSubTexture->Draw( mPos.x, mPos.y, mAngle, mScale, mVertexColors[0], mVertexColors[1], mVertexColors[2], mVertexColors[4], mBlend, mRender ); + mSubTexture->draw( mPos.x, mPos.y, mAngle, mScale, mVertexColors[0], mVertexColors[1], mVertexColors[2], mVertexColors[4], mBlend, mRender ); } else { - mSubTexture->Draw( mPos.x, mPos.y, mColor, mAngle, mScale, mBlend, mRender ); + mSubTexture->draw( mPos.x, mPos.y, mColor, mAngle, mScale, mBlend, mRender ); } } } diff --git a/src/eepp/gaming/gameobjectvirtual.cpp b/src/eepp/gaming/gameobjectvirtual.cpp index 8a7663475..c08ff680e 100644 --- a/src/eepp/gaming/gameobjectvirtual.cpp +++ b/src/eepp/gaming/gameobjectvirtual.cpp @@ -27,7 +27,7 @@ GameObjectVirtual::GameObjectVirtual( SubTexture * SubTexture, MapLayer * Layer, mSubTexture( SubTexture ) { if ( NULL != SubTexture ) - mDataId = SubTexture->Id(); + mDataId = SubTexture->getId(); } GameObjectVirtual::~GameObjectVirtual() { @@ -47,7 +47,7 @@ Uint32 GameObjectVirtual::RealType() const { Sizei GameObjectVirtual::Size() { if ( NULL != mSubTexture ) - return mSubTexture->RealSize(); + return mSubTexture->realSize(); if ( NULL != mLayer ) return mLayer->Map()->TileSize(); @@ -64,7 +64,7 @@ void GameObjectVirtual::Draw() { Vector2i Tile = reinterpret_cast ( mLayer )->GetCurrentTile(); if ( LM->IsByVertex() ) { - mSubTexture->Draw( + mSubTexture->draw( mPos.x, mPos.y, GetAngle(), @@ -77,28 +77,28 @@ void GameObjectVirtual::Draw() { RenderModeFromFlags() ); } 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 ), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); } } else { if ( LM->IsByVertex() ) { - mSubTexture->Draw( + mSubTexture->draw( mPos.x, mPos.y, GetAngle(), Vector2f::One, LM->GetColorFromPos( Vector2f( mPos.x, mPos.y ) ), - LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->DestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->DestSize().x, mPos.y + mSubTexture->DestSize().y ) ), - LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->DestSize().x, mPos.y ) ), + LM->GetColorFromPos( Vector2f( mPos.x, mPos.y + mSubTexture->destSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().x, mPos.y + mSubTexture->destSize().y ) ), + LM->GetColorFromPos( Vector2f( mPos.x + mSubTexture->destSize().x, mPos.y ) ), ALPHA_NORMAL, RenderModeFromFlags() ); } 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 ) ), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); } } } else { - mSubTexture->Draw( mPos.x, mPos.y, ColorA(), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); + mSubTexture->draw( mPos.x, mPos.y, ColorA(), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); } } else { Primitives P; @@ -106,13 +106,13 @@ void GameObjectVirtual::Draw() { ColorA C( mDataId ); C.Alpha = 255; - P.SetColor( C ); + P.setColor( C ); if ( NULL != mLayer ) { Sizei ts = mLayer->Map()->TileSize(); - P.DrawRectangle( Rectf( Vector2f( mPos.x, mPos.y ), Sizef( ts.x ,ts.y ) ), 0, Vector2f::One ); + 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 ); + P.drawRectangle( Rectf( Vector2f( mPos.x, mPos.y ), Sizef( 32 ,32 ) ), 0, Vector2f::One ); } } } diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index ad06fdba8..dc6cb338d 100644 --- a/src/eepp/gaming/mapeditor/mapeditor.cpp +++ b/src/eepp/gaming/mapeditor/mapeditor.cpp @@ -447,7 +447,7 @@ void MapEditor::CreateUIMap() { SubTexture * tTex = HScrollSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tTex ) { - ScrollH = tTex->Size().height(); + ScrollH = tTex->size().height(); } } @@ -455,7 +455,7 @@ void MapEditor::CreateUIMap() { SubTexture * tTex = VScrollSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tTex ) { - ScrollV = tTex->Size().height(); + ScrollV = tTex->size().height(); } } @@ -719,11 +719,11 @@ void MapEditor::FillSGCombo() { std::vector items; Uint32 Restricted1 = String::hash( std::string( "global" ) ); - Uint32 Restricted2 = String::hash( mTheme->TextureAtlas()->Name() ); + Uint32 Restricted2 = String::hash( mTheme->TextureAtlas()->getName() ); for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { - if ( (*it)->Id() != Restricted1 && (*it)->Id() != Restricted2 ) - items.push_back( (*it)->Name() ); + if ( (*it)->getId() != Restricted1 && (*it)->getId() != Restricted2 ) + items.push_back( (*it)->getName() ); } if ( items.size() ) { @@ -746,7 +746,7 @@ void MapEditor::FillSubTextureList() { std::vector items; for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { - items.push_back( (*it)->Name() ); + items.push_back( (*it)->getName() ); } if ( items.size() ) { @@ -1135,7 +1135,7 @@ void MapEditor::TextureAtlasOpen( const UIEvent * Event ) { if ( NULL == SG ) { TextureAtlasLoader tgl( CDL->GetFullPath() ); - if ( tgl.IsLoaded() ) { + if ( tgl.isLoaded() ) { mTextureAtlasesList->ListBox()->AddListBoxItem( sgname ); } } else { @@ -1195,7 +1195,7 @@ GameObject * MapEditor::CreateGameObject() { if ( mChkAnim->Active() ) { - Sprite * tAnimSprite = eeNew( Sprite, ( String::removeNumbersAtEnd( mGfxPreview->SubTexture()->Name() ) ) ); + Sprite * tAnimSprite = eeNew( Sprite, ( String::removeNumbersAtEnd( mGfxPreview->SubTexture()->getName() ) ) ); tObj = eeNew( GameObjectSprite, ( mCurGOFlags, mCurLayer, tAnimSprite ) ); } else { diff --git a/src/eepp/gaming/mapeditor/uimap.cpp b/src/eepp/gaming/mapeditor/uimap.cpp index b2d7163cb..703626560 100644 --- a/src/eepp/gaming/mapeditor/uimap.cpp +++ b/src/eepp/gaming/mapeditor/uimap.cpp @@ -366,78 +366,78 @@ void UIMap::AddLight( MapLight * Light ) { void UIMap::MapDraw() { if ( EDITING_LIGHT == mEditingMode ) { if ( NULL != mSelLight ) { - mP.SetColor( ColorA( 255, 0, 0, (Uint8)mAlpha ) ); + mP.setColor( ColorA( 255, 0, 0, (Uint8)mAlpha ) ); Vector2f Pos( mSelLight->GetAABB().Left, mSelLight->GetAABB().Top ); eeAABB AB( mSelLight->GetAABB() ); - mP.FillMode( DRAW_LINE ); - mP.DrawRectangle( Rectf( Pos, AB.size() ) ); + mP.fillMode( DRAW_LINE ); + mP.drawRectangle( Rectf( Pos, AB.size() ) ); } } else if ( EDITING_OBJECT == mEditingMode ) { switch ( mEditingObjMode ) { case INSERT_OBJECT: { if ( mObjRECTEditing ) { - mP.FillMode( DRAW_FILL ); - mP.SetColor( ColorA( 100, 100, 100, 20 ) ); - mP.DrawRectangle( mObjRECT ); + mP.fillMode( DRAW_FILL ); + mP.setColor( ColorA( 100, 100, 100, 20 ) ); + mP.drawRectangle( mObjRECT ); - mP.FillMode( DRAW_LINE ); - mP.SetColor( ColorA( 255, 0, 0, 200 ) ); - mP.DrawRectangle( mObjRECT ); + mP.fillMode( DRAW_LINE ); + mP.setColor( ColorA( 255, 0, 0, 200 ) ); + mP.drawRectangle( mObjRECT ); } break; } case INSERT_POLYGON: { - mP.FillMode( DRAW_FILL ); - mP.SetColor( ColorA( 50, 50, 50, 50 ) ); - mP.DrawPolygon( mObjPoly ); + mP.fillMode( DRAW_FILL ); + mP.setColor( ColorA( 50, 50, 50, 50 ) ); + mP.drawPolygon( mObjPoly ); - mP.FillMode( DRAW_LINE ); - mP.SetColor( ColorA( 255, 0, 0, 200 ) ); - mP.DrawPolygon( mObjPoly ); + mP.fillMode( DRAW_LINE ); + mP.setColor( ColorA( 255, 0, 0, 200 ) ); + mP.drawPolygon( mObjPoly ); Polygon2f polyN( mObjPoly ); polyN.pushBack( GetMouseMapPos() ); - mP.FillMode( DRAW_FILL ); - mP.SetColor( ColorA( 100, 100, 100, 100 ) ); - mP.DrawPolygon( polyN ); + mP.fillMode( DRAW_FILL ); + mP.setColor( ColorA( 100, 100, 100, 100 ) ); + mP.drawPolygon( polyN ); - mP.FillMode( DRAW_LINE ); - mP.SetColor( ColorA( 255, 255, 0, 200 ) ); - mP.DrawPolygon( polyN ); + mP.fillMode( DRAW_LINE ); + mP.setColor( ColorA( 255, 255, 0, 200 ) ); + mP.drawPolygon( polyN ); break; } case INSERT_POLYLINE: { - mP.FillMode( DRAW_LINE ); - mP.SetColor( ColorA( 255, 0, 0, 200 ) ); - mP.DrawPolygon( mObjPoly ); + mP.fillMode( DRAW_LINE ); + mP.setColor( ColorA( 255, 0, 0, 200 ) ); + mP.drawPolygon( mObjPoly ); Polygon2f polyN( mObjPoly ); polyN.pushBack( GetMouseMapPos() ); - mP.FillMode( DRAW_LINE ); - mP.SetColor( ColorA( 255, 255, 0, 200 ) ); - mP.DrawPolygon( polyN ); + mP.fillMode( DRAW_LINE ); + mP.setColor( ColorA( 255, 255, 0, 200 ) ); + mP.drawPolygon( polyN ); break; } case EDIT_POLYGONS: { if ( NULL != mSelObj && eeINDEX_NOT_FOUND != mSelPointIndex ) { - mP.SetColor( ColorA( 255, 255, 100, 100 ) ); + mP.setColor( ColorA( 255, 255, 100, 100 ) ); - mP.FillMode( DRAW_FILL ); - mP.DrawRectangle( mSelPointRect ); + mP.fillMode( DRAW_FILL ); + mP.drawRectangle( mSelPointRect ); - mP.FillMode( DRAW_LINE ); - mP.DrawRectangle( mSelPointRect ); + mP.fillMode( DRAW_LINE ); + mP.drawRectangle( mSelPointRect ); } break; diff --git a/src/eepp/gaming/objectlayer.cpp b/src/eepp/gaming/objectlayer.cpp index 0846982b8..4d8659ccc 100644 --- a/src/eepp/gaming/objectlayer.cpp +++ b/src/eepp/gaming/objectlayer.cpp @@ -30,12 +30,12 @@ void MapObjectLayer::DeallocateLayer() { } void MapObjectLayer::Draw( const Vector2f &Offset ) { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); ObjList::iterator it; - GLi->PushMatrix(); - GLi->Translatef( mOffset.x, mOffset.y, 0.0f ); + GLi->pushMatrix(); + GLi->translatef( mOffset.x, mOffset.y, 0.0f ); for ( it = mObjects.begin(); it != mObjects.end(); it++ ) { (*it)->Draw(); @@ -50,14 +50,14 @@ void MapObjectLayer::Draw( const Vector2f &Offset ) { GameObject * Obj = (*it); if ( Obj->Blocked() ) { - Tex->DrawEx( Obj->Pos().x, Obj->Pos().y, Obj->Size().width(), Obj->Size().height(), 0, Vector2f::One, Col, Col, Col, Col ); + Tex->drawEx( Obj->Pos().x, Obj->Pos().y, Obj->Size().width(), Obj->Size().height(), 0, Vector2f::One, Col, Col, Col, Col ); } } } - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); - GLi->PopMatrix(); + GLi->popMatrix(); } void MapObjectLayer::Update() { diff --git a/src/eepp/gaming/tilemap.cpp b/src/eepp/gaming/tilemap.cpp index 82b3a90de..ec9535836 100644 --- a/src/eepp/gaming/tilemap.cpp +++ b/src/eepp/gaming/tilemap.cpp @@ -121,7 +121,7 @@ void TileMap::CreateEmptyTile() { std::string tileName( String::strFormated( "maptile-%dx%d-%ul", mTileSize.width(), mTileSize.height(), mGridLinesColor.getValue() ) ); - Texture * Tex = TF->GetByName( tileName ); + Texture * Tex = TF->getByName( tileName ); if ( NULL == Tex ) { Uint32 x, y; @@ -129,23 +129,23 @@ void TileMap::CreateEmptyTile() { Image Img( mTileSize.width(), mTileSize.height(), 4 ); - Img.FillWithColor( ColorA( 0, 0, 0, 0 ) ); + Img.fillWithColor( ColorA( 0, 0, 0, 0 ) ); - for ( x = 0; x < Img.Width(); x++ ) { - Img.SetPixel( x, 0, Col ); - Img.SetPixel( x, mTileSize.y - 1, Col ); + for ( x = 0; x < Img.width(); x++ ) { + Img.setPixel( x, 0, Col ); + Img.setPixel( x, mTileSize.y - 1, Col ); } - for ( y = 0; y < Img.Height(); y++ ) { - Img.SetPixel( 0, y, Col ); - Img.SetPixel( mTileSize.x - 1, y, Col ); + for ( y = 0; y < Img.height(); y++ ) { + Img.setPixel( 0, y, Col ); + Img.setPixel( mTileSize.x - 1, y, Col ); } - Uint32 TileTexId = TF->LoadFromPixels( - Img.GetPixelsPtr(), - Img.Width(), - Img.Height(), - Img.Channels(), + Uint32 TileTexId = TF->loadFromPixels( + Img.getPixelsPtr(), + Img.width(), + Img.height(), + Img.channels(), true, CLAMP_TO_EDGE, false, @@ -153,7 +153,7 @@ void TileMap::CreateEmptyTile() { tileName ); - mTileTex = TF->GetTexture( TileTexId ); + mTileTex = TF->getTexture( TileTexId ); } else { mTileTex = Tex; } @@ -211,7 +211,7 @@ MapLayer* TileMap::GetLayer( const std::string& name ) { } void TileMap::Draw() { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); if ( ClipedArea() ) { mWindow->clipEnable( mScreenPos.x, mScreenPos.y, mViewSize.x, mViewSize.y ); @@ -222,17 +222,17 @@ void TileMap::Draw() { Uint8 Alpha = static_cast( (Float)mBackColor.a() * ( (Float)mBackAlpha / 255.f ) ); - P.SetColor( ColorA( mBackColor.r(), mBackColor.g(), mBackColor.b(), Alpha ) ); - P.DrawRectangle( Rectf( Vector2f( mScreenPos.x, mScreenPos.y ), Sizef( mViewSize.x, mViewSize.y ) ), 0.f, Vector2f::One ); - P.SetColor( ColorA( 255, 255, 255, 255 ) ); + P.setColor( ColorA( mBackColor.r(), mBackColor.g(), mBackColor.b(), Alpha ) ); + P.drawRectangle( Rectf( Vector2f( mScreenPos.x, mScreenPos.y ), Sizef( mViewSize.x, mViewSize.y ) ), 0.f, Vector2f::One ); + P.setColor( ColorA( 255, 255, 255, 255 ) ); } float oldM[16]; - GLi->GetCurrentMatrix( GL_MODELVIEW_MATRIX, oldM ); - GLi->LoadIdentity(); - GLi->PushMatrix(); - GLi->Translatef( (Float)static_cast( mScreenPos.x + mOffset.x ), (Float)static_cast( mScreenPos.y + mOffset.y ), 0 ); - GLi->Scalef( mScale, mScale, 0 ); + GLi->getCurrentMatrix( GL_MODELVIEW_MATRIX, oldM ); + GLi->loadIdentity(); + GLi->pushMatrix(); + GLi->translatef( (Float)static_cast( mScreenPos.x + mOffset.x ), (Float)static_cast( mScreenPos.y + mOffset.y ), 0 ); + GLi->scalef( mScale, mScale, 0 ); GridDraw(); @@ -246,10 +246,10 @@ void TileMap::Draw() { if ( mDrawCb.IsSet() ) mDrawCb(); - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); - GLi->PopMatrix(); - GLi->LoadMatrixf( oldM ); + GLi->popMatrix(); + GLi->loadMatrixf( oldM ); if ( ClipedArea() ) { mWindow->clipDisable(); @@ -260,7 +260,7 @@ void TileMap::MouseOverDraw() { if ( !DrawTileOver() || NULL == mTileTex ) return; - mTileTex->Draw( mMouseOverTileFinal.x * mTileSize.x, mMouseOverTileFinal.y * mTileSize.y, 0, Vector2f::One, mTileOverColor ); + mTileTex->draw( mMouseOverTileFinal.x * mTileSize.x, mMouseOverTileFinal.y * mTileSize.y, 0, Vector2f::One, mTileOverColor ); } void TileMap::GridDraw() { @@ -270,7 +270,7 @@ void TileMap::GridDraw() { if ( 0 == mSize.x || 0 == mSize.y || NULL == mTileTex ) return; - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); Vector2i start = StartTile(); Vector2i end = EndTile(); @@ -295,20 +295,20 @@ void TileMap::GridDraw() { TileTexCol0.Alpha = TileTexCol1.Alpha = TileTexCol2.Alpha = TileTexCol3.Alpha = mBackAlpha; - mTileTex->DrawEx( tx, ty, 0, 0, 0, Vector2f::One, TileTexCol0, TileTexCol1, TileTexCol2, TileTexCol3 ); + mTileTex->drawEx( tx, ty, 0, 0, 0, Vector2f::One, TileTexCol0, TileTexCol1, TileTexCol2, TileTexCol3 ); } else { TileTexCol = *mLightManager->GetTileColor( TPos ); TileTexCol.Alpha = mBackAlpha; - mTileTex->Draw( tx, ty, 0, Vector2f::One, TileTexCol ); + mTileTex->draw( tx, ty, 0, Vector2f::One, TileTexCol ); } } else { - mTileTex->Draw( tx, ty, 0, Vector2f::One, TileTexCol ); + mTileTex->draw( tx, ty, 0, Vector2f::One, TileTexCol ); } } } - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); } const bool& TileMap::IsMouseOver() const { @@ -655,7 +655,7 @@ GameObject * TileMap::CreateGameObject( const Uint32& Type, const Uint32& Flags, return mCreateGOCb( Type, Flags, Layer, DataId ); } else { GameObjectVirtual * tVirtual; - SubTexture * tIsSubTexture = TextureAtlasManager::instance()->GetSubTextureById( DataId ); + SubTexture * tIsSubTexture = TextureAtlasManager::instance()->getSubTextureById( DataId ); if ( NULL != tIsSubTexture ) { tVirtual = eeNew( GameObjectVirtual, ( tIsSubTexture, Layer, Flags, Type ) ); @@ -840,7 +840,7 @@ bool TileMap::LoadFromStream( IOStream& IOS ) { if ( NULL == TextureAtlasManager::instance()->getByName( sgname ) ) { TextureAtlasLoader * tgl = eeNew( TextureAtlasLoader, () ); - tgl->Load( Sys::getProcessPath() + TextureAtlases[i] ); + tgl->load( Sys::getProcessPath() + TextureAtlases[i] ); eeSAFE_DELETE( tgl ); } @@ -1379,11 +1379,11 @@ std::vector TileMap::GetTextureAtlases() { //! Ugly ugly ugly, but i don't see another way Uint32 Restricted1 = String::hash( std::string( "global" ) ); - Uint32 Restricted2 = String::hash( UI::UIThemeManager::instance()->DefaultTheme()->TextureAtlas()->Name() ); + Uint32 Restricted2 = String::hash( UI::UIThemeManager::instance()->DefaultTheme()->TextureAtlas()->getName() ); for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { - if ( (*it)->Id() != Restricted1 && (*it)->Id() != Restricted2 ) - items.push_back( (*it)->Path() ); + if ( (*it)->getId() != Restricted1 && (*it)->getId() != Restricted2 ) + items.push_back( (*it)->path() ); } return items; diff --git a/src/eepp/gaming/tilemaplayer.cpp b/src/eepp/gaming/tilemaplayer.cpp index f19f71029..b4a296519 100644 --- a/src/eepp/gaming/tilemaplayer.cpp +++ b/src/eepp/gaming/tilemaplayer.cpp @@ -20,10 +20,10 @@ TileMapLayer::~TileMapLayer() { } void TileMapLayer::Draw( const Vector2f& Offset ) { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); - GLi->PushMatrix(); - GLi->Translatef( mOffset.x, mOffset.y, 0.0f ); + GLi->pushMatrix(); + GLi->translatef( mOffset.x, mOffset.y, 0.0f ); Vector2i start = mMap->StartTile(); Vector2i end = mMap->EndTile(); @@ -46,16 +46,16 @@ void TileMapLayer::Draw( const Vector2f& Offset ) { 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 ) ); + Tex->draw( x * mMap->TileSize().x, y * mMap->TileSize().y, 0 , Vector2f::One, ColorA( 255, 0, 0, 200 ) ); } } } } } - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); - GLi->PopMatrix(); + GLi->popMatrix(); } void TileMapLayer::Update() { diff --git a/src/eepp/graphics/batchrenderer.cpp b/src/eepp/graphics/batchrenderer.cpp index 07676a5fe..b7a72ee70 100755 --- a/src/eepp/graphics/batchrenderer.cpp +++ b/src/eepp/graphics/batchrenderer.cpp @@ -23,8 +23,8 @@ BatchRenderer::BatchRenderer() : mForceRendering(false), mForceBlendMode(true) { - AllocVertexs( 1024 ); - Init(); + allocVertexs( 1024 ); + init(); } BatchRenderer::BatchRenderer( const unsigned int& Prealloc ) : @@ -43,68 +43,68 @@ BatchRenderer::BatchRenderer( const unsigned int& Prealloc ) : mForceRendering(false), mForceBlendMode(true) { - AllocVertexs( Prealloc ); - Init(); + allocVertexs( Prealloc ); + init(); } BatchRenderer::~BatchRenderer() { eeSAFE_DELETE_ARRAY( mVertex ); } -void BatchRenderer::Init() { - QuadsBegin(); +void BatchRenderer::init() { + quadsBegin(); } -void BatchRenderer::AllocVertexs( const unsigned int& size ) { +void BatchRenderer::allocVertexs( const unsigned int& size ) { eeSAFE_DELETE_ARRAY( mVertex ); mVertex = eeNewArray( eeVertex, size ); mVertexSize = size; mNumVertex = 0; } -void BatchRenderer::DrawOpt() { +void BatchRenderer::drawOpt() { if ( mForceRendering ) - Flush(); + flush(); } -void BatchRenderer::Draw() { - Flush(); +void BatchRenderer::draw() { + flush(); } -void BatchRenderer::SetTexture( const Texture * Tex ) { +void BatchRenderer::setTexture( const Texture * Tex ) { if ( mTexture != Tex ) - Flush(); + flush(); mTexture = Tex; } -void BatchRenderer::SetBlendMode( const EE_BLEND_MODE& Blend ) { +void BatchRenderer::setBlendMode( const EE_BLEND_MODE& Blend ) { if ( Blend != mBlend ) - Flush(); + flush(); mBlend = Blend; } -void BatchRenderer::AddVertexs( const unsigned int& num ) { +void BatchRenderer::addVertexs( const unsigned int& num ) { mNumVertex += num; if ( ( mNumVertex + num ) >= mVertexSize ) - Flush(); + flush(); } -void BatchRenderer::SetBlendMode( EE_DRAW_MODE Mode, const bool& Force ) { +void BatchRenderer::setBlendMode( EE_DRAW_MODE Mode, const bool& Force ) { if ( Force && mCurrentMode != Mode ) { - Flush(); + flush(); mCurrentMode = Mode; } } -void BatchRenderer::Flush() { +void BatchRenderer::flush() { if ( mNumVertex == 0 ) return; if ( GlobalBatchRenderer::instance() != this ) - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); Uint32 NumVertex = mNumVertex; mNumVertex = 0; @@ -114,65 +114,65 @@ void BatchRenderer::Flush() { BlendMode::SetMode( mBlend ); if ( mCurrentMode == DM_POINTS && NULL != mTexture ) { - GLi->Enable( GL_POINT_SPRITE ); - GLi->PointSize( (float)mTexture->Width() ); + GLi->enable( GL_POINT_SPRITE ); + GLi->pointSize( (float)mTexture->width() ); } if ( CreateMatrix ) { - GLi->LoadIdentity(); - GLi->PushMatrix(); + GLi->loadIdentity(); + GLi->pushMatrix(); - GLi->Translatef( mPosition.x + mCenter.x, mPosition.y + mCenter.y, 0.0f); - GLi->Rotatef( mRotation, 0.0f, 0.0f, 1.0f ); - GLi->Scalef( mScale.x, mScale.y, 1.0f ); - GLi->Translatef( -mCenter.x, -mCenter.y, 0.0f); + GLi->translatef( mPosition.x + mCenter.x, mPosition.y + mCenter.y, 0.0f); + GLi->rotatef( mRotation, 0.0f, 0.0f, 1.0f ); + GLi->scalef( mScale.x, mScale.y, 1.0f ); + GLi->translatef( -mCenter.x, -mCenter.y, 0.0f); } Uint32 alloc = sizeof(eeVertex) * NumVertex; if ( NULL != mTexture ) { - mTF->Bind( mTexture ); - GLi->TexCoordPointer( 2, GL_FP , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) + sizeof(Vector2f) , alloc ); + mTF->bind( mTexture ); + GLi->texCoordPointer( 2, GL_FP , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) + sizeof(Vector2f) , alloc ); } else { - GLi->Disable( GL_TEXTURE_2D ); - GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->disable( GL_TEXTURE_2D ); + GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); } - GLi->VertexPointer ( 2, GL_FP , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) , alloc ); - GLi->ColorPointer ( 4, GL_UNSIGNED_BYTE , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) + sizeof(Vector2f) + sizeof(eeTexCoord) , alloc ); + GLi->vertexPointer ( 2, GL_FP , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) , alloc ); + GLi->colorPointer ( 4, GL_UNSIGNED_BYTE , sizeof(eeVertex), reinterpret_cast ( &mVertex[0] ) + sizeof(Vector2f) + sizeof(eeTexCoord) , alloc ); - if ( !GLi->QuadsSupported() ) { + if ( !GLi->quadsSupported() ) { if ( DM_QUADS == mCurrentMode ) { - GLi->DrawArrays( DM_TRIANGLES, 0, NumVertex ); + GLi->drawArrays( DM_TRIANGLES, 0, NumVertex ); } else if ( DM_POLYGON == mCurrentMode ) { - GLi->DrawArrays( DM_TRIANGLE_FAN, 0, NumVertex ); + GLi->drawArrays( DM_TRIANGLE_FAN, 0, NumVertex ); } else { - GLi->DrawArrays( mCurrentMode, 0, NumVertex ); + GLi->drawArrays( mCurrentMode, 0, NumVertex ); } } else { - GLi->DrawArrays( mCurrentMode, 0, NumVertex ); + GLi->drawArrays( mCurrentMode, 0, NumVertex ); } if ( CreateMatrix ) { - GLi->PopMatrix(); + GLi->popMatrix(); } if ( mCurrentMode == DM_POINTS && NULL != mTexture ) { - GLi->Disable( GL_POINT_SPRITE ); + GLi->disable( GL_POINT_SPRITE ); } if ( NULL == mTexture ) { - GLi->Enable( GL_TEXTURE_2D ); - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->enable( GL_TEXTURE_2D ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); } } -void BatchRenderer::BatchQuad( const Float& x, const Float& y, const Float& width, const Float& height, const Float& angle ) { - BatchQuadEx( x, y, width, height, angle ); +void BatchRenderer::batchQuad( const Float& x, const Float& y, const Float& width, const Float& height, const Float& angle ) { + batchQuadEx( x, y, width, height, angle ); } -void BatchRenderer::BatchQuadEx( Float x, Float y, Float width, Float height, Float angle, Vector2f scale, OriginPoint originPoint ) { - if ( mNumVertex + ( GLi->QuadsSupported() ? 3 : 5 ) >= mVertexSize ) +void BatchRenderer::batchQuadEx( Float x, Float y, Float width, Float height, Float angle, Vector2f scale, OriginPoint originPoint ) { + if ( mNumVertex + ( GLi->quadsSupported() ? 3 : 5 ) >= mVertexSize ) return; if ( originPoint.OriginType == OriginPoint::OriginCenter ) { @@ -191,59 +191,59 @@ void BatchRenderer::BatchQuadEx( Float x, Float y, Float width, Float height, Fl originPoint.x += x; originPoint.y += y; - SetBlendMode( DM_QUADS, mForceBlendMode ); + setBlendMode( DM_QUADS, mForceBlendMode ); - if ( GLi->QuadsSupported() ) { + if ( GLi->quadsSupported() ) { mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x; mTVertex->pos.y = y; mTVertex->tex = mTexCoord[0]; mTVertex->color = mVerColor[0]; - Rotate(originPoint, &mTVertex->pos, angle); + rotate(originPoint, &mTVertex->pos, angle); mTVertex = &mVertex[ mNumVertex + 1 ]; mTVertex->pos.x = x; mTVertex->pos.y = y + height; mTVertex->tex = mTexCoord[1]; mTVertex->color = mVerColor[1]; - Rotate(originPoint, &mTVertex->pos, angle); + rotate(originPoint, &mTVertex->pos, angle); mTVertex = &mVertex[ mNumVertex + 2 ]; mTVertex->pos.x = x + width; mTVertex->pos.y = y + height; mTVertex->tex = mTexCoord[2]; mTVertex->color = mVerColor[2]; - Rotate(originPoint, &mTVertex->pos, angle); + rotate(originPoint, &mTVertex->pos, angle); mTVertex = &mVertex[ mNumVertex + 3 ]; mTVertex->pos.x = x + width; mTVertex->pos.y = y; mTVertex->tex = mTexCoord[3]; mTVertex->color = mVerColor[3]; - Rotate(originPoint, &mTVertex->pos, angle); + rotate(originPoint, &mTVertex->pos, angle); - AddVertexs( 4 ); + addVertexs( 4 ); } else { mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x; mTVertex->pos.y = y + height; mTVertex->tex = mTexCoord[1]; mTVertex->color = mVerColor[1]; - Rotate(originPoint, &mTVertex->pos, angle); + rotate(originPoint, &mTVertex->pos, angle); mTVertex = &mVertex[ mNumVertex + 1 ]; mTVertex->pos.x = x; mTVertex->pos.y = y; mTVertex->tex = mTexCoord[0]; mTVertex->color = mVerColor[0]; - Rotate(originPoint, &mTVertex->pos, angle); + rotate(originPoint, &mTVertex->pos, angle); mTVertex = &mVertex[ mNumVertex + 2 ]; mTVertex->pos.x = x + width; mTVertex->pos.y = y; mTVertex->tex = mTexCoord[3]; mTVertex->color = mVerColor[3]; - Rotate(originPoint, &mTVertex->pos, angle); + rotate(originPoint, &mTVertex->pos, angle); mTVertex = &mVertex[ mNumVertex + 3 ]; mTVertex->pos = mVertex[ mNumVertex ].pos; @@ -255,24 +255,24 @@ void BatchRenderer::BatchQuadEx( Float x, Float y, Float width, Float height, Fl mTVertex->pos.y = y + height; mTVertex->tex = mTexCoord[2]; mTVertex->color = mVerColor[2]; - Rotate(originPoint, &mTVertex->pos, angle); + rotate(originPoint, &mTVertex->pos, angle); mTVertex = &mVertex[ mNumVertex + 5 ]; mTVertex->pos = mVertex[ mNumVertex + 2 ].pos; mTVertex->tex = mTexCoord[3]; mTVertex->color = mVerColor[3]; - AddVertexs( 6 ); + addVertexs( 6 ); } } -void BatchRenderer::BatchQuadFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ) { - if ( mNumVertex + ( GLi->QuadsSupported() ? 3 : 5 ) >= mVertexSize ) +void BatchRenderer::batchQuadFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ) { + if ( mNumVertex + ( GLi->quadsSupported() ? 3 : 5 ) >= mVertexSize ) return; - SetBlendMode( DM_QUADS, mForceBlendMode ); + setBlendMode( DM_QUADS, mForceBlendMode ); - if ( GLi->QuadsSupported() ) { + if ( GLi->quadsSupported() ) { mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x0; mTVertex->pos.y = y0; @@ -297,7 +297,7 @@ void BatchRenderer::BatchQuadFree( const Float& x0, const Float& y0, const Float mTVertex->tex = mTexCoord[3]; mTVertex->color = mVerColor[3]; - AddVertexs( 4 ); + addVertexs( 4 ); } else { mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x1; @@ -335,12 +335,12 @@ void BatchRenderer::BatchQuadFree( const Float& x0, const Float& y0, const Float mTVertex->tex = mTexCoord[3]; mTVertex->color = mVerColor[3]; - AddVertexs( 6 ); + addVertexs( 6 ); } } -void BatchRenderer::BatchQuadFreeEx( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3, const Float& Angle, const Float& Scale ) { - if ( mNumVertex + ( GLi->QuadsSupported() ? 3 : 5 ) >= mVertexSize ) +void BatchRenderer::batchQuadFreeEx( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3, const Float& Angle, const Float& Scale ) { + if ( mNumVertex + ( GLi->quadsSupported() ? 3 : 5 ) >= mVertexSize ) return; Quad2f mQ; @@ -354,9 +354,9 @@ void BatchRenderer::BatchQuadFreeEx( const Float& x0, const Float& y0, const Flo mQ.scale( Scale, QCenter ); } - SetBlendMode( DM_QUADS, mForceBlendMode ); + setBlendMode( DM_QUADS, mForceBlendMode ); - if ( GLi->QuadsSupported() ) { + if ( GLi->quadsSupported() ) { mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = mQ[0].x; mTVertex->pos.y = mQ[0].y; @@ -381,7 +381,7 @@ void BatchRenderer::BatchQuadFreeEx( const Float& x0, const Float& y0, const Flo mTVertex->tex = mTexCoord[3]; mTVertex->color = mVerColor[3]; - AddVertexs( 4 ); + addVertexs( 4 ); } else { mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = mQ[1].x; @@ -419,28 +419,28 @@ void BatchRenderer::BatchQuadFreeEx( const Float& x0, const Float& y0, const Flo mTVertex->tex = mTexCoord[3]; mTVertex->color = mVerColor[3]; - AddVertexs( 6 ); + addVertexs( 6 ); } } -void BatchRenderer::QuadsBegin() { - SetBlendMode( DM_QUADS, true ); - QuadsSetSubset( 0, 0, 1, 1 ); - QuadsSetColor( ColorA() ); +void BatchRenderer::quadsBegin() { + setBlendMode( DM_QUADS, true ); + quadsSetSubset( 0, 0, 1, 1 ); + quadsSetColor( ColorA() ); } -void BatchRenderer::QuadsSetColor( const ColorA& Color ) { +void BatchRenderer::quadsSetColor( const ColorA& Color ) { mVerColor[0] = mVerColor[1] = mVerColor[2] = mVerColor[3] = Color; } -void BatchRenderer::QuadsSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { +void BatchRenderer::quadsSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { mVerColor[0] = Color0; mVerColor[1] = Color1; mVerColor[2] = Color2; mVerColor[3] = Color3; } -void BatchRenderer::QuadsSetSubset( const Float& tl_u, const Float& tl_v, const Float& br_u, const Float& br_v ) { +void BatchRenderer::quadsSetSubset( const Float& tl_u, const Float& tl_v, const Float& br_u, const Float& br_v ) { mTexCoord[0].u = tl_u; mTexCoord[1].u = tl_u; mTexCoord[0].v = tl_v; mTexCoord[1].v = br_v; @@ -448,14 +448,14 @@ void BatchRenderer::QuadsSetSubset( const Float& tl_u, const Float& tl_v, const mTexCoord[2].v = br_v; mTexCoord[3].v = tl_v; } -void BatchRenderer::QuadsSetSubsetFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ) { +void BatchRenderer::quadsSetSubsetFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ) { mTexCoord[0].u = x0; mTexCoord[0].v = y0; mTexCoord[1].u = x1; mTexCoord[1].v = y1; mTexCoord[2].u = x2; mTexCoord[2].v = y2; mTexCoord[3].u = x3; mTexCoord[3].v = y3; } -void BatchRenderer::Rotate( const Vector2f& center, Vector2f* point, const Float& angle ) { +void BatchRenderer::rotate( const Vector2f& center, Vector2f* point, const Float& angle ) { if ( angle ) { Float x = point->x - center.x; Float y = point->y - center.y; @@ -464,21 +464,21 @@ void BatchRenderer::Rotate( const Vector2f& center, Vector2f* point, const Float } } -void BatchRenderer::PointsBegin() { - SetBlendMode( DM_POINTS, true ); - QuadsSetSubset( 0, 0, 1, 1 ); - PointSetColor( ColorA() ); +void BatchRenderer::pointsBegin() { + setBlendMode( DM_POINTS, true ); + quadsSetSubset( 0, 0, 1, 1 ); + pointSetColor( ColorA() ); } -void BatchRenderer::PointSetColor( const ColorA& Color ) { - QuadsSetColor( Color ); +void BatchRenderer::pointSetColor( const ColorA& Color ) { + quadsSetColor( Color ); } -void BatchRenderer::BatchPoint( const Float& x, const Float& y ) { +void BatchRenderer::batchPoint( const Float& x, const Float& y ) { if ( mNumVertex + 1 >= mVertexSize ) return; - SetBlendMode( DM_POINTS, mForceBlendMode ); + setBlendMode( DM_POINTS, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x; @@ -486,28 +486,28 @@ void BatchRenderer::BatchPoint( const Float& x, const Float& y ) { mTVertex->tex = mTexCoord[0]; mTVertex->color = mVerColor[0]; - AddVertexs(1); + addVertexs(1); } -void BatchRenderer::LinesBegin() { - SetBlendMode( DM_LINES, true ); - QuadsSetSubset( 0, 0, 1, 1 ); - PointSetColor( ColorA() ); +void BatchRenderer::linesBegin() { + setBlendMode( DM_LINES, true ); + quadsSetSubset( 0, 0, 1, 1 ); + pointSetColor( ColorA() ); } -void BatchRenderer::LinesSetColor( const ColorA& Color ) { - QuadsSetColor( Color ); +void BatchRenderer::linesSetColor( const ColorA& Color ) { + quadsSetColor( Color ); } -void BatchRenderer::LinesSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { - QuadsSetColorFree( Color0, Color1, Color0, Color0 ); +void BatchRenderer::linesSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { + quadsSetColorFree( Color0, Color1, Color0, Color0 ); } -void BatchRenderer::BatchLine( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ) { +void BatchRenderer::batchLine( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ) { if ( mNumVertex + 1 >= mVertexSize ) return; - SetBlendMode( DM_LINES, mForceBlendMode ); + setBlendMode( DM_LINES, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x0; @@ -521,28 +521,28 @@ void BatchRenderer::BatchLine( const Float& x0, const Float& y0, const Float& x1 mTVertex->tex = mTexCoord[1]; mTVertex->color = mVerColor[1]; - AddVertexs(2); + addVertexs(2); } -void BatchRenderer::LineLoopBegin() { - SetBlendMode( DM_LINE_LOOP, true ); - QuadsSetSubset( 0, 0, 1, 1 ); - PointSetColor( ColorA() ); +void BatchRenderer::lineLoopBegin() { + setBlendMode( DM_LINE_LOOP, true ); + quadsSetSubset( 0, 0, 1, 1 ); + pointSetColor( ColorA() ); } -void BatchRenderer::LineLoopSetColor( const ColorA& Color ) { - QuadsSetColor( Color ); +void BatchRenderer::lineLoopSetColor( const ColorA& Color ) { + quadsSetColor( Color ); } -void BatchRenderer::LineLoopSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { - QuadsSetColorFree( Color0, Color1, Color0, Color0 ); +void BatchRenderer::lineLoopSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { + quadsSetColorFree( Color0, Color1, Color0, Color0 ); } -void BatchRenderer::BatchLineLoop( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ) { +void BatchRenderer::batchLineLoop( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ) { if ( mNumVertex + 1 >= mVertexSize ) return; - SetBlendMode( DM_LINE_LOOP, mForceBlendMode ); + setBlendMode( DM_LINE_LOOP, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x0; @@ -556,18 +556,18 @@ void BatchRenderer::BatchLineLoop( const Float& x0, const Float& y0, const Float mTVertex->tex = mTexCoord[1]; mTVertex->color = mVerColor[1]; - AddVertexs(2); + addVertexs(2); } -void BatchRenderer::BatchLineLoop( const Vector2f& vector1, const Vector2f& vector2 ) { - BatchLineLoop( vector1.x, vector1.y, vector2.x, vector2.y ); +void BatchRenderer::batchLineLoop( const Vector2f& vector1, const Vector2f& vector2 ) { + batchLineLoop( vector1.x, vector1.y, vector2.x, vector2.y ); } -void BatchRenderer::BatchLineLoop( const Float& x0, const Float& y0 ) { +void BatchRenderer::batchLineLoop( const Float& x0, const Float& y0 ) { if ( mNumVertex + 1 >= mVertexSize ) return; - SetBlendMode( DM_LINE_LOOP, mForceBlendMode ); + setBlendMode( DM_LINE_LOOP, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x0; @@ -575,32 +575,32 @@ void BatchRenderer::BatchLineLoop( const Float& x0, const Float& y0 ) { mTVertex->tex = mTexCoord[0]; mTVertex->color = mVerColor[0]; - AddVertexs(1); + addVertexs(1); } -void BatchRenderer::BatchLineLoop( const Vector2f& vector1 ) { - BatchLineLoop( vector1.x, vector1.y ); +void BatchRenderer::batchLineLoop( const Vector2f& vector1 ) { + batchLineLoop( vector1.x, vector1.y ); } -void BatchRenderer::LineStripBegin() { - SetBlendMode( DM_LINE_STRIP, true ); - QuadsSetSubset( 0, 0, 1, 1 ); - PointSetColor( ColorA() ); +void BatchRenderer::lineStripBegin() { + setBlendMode( DM_LINE_STRIP, true ); + quadsSetSubset( 0, 0, 1, 1 ); + pointSetColor( ColorA() ); } -void BatchRenderer::LineStripSetColor( const ColorA& Color ) { - QuadsSetColor( Color ); +void BatchRenderer::lineStripSetColor( const ColorA& Color ) { + quadsSetColor( Color ); } -void BatchRenderer::LineStripSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { - QuadsSetColorFree( Color0, Color1, Color0, Color0 ); +void BatchRenderer::lineStripSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { + quadsSetColorFree( Color0, Color1, Color0, Color0 ); } -void BatchRenderer::BatchLineStrip( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ) { +void BatchRenderer::batchLineStrip( const Float& x0, const Float& y0, const Float& x1, const Float& y1 ) { if ( mNumVertex + 1 >= mVertexSize ) return; - SetBlendMode( DM_LINE_STRIP, mForceBlendMode ); + setBlendMode( DM_LINE_STRIP, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x0; @@ -614,18 +614,18 @@ void BatchRenderer::BatchLineStrip( const Float& x0, const Float& y0, const Floa mTVertex->tex = mTexCoord[1]; mTVertex->color = mVerColor[1]; - AddVertexs(2); + addVertexs(2); } -void BatchRenderer::BatchLineStrip( const Vector2f& vector1, const Vector2f& vector2 ) { - BatchLineStrip( vector1.x, vector1.y, vector2.x, vector2.y ); +void BatchRenderer::batchLineStrip( const Vector2f& vector1, const Vector2f& vector2 ) { + batchLineStrip( vector1.x, vector1.y, vector2.x, vector2.y ); } -void BatchRenderer::BatchLineStrip( const Float& x0, const Float& y0 ) { +void BatchRenderer::batchLineStrip( const Float& x0, const Float& y0 ) { if ( mNumVertex + 1 >= mVertexSize ) return; - SetBlendMode( DM_LINE_STRIP, mForceBlendMode ); + setBlendMode( DM_LINE_STRIP, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x0; @@ -633,39 +633,39 @@ void BatchRenderer::BatchLineStrip( const Float& x0, const Float& y0 ) { mTVertex->tex = mTexCoord[0]; mTVertex->color = mVerColor[0]; - AddVertexs(1); + addVertexs(1); } -void BatchRenderer::BatchLineStrip( const Vector2f& vector1 ) { - BatchLineStrip( vector1.x, vector1.y ); +void BatchRenderer::batchLineStrip( const Vector2f& vector1 ) { + batchLineStrip( vector1.x, vector1.y ); } -void BatchRenderer::TriangleFanBegin() { - SetBlendMode( DM_TRIANGLE_FAN, true ); - TriangleFanSetSubset( 0, 0, 0, 1, 1, 1 ); - TriangleFanSetColor( ColorA() ); +void BatchRenderer::triangleFanBegin() { + setBlendMode( DM_TRIANGLE_FAN, true ); + triangleFanSetSubset( 0, 0, 0, 1, 1, 1 ); + triangleFanSetColor( ColorA() ); } -void BatchRenderer::TriangleFanSetColor( const ColorA& Color ) { - QuadsSetColor( Color ); +void BatchRenderer::triangleFanSetColor( const ColorA& Color ) { + quadsSetColor( Color ); } -void BatchRenderer::TriangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { - QuadsSetColorFree( Color0, Color1, Color2, Color0 ); +void BatchRenderer::triangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { + quadsSetColorFree( Color0, Color1, Color2, Color0 ); } -void BatchRenderer::TriangleFanSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) { +void BatchRenderer::triangleFanSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) { mTexCoord[0].u = x0; mTexCoord[0].v = y0; mTexCoord[1].u = x1; mTexCoord[1].v = y1; mTexCoord[2].u = x2; mTexCoord[2].v = y2; } -void BatchRenderer::BatchTriangleFan( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) { +void BatchRenderer::batchTriangleFan( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) { if ( mNumVertex + 3 >= mVertexSize ) return; - SetBlendMode( DM_TRIANGLE_FAN, mForceBlendMode ); + setBlendMode( DM_TRIANGLE_FAN, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x0; @@ -685,14 +685,14 @@ void BatchRenderer::BatchTriangleFan( const Float& x0, const Float& y0, const Fl mTVertex->tex = mTexCoord[2]; mTVertex->color = mVerColor[2]; - AddVertexs(3); + addVertexs(3); } -void BatchRenderer::BatchTriangleFan( const Float& x0, const Float& y0 ) { +void BatchRenderer::batchTriangleFan( const Float& x0, const Float& y0 ) { if ( mNumVertex + 1 >= mVertexSize ) return; - SetBlendMode( DM_TRIANGLE_FAN, mForceBlendMode ); + setBlendMode( DM_TRIANGLE_FAN, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x0; @@ -700,35 +700,35 @@ void BatchRenderer::BatchTriangleFan( const Float& x0, const Float& y0 ) { mTVertex->tex = mTexCoord[0]; mTVertex->color = mVerColor[0]; - AddVertexs(1); + addVertexs(1); } -void BatchRenderer::TrianglesBegin() { - SetBlendMode( DM_TRIANGLES, true ); - TrianglesSetSubset( 0, 0, 0, 1, 1, 1 ); - TrianglesSetColor( ColorA() ); +void BatchRenderer::trianglesBegin() { + setBlendMode( DM_TRIANGLES, true ); + trianglesSetSubset( 0, 0, 0, 1, 1, 1 ); + trianglesSetColor( ColorA() ); } -void BatchRenderer::TrianglesSetColor( const ColorA& Color ) { - QuadsSetColor( Color ); +void BatchRenderer::trianglesSetColor( const ColorA& Color ) { + quadsSetColor( Color ); } -void BatchRenderer::TrianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { - QuadsSetColorFree( Color0, Color1, Color2, Color0 ); +void BatchRenderer::trianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { + quadsSetColorFree( Color0, Color1, Color2, Color0 ); } -void BatchRenderer::TrianglesSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) { +void BatchRenderer::trianglesSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) { mTexCoord[0].u = x0; mTexCoord[0].v = y0; mTexCoord[1].u = x1; mTexCoord[1].v = y1; mTexCoord[2].u = x2; mTexCoord[2].v = y2; } -void BatchRenderer::BatchTriangle( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) { +void BatchRenderer::batchTriangle( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) { if ( mNumVertex + 2 >= mVertexSize ) return; - SetBlendMode( DM_TRIANGLES, mForceBlendMode ); + setBlendMode( DM_TRIANGLES, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x0; @@ -748,18 +748,18 @@ void BatchRenderer::BatchTriangle( const Float& x0, const Float& y0, const Float mTVertex->tex = mTexCoord[2]; mTVertex->color = mVerColor[2]; - AddVertexs(3); + addVertexs(3); } -void BatchRenderer::PolygonSetColor( const ColorA& Color ) { - PointSetColor( Color ); +void BatchRenderer::polygonSetColor( const ColorA& Color ) { + pointSetColor( Color ); } -void BatchRenderer::BatchPolygon( const Polygon2f& Polygon ) { +void BatchRenderer::batchPolygon( const Polygon2f& Polygon ) { if ( Polygon.size() > mVertexSize ) return; - SetBlendMode( DM_POLYGON, mForceBlendMode ); + setBlendMode( DM_POLYGON, mForceBlendMode ); for ( Uint32 i = 0; i < Polygon.size(); i++ ) { mTVertex = &mVertex[ mNumVertex ]; @@ -769,15 +769,15 @@ void BatchRenderer::BatchPolygon( const Polygon2f& Polygon ) { mTVertex->tex = mTexCoord[0]; mTVertex->color = mVerColor[0]; - AddVertexs(1); + addVertexs(1); } } -void BatchRenderer::BatchPolygonByPoint( const Float& x, const Float& y ) { +void BatchRenderer::batchPolygonByPoint( const Float& x, const Float& y ) { if ( mNumVertex + 1 >= mVertexSize ) return; - SetBlendMode( DM_POLYGON, mForceBlendMode ); + setBlendMode( DM_POLYGON, mForceBlendMode ); mTVertex = &mVertex[ mNumVertex ]; mTVertex->pos.x = x; @@ -785,18 +785,18 @@ void BatchRenderer::BatchPolygonByPoint( const Float& x, const Float& y ) { mTVertex->tex = mTexCoord[0]; mTVertex->color = mVerColor[0]; - AddVertexs(1); + addVertexs(1); } -void BatchRenderer::BatchPolygonByPoint( const Vector2f& Vector ) { - BatchPolygonByPoint( Vector.x, Vector.y ); +void BatchRenderer::batchPolygonByPoint( const Vector2f& Vector ) { + batchPolygonByPoint( Vector.x, Vector.y ); } -void BatchRenderer::SetLineWidth( const Float& lineWidth ) { - GLi->LineWidth( lineWidth ); +void BatchRenderer::setLineWidth( const Float& lineWidth ) { + GLi->lineWidth( lineWidth ); } -Float BatchRenderer::GetLineWidth() { +Float BatchRenderer::getLineWidth() { float lw = 1; #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN @@ -806,19 +806,19 @@ Float BatchRenderer::GetLineWidth() { return lw; } -void BatchRenderer::SetPointSize( const Float& pointSize ) { - GLi->PointSize( pointSize ); +void BatchRenderer::setPointSize( const Float& pointSize ) { + GLi->pointSize( pointSize ); } -Float BatchRenderer::GetPointSize() { - return GLi->PointSize(); +Float BatchRenderer::getPointSize() { + return GLi->pointSize(); } -void BatchRenderer::ForceBlendModeChange( const bool& Force ) { +void BatchRenderer::forceBlendModeChange( const bool& Force ) { mForceBlendMode = Force; } -const bool& BatchRenderer::ForceBlendModeChange() const { +const bool& BatchRenderer::forceBlendModeChange() const { return mForceBlendMode; } diff --git a/src/eepp/graphics/blendmode.cpp b/src/eepp/graphics/blendmode.cpp index c16b18720..bcfd99574 100644 --- a/src/eepp/graphics/blendmode.cpp +++ b/src/eepp/graphics/blendmode.cpp @@ -9,39 +9,39 @@ EE_BLEND_MODE BlendMode::sLastBlend = ALPHA_NORMAL; void BlendMode::SetMode( const EE_BLEND_MODE& blend, bool force ) { if ( sLastBlend != blend || force ) { if (blend == ALPHA_NONE) { - GLi->Disable( GL_BLEND ); + GLi->disable( GL_BLEND ); } else { - GLi->Enable( GL_BLEND ); + GLi->enable( GL_BLEND ); switch (blend) { case ALPHA_NORMAL: - if ( GLi->IsExtension( EEGL_EXT_blend_func_separate ) ) + if ( GLi->isExtension( EEGL_EXT_blend_func_separate ) ) glBlendFuncSeparateEXT( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); else - GLi->BlendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA); + GLi->blendFunc(GL_SRC_ALPHA , GL_ONE_MINUS_SRC_ALPHA); break; case ALPHA_BLENDONE: - if ( GLi->IsExtension( EEGL_EXT_blend_func_separate ) ) + if ( GLi->isExtension( EEGL_EXT_blend_func_separate ) ) glBlendFuncSeparateEXT( GL_SRC_ALPHA, GL_ONE, GL_ONE, GL_ONE ); else - GLi->BlendFunc(GL_SRC_ALPHA , GL_ONE); + GLi->blendFunc(GL_SRC_ALPHA , GL_ONE); break; case ALPHA_BLENDTWO: - GLi->BlendFunc(GL_SRC_ALPHA , GL_SRC_ALPHA); - GLi->BlendFunc(GL_DST_ALPHA , GL_ONE); + GLi->blendFunc(GL_SRC_ALPHA , GL_SRC_ALPHA); + GLi->blendFunc(GL_DST_ALPHA , GL_ONE); break; case ALPHA_BLENDTHREE: - GLi->BlendFunc(GL_SRC_ALPHA , GL_ONE); - GLi->BlendFunc(GL_DST_ALPHA , GL_SRC_ALPHA); + GLi->blendFunc(GL_SRC_ALPHA , GL_ONE); + GLi->blendFunc(GL_DST_ALPHA , GL_SRC_ALPHA); break; case ALPHA_ALPHACHANNELS: - GLi->BlendFunc(GL_SRC_ALPHA , GL_SRC_ALPHA); + GLi->blendFunc(GL_SRC_ALPHA , GL_SRC_ALPHA); break; case ALPHA_DESTALPHA: - GLi->BlendFunc(GL_SRC_ALPHA , GL_DST_ALPHA); + GLi->blendFunc(GL_SRC_ALPHA , GL_DST_ALPHA); break; case ALPHA_MULTIPLY: - GLi->BlendFunc(GL_DST_COLOR,GL_ZERO); + GLi->blendFunc(GL_DST_COLOR,GL_ZERO); break; case ALPHA_NONE: // Avoid compiler warning @@ -57,9 +57,9 @@ void BlendMode::SetMode( const EE_BLEND_MODE& blend, bool force ) { } void BlendMode::SetBlendFunc( const EE_BLEND_FUNC& SrcFactor, const EE_BLEND_FUNC& DestFactor ) { - GLi->Enable( GL_BLEND ); + GLi->enable( GL_BLEND ); - GLi->BlendFunc( (unsigned int)SrcFactor, (unsigned int)DestFactor ); + GLi->blendFunc( (unsigned int)SrcFactor, (unsigned int)DestFactor ); sLastBlend = ALPHA_CUSTOM; } diff --git a/src/eepp/graphics/console.cpp b/src/eepp/graphics/console.cpp index 2b56ecd8b..712d2398a 100755 --- a/src/eepp/graphics/console.cpp +++ b/src/eepp/graphics/console.cpp @@ -79,7 +79,7 @@ Console::Console( Font* Font, const bool& MakeDefaultCommands, const bool& Attac mWindow = Engine::instance()->getCurrentWindow(); } - Create( Font, MakeDefaultCommands, AttachToLog, MaxLogLines, TextureId ); + create( Font, MakeDefaultCommands, AttachToLog, MaxLogLines, TextureId ); } Console::~Console() { @@ -99,17 +99,17 @@ Console::~Console() { } } -void Console::Create( Font* Font, const bool& MakeDefaultCommands, const bool& AttachToLog, const unsigned int& MaxLogLines, const Uint32& TextureId ) { +void Console::create( Font* Font, const bool& MakeDefaultCommands, const bool& AttachToLog, const unsigned int& MaxLogLines, const Uint32& TextureId ) { if ( NULL == mWindow ) { mWindow = Engine::instance()->getCurrentWindow(); } mFont = Font; - mFontSize = (Float)( mFont->GetFontSize() * 1.25 ); + mFontSize = (Float)( mFont->getFontSize() * 1.25 ); - if ( mFont->GetFontHeight() < mFontSize && ( mFont->GetFontHeight() != mFont->GetFontSize() || mFont->GetLineSkip() != (Int32)mFont->GetFontHeight() ) ) - mFontSize = mFont->GetFontHeight(); + if ( mFont->getFontHeight() < mFontSize && ( mFont->getFontHeight() != mFont->getFontSize() || mFont->getLineSkip() != (Int32)mFont->getFontHeight() ) ) + mFontSize = mFont->getFontHeight(); if ( TextureId > 0 ) mTexId = TextureId; @@ -120,7 +120,7 @@ void Console::Create( Font* Font, const bool& MakeDefaultCommands, const bool& A mEnabled = true; if ( MakeDefaultCommands ) - CreateDefaultCommands(); + createDefaultCommands(); mWidth = (Float) mWindow->getWidth(); mHeight = (Float) mWindow->getHeight(); @@ -129,52 +129,52 @@ void Console::Create( Font* Font, const bool& MakeDefaultCommands, const bool& A if ( NULL != Engine::existsSingleton() && Engine::instance()->existsWindow( mWindow ) ) { - mMyCallback = mWindow->getInput()->pushCallback( cb::Make1( this, &Console::PrivInputCallback ) ); - mVidCb = mWindow->pushResizeCallback( cb::Make1( this, &Console::PrivVideoResize ) ); + mMyCallback = mWindow->getInput()->pushCallback( cb::Make1( this, &Console::privInputCallback ) ); + mVidCb = mWindow->pushResizeCallback( cb::Make1( this, &Console::privVideoResize ) ); } - mTBuf->setReturnCallback( cb::Make0( this, &Console::ProcessLine ) ); + mTBuf->setReturnCallback( cb::Make0( this, &Console::processLine ) ); mTBuf->start(); mTBuf->supportNewLine( false ); mTBuf->active( false ); - IgnoreCharOnPrompt( KEY_TAB ); + ignoreCharOnPrompt( KEY_TAB ); mCon.ConModif = 0; - CmdGetLog(); + cmdGetLog(); if ( AttachToLog ) { Log::instance()->addLogReader( this ); } } -void Console::AddCommand( const String& Command, ConsoleCallback CB ) { +void Console::addCommand( const String& Command, ConsoleCallback CB ) { if ( !(mCallbacks.count( Command ) > 0) ) mCallbacks[Command] = CB; } -void Console::Draw() { +void Console::draw() { if ( mEnabled && NULL != mFont ) { - ColorA OldColor( mFont->Color() ); + ColorA OldColor( mFont->color() ); - Fade(); + fade(); if ( mY > 0.0f ) { if ( mTexId == 0 ) { - mPri.SetColor( ColorA( mConColor.r(), mConColor.g(), mConColor.b(), static_cast(mA) ) ); - mPri.DrawRectangle( Rectf( Vector2f( 0.0f, 0.0f ), Sizef( mWidth, mY ) ) ); + mPri.setColor( ColorA( mConColor.r(), mConColor.g(), mConColor.b(), static_cast(mA) ) ); + mPri.drawRectangle( Rectf( Vector2f( 0.0f, 0.0f ), Sizef( mWidth, mY ) ) ); } else { ColorA C( mConColor.r(), mConColor.g(), mConColor.b(), static_cast(mA) ); - Texture * Tex = TextureFactory::instance()->GetTexture( mTexId ); + Texture * Tex = TextureFactory::instance()->getTexture( mTexId ); if ( NULL != Tex ) - Tex->DrawEx( 0.0f, 0.0f, mWidth, mY, 0.0f, Vector2f::One, C, C, C, C ); + Tex->drawEx( 0.0f, 0.0f, mWidth, mY, 0.0f, Vector2f::One, C, C, C, C ); } - mPri.SetColor( ColorA( mConLineColor.r(), mConLineColor.g(), mConLineColor.b(), static_cast(mA) ) ); - mPri.DrawRectangle( Rectf( Vector2f( 0.0f, mY ), Sizef( mWidth, 4.0f ) ) ); + mPri.setColor( ColorA( mConLineColor.r(), mConLineColor.g(), mConLineColor.b(), static_cast(mA) ) ); + mPri.drawRectangle( Rectf( Vector2f( 0.0f, mY ), Sizef( mWidth, 4.0f ) ) ); - Int32 linesInScreen = LinesInScreen(); + Int32 linesInScreen = this->linesInScreen(); if ( static_cast( mCmdLog.size() ) > linesInScreen ) mEx = (Uint32) ( mCmdLog.size() - linesInScreen ); @@ -188,13 +188,13 @@ void Console::Draw() { mCon.ConMin = mEx; mCon.ConMax = (int)mCmdLog.size() - 1; - mFont->Color( ColorA ( mFontColor.r(), mFontColor.g(), mFontColor.b(), static_cast(mA) ) ); + mFont->color( ColorA ( mFontColor.r(), mFontColor.g(), mFontColor.b(), static_cast(mA) ) ); for (int i = mCon.ConMax - mCon.ConModif; i >= mCon.ConMin - mCon.ConModif; i-- ) { if ( i < static_cast( mCmdLog.size() ) && i >= 0 ) { CurY = mTempY + mY + mCurHeight - Pos * mFontSize - mFontSize * 2; - mFont->Draw( mCmdLog[i], mFontSize, CurY ); + mFont->draw( mCmdLog[i], mFontSize, CurY ); Pos++; } @@ -202,33 +202,33 @@ void Console::Draw() { CurY = mTempY + mY + mCurHeight - mFontSize - 1; - mFont->Color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mA) ) ); - mFont->SetText( "> " + mTBuf->buffer() ); - mFont->Draw( mFontSize, CurY ); + mFont->color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mA) ) ); + mFont->setText( "> " + mTBuf->buffer() ); + mFont->draw( mFontSize, CurY ); - mFont->Color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mCurAlpha) ) ); + mFont->color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mCurAlpha) ) ); if ( (unsigned int)mTBuf->curPos() == mTBuf->buffer().size() ) { - mFont->Draw( "_", mFontSize + mFont->GetTextWidth() , CurY ); + mFont->draw( "_", mFontSize + mFont->getTextWidth() , CurY ); } else { - mFont->SetText( "> " + mTBuf->buffer().substr( 0, mTBuf->curPos() ) ); - mFont->Draw( "_", mFontSize + mFont->GetTextWidth() , CurY ); + mFont->setText( "> " + mTBuf->buffer().substr( 0, mTBuf->curPos() ) ); + mFont->draw( "_", mFontSize + mFont->getTextWidth() , CurY ); } - mFont->Color( OldColor ); + mFont->color( OldColor ); } } if ( mShowFps && NULL != mFont ) { - ColorA OldColor1( mFont->Color() ); - mFont->Color( ColorA () ); - mFont->SetText( "FPS: " + String::toStr( mWindow->FPS() ) ); - mFont->Draw( mWindow->getWidth() - mFont->GetTextWidth() - 15, 6 ); - mFont->Color( OldColor1 ); + ColorA OldColor1( mFont->color() ); + mFont->color( ColorA () ); + mFont->setText( "FPS: " + String::toStr( mWindow->FPS() ) ); + mFont->draw( mWindow->getWidth() - mFont->getTextWidth() - 15, 6 ); + mFont->color( OldColor1 ); } } -void Console::FadeIn() { +void Console::fadeIn() { if (!mFading) { mFading = true; mFadeIn = true; @@ -238,7 +238,7 @@ void Console::FadeIn() { } } -void Console::FadeOut() { +void Console::fadeOut() { if (!mFading) { mFading = true; mFadeOut = true; @@ -279,7 +279,7 @@ static std::vector< String > SplitCommandParams( String str ) { return rparams; } -void Console::ProcessLine() { +void Console::processLine() { String str = mTBuf->buffer(); std::vector < String > params = SplitCommandParams( str ); @@ -290,37 +290,37 @@ void Console::ProcessLine() { mLastCommands.pop_front(); if ( str.size() > 0 ) { - PrivPushText( "> " + str ); + privPushText( "> " + str ); if ( mCallbacks.find( params[0] ) != mCallbacks.end() ) { mCallbacks[ params[0] ]( params ); } else { - PrivPushText( "Unknown Command: '" + params[0] + "'" ); + privPushText( "Unknown Command: '" + params[0] + "'" ); } } mTBuf->clear(); } -void Console::PrivPushText( const String& str ) { +void Console::privPushText( const String& str ) { mCmdLog.push_back( str ); if ( mCmdLog.size() >= mMaxLogLines ) mCmdLog.pop_front(); } -void Console::PushText( const String& str ) { +void Console::pushText( const String& str ) { if ( std::string::npos != str.find_first_of( '\n' ) ) { std::vector Strings = String::split( String( str ) ); for ( Uint32 i = 0; i < Strings.size(); i++ ) { - PrivPushText( Strings[i] ); + privPushText( Strings[i] ); } } else { - PrivPushText( str ); + privPushText( str ); } } -void Console::PushText( const char * format, ... ) { +void Console::pushText( const char * format, ... ) { int n, size = 256; std::string tstr( size, '\0' ); @@ -334,7 +334,7 @@ void Console::PushText( const char * format, ... ) { if ( n > -1 && n < size ) { tstr.resize( n ); - PushText( tstr ); + pushText( tstr ); va_end( args ); @@ -350,14 +350,14 @@ void Console::PushText( const char * format, ... ) { } } -void Console::Toggle() { +void Console::toggle() { if ( mVisible ) - FadeOut(); + fadeOut(); else - FadeIn(); + fadeIn(); } -void Console::Fade() { +void Console::fade() { if (mCurSide) { mCurAlpha -= 255.f * mWindow->elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); if ( mCurAlpha <= 0.0f ) { @@ -405,7 +405,7 @@ void Console::Fade() { if ( mA < 0.0f ) mA = 0.0f; } -String Console::GetLastCommonSubStr( std::list& cmds ) { +String Console::getLastCommonSubStr( std::list& cmds ) { String lastCommon( mTBuf->buffer() ); String strTry( lastCommon ); @@ -442,7 +442,7 @@ String Console::GetLastCommonSubStr( std::list& cmds ) { return lastCommon; } -void Console::PrintCommandsStartingWith( const String& start ) { +void Console::printCommandsStartingWith( const String& start ) { std::list cmds; std::map < String, ConsoleCallback >::iterator it; @@ -453,14 +453,14 @@ void Console::PrintCommandsStartingWith( const String& start ) { } if ( cmds.size() > 1 ) { - PrivPushText( "> " + mTBuf->buffer() ); + privPushText( "> " + mTBuf->buffer() ); std::list::iterator ite; for ( ite = cmds.begin(); ite != cmds.end(); ite++ ) - PrivPushText( (*ite) ); + privPushText( (*ite) ); - String newStr( GetLastCommonSubStr( cmds ) ); + String newStr( getLastCommonSubStr( cmds ) ); if ( newStr != mTBuf->buffer() ) { mTBuf->buffer( newStr ); @@ -472,7 +472,7 @@ void Console::PrintCommandsStartingWith( const String& start ) { } } -void Console::PrivVideoResize( EE::Window::Window * win ) { +void Console::privVideoResize( EE::Window::Window * win ) { mWidth = (Float) mWindow->getWidth(); mHeight = (Float) mWindow->getHeight(); @@ -486,7 +486,7 @@ void Console::PrivVideoResize( EE::Window::Window * win ) { } } -void Console::GetFilesFrom( std::string txt, const Uint32& curPos ) { +void Console::getFilesFrom( std::string txt, const Uint32& curPos ) { static char OSSlash = FileSystem::getOSlash().at(0); size_t pos; @@ -561,8 +561,8 @@ void Console::GetFilesFrom( std::string txt, const Uint32& curPos ) { mTBuf->buffer( mTBuf->buffer().substr( 0, pos + 1 ) + files[lasti] + slash ); mTBuf->cursorToEnd(); } else if ( count > 1 ) { - PrivPushText( "Directory file list:" ); - PushText( res ); + privPushText( "Directory file list:" ); + pushText( res ); mTBuf->buffer( mTBuf->buffer().substr( 0, pos + 1 ) + file ); mTBuf->cursorToEnd(); @@ -571,11 +571,11 @@ void Console::GetFilesFrom( std::string txt, const Uint32& curPos ) { } } -Int32 Console::LinesInScreen() { +Int32 Console::linesInScreen() { return static_cast ( (mCurHeight / mFontSize) - 1 ); } -void Console::PrivInputCallback( InputEvent * Event ) { +void Console::privInputCallback( InputEvent * Event ) { Uint8 etype = Event->Type; if ( mVisible ) { @@ -585,8 +585,8 @@ void Console::PrivInputCallback( InputEvent * Event ) { if ( InputEvent::KeyDown == etype ) { if ( ( KeyCode == KEY_TAB ) && (unsigned int)mTBuf->curPos() == mTBuf->buffer().size() ) { - PrintCommandsStartingWith( mTBuf->buffer() ); - GetFilesFrom( mTBuf->buffer().toUtf8(), mTBuf->curPos() ); + printCommandsStartingWith( mTBuf->buffer() ); + getFilesFrom( mTBuf->buffer().toUtf8(), mTBuf->curPos() ); } if ( KeyMod & KEYMOD_SHIFT ) { @@ -601,7 +601,7 @@ void Console::PrivInputCallback( InputEvent * Event ) { } if ( KeyCode == KEY_HOME ) { - if ( static_cast( mCmdLog.size() ) > LinesInScreen() ) + if ( static_cast( mCmdLog.size() ) > linesInScreen() ) mCon.ConModif = mCon.ConMin; } @@ -610,15 +610,15 @@ void Console::PrivInputCallback( InputEvent * Event ) { } if ( KeyCode == KEY_PAGEUP ) { - if ( mCon.ConMin - mCon.ConModif - LinesInScreen() / 2 > 0 ) - mCon.ConModif+=LinesInScreen() / 2; + if ( mCon.ConMin - mCon.ConModif - linesInScreen() / 2 > 0 ) + mCon.ConModif+=linesInScreen() / 2; else mCon.ConModif = mCon.ConMin; } if ( KeyCode == KEY_PAGEDOWN ) { - if ( mCon.ConModif - LinesInScreen() / 2 > 0 ) - mCon.ConModif-=LinesInScreen() / 2; + if ( mCon.ConModif - linesInScreen() / 2 > 0 ) + mCon.ConModif-=linesInScreen() / 2; else mCon.ConModif = 0; } @@ -663,27 +663,27 @@ void Console::PrivInputCallback( InputEvent * Event ) { } } -void Console::CreateDefaultCommands() { - AddCommand( "clear", cb::Make1( this, &Console::CmdClear) ); - AddCommand( "quit", cb::Make1( this, &Console::CmdQuit) ); - AddCommand( "maximize", cb::Make1( this, &Console::CmdMaximize) ); - AddCommand( "minimize", cb::Make1( this, &Console::CmdMinimize) ); - AddCommand( "cmdlist", cb::Make1( this, &Console::CmdCmdList) ); - AddCommand( "help", cb::Make1( this, &Console::CmdCmdList) ); - AddCommand( "showcursor", cb::Make1( this, &Console::CmdShowCursor) ); - AddCommand( "setfpslimit", cb::Make1( this, &Console::CmdFrameLimit) ); - AddCommand( "getlog", cb::Make1( this, &Console::CmdGetLog) ); - AddCommand( "setgamma", cb::Make1( this, &Console::CmdSetGamma) ); - AddCommand( "setvolume", cb::Make1( this, &Console::CmdSetVolume) ); - AddCommand( "getgpuextensions", cb::Make1( this, &Console::CmdGetGpuExtensions) ); - AddCommand( "dir", cb::Make1( this, &Console::CmdDir) ); - AddCommand( "ls", cb::Make1( this, &Console::CmdDir) ); - AddCommand( "showfps", cb::Make1( this, &Console::CmdShowFps) ); - AddCommand( "gettexturememory", cb::Make1( this, &Console::CmdGetTextureMemory) ); - AddCommand( "hide", cb::Make1( this, &Console::CmdHideConsole ) ); +void Console::createDefaultCommands() { + addCommand( "clear", cb::Make1( this, &Console::cmdClear) ); + addCommand( "quit", cb::Make1( this, &Console::cmdQuit) ); + addCommand( "maximize", cb::Make1( this, &Console::cmdMaximize) ); + addCommand( "minimize", cb::Make1( this, &Console::cmdMinimize) ); + addCommand( "cmdlist", cb::Make1( this, &Console::cmdCmdList) ); + addCommand( "help", cb::Make1( this, &Console::cmdCmdList) ); + addCommand( "showcursor", cb::Make1( this, &Console::cmdShowCursor) ); + addCommand( "setfpslimit", cb::Make1( this, &Console::cmdFrameLimit) ); + addCommand( "getlog", cb::Make1( this, &Console::cmdGetLog) ); + addCommand( "setgamma", cb::Make1( this, &Console::cmdSetGamma) ); + addCommand( "setvolume", cb::Make1( this, &Console::cmdSetVolume) ); + addCommand( "getgpuextensions", cb::Make1( this, &Console::cmdGetGpuExtensions) ); + addCommand( "dir", cb::Make1( this, &Console::cmdDir) ); + addCommand( "ls", cb::Make1( this, &Console::cmdDir) ); + addCommand( "showfps", cb::Make1( this, &Console::cmdShowFps) ); + addCommand( "gettexturememory", cb::Make1( this, &Console::cmdGetTextureMemory) ); + addCommand( "hide", cb::Make1( this, &Console::cmdHideConsole ) ); } -void Console::CmdClear () { +void Console::cmdClear () { Uint16 CutLines; if ( mExpand ) { CutLines = (Uint16)( mHeight / mFontSize ); @@ -692,41 +692,41 @@ void Console::CmdClear () { } for (Uint16 i = 0; i < CutLines; i++ ) - PrivPushText( "" ); + privPushText( "" ); } -void Console::CmdClear ( const std::vector < String >& params ) { - CmdClear(); +void Console::cmdClear ( const std::vector < String >& params ) { + cmdClear(); } -void Console::CmdMaximize ( const std::vector < String >& params ) { +void Console::cmdMaximize ( const std::vector < String >& params ) { mExpand = true; mY = mHeight; - PrivPushText( "Console Maximized" ); + privPushText( "Console Maximized" ); } -void Console::CmdMinimize ( const std::vector < String >& params ) { +void Console::cmdMinimize ( const std::vector < String >& params ) { mExpand = false; mY = mHeightMin; - PrivPushText( "Console Minimized" ); + privPushText( "Console Minimized" ); } -void Console::CmdQuit ( const std::vector < String >& params ) { +void Console::cmdQuit ( const std::vector < String >& params ) { mWindow->close(); } -void Console::CmdGetTextureMemory ( const std::vector < String >& params ) { - PrivPushText( "Total texture memory used: " + FileSystem::sizeToString( TextureFactory::instance()->MemorySize() ) ); +void Console::cmdGetTextureMemory ( const std::vector < String >& params ) { + privPushText( "Total texture memory used: " + FileSystem::sizeToString( TextureFactory::instance()->memorySize() ) ); } -void Console::CmdCmdList ( const std::vector < String >& params ) { +void Console::cmdCmdList ( const std::vector < String >& params ) { std::map < String, ConsoleCallback >::iterator itr; for (itr = mCallbacks.begin(); itr != mCallbacks.end(); itr++) { - PrivPushText( "\t" + itr->first ); + privPushText( "\t" + itr->first ); } } -void Console::CmdShowCursor ( const std::vector < String >& params ) { +void Console::cmdShowCursor ( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; @@ -735,13 +735,13 @@ void Console::CmdShowCursor ( const std::vector < String >& params ) { if ( Res && ( tInt == 0 || tInt == 1 ) ) { mWindow->getCursorManager()->visible( 0 != tInt ); } else - PrivPushText( "Valid parameters are 0 or 1." ); + privPushText( "Valid parameters are 0 or 1." ); } else { - PrivPushText( "No parameters. Valid parameters are 0 ( hide ) or 1 ( show )." ); + privPushText( "No parameters. Valid parameters are 0 ( hide ) or 1 ( show )." ); } } -void Console::CmdFrameLimit ( const std::vector < String >& params ) { +void Console::cmdFrameLimit ( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; @@ -753,34 +753,34 @@ void Console::CmdFrameLimit ( const std::vector < String >& params ) { } } - PrivPushText( "Valid parameters are between 0 and 10000 (0 = no limit)." ); + privPushText( "Valid parameters are between 0 and 10000 (0 = no limit)." ); } -void Console::CmdGetLog() { +void Console::cmdGetLog() { std::vector < String > tvec = String::split( String( String::toStr( Log::instance()->buffer() ) ) ); if ( tvec.size() > 0 ) { for ( unsigned int i = 0; i < tvec.size(); i++ ) - PrivPushText( tvec[i] ); + privPushText( tvec[i] ); } } -void Console::CmdGetLog( const std::vector < String >& params ) { - CmdGetLog(); +void Console::cmdGetLog( const std::vector < String >& params ) { + cmdGetLog(); } -void Console::CmdGetGpuExtensions() { - std::vector < String > tvec = String::split( String( GLi->GetExtensions() ), ' ' ); +void Console::cmdGetGpuExtensions() { + std::vector < String > tvec = String::split( String( GLi->getExtensions() ), ' ' ); if ( tvec.size() > 0 ) { for ( unsigned int i = 0; i < tvec.size(); i++ ) - PrivPushText( tvec[i] ); + privPushText( tvec[i] ); } } -void Console::CmdGetGpuExtensions( const std::vector < String >& params ) { - CmdGetGpuExtensions(); +void Console::cmdGetGpuExtensions( const std::vector < String >& params ) { + cmdGetGpuExtensions(); } -void Console::CmdSetGamma( const std::vector < String >& params ) { +void Console::cmdSetGamma( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Float tFloat = 0.f; @@ -792,10 +792,10 @@ void Console::CmdSetGamma( const std::vector < String >& params ) { } } - PrivPushText( "Valid parameters are between 0.1 and 10." ); + privPushText( "Valid parameters are between 0.1 and 10." ); } -void Console::CmdSetVolume( const std::vector < String >& params ) { +void Console::cmdSetVolume( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Float tFloat = 0.f; @@ -807,10 +807,10 @@ void Console::CmdSetVolume( const std::vector < String >& params ) { } } - PrivPushText( "Valid parameters are between 0 and 100." ); + privPushText( "Valid parameters are between 0 and 100." ); } -void Console::CmdDir( const std::vector < String >& params ) { +void Console::cmdDir( const std::vector < String >& params ) { if ( params.size() >= 2 ) { String Slash( FileSystem::getOSlash() ); String myPath = params[1]; @@ -826,7 +826,7 @@ void Console::CmdDir( const std::vector < String >& params ) { std::vector mFiles = FileSystem::filesGetInPath( myPath ); std::sort( mFiles.begin(), mFiles.end() ); - PrivPushText( "Directory: " + myPath ); + privPushText( "Directory: " + myPath ); if ( myOrder == "ff" ) { std::vector mFolders; @@ -841,33 +841,33 @@ void Console::CmdDir( const std::vector < String >& params ) { } if ( mFolders.size() ) - PrivPushText( "Folders: " ); + privPushText( "Folders: " ); for ( i = 0; i < mFolders.size(); i++ ) - PrivPushText( " " + mFolders[i] ); + privPushText( " " + mFolders[i] ); if ( mFolders.size() ) - PrivPushText( "Files: " ); + privPushText( "Files: " ); for ( i = 0; i < mFile.size(); i++ ) - PrivPushText( " " + mFile[i] ); + privPushText( " " + mFile[i] ); } else { for ( i = 0; i < mFiles.size(); i++ ) - PrivPushText( " " + mFiles[i] ); + privPushText( " " + mFiles[i] ); } } else { if ( myPath == "help" ) - PrivPushText( "You can use a third parameter to show folders first, the parameter is ff." ); + privPushText( "You can use a third parameter to show folders first, the parameter is ff." ); else - PrivPushText( "Path \"" + myPath + "\" is not a directory." ); + privPushText( "Path \"" + myPath + "\" is not a directory." ); } } else { - PrivPushText( "Expected a path to list. Example of usage: ls /home" ); + privPushText( "Expected a path to list. Example of usage: ls /home" ); } } -void Console::CmdShowFps( const std::vector < String >& params ) { +void Console::cmdShowFps( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; @@ -879,30 +879,30 @@ void Console::CmdShowFps( const std::vector < String >& params ) { } } - PrivPushText( "Valid parameters are 0 ( hide ) or 1 ( show )." ); + privPushText( "Valid parameters are 0 ( hide ) or 1 ( show )." ); } -void Console::CmdHideConsole( const std::vector < String >& params ) { - FadeOut(); +void Console::cmdHideConsole( const std::vector < String >& params ) { + fadeOut(); } -void Console::IgnoreCharOnPrompt( const Uint32& ch ) { +void Console::ignoreCharOnPrompt( const Uint32& ch ) { mTBuf->pushIgnoredChar( ch ); } -const bool& Console::IsShowingFps() const { +const bool& Console::isShowingFps() const { return mShowFps; } -void Console::ShowFps( const bool& Show ) { +void Console::showFps( const bool& Show ) { mShowFps = Show; } -void Console::WriteLog( const std::string& Text ) { +void Console::writeLog( const std::string& Text ) { std::vector Strings = String::split( String( Text ) ); for ( Uint32 i = 0; i < Strings.size(); i++ ) { - PrivPushText( Strings[i] ); + privPushText( Strings[i] ); } } diff --git a/src/eepp/graphics/font.cpp b/src/eepp/graphics/font.cpp index ab01f9977..a630b58aa 100644 --- a/src/eepp/graphics/font.cpp +++ b/src/eepp/graphics/font.cpp @@ -16,7 +16,7 @@ Font::Font( const Uint32& Type, const std::string& Name ) : mDescent(0), mTextCache( this ) { - this->Name( Name ); + this->setName( Name ); FontManager::instance()->add( this ); } @@ -28,87 +28,87 @@ Font::~Font() { } } -void Font::SetText( const String& Text ) { - mTextCache.Text( Text ); +void Font::setText( const String& Text ) { + mTextCache.text( Text ); } -const ColorA& Font::Color() const { - return mTextCache.Color(); +const ColorA& Font::color() const { + return mTextCache.color(); } -void Font::Color(const ColorA& Color) { - mTextCache.Color( Color ); +void Font::color(const ColorA& Color) { + mTextCache.color( Color ); } -const ColorA& Font::ShadowColor() const { - return mTextCache.ShadowColor(); +const ColorA& Font::shadowColor() const { + return mTextCache.shadowColor(); } -void Font::ShadowColor(const ColorA& Color) { - mTextCache.ShadowColor( Color ); +void Font::shadowColor(const ColorA& Color) { + mTextCache.shadowColor( Color ); } -int Font::GetNumLines() { - return mTextCache.GetNumLines(); +int Font::getNumLines() { + return mTextCache.getNumLines(); } -Float Font::GetTextWidth( const String& Text ) { - SetText( Text ); - return mTextCache.GetTextWidth(); +Float Font::getTextWidth( const String& Text ) { + setText( Text ); + return mTextCache.getTextWidth(); } -Float Font::GetTextWidth() { - return mTextCache.GetTextWidth(); +Float Font::getTextWidth() { + return mTextCache.getTextWidth(); } -Uint32 Font::GetFontSize() const { +Uint32 Font::getFontSize() const { return mSize; } -Uint32 Font::GetFontHeight() const { +Uint32 Font::getFontHeight() const { return mHeight; } -Int32 Font::GetLineSkip() const { +Int32 Font::getLineSkip() const { return mLineSkip; } -Int32 Font::GetFontAscent() const { +Int32 Font::getFontAscent() const { return mAscent; } -Int32 Font::GetFontDescent() const { +Int32 Font::getFontDescent() const { return mDescent; } -String Font::GetText() { - return mTextCache.Text(); +String Font::getText() { + return mTextCache.text(); } -Float Font::GetTextHeight() { - return (Float)GetFontHeight() * (Float)GetNumLines(); +Float Font::getTextHeight() { + return (Float)getFontHeight() * (Float)getNumLines(); } -const std::vector& Font::GetLinesWidth() { - return mTextCache.LinesWidth(); +const std::vector& Font::getLinesWidth() { + return mTextCache.linesWidth(); } -void Font::Draw( const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& Effect) { - Draw( mTextCache, X, Y, Flags, Scale, Angle, Effect ); +void Font::draw( const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& Effect) { + draw( mTextCache, X, Y, Flags, Scale, Angle, Effect ); } -void Font::Draw( const String& Text, const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& Effect ) { - mTextCache.Text( Text ); - mTextCache.Flags( Flags ); - mTextCache.Draw( X, Y, Scale, Angle, Effect ); +void Font::draw( const String& Text, const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& Effect ) { + mTextCache.text( Text ); + mTextCache.flags( Flags ); + mTextCache.draw( X, Y, Scale, Angle, Effect ); } -void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& Effect ) { - if ( !TextCache.Text().size() ) +void Font::draw( TextCache& TextCache, const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& Effect ) { + if ( !TextCache.text().size() ) return; - GlobalBatchRenderer::instance()->Draw(); - TextureFactory::instance()->Bind( mTexId ); + GlobalBatchRenderer::instance()->draw(); + TextureFactory::instance()->bind( mTexId ); BlendMode::SetMode( Effect ); if ( Flags & FONT_DRAW_SHADOW ) { @@ -116,25 +116,25 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin f &= ~FONT_DRAW_SHADOW; - ColorA Col = TextCache.Color(); + ColorA Col = TextCache.color(); - SetText( TextCache.Text() ); + setText( TextCache.text() ); if ( Col.a() != 255 ) { - ColorA ShadowColor = TextCache.ShadowColor(); + ColorA ShadowColor = TextCache.shadowColor(); ShadowColor.Alpha = (Uint8)( (Float)ShadowColor.Alpha * ( (Float)Col.a() / (Float)255 ) ); - Color( ShadowColor ); + color( ShadowColor ); } else { - Color( TextCache.ShadowColor() ); + color( TextCache.shadowColor() ); } - Draw( X + 1, Y + 1, f, Scale, Angle, Effect ); + draw( X + 1, Y + 1, f, Scale, Angle, Effect ); - mTextCache.Flags( Flags ); + mTextCache.flags( Flags ); - Color( Col ); + color( Col ); } Float cX = (Float) ( (Int32)X ); @@ -146,27 +146,27 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin unsigned int numvert = 0; if ( Angle != 0.0f || Scale != 1.0f ) { - GLi->PushMatrix(); + GLi->pushMatrix(); - Vector2f Center( cX + TextCache.GetTextWidth() * 0.5f, cY + TextCache.GetTextHeight() * 0.5f ); - GLi->Translatef( Center.x , Center.y, 0.f ); - GLi->Rotatef( Angle, 0.0f, 0.0f, 1.0f ); - GLi->Scalef( Scale.x, Scale.y, 1.0f ); - GLi->Translatef( -Center.x + X, -Center.y + Y, 0.f ); + Vector2f Center( cX + TextCache.getTextWidth() * 0.5f, cY + TextCache.getTextHeight() * 0.5f ); + GLi->translatef( Center.x , Center.y, 0.f ); + GLi->rotatef( Angle, 0.0f, 0.0f, 1.0f ); + GLi->scalef( Scale.x, Scale.y, 1.0f ); + GLi->translatef( -Center.x + X, -Center.y + Y, 0.f ); } - std::vector& RenderCoords = TextCache.VertextCoords(); - std::vector& Colors = TextCache.Colors(); + std::vector& RenderCoords = TextCache.vertextCoords(); + std::vector& Colors = TextCache.colors(); - if ( !TextCache.CachedCoords() ) { + if ( !TextCache.cachedCoords() ) { if ( !( Flags & FONT_DRAW_VERTICAL ) ) { switch ( FontHAlignGet( Flags ) ) { case FONT_DRAW_CENTER: - nX = (Float)( (Int32)( ( TextCache.GetTextWidth() - TextCache.LinesWidth()[ Line ] ) * 0.5f ) ); + nX = (Float)( (Int32)( ( TextCache.getTextWidth() - TextCache.linesWidth()[ Line ] ) * 0.5f ) ); Line++; break; case FONT_DRAW_RIGHT: - nX = TextCache.GetTextWidth() - TextCache.LinesWidth()[ Line ]; + nX = TextCache.getTextWidth() - TextCache.linesWidth()[ Line ]; Line++; break; } @@ -174,8 +174,8 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin Int32 tGlyphSize = (Int32)mGlyphs.size(); - for ( unsigned int i = 0; i < TextCache.Text().size(); i++ ) { - Char = static_cast( TextCache.Text().at(i) ); + for ( unsigned int i = 0; i < TextCache.text().size(); i++ ) { + Char = static_cast( TextCache.text().at(i) ); if ( Char < 0 && Char > -128 ) Char = 256 + Char; @@ -187,7 +187,7 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin case '\v': { if ( Flags & FONT_DRAW_VERTICAL ) - nY += GetFontHeight(); + nY += getFontHeight(); else nX += mGlyphs[ Char ].Advance; break; @@ -195,7 +195,7 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin case '\t': { if ( Flags & FONT_DRAW_VERTICAL ) - nY += GetFontHeight() * 4; + nY += getFontHeight() * 4; else nX += mGlyphs[ Char ].Advance * 4; break; @@ -203,23 +203,23 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin case '\n': { if ( Flags & FONT_DRAW_VERTICAL ) { - nX += (GetFontHeight() * Scale.y); + nX += (getFontHeight() * Scale.y); nY = 0; } else { - if ( i + 1 < TextCache.Text().size() ) { + if ( i + 1 < TextCache.text().size() ) { switch ( FontHAlignGet( Flags ) ) { case FONT_DRAW_CENTER: - nX = (Float)( (Int32)( ( TextCache.GetTextWidth() - TextCache.LinesWidth()[ Line ] ) * 0.5f ) ); + nX = (Float)( (Int32)( ( TextCache.getTextWidth() - TextCache.linesWidth()[ Line ] ) * 0.5f ) ); break; case FONT_DRAW_RIGHT: - nX = TextCache.GetTextWidth() - TextCache.LinesWidth()[ Line ]; + nX = TextCache.getTextWidth() - TextCache.linesWidth()[ Line ]; break; default: nX = 0; } } - nY += (GetFontHeight() * Scale.y); + nY += (getFontHeight() * Scale.y); Line++; } @@ -227,7 +227,7 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin } default: { - if ( GLi->QuadsSupported() ) { + if ( GLi->quadsSupported() ) { for ( Uint8 z = 0; z < 8; z+=2 ) { RenderCoords[ numvert ].TexCoords[0] = C->TexCoords[z]; RenderCoords[ numvert ].TexCoords[1] = C->TexCoords[ z + 1 ]; @@ -274,7 +274,7 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin } if ( Flags & FONT_DRAW_VERTICAL ) - nY += GetFontHeight(); + nY += getFontHeight(); else nX += mGlyphs[ Char ].Advance; } @@ -282,31 +282,31 @@ void Font::Draw( TextCache& TextCache, const Float& X, const Float& Y, const Uin } } - TextCache.CachedCoords( true ); - TextCache.CachedVerts( numvert ); + TextCache.cachedCoords( true ); + TextCache.cachedVerts( numvert ); } else { - numvert = TextCache.CachedVerts(); + numvert = TextCache.cachedVerts(); } Uint32 alloc = numvert * sizeof(eeVertexCoords); - Uint32 allocC = numvert * GLi->QuadVertexs(); + Uint32 allocC = numvert * GLi->quadVertexs(); - GLi->ColorPointer ( 4, GL_UNSIGNED_BYTE , 0 , reinterpret_cast( &Colors[0] ) , allocC ); - GLi->TexCoordPointer( 2, GL_FP , sizeof(eeVertexCoords), reinterpret_cast( &RenderCoords[0] ) , alloc ); - GLi->VertexPointer ( 2, GL_FP , sizeof(eeVertexCoords), reinterpret_cast( &RenderCoords[0] ) + sizeof(Float) * 2 , alloc ); + GLi->colorPointer ( 4, GL_UNSIGNED_BYTE , 0 , reinterpret_cast( &Colors[0] ) , allocC ); + GLi->texCoordPointer( 2, GL_FP , sizeof(eeVertexCoords), reinterpret_cast( &RenderCoords[0] ) , alloc ); + GLi->vertexPointer ( 2, GL_FP , sizeof(eeVertexCoords), reinterpret_cast( &RenderCoords[0] ) + sizeof(Float) * 2 , alloc ); - if ( GLi->QuadsSupported() ) { - GLi->DrawArrays( GL_QUADS, 0, numvert ); + if ( GLi->quadsSupported() ) { + GLi->drawArrays( GL_QUADS, 0, numvert ); } else { - GLi->DrawArrays( GL_TRIANGLES, 0, numvert ); + GLi->drawArrays( GL_TRIANGLES, 0, numvert ); } if ( Angle != 0.0f || Scale != 1.0f ) { - GLi->PopMatrix(); + GLi->popMatrix(); } } -void Font::CacheWidth( const String& Text, std::vector& LinesWidth, Float& CachedWidth, int& NumLines , int& LargestLineCharCount ) { +void Font::cacheWidth( const String& Text, std::vector& LinesWidth, Float& CachedWidth, int& NumLines , int& LargestLineCharCount ) { LinesWidth.clear(); Float Width = 0, MaxWidth = 0; @@ -357,8 +357,8 @@ void Font::CacheWidth( const String& Text, std::vector& LinesWidth, Float NumLines = Lines; } -Int32 Font::FindClosestCursorPosFromPoint( const String& Text, const Vector2i& pos ) { - Float Width = 0, lWidth = 0, Height = GetFontHeight(), lHeight = 0; +Int32 Font::findClosestCursorPosFromPoint( const String& Text, const Vector2i& pos ) { + Float Width = 0, lWidth = 0, Height = getFontHeight(), lHeight = 0; Int32 CharID; Int32 tGlyphSize = (Int32)mGlyphs.size(); std::size_t tSize = Text.size(); @@ -395,7 +395,7 @@ Int32 Font::FindClosestCursorPosFromPoint( const String& Text, const Vector2i& p if ( CharID == '\n' ) { lHeight = Height; - Height += GetFontHeight(); + Height += getFontHeight(); if ( pos.x > Width && pos.y <= lHeight ) { return i; @@ -411,8 +411,8 @@ Int32 Font::FindClosestCursorPosFromPoint( const String& Text, const Vector2i& p return -1; } -Vector2i Font::GetCursorPos( const String& Text, const Uint32& Pos ) { - Float Width = 0, Height = GetFontHeight(); +Vector2i Font::getCursorPos( const String& Text, const Uint32& Pos ) { + Float Width = 0, Height = getFontHeight(); Int32 CharID; Int32 tGlyphSize = mGlyphs.size(); std::size_t tSize = ( Pos < Text.size() ) ? Pos : Text.size(); @@ -429,7 +429,7 @@ Vector2i Font::GetCursorPos( const String& Text, const Uint32& Pos ) { if ( CharID == '\n' ) { Width = 0; - Height += GetFontHeight(); + Height += getFontHeight(); } } } @@ -449,7 +449,7 @@ static bool IsStopSelChar( Uint32 c ) { '\'' == c; } -void Font::SelectSubStringFromCursor( const String& Text, const Int32& CurPos, Int32& InitCur, Int32& EndCur ) { +void Font::selectSubStringFromCursor( const String& Text, const Int32& CurPos, Int32& InitCur, Int32& EndCur ) { InitCur = 0; EndCur = Text.size(); @@ -476,11 +476,11 @@ void Font::SelectSubStringFromCursor( const String& Text, const Int32& CurPos, I } } -void Font::CacheWidth() { - mTextCache.Cache(); +void Font::cacheWidth() { + mTextCache.cache(); } -void Font::ShrinkText( std::string& Str, const Uint32& MaxWidth ) { +void Font::shrinkText( std::string& Str, const Uint32& MaxWidth ) { if ( !Str.size() ) return; @@ -537,7 +537,7 @@ void Font::ShrinkText( std::string& Str, const Uint32& MaxWidth ) { } } -void Font::ShrinkText( String& Str, const Uint32& MaxWidth ) { +void Font::shrinkText( String& Str, const Uint32& MaxWidth ) { if ( !Str.size() ) return; @@ -602,24 +602,24 @@ void Font::ShrinkText( String& Str, const Uint32& MaxWidth ) { } } -const Uint32& Font::GetTexId() const { +const Uint32& Font::getTexId() const { return mTexId; } -const Uint32& Font::Type() const { +const Uint32& Font::getType() const { return mType; } -const std::string& Font::Name() const { +const std::string& Font::getName() const { return mFontName; } -void Font::Name( const std::string& name ) { +void Font::setName( const std::string& name ) { mFontName = name; mFontHash = String::hash( mFontName ); } -const Uint32& Font::Id() { +const Uint32& Font::getId() { return mFontHash; } diff --git a/src/eepp/graphics/framebuffer.cpp b/src/eepp/graphics/framebuffer.cpp index 8c3cdcb56..66c15829c 100644 --- a/src/eepp/graphics/framebuffer.cpp +++ b/src/eepp/graphics/framebuffer.cpp @@ -11,7 +11,7 @@ using namespace EE::Graphics::Private; namespace EE { namespace Graphics { FrameBuffer * FrameBuffer::New( const Uint32& Width, const Uint32& Height, bool DepthBuffer, EE::Window::Window * window ) { - if ( FrameBufferFBO::IsSupported() ) + if ( FrameBufferFBO::isSupported() ) return eeNew( FrameBufferFBO, ( Width, Height, DepthBuffer, window ) ); return NULL; @@ -40,60 +40,60 @@ FrameBuffer::~FrameBuffer() { FrameBufferManager::instance()->remove( this ); } -Texture * FrameBuffer::GetTexture() const { +Texture * FrameBuffer::getTexture() const { return mTexture; } -void FrameBuffer::ClearColor( ColorAf Color ) { +void FrameBuffer::clearColor( ColorAf Color ) { mClearColor = Color; } -ColorAf FrameBuffer::ClearColor() const { +ColorAf FrameBuffer::clearColor() const { return mClearColor; } -void FrameBuffer::Clear() { - GLi->ClearColor( mClearColor.r(), mClearColor.g(), mClearColor.b(), mClearColor.a() ); - GLi->Clear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); +void FrameBuffer::clear() { + GLi->clearColor( mClearColor.r(), mClearColor.g(), mClearColor.b(), mClearColor.a() ); + GLi->clear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); mWindow->backColor( mWindow->backColor() ); } -void FrameBuffer::SetBufferView() { +void FrameBuffer::setBufferView() { mPrevView = mWindow->getView(); // Get the user projection matrix - GLi->GetCurrentMatrix( GL_PROJECTION_MATRIX, mProjMat ); + GLi->getCurrentMatrix( GL_PROJECTION_MATRIX, mProjMat ); - GLi->Viewport( 0, 0, mWidth, mHeight ); - GLi->MatrixMode( GL_PROJECTION ); - GLi->LoadIdentity(); - GLi->Ortho( 0.0f, mWidth, 0.f, mHeight, -1000.0f, 1000.0f ); - GLi->MatrixMode( GL_MODELVIEW ); - GLi->LoadIdentity(); + GLi->viewport( 0, 0, mWidth, mHeight ); + GLi->matrixMode( GL_PROJECTION ); + GLi->loadIdentity(); + GLi->ortho( 0.0f, mWidth, 0.f, mHeight, -1000.0f, 1000.0f ); + GLi->matrixMode( GL_MODELVIEW ); + GLi->loadIdentity(); } -void FrameBuffer::RecoverView() { - GlobalBatchRenderer::instance()->Draw(); +void FrameBuffer::recoverView() { + GlobalBatchRenderer::instance()->draw(); mWindow->setView( mPrevView ); // Recover the user projection matrix - GLi->LoadIdentity(); - GLi->MatrixMode( GL_PROJECTION ); - GLi->LoadMatrixf( mProjMat ); - GLi->MatrixMode( GL_MODELVIEW ); - GLi->LoadIdentity(); + GLi->loadIdentity(); + GLi->matrixMode( GL_PROJECTION ); + GLi->loadMatrixf( mProjMat ); + GLi->matrixMode( GL_MODELVIEW ); + GLi->loadIdentity(); } -const Int32& FrameBuffer::GetWidth() const { +const Int32& FrameBuffer::getWidth() const { return mWidth; } -const Int32& FrameBuffer::GetHeight() const { +const Int32& FrameBuffer::getHeight() const { return mHeight; } -const bool& FrameBuffer::HasDepthBuffer() const { +const bool& FrameBuffer::hasDepthBuffer() const { return mHasDepthBuffer; } diff --git a/src/eepp/graphics/framebufferfbo.cpp b/src/eepp/graphics/framebufferfbo.cpp index 24b251d0b..c6ef1269f 100644 --- a/src/eepp/graphics/framebufferfbo.cpp +++ b/src/eepp/graphics/framebufferfbo.cpp @@ -7,8 +7,8 @@ namespace EE { namespace Graphics { -bool FrameBufferFBO::IsSupported() { - return 0 != GLi->IsExtension( EEGL_EXT_framebuffer_object ); +bool FrameBufferFBO::isSupported() { + return 0 != GLi->isExtension( EEGL_EXT_framebuffer_object ); } FrameBufferFBO::FrameBufferFBO( EE::Window::Window * window ) : @@ -26,18 +26,18 @@ FrameBufferFBO::FrameBufferFBO( const Uint32& Width, const Uint32& Height, bool mLastFB(0), mLastRB(0) { - Create( Width, Height, DepthBuffer ); + create( Width, Height, DepthBuffer ); } FrameBufferFBO::~FrameBufferFBO() { - if ( !IsSupported() ) + if ( !isSupported() ) return; int curFB; glGetIntegerv( GL_FRAMEBUFFER_BINDING, &curFB ); if ( curFB == mFrameBuffer ) - Unbind(); + unbind(); if ( mDepthBuffer ) { unsigned int depthBuffer = static_cast( mDepthBuffer ); @@ -50,12 +50,12 @@ FrameBufferFBO::~FrameBufferFBO() { } } -bool FrameBufferFBO::Create( const Uint32& Width, const Uint32& Height ) { - return Create( Width, Height, false ); +bool FrameBufferFBO::create( const Uint32& Width, const Uint32& Height ) { + return create( Width, Height, false ); } -bool FrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool DepthBuffer ) { - if ( !IsSupported() ) +bool FrameBufferFBO::create( const Uint32& Width, const Uint32& Height, bool DepthBuffer ) { + if ( !isSupported() ) return false; if ( NULL == mWindow ) { @@ -75,7 +75,7 @@ bool FrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool Dep if ( !mFrameBuffer) return false; - BindFrameBuffer(); + bindFrameBuffer(); if ( DepthBuffer ) { unsigned int depth = 0; @@ -87,7 +87,7 @@ bool FrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool Dep if ( !mDepthBuffer ) return false; - BindRenderBuffer(); + bindRenderBuffer(); glRenderbufferStorageEXT( GL_RENDERBUFFER, GL_DEPTH_COMPONENT, Width, Height ); @@ -95,16 +95,16 @@ bool FrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool Dep } if ( NULL == mTexture ) { - Uint32 TexId = TextureFactory::instance()->CreateEmptyTexture( Width, Height, 4, ColorA(0,0,0,0) ); + Uint32 TexId = TextureFactory::instance()->createEmptyTexture( Width, Height, 4, ColorA(0,0,0,0) ); - if ( TextureFactory::instance()->TextureIdExists( TexId ) ) { - mTexture = TextureFactory::instance()->GetTexture( TexId ); + if ( TextureFactory::instance()->textureIdExists( TexId ) ) { + mTexture = TextureFactory::instance()->getTexture( TexId ); } else { return false; } } - glFramebufferTexture2DEXT( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTexture->Handle(), 0 ); + glFramebufferTexture2DEXT( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTexture->handle(), 0 ); if ( glCheckFramebufferStatusEXT( GL_FRAMEBUFFER ) != GL_FRAMEBUFFER_COMPLETE ) { glBindFramebufferEXT( GL_FRAMEBUFFER, mLastFB ); @@ -117,20 +117,20 @@ bool FrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool Dep return true; } -void FrameBufferFBO::Bind() { +void FrameBufferFBO::bind() { if ( mFrameBuffer ) { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); - BindFrameBuffer(); - BindRenderBuffer(); + bindFrameBuffer(); + bindRenderBuffer(); - SetBufferView(); + setBufferView(); } } -void FrameBufferFBO::Unbind() { +void FrameBufferFBO::unbind() { if ( mFrameBuffer ) { - RecoverView(); + recoverView(); if ( mDepthBuffer ) { glBindFramebufferEXT( GL_FRAMEBUFFER, mLastRB ); @@ -140,11 +140,11 @@ void FrameBufferFBO::Unbind() { } } -void FrameBufferFBO::Reload() { - Create( mWidth, mHeight, mHasDepthBuffer ); +void FrameBufferFBO::reload() { + create( mWidth, mHeight, mHasDepthBuffer ); } -void FrameBufferFBO::BindFrameBuffer() { +void FrameBufferFBO::bindFrameBuffer() { int curFB; glGetIntegerv( GL_FRAMEBUFFER_BINDING, &curFB ); @@ -153,7 +153,7 @@ void FrameBufferFBO::BindFrameBuffer() { glBindFramebufferEXT( GL_FRAMEBUFFER, mFrameBuffer ); } -void FrameBufferFBO::BindRenderBuffer() { +void FrameBufferFBO::bindRenderBuffer() { if ( mDepthBuffer ) { int curRB; glGetIntegerv( GL_RENDERBUFFER_BINDING, &curRB ); diff --git a/src/eepp/graphics/framebufferfbo.hpp b/src/eepp/graphics/framebufferfbo.hpp index 1c5c81595..e9af51e82 100644 --- a/src/eepp/graphics/framebufferfbo.hpp +++ b/src/eepp/graphics/framebufferfbo.hpp @@ -15,26 +15,26 @@ class EE_API FrameBufferFBO : public FrameBuffer { FrameBufferFBO( const Uint32& Width, const Uint32& Height, bool DepthBuffer = false, EE::Window::Window * window = NULL ); - void Bind(); + void bind(); - void Unbind(); + void unbind(); - void Reload(); + void reload(); - static bool IsSupported(); + static bool isSupported(); protected: Int32 mFrameBuffer; Uint32 mDepthBuffer; Int32 mLastFB; Int32 mLastRB; - bool Create( const Uint32& Width, const Uint32& Height ); + bool create( const Uint32& Width, const Uint32& Height ); - bool Create( const Uint32& Width, const Uint32& Height, bool DepthBuffer ); + bool create( const Uint32& Width, const Uint32& Height, bool DepthBuffer ); - void BindFrameBuffer(); + void bindFrameBuffer(); - void BindRenderBuffer(); + void bindRenderBuffer(); }; }} diff --git a/src/eepp/graphics/framebuffermanager.cpp b/src/eepp/graphics/framebuffermanager.cpp index a006f9d66..9aad9255f 100644 --- a/src/eepp/graphics/framebuffermanager.cpp +++ b/src/eepp/graphics/framebuffermanager.cpp @@ -12,11 +12,11 @@ FrameBufferManager::~FrameBufferManager() { } -void FrameBufferManager::Reload() { +void FrameBufferManager::reload() { std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) - (*it)->Reload(); + (*it)->reload(); } }}} diff --git a/src/eepp/graphics/framebuffermanager.hpp b/src/eepp/graphics/framebuffermanager.hpp index 71b640722..b1d9ea8a0 100644 --- a/src/eepp/graphics/framebuffermanager.hpp +++ b/src/eepp/graphics/framebuffermanager.hpp @@ -12,7 +12,7 @@ class EE_API FrameBufferManager : public Container { public: virtual ~FrameBufferManager(); - void Reload(); + void reload(); protected: FrameBufferManager(); }; diff --git a/src/eepp/graphics/globalbatchrenderer.cpp b/src/eepp/graphics/globalbatchrenderer.cpp index 06083b54a..e48ed9e64 100755 --- a/src/eepp/graphics/globalbatchrenderer.cpp +++ b/src/eepp/graphics/globalbatchrenderer.cpp @@ -5,7 +5,7 @@ namespace EE { namespace Graphics { SINGLETON_DECLARE_IMPLEMENTATION(GlobalBatchRenderer) GlobalBatchRenderer::GlobalBatchRenderer() { - AllocVertexs( 4096 ); + allocVertexs( 4096 ); } GlobalBatchRenderer::~GlobalBatchRenderer() { diff --git a/src/eepp/graphics/image.cpp b/src/eepp/graphics/image.cpp index 96dd045ca..de1962aee 100644 --- a/src/eepp/graphics/image.cpp +++ b/src/eepp/graphics/image.cpp @@ -151,16 +151,16 @@ static unsigned char * resample_image( unsigned char* pSrc_image, int src_width, Uint32 Image::sJpegQuality = 85; -Uint32 Image::JpegQuality() { +Uint32 Image::jpegQuality() { return sJpegQuality; } -void Image::JpegQuality( Uint32 level ) { +void Image::jpegQuality( Uint32 level ) { level = eemin( level, 100 ); sJpegQuality = level; } -std::string Image::SaveTypeToExtension( const Int32& Format ) { +std::string Image::saveTypeToExtension( const Int32& Format ) { switch( Format ) { case SAVE_TYPE_TGA: return "tga"; case SAVE_TYPE_BMP: return "bmp"; @@ -175,7 +175,7 @@ std::string Image::SaveTypeToExtension( const Int32& Format ) { return ""; } -EE_SAVE_TYPE Image::ExtensionToSaveType( const std::string& Extension ) { +EE_SAVE_TYPE Image::extensionToSaveType( const std::string& Extension ) { EE_SAVE_TYPE saveType = SAVE_TYPE_UNKNOWN; if ( Extension == "tga" ) saveType = SAVE_TYPE_TGA; @@ -187,7 +187,7 @@ EE_SAVE_TYPE Image::ExtensionToSaveType( const std::string& Extension ) { return saveType; } -EE_PIXEL_FORMAT Image::ChannelsToPixelFormat( const Uint32& channels ) { +EE_PIXEL_FORMAT Image::channelsToPixelFormat( const Uint32& channels ) { EE_PIXEL_FORMAT pf = PF_RGBA;; if ( 3 == channels ) @@ -200,7 +200,7 @@ EE_PIXEL_FORMAT Image::ChannelsToPixelFormat( const Uint32& channels ) { return pf; } -bool Image::GetInfo( const std::string& path, int * width, int * height, int * channels ) { +bool Image::getInfo( const std::string& path, int * width, int * height, int * channels ) { bool res = stbi_info( path.c_str(), width, height, channels ) != 0; if ( !res && PackManager::instance()->fallbackToPacks() ) { @@ -219,11 +219,11 @@ bool Image::GetInfo( const std::string& path, int * width, int * height, int * c return res; } -bool Image::IsImage( const std::string& path ) { +bool Image::isImage( const std::string& path ) { return STBI_unknown != stbi_test( path.c_str() ); } -std::string Image::GetLastFailureReason() { +std::string Image::getLastFailureReason() { return std::string( stbi_failure_reason() ); } @@ -247,7 +247,7 @@ Image::Image( Graphics::Image * image ) : mAvoidFree(image->mAvoidFree), mLoadedFromStbi(image->mLoadedFromStbi) { - SetPixels( image->GetPixelsPtr() ); + setPixels( image->getPixelsPtr() ); } Image::Image( const Uint8* data, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels ) : @@ -259,7 +259,7 @@ Image::Image( const Uint8* data, const unsigned int& Width, const unsigned int& mAvoidFree(false), mLoadedFromStbi(false) { - SetPixels( data ); + setPixels( data ); } Image::Image( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) : @@ -314,7 +314,7 @@ Image::Image( std::string Path, const unsigned int& forceChannels ) : mLoadedFromStbi = true; } else if ( PackManager::instance()->fallbackToPacks() && NULL != ( tPack = PackManager::instance()->exists( Path ) ) ) { - LoadFromPack( tPack, Path ); + loadFromPack( tPack, Path ); } else { std::string reason = "."; @@ -335,15 +335,15 @@ Image::Image( Pack * Pack, std::string FilePackPath, const unsigned int& forceCh mAvoidFree(false), mLoadedFromStbi(false) { - LoadFromPack( Pack, FilePackPath ); + loadFromPack( Pack, FilePackPath ); } Image::~Image() { if ( !mAvoidFree ) - ClearCache(); + clearCache(); } -void Image::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { +void Image::loadFromPack( Pack * Pack, const std::string& FilePackPath ) { if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( FilePackPath ) ) { SafeDataPointer PData; @@ -371,26 +371,26 @@ void Image::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { } } -void Image::SetPixels( const Uint8* data ) { +void Image::setPixels( const Uint8* data ) { if ( data != NULL ) { - Allocate( mWidth * mHeight * mChannels, ColorA(0,0,0,0), false ); + allocate( mWidth * mHeight * mChannels, ColorA(0,0,0,0), false ); memcpy( reinterpret_cast( &mPixels[0] ), reinterpret_cast ( data ), mSize ); } } -const Uint8* Image::GetPixelsPtr() { +const Uint8* Image::getPixelsPtr() { return reinterpret_cast (&mPixels[0]); } -ColorA Image::GetPixel( const unsigned int& x, const unsigned int& y ) { +ColorA Image::getPixel( const unsigned int& x, const unsigned int& y ) { eeASSERT( !( mPixels == NULL || x > mWidth || y > mHeight ) ); ColorA dst; memcpy( &dst, &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], mChannels ); return dst; } -void Image::SetPixel(const unsigned int& x, const unsigned int& y, const ColorA& Color) { +void Image::setPixel(const unsigned int& x, const unsigned int& y, const ColorA& Color) { eeASSERT( !( mPixels == NULL || x > mWidth || y > mHeight ) ); memcpy( &mPixels[ ( ( x + y * mWidth ) * mChannels ) ], &Color, mChannels ); } @@ -400,15 +400,15 @@ void Image::Create( const Uint32& Width, const Uint32& Height, const Uint32& Cha mHeight = Height; mChannels = Channels; - Allocate( mWidth * mHeight * mChannels, DefaultColor, initWithDefaultColor ); + allocate( mWidth * mHeight * mChannels, DefaultColor, initWithDefaultColor ); } -Uint8* Image::GetPixels() const { +Uint8* Image::getPixels() const { return mPixels; } -void Image::Allocate( const Uint32& size, ColorA DefaultColor, bool memsetData ) { - ClearCache(); +void Image::allocate( const Uint32& size, ColorA DefaultColor, bool memsetData ) { + clearCache(); mPixels = eeNewArray( unsigned char, size ); mSize = size; @@ -418,15 +418,15 @@ void Image::Allocate( const Uint32& size, ColorA DefaultColor, bool memsetData ) } } -unsigned int Image::MemSize() const { +unsigned int Image::memSize() const { return mSize; } -Sizei Image::Size() { +Sizei Image::getSize() { return Sizei( mWidth, mHeight ); } -void Image::ClearCache() { +void Image::clearCache() { if ( mLoadedFromStbi ) { if ( NULL != mPixels ) free( mPixels ); @@ -435,31 +435,31 @@ void Image::ClearCache() { } } -void Image::Width( const unsigned int& width ) { +void Image::width( const unsigned int& width ) { mWidth = width; } -unsigned int Image::Width() const { +unsigned int Image::width() const { return mWidth; } -void Image::Height( const unsigned int& height ) { +void Image::height( const unsigned int& height ) { mHeight = height; } -unsigned int Image::Height() const { +unsigned int Image::height() const { return mHeight; } -void Image::Channels( const unsigned int& channels ) { +void Image::channels( const unsigned int& channels ) { mChannels = channels; } -unsigned int Image::Channels() const { +unsigned int Image::channels() const { return mChannels; } -bool Image::SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ) { +bool Image::saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ) { bool Res = false; std::string fpath( FileSystem::fileRemoveFileName( filepath )); @@ -469,18 +469,18 @@ bool Image::SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format if ( NULL != mPixels && 0 != mWidth && 0 != mHeight && 0 != mChannels ) { if ( SAVE_TYPE_JPG != Format ) { - Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, (Int32)mWidth, (Int32)mHeight, mChannels, GetPixelsPtr() ) ); + Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, (Int32)mWidth, (Int32)mHeight, mChannels, getPixelsPtr() ) ); } else { jpge::params params; - params.m_quality = JpegQuality(); - Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), mWidth, mHeight, mChannels, GetPixelsPtr(), params); + params.m_quality = jpegQuality(); + Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), mWidth, mHeight, mChannels, getPixelsPtr(), params); } } return Res; } -void Image::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { +void Image::replaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { unsigned int Pos = 0; if ( NULL == mPixels ) @@ -517,15 +517,15 @@ void Image::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { } } -void Image::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { - ReplaceColor( ColorKey, ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), Alpha ) ); +void Image::createMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { + replaceColor( ColorKey, ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), Alpha ) ); } -void Image::CreateMaskFromColor( const RGB& ColorKey, Uint8 Alpha ) { - CreateMaskFromColor( ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), 255 ), Alpha ); +void Image::createMaskFromColor( const RGB& ColorKey, Uint8 Alpha ) { + createMaskFromColor( ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), 255 ), Alpha ); } -void Image::FillWithColor( const ColorA& Color ) { +void Image::fillWithColor( const ColorA& Color ) { if ( NULL == mPixels ) return; @@ -546,22 +546,22 @@ void Image::FillWithColor( const ColorA& Color ) { } } -void Image::CopyImage( Graphics::Image * image, const Uint32& x, const Uint32& y ) { - if ( NULL != mPixels && NULL != image->GetPixels() && mWidth >= x + image->Width() && mHeight >= y + image->Height() ) { - unsigned int dWidth = image->Width(); - unsigned int dHeight = image->Height(); +void Image::copyImage( Graphics::Image * image, const Uint32& x, const Uint32& y ) { + if ( NULL != mPixels && NULL != image->getPixels() && mWidth >= x + image->width() && mHeight >= y + image->height() ) { + unsigned int dWidth = image->width(); + unsigned int dHeight = image->height(); - if ( mChannels != image->Channels() ) { + if ( mChannels != image->channels() ) { for ( unsigned int ty = 0; ty < dHeight; ty++ ) { for ( unsigned int tx = 0; tx < dWidth; tx++ ) { - SetPixel( x + tx, y + ty, image->GetPixel( tx, ty ) ); + setPixel( x + tx, y + ty, image->getPixel( tx, ty ) ); } } } else { // Copy per row for ( unsigned int ty = 0; ty < dHeight; ty++ ) { Uint8 * pDst = &mPixels[ ( x + ( ( ty + y ) * mWidth ) ) * mChannels ]; - const Uint8 * pSrc = &( ( image->GetPixelsPtr() )[ ( ty * dWidth ) * mChannels ] ); + const Uint8 * pSrc = &( ( image->getPixelsPtr() )[ ( ty * dWidth ) * mChannels ] ); memcpy( pDst, pSrc, mChannels * dWidth ); } @@ -569,13 +569,13 @@ void Image::CopyImage( Graphics::Image * image, const Uint32& x, const Uint32& y } } -void Image::Resize( const Uint32 &newWidth, const Uint32 &newHeight , EE_RESAMPLER_FILTER filter ) { +void Image::resize( const Uint32 &newWidth, const Uint32 &newHeight , EE_RESAMPLER_FILTER filter ) { if ( NULL != mPixels && mWidth != newWidth && mHeight != newHeight ) { unsigned char * resampled = resample_image( mPixels, mWidth, mHeight, mChannels, newWidth, newHeight, filter ); if ( NULL != resampled ) { - ClearCache(); + clearCache(); mPixels = resampled; mWidth = newWidth; @@ -584,17 +584,17 @@ void Image::Resize( const Uint32 &newWidth, const Uint32 &newHeight , EE_RESAMPL } } -void Image::Scale( const Float& scale , EE_RESAMPLER_FILTER filter ) { +void Image::scale( const Float& scale , EE_RESAMPLER_FILTER filter ) { if ( 1.f == scale ) return; Int32 new_width = (Int32)( (Float)mWidth * scale ); Int32 new_height = (Int32)( (Float)mHeight * scale ); - Resize( new_width, new_height, filter ); + resize( new_width, new_height, filter ); } -Graphics::Image * Image::Thumbnail( const Uint32& maxWidth, const Uint32& maxHeight, EE_RESAMPLER_FILTER filter ) { +Graphics::Image * Image::thumbnail( const Uint32& maxWidth, const Uint32& maxHeight, EE_RESAMPLER_FILTER filter ) { if ( NULL != mPixels ) { Float iScaleX = ( (Float)maxWidth / (Float)mWidth ); Float iScaleY = ( (Float)maxHeight / (Float)mHeight ); @@ -612,7 +612,7 @@ Graphics::Image * Image::Thumbnail( const Uint32& maxWidth, const Uint32& maxHei return NULL; } -Graphics::Image * Image::Crop( Recti rect ) { +Graphics::Image * Image::crop( Recti rect ) { if ( rect.Left >= 0 && rect.Right <= (Int32)mWidth && rect.Top >= 0 && rect.Bottom <= (Int32)mHeight ) { Image * img = eeNew( Image, ( rect.size().width(), rect.size().height(), mChannels ) ); @@ -630,45 +630,45 @@ Graphics::Image * Image::Crop( Recti rect ) { return NULL; } -void Image::Flip() { +void Image::flip() { if ( NULL != mPixels ) { Image tImg( mHeight, mWidth, mChannels ); for ( unsigned int y = 0; y < mHeight; y++ ) for ( unsigned int x = 0; x < mWidth; x++ ) - tImg.SetPixel( y, x, GetPixel( x, mHeight - 1 - y ) ); + tImg.setPixel( y, x, getPixel( x, mHeight - 1 - y ) ); - ClearCache(); + clearCache(); - mPixels = tImg.GetPixels(); - mWidth = tImg.Width(); - mHeight = tImg.Height(); + mPixels = tImg.getPixels(); + mWidth = tImg.width(); + mHeight = tImg.height(); - tImg.AvoidFreeImage( true ); + tImg.avoidFreeImage( true ); } } -void Image::AvoidFreeImage( const bool& AvoidFree ) { +void Image::avoidFreeImage( const bool& AvoidFree ) { mAvoidFree = AvoidFree; } -void Image::Blit( Graphics::Image * image, const Uint32& x, const Uint32& y ) { - if ( NULL != image && NULL != image->GetPixelsPtr() && x < mWidth && y < mHeight ) { - unsigned int dh = eemin( mHeight , y + image->Height() ); - unsigned int dw = eemin( mWidth , x + image->Width() ); +void Image::blit( Graphics::Image * image, const Uint32& x, const Uint32& y ) { + if ( NULL != image && NULL != image->getPixelsPtr() && x < mWidth && y < mHeight ) { + unsigned int dh = eemin( mHeight , y + image->height() ); + unsigned int dw = eemin( mWidth , x + image->width() ); for ( unsigned int ty = y; ty < dh; ty++ ) { for ( unsigned int tx = x; tx < dw; tx++ ) { - ColorA ts( image->GetPixel( tx - x, ty - y ) ); - ColorA td( GetPixel( tx, ty ) ); + ColorA ts( image->getPixel( tx - x, ty - y ) ); + ColorA td( getPixel( tx, ty ) ); - SetPixel( tx, ty, Color::blend( ts, td ) ); + setPixel( tx, ty, Color::blend( ts, td ) ); } } } } -Graphics::Image * Image::Copy() { +Graphics::Image * Image::copy() { return eeNew( Graphics::Image, ( this ) ); } @@ -680,10 +680,10 @@ Graphics::Image &Image::operator =(const Image &right) { mAvoidFree = right.mAvoidFree; mLoadedFromStbi = right.mLoadedFromStbi; - ClearCache(); + clearCache(); if ( NULL != right.mPixels ) { - SetPixels( right.mPixels ); + setPixels( right.mPixels ); } return *this; diff --git a/src/eepp/graphics/particle.cpp b/src/eepp/graphics/particle.cpp index 0291172b2..4c47e59ad 100755 --- a/src/eepp/graphics/particle.cpp +++ b/src/eepp/graphics/particle.cpp @@ -3,7 +3,7 @@ namespace EE { namespace Graphics { Particle::Particle() { - Reset(0.f, 0.f, 0.f, 0.f, 0.f, 0.f); + reset(0.f, 0.f, 0.f, 0.f, 0.f, 0.f); } Particle::~Particle() {} @@ -13,7 +13,7 @@ void Particle::Color(ColorAf Color, Float AlphaDecay) { mAlphaDecay = AlphaDecay; } -void Particle::Reset(const Float &x, const Float &y, const Float &xspeed, const Float &yspeed, const Float &xacc, const Float &yacc, const Float size) { +void Particle::reset(const Float &x, const Float &y, const Float &xspeed, const Float &yspeed, const Float &xacc, const Float &yacc, const Float size) { mX = x; mY = y; mXSpeed = xspeed; @@ -25,7 +25,7 @@ void Particle::Reset(const Float &x, const Float &y, const Float &xspeed, const mAlphaDecay = 0.01f; } -void Particle::Update(const Float &pTime) { +void Particle::update(const Float &pTime) { mX = mX + mXSpeed * pTime; mY = mY + mYSpeed * pTime; mXSpeed = mXSpeed + mXAcc * pTime; diff --git a/src/eepp/graphics/particlesystem.cpp b/src/eepp/graphics/particlesystem.cpp index f36ff0e2f..8314ccf4d 100755 --- a/src/eepp/graphics/particlesystem.cpp +++ b/src/eepp/graphics/particlesystem.cpp @@ -39,8 +39,8 @@ ParticleSystem::~ParticleSystem() { eeSAFE_DELETE_ARRAY( mParticle ); } -void ParticleSystem::Create( const EE_PARTICLE_EFFECT& Effect, const Uint32& NumParticles, const Uint32& TexId, const Vector2f& Pos, const Float& PartSize, const bool& AnimLoop, const Uint32& NumLoops, const ColorAf& Color, const Vector2f& Pos2, const Float& AlphaDecay, const Vector2f& Speed, const Vector2f& Acc ) { - mPointsSup = GLi->PointSpriteSupported(); +void ParticleSystem::create( const EE_PARTICLE_EFFECT& Effect, const Uint32& NumParticles, const Uint32& TexId, const Vector2f& Pos, const Float& PartSize, const bool& AnimLoop, const Uint32& NumLoops, const ColorAf& Color, const Vector2f& Pos2, const Float& AlphaDecay, const Vector2f& Speed, const Vector2f& Acc ) { + mPointsSup = GLi->pointSpriteSupported(); mEffect = Effect; mPos = Pos; mPCount = NumParticles; @@ -68,10 +68,10 @@ void ParticleSystem::Create( const EE_PARTICLE_EFFECT& Effect, const Uint32& Num if ( !mLoop && mLoops < 1 ) mLoops = 1; - Begin(); + begin(); } -void ParticleSystem::Begin() { +void ParticleSystem::begin() { mPLeft = mPCount; eeSAFE_DELETE_ARRAY( mParticle ); @@ -82,30 +82,30 @@ void ParticleSystem::Begin() { for ( Uint32 i=0; i < mPCount; i++ ) { P = &mParticle[i]; - P->Used(true); - P->Id(i+1); + P->used(true); + P->id(i+1); - Reset( P ); + reset( P ); } } -void ParticleSystem::SetCallbackReset( const ParticleCallback& pc ) { +void ParticleSystem::setCallbackReset( const ParticleCallback& pc ) { mPC = pc; } -void ParticleSystem::Reset( Particle * P ) { +void ParticleSystem::reset( Particle * P ) { Float x, y, radio, q, z, w; switch ( mEffect ) { case PSE_Nofx: { - P->Reset( mPos.x, mPos.y, mSpeed.x, mSpeed.y, mAcc.x, mAcc.y, mSize ); + P->reset( mPos.x, mPos.y, mSpeed.x, mSpeed.y, mAcc.x, mAcc.y, mSize ); P->Color( mColor , mAlphaDecay ); break; } case PSE_BlueBall: { - P->Reset( mPos.x, mPos.y, -10, ( -1 * Math::randf() ), 0.01f, Math::randf(), mSize ); + P->reset( mPos.x, mPos.y, -10, ( -1 * Math::randf() ), 0.01f, Math::randf(), mSize ); P->Color( ColorAf( 0.25f ,0.25f ,1 ,1 ), 0.1f + ( 0.1f * Math::randf() ) ); break; } @@ -114,7 +114,7 @@ void ParticleSystem::Reset( Particle * P ) { x = ( mPos2.x - mPos.x + 1 ) * Math::randf() + mPos.x; y = ( mPos2.y - mPos.y + 1 ) * Math::randf() + mPos.y; - P->Reset( x, y, Math::randf() - 0.5f, ( Math::randf() - 1.1f ) * 8.5f, 0.f, 0.05f, mSize ); + P->reset( x, y, Math::randf() - 0.5f, ( Math::randf() - 1.1f ) * 8.5f, 0.f, 0.05f, mSize ); P->Color( ColorAf( 1.f, 0.5f, 0.1f, ( Math::randf() * 0.5f ) ), Math::randf() * 0.4f + 0.01f ); break; } @@ -123,7 +123,7 @@ void ParticleSystem::Reset( Particle * P ) { x = ( mPos2.x - mPos.x + 1 ) * Math::randf() + mPos.x; y = ( mPos2.y - mPos.y + 1 ) * Math::randf() + mPos.y; - P->Reset( x, y, -( Math::randf() / 3.f + 0.1f ), ( ( Math::randf() * 0.5f ) - 0.7f ) * 3, ( Math::randf() / 200.f ), ( Math::randf() - 0.5f ) / 200.f ); + P->reset( x, y, -( Math::randf() / 3.f + 0.1f ), ( ( Math::randf() * 0.5f ) - 0.7f ) * 3, ( Math::randf() / 200.f ), ( Math::randf() - 0.5f ) / 200.f ); P->Color( ColorAf( 0.8f, 0.8f, 0.8f, 0.3f ), ( Math::randf() * 0.005f ) + 0.005f ); break; } @@ -133,31 +133,31 @@ void ParticleSystem::Reset( Particle * P ) { y = ( mPos2.y - mPos.y + 1 ) * Math::randf() + mPos.y; w = ( Math::randf() + 0.3f ) * 4; - P->Reset( x, y, Math::randf() - 0.5f, w, 0.f, 0.f, w * 3 ); + P->reset( x, y, Math::randf() - 0.5f, w, 0.f, 0.f, w * 3 ); P->Color( ColorAf( 1.f, 1.f, 1.f, 0.5f ), 0 ); break; } case PSE_MagicFire: { - P->Reset( mPos.x + Math::randf() , mPos.y, -0.4f + Math::randf() * 0.8f, -0.5f - Math::randf() * 0.4f, 0.f, -( Math::randf() * 0.3f ) ); + P->reset( mPos.x + Math::randf() , mPos.y, -0.4f + Math::randf() * 0.8f, -0.5f - Math::randf() * 0.4f, 0.f, -( Math::randf() * 0.3f ) ); P->Color( ColorAf( 1.f, 0.5f, 0.1f, 0.7f + 0.2f * Math::randf() ), 0.01f + Math::randf() * 0.05f ); break; } case PSE_LevelUp: { - P->Reset( mPos.x, mPos.y, Math::randf() * 1.5f - 0.75f, Math::randf() * 1.5f - 0.75f, Math::randf() * 4 - 2, Math::randf() * -4 + 2 ); + P->reset( mPos.x, mPos.y, Math::randf() * 1.5f - 0.75f, Math::randf() * 1.5f - 0.75f, Math::randf() * 4 - 2, Math::randf() * -4 + 2 ); P->Color( ColorAf( 1.f, 0.5f, 0.1f, 1.f ), 0.07f + Math::randf() * 0.01f ); break; } case PSE_LevelUp2: { - P->Reset( mPos.x + Math::randf() * 32 - 16, mPos.y + Math::randf() * 64 - 32, Math::randf() - 0.5f, Math::randf() - 0.5f, Math::randf() - 0.5f, Math::randf() * -0.9f + 0.45f ); + P->reset( mPos.x + Math::randf() * 32 - 16, mPos.y + Math::randf() * 64 - 32, Math::randf() - 0.5f, Math::randf() - 0.5f, Math::randf() - 0.5f, Math::randf() * -0.9f + 0.45f ); P->Color( ColorAf( 0.1f + Math::randf() * 0.1f, 0.1f + Math::randf() * 0.1f, 0.8f + Math::randf() * 0.3f, 1 ), 0.07f + Math::randf() * 0.01f ); break; } case PSE_Heal: { - P->Reset( mPos.x, mPos.y, Math::randf() * 1.4f - 0.7f, Math::randf() * -0.4f - 1.5f, Math::randf() - 0.5f, Math::randf() * -0.2f + 0.1f ); + P->reset( mPos.x, mPos.y, Math::randf() * 1.4f - 0.7f, Math::randf() * -0.4f - 1.5f, Math::randf() - 0.5f, Math::randf() * -0.2f + 0.1f ); P->Color( ColorAf( 0.2f, 0.3f, 0.9f, 0.4f ), 0.01f + Math::randf() * 0.01f ); break; } @@ -175,11 +175,11 @@ void ParticleSystem::Reset( Particle * P ) { } mProgression = (int) Math::randf() * 10; - radio = ( P->Id() * 0.125f ) * mProgression; - x = mPos.x + ( radio * eecos( (Float)P->Id() ) ); - y = mPos.y + ( radio * eesin( (Float)P->Id() ) ); + radio = ( P->id() * 0.125f ) * mProgression; + x = mPos.x + ( radio * eecos( (Float)P->id() ) ); + y = mPos.y + ( radio * eesin( (Float)P->id() ) ); - P->Reset( x, y, VarB[0], VarB[1], VarB[2], VarB[3] ); + P->reset( x, y, VarB[0], VarB[1], VarB[2], VarB[3] ); P->Color( ColorAf( 1.f, 0.6f, 0.3f, 1.f ), 0.02f + Math::randf() * 0.3f ); break; } @@ -195,64 +195,64 @@ void ParticleSystem::Reset( Particle * P ) { else if ( mProgression < -50 ) mDirection = 1; - q = ( ( P->Id() * 0.01f ) + mProgression ) * 2; + q = ( ( P->id() * 0.01f ) + mProgression ) * 2; x = mPos.x - w * eesin( q ); y = mPos.y - z * eecos( q ); - P->Reset( x, y, 1, 1, 0, 0 ); + P->reset( x, y, 1, 1, 0, 0 ); P->Color( ColorAf( 1.f, 0.25f, 0.25f, 1 ), 0.6f + Math::randf() * 0.3f ); break; } case PSE_Flower: { - radio = eecos( 2 * ( (Float)P->Id() * 0.1f ) ) * 50; - x = mPos.x + radio * eecos( (Float)P->Id() * 0.1f ); - y = mPos.y + radio * eesin( (Float)P->Id() * 0.1f ); + radio = eecos( 2 * ( (Float)P->id() * 0.1f ) ) * 50; + x = mPos.x + radio * eecos( (Float)P->id() * 0.1f ); + y = mPos.y + radio * eesin( (Float)P->id() * 0.1f ); - P->Reset( x, y, 1, 1, 0, 0 ); + P->reset( x, y, 1, 1, 0, 0 ); P->Color( ColorAf( 1.f, 0.25f, 0.1f, 0.1f ), 0.3f + ( 0.2f * Math::randf()) + Math::randf() * 0.3f ); break; } case PSE_Galaxy: { - radio = ( Math::randf( 1.f, 1.2f ) + eesin( 20.f / (Float)P->Id() ) ) * 60; - x = mPos.x + radio * eecos( (Float)P->Id() ); - y = mPos.y + radio * eesin( (Float)P->Id() ); + radio = ( Math::randf( 1.f, 1.2f ) + eesin( 20.f / (Float)P->id() ) ) * 60; + x = mPos.x + radio * eecos( (Float)P->id() ); + y = mPos.y + radio * eesin( (Float)P->id() ); - P->Reset( x, y, 0, 0, 0, 0 ); + P->reset( x, y, 0, 0, 0, 0 ); P->Color( ColorAf( 0.2f, 0.2f, 0.6f + 0.4f * Math::randf(), 1.f ), Math::randf( 0.05f, 0.15f ) ); break; } case PSE_Heart: { - q = P->Id() * 0.01f; + q = P->id() * 0.01f; x = mPos.x - 50 * eesin( q * 2 ) * eesqrt( eeabs( eecos( q ) ) ); y = mPos.y - 50 * eecos( q * 2 ) * eesqrt( eeabs( eesin( q ) ) ); - P->Reset( x, y, 0.f, 0.f, 0.f, -( Math::randf() * 0.2f ) ); + P->reset( x, y, 0.f, 0.f, 0.f, -( Math::randf() * 0.2f ) ); P->Color( ColorAf( 1.f, 0.5f, 0.2f, 0.6f + 0.2f * Math::randf() ), 0.01f + Math::randf() * 0.08f ); break; } case PSE_BlueExplosion: { - if ( P->Id() == 0 ) + if ( P->id() == 0 ) mProgression += 10; - radio = atan( static_cast( P->Id() % 12 ) ); - x = mPos.x + ( radio * eecos( (Float)P->Id() / mProgression ) * 30 ); - y = mPos.y + ( radio * eesin( (Float)P->Id() / mProgression ) * 30 ); + radio = atan( static_cast( P->id() % 12 ) ); + x = mPos.x + ( radio * eecos( (Float)P->id() / mProgression ) * 30 ); + y = mPos.y + ( radio * eesin( (Float)P->id() / mProgression ) * 30 ); - P->Reset(x, y, eecos( (Float)P->Id() ), eesin( (Float)P->Id() ), 0, 0 ); + P->reset(x, y, eecos( (Float)P->id() ), eesin( (Float)P->id() ), 0, 0 ); P->Color( ColorAf( 0.3f, 0.6f, 1.f, 1.f ), 0.03f ); break; } case PSE_GP: { - radio = 50 + Math::randf() * 15 * eecos( (Float)P->Id() * 3.5f ); - x = mPos.x + ( radio * eecos( (Float)P->Id() * (Float)0.01428571428 ) ); - y = mPos.y + ( radio * eesin( (Float)P->Id() * (Float)0.01428571428 ) ); + radio = 50 + Math::randf() * 15 * eecos( (Float)P->id() * 3.5f ); + x = mPos.x + ( radio * eecos( (Float)P->id() * (Float)0.01428571428 ) ); + y = mPos.y + ( radio * eesin( (Float)P->id() * (Float)0.01428571428 ) ); - P->Reset( x, y, 0, 0, 0, 0 ); + P->reset( x, y, 0, 0, 0, 0 ); P->Color( ColorAf( 0.2f, 0.8f, 0.4f, 0.5f ), Math::randf() * 0.3f ); break; } @@ -267,11 +267,11 @@ void ParticleSystem::Reset( Particle * P ) { else if ( mProgression < -50 ) mDirection = 1; - q = ( P->Id() * 0.01f + mProgression ) * 2; + q = ( P->id() * 0.01f + mProgression ) * 2; x = mPos.x + w * eesin( q ); y = mPos.y - w * eecos( q ); - P->Reset( x, y, 1, 1, 0, 0 ); + P->reset( x, y, 1, 1, 0, 0 ); P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::randf() * 0.3f + Math::randf() * 0.3f ); break; } @@ -286,21 +286,21 @@ void ParticleSystem::Reset( Particle * P ) { else if ( mProgression < -50 ) mDirection = 1; - q = ( P->Id() * 0.01f + mProgression ) * 2; + q = ( P->id() * 0.01f + mProgression ) * 2; x = mPos.x + w * eesin( q ); y = mPos.y - w * eecos( q ); - P->Reset( x, y, -10, -1 * Math::randf(), 0, Math::randf() ); + P->reset( x, y, -10, -1 * Math::randf(), 0, Math::randf() ); P->Color( ColorAf( 0.25f, 0.25f, 1.f, 1.f ), 0.1f + Math::randf() * 0.1f + Math::randf() * 0.3f ); break; } case PSE_Atomic: { - radio = 10 + eesin( 2 * ( (Float)P->Id() * 0.1f ) ) * 50; - x = mPos.x + radio * eecos( (Float)P->Id() * 0.033333 ); - y = mPos.y + radio * eesin( (Float)P->Id() * 0.033333 ); + radio = 10 + eesin( 2 * ( (Float)P->id() * 0.1f ) ) * 50; + x = mPos.x + radio * eecos( (Float)P->id() * 0.033333 ); + y = mPos.y + radio * eesin( (Float)P->id() * 0.033333 ); - P->Reset( x, y, 1, 1, 0, 0 ); + P->reset( x, y, 1, 1, 0, 0 ); P->Color( ColorAf( 0.4f, 0.25f, 1.f, 1.f ), 0.3f + Math::randf() * 0.2f + Math::randf() * 0.3f ); break; } @@ -315,29 +315,29 @@ void ParticleSystem::Reset( Particle * P ) { } } -void ParticleSystem::Draw() { +void ParticleSystem::draw() { if ( !mUsed ) return; TextureFactory * TF = TextureFactory::instance(); - TF->Bind( mTexId ); + TF->bind( mTexId ); BlendMode::SetMode( mBlend ); if ( mPointsSup ) { - GLi->Enable( GL_POINT_SPRITE ); - GLi->PointSize( mSize ); + GLi->enable( GL_POINT_SPRITE ); + GLi->pointSize( mSize ); Uint32 alloc = mPCount * sizeof(Particle); - GLi->ColorPointer ( 4, GL_FP, sizeof(Particle), reinterpret_cast( &mParticle[0] ) + sizeof(Float) * 2 , alloc ); - GLi->VertexPointer ( 2, GL_FP, sizeof(Particle), reinterpret_cast( &mParticle[0] ) , alloc ); + GLi->colorPointer ( 4, GL_FP, sizeof(Particle), reinterpret_cast( &mParticle[0] ) + sizeof(Float) * 2 , alloc ); + GLi->vertexPointer ( 2, GL_FP, sizeof(Particle), reinterpret_cast( &mParticle[0] ) , alloc ); - GLi->DrawArrays( GL_POINTS, 0, (int)mPCount ); + GLi->drawArrays( GL_POINTS, 0, (int)mPCount ); - GLi->Disable( GL_POINT_SPRITE ); + GLi->disable( GL_POINT_SPRITE ); } else { - Texture * Tex = TF->GetTexture( mTexId ); + Texture * Tex = TF->getTexture( mTexId ); if ( NULL == Tex ) return; @@ -345,28 +345,28 @@ void ParticleSystem::Draw() { Particle* P; BatchRenderer * BR = GlobalBatchRenderer::instance(); - BR->SetTexture( Tex ); - BR->SetBlendMode( mBlend ); - BR->QuadsBegin(); + BR->setTexture( Tex ); + BR->setBlendMode( mBlend ); + BR->quadsBegin(); for ( Uint32 i = 0; i < mPCount; i++ ) { P = &mParticle[i]; - if ( P->Used() ) { - BR->QuadsSetColor( ColorA( static_cast ( P->R() * 255 ), static_cast ( P->G() * 255 ), static_cast( P->B() * 255 ), static_cast( P->A() * 255 ) ) ); - BR->BatchQuad( P->X() - mHSize, P->Y() - mHSize, mSize, mSize ); + if ( P->used() ) { + BR->quadsSetColor( ColorA( static_cast ( P->r() * 255 ), static_cast ( P->g() * 255 ), static_cast( P->b() * 255 ), static_cast( P->a() * 255 ) ) ); + BR->batchQuad( P->X() - mHSize, P->Y() - mHSize, mSize, mSize ); } } - BR->DrawOpt(); + BR->drawOpt(); } } -void ParticleSystem::Update() { - Update( Engine::instance()->elapsed() ); +void ParticleSystem::update() { + update( Engine::instance()->elapsed() ); } -void ParticleSystem::Update( const System::Time& time ) { +void ParticleSystem::update( const System::Time& time ) { if ( !mUsed ) return; @@ -375,130 +375,130 @@ void ParticleSystem::Update( const System::Time& time ) { for ( Uint32 i = 0; i < mPCount; i++ ) { P = &mParticle[i]; - if ( P->Used() || P->A() > 0.f ) { - P->Update( time.asMilliseconds() * mTime ); + if ( P->used() || P->a() > 0.f ) { + P->update( time.asMilliseconds() * mTime ); // If not alive - if ( P->A() <= 0.f ) { + if ( P->a() <= 0.f ) { if ( !mLoop ) { // If not loop if ( mLoops == 1 ) { // If left only one loop - P->Used(false); + P->used(false); mPLeft--; } else { // more than one if ( i == 0 ) if ( mLoops > 0 ) mLoops--; - Reset(P); + reset(P); } if ( mPLeft == 0 ) // Last mParticle? mUsed = false; } else { - Reset( P ); + reset( P ); } } } } } -void ParticleSystem::End() { +void ParticleSystem::end() { mLoop = false; mLoops = 1; } -void ParticleSystem::ReUse() { +void ParticleSystem::reuse() { mLoop = true; mLoops = 0; for ( Uint32 i = 0; i < mPCount; i++ ) - mParticle[i].Used( true ); + mParticle[i].used( true ); } -void ParticleSystem::Kill() { +void ParticleSystem::kill() { mUsed = false; } -void ParticleSystem::Position( const Vector2f& Pos ) { +void ParticleSystem::position( const Vector2f& Pos ) { mPos2.x = Pos.x + ( mPos2.x - mPos.x ); mPos2.y = Pos.y + ( mPos2.y - mPos.y ); mPos.x = Pos.x; mPos.y = Pos.y; } -const Vector2f& ParticleSystem::Position() const { +const Vector2f& ParticleSystem::position() const { return mPos; } -void ParticleSystem::Position(const Float& x, const Float& y) { - Position( Vector2f( x, y ) ); +void ParticleSystem::position(const Float& x, const Float& y) { + position( Vector2f( x, y ) ); } -void ParticleSystem::Position2( const Vector2f& Pos ) { +void ParticleSystem::position2( const Vector2f& Pos ) { mPos2.x = Pos.x + ( Pos.x - mPos.x ); mPos2.y = Pos.y + ( Pos.y - mPos.y ); } -const Vector2f& ParticleSystem::Position2() const { +const Vector2f& ParticleSystem::position2() const { return mPos2; } -void ParticleSystem::Position2( const Float& x, const Float& y ) { - Position( Vector2f( x, y ) ); +void ParticleSystem::position2( const Float& x, const Float& y ) { + position( Vector2f( x, y ) ); } -void ParticleSystem::Time( const Float& time ) { +void ParticleSystem::time( const Float& time ) { mTime = ( time >= 0 ) ? time : mTime; } -Float ParticleSystem::Time() const { +Float ParticleSystem::time() const { return mTime; } -void ParticleSystem::Using(const bool& inuse) { +void ParticleSystem::setUsing(const bool& inuse) { mUsed = inuse; } -bool ParticleSystem::Using() const { +bool ParticleSystem::isUsing() const { return mUsed; } -const EE_BLEND_MODE& ParticleSystem::BlendMode() const { +const EE_BLEND_MODE& ParticleSystem::blendMode() const { return mBlend; } -void ParticleSystem::BlendMode( const EE_BLEND_MODE& mode ) { +void ParticleSystem::blendMode( const EE_BLEND_MODE& mode ) { mBlend = mode; } -const ColorAf& ParticleSystem::Color() const { +const ColorAf& ParticleSystem::color() const { return mColor; } -void ParticleSystem::Color( const ColorAf& Col ) { +void ParticleSystem::color( const ColorAf& Col ) { mColor = Col; } -const Float& ParticleSystem::AlphaDecay() const { +const Float& ParticleSystem::alphaDecay() const { return mAlphaDecay; } -void ParticleSystem::AlphaDecay( const Float& Decay ) { +void ParticleSystem::alphaDecay( const Float& Decay ) { mAlphaDecay = Decay; } -const Vector2f& ParticleSystem::Speed() const { +const Vector2f& ParticleSystem::speed() const { return mSpeed; } -void ParticleSystem::Speed( const Vector2f& speed ) { +void ParticleSystem::speed( const Vector2f& speed ) { mSpeed = speed; } -const Vector2f& ParticleSystem::Acceleration() const { +const Vector2f& ParticleSystem::acceleration() const { return mAcc; } -void ParticleSystem::Acceleration( const Vector2f& acc ) { +void ParticleSystem::acceleration( const Vector2f& acc ) { mAcc = acc; } diff --git a/src/eepp/graphics/pixelperfect.cpp b/src/eepp/graphics/pixelperfect.cpp index 1cccca1b2..6ea391662 100644 --- a/src/eepp/graphics/pixelperfect.cpp +++ b/src/eepp/graphics/pixelperfect.cpp @@ -2,7 +2,7 @@ namespace EE { namespace Graphics { -bool PixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned int& y1, Texture * Tex2, const unsigned int& x2, const unsigned int& y2, const Rectu& Tex1_SrcRECT, const Rectu& Tex2_SrcRECT ) { +bool pixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned int& y1, Texture * Tex2, const unsigned int& x2, const unsigned int& y2, const Rectu& Tex1_SrcRECT, const Rectu& Tex2_SrcRECT ) { eeASSERT( NULL != Tex1 && NULL != Tex2 ); unsigned int ax1, ay1, ax2, ay2, bx1, by1, bx2, by2; @@ -14,8 +14,8 @@ bool PixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned ax2 = ax1 + Tex1_SrcRECT.Right - Tex1_SrcRECT.Left - 1; ay2 = ay1 + Tex1_SrcRECT.Bottom - Tex1_SrcRECT.Top - 1; } else { - ax2 = ax1 + Tex1->Width() - 1; - ay2 = ay1 + Tex1->Height() - 1; + ax2 = ax1 + Tex1->width() - 1; + ay2 = ay1 + Tex1->height() - 1; } bx1 = x2; @@ -24,15 +24,15 @@ bool PixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned bx2 = bx1 + Tex2_SrcRECT.Right - Tex2_SrcRECT.Left - 1; by2 = by1 + Tex2_SrcRECT.Bottom - Tex2_SrcRECT.Top - 1; } else { - bx2 = bx1 + Tex2->Width() - 1; - by2 = by1 + Tex2->Height() - 1; + bx2 = bx1 + Tex2->width() - 1; + by2 = by1 + Tex2->height() - 1; } if ( !(ax1 > bx2 || ax2 < bx1 || ay1 > by2 || ay2 < by1) ) { unsigned int inter_x0, inter_x1, inter_y0, inter_y1; - Tex1->Lock(); - Tex2->Lock(); + Tex1->lock(); + Tex2->lock(); inter_x0 = eemax(ax1,bx1); inter_x1 = eemin(ax2,bx2); @@ -43,14 +43,14 @@ bool PixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned for(unsigned int y = inter_y0 ; y <= inter_y1 ; y++) { for(unsigned int x = inter_x0 ; x <= inter_x1 ; x++) { if (Tex1_SrcRECT.Right != 0 && Tex1_SrcRECT.Bottom != 0) - C1 = Tex1->GetPixel( x - x1 + Tex1_SrcRECT.Left, y - y1 + Tex1_SrcRECT.Top ); + C1 = Tex1->getPixel( x - x1 + Tex1_SrcRECT.Left, y - y1 + Tex1_SrcRECT.Top ); else - C1 = Tex1->GetPixel( x - x1, y - y1 ); + C1 = Tex1->getPixel( x - x1, y - y1 ); if (Tex2_SrcRECT.Right != 0 && Tex2_SrcRECT.Bottom != 0) - C2 = Tex2->GetPixel( x - x2 + Tex2_SrcRECT.Left, y - y2 + Tex2_SrcRECT.Top ); + C2 = Tex2->getPixel( x - x2 + Tex2_SrcRECT.Left, y - y2 + Tex2_SrcRECT.Top ); else - C2 = Tex2->GetPixel( x - x2, y - y2 ); + C2 = Tex2->getPixel( x - x2, y - y2 ); if ( C1.a() > 0 && C2.a() > 0 ) { Collide = true; @@ -59,13 +59,13 @@ bool PixelPerfectCollide( Texture * Tex1, const unsigned int& x1, const unsigned } } - Tex1->Unlock(true); - Tex2->Unlock(true); + Tex1->unlock(true); + Tex2->unlock(true); } return Collide; } -bool PixelPerfectCollide( Texture * Tex, const unsigned int& x1, const unsigned int& y1, const unsigned int& x2, const unsigned int& y2, const Rectu& Tex1_SrcRECT) { +bool pixelPerfectCollide( Texture * Tex, const unsigned int& x1, const unsigned int& y1, const unsigned int& x2, const unsigned int& y2, const Rectu& Tex1_SrcRECT) { eeASSERT( NULL != Tex ); unsigned int ax1, ay1, ax2, ay2; @@ -77,24 +77,24 @@ bool PixelPerfectCollide( Texture * Tex, const unsigned int& x1, const unsigned ax2 = ax1 + Tex1_SrcRECT.Right - Tex1_SrcRECT.Left - 1; ay2 = ay1 + Tex1_SrcRECT.Bottom - Tex1_SrcRECT.Top - 1; } else { - ax2 = ax1 + Tex->Width() - 1; - ay2 = ay1 + Tex->Height() - 1; + ax2 = ax1 + Tex->width() - 1; + ay2 = ay1 + Tex->height() - 1; } if ( !( ax1 >= x2 && ax2 <= x2 && ay1 >= y2 && ay2 <= y2 ) ) { ColorA C1; - Tex->Lock(); + Tex->lock(); if (Tex1_SrcRECT.Right != 0 && Tex1_SrcRECT.Bottom != 0) - C1 = Tex->GetPixel( x2 - ax1 + Tex1_SrcRECT.Left, y2 - ay1 + Tex1_SrcRECT.Top ); + C1 = Tex->getPixel( x2 - ax1 + Tex1_SrcRECT.Left, y2 - ay1 + Tex1_SrcRECT.Top ); else - C1 = Tex->GetPixel( x2 - ax1, y2 - ay1 ); + C1 = Tex->getPixel( x2 - ax1, y2 - ay1 ); if ( C1.a() > 0 ) Collide = true; - Tex->Unlock(true); + Tex->unlock(true); } return Collide; } diff --git a/src/eepp/graphics/primitives.cpp b/src/eepp/graphics/primitives.cpp index b30006480..6faf5c042 100755 --- a/src/eepp/graphics/primitives.cpp +++ b/src/eepp/graphics/primitives.cpp @@ -23,67 +23,67 @@ Primitives::Primitives() : Primitives::~Primitives() { } -void Primitives::DrawPoint( const Vector2f& p, const Float& pointSize ) { - sBR->SetPointSize( pointSize ); +void Primitives::drawPoint( const Vector2f& p, const Float& pointSize ) { + sBR->setPointSize( pointSize ); - sBR->SetTexture( NULL ); - sBR->PointsBegin(); - sBR->PointSetColor( mColor ); + sBR->setTexture( NULL ); + sBR->pointsBegin(); + sBR->pointSetColor( mColor ); - sBR->BatchPoint( p.x, p.y ); + sBR->batchPoint( p.x, p.y ); - DrawBatch(); + drawBatch(); } -void Primitives::DrawLine( const Line2f& line ) { - sBR->SetLineWidth( mLineWidth ); +void Primitives::drawLine( const Line2f& line ) { + sBR->setLineWidth( mLineWidth ); - sBR->SetTexture( NULL ); - sBR->LinesBegin(); - sBR->LinesSetColor( mColor ); + sBR->setTexture( NULL ); + sBR->linesBegin(); + sBR->linesSetColor( mColor ); - sBR->BatchLine( line.V[0].x, line.V[0].y, line.V[1].x, line.V[1].y ); + sBR->batchLine( line.V[0].x, line.V[0].y, line.V[1].x, line.V[1].y ); - DrawBatch(); + drawBatch(); } -void Primitives::DrawTriangle( const Triangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { - sBR->SetTexture( NULL ); - sBR->SetBlendMode( mBlendMode ); +void Primitives::drawTriangle( const Triangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { + sBR->setTexture( NULL ); + sBR->setBlendMode( mBlendMode ); switch( mFillMode ) { case DRAW_LINE: { - sBR->SetLineWidth( mLineWidth ); + sBR->setLineWidth( mLineWidth ); - sBR->LineLoopBegin(); + sBR->lineLoopBegin(); - sBR->LineLoopSetColorFree( Color1, Color2 ); - sBR->BatchLineLoop( t.V[0].x, t.V[0].y, t.V[1].x, t.V[1].y ); - sBR->LineLoopSetColorFree( Color2, Color3 ); - sBR->BatchLineLoop( t.V[1].x, t.V[1].y, t.V[2].x, t.V[2].y ); + sBR->lineLoopSetColorFree( Color1, Color2 ); + sBR->batchLineLoop( t.V[0].x, t.V[0].y, t.V[1].x, t.V[1].y ); + sBR->lineLoopSetColorFree( Color2, Color3 ); + sBR->batchLineLoop( t.V[1].x, t.V[1].y, t.V[2].x, t.V[2].y ); break; } default: case DRAW_FILL: { - sBR->TrianglesBegin(); + sBR->trianglesBegin(); - sBR->TrianglesSetColorFree( Color1, Color2, Color3 ); - sBR->BatchTriangle( t.V[0].x, t.V[0].y, t.V[1].x, t.V[1].y, t.V[2].x, t.V[2].y ); + sBR->trianglesSetColorFree( Color1, Color2, Color3 ); + sBR->batchTriangle( t.V[0].x, t.V[0].y, t.V[1].x, t.V[1].y, t.V[2].x, t.V[2].y ); break; } } - DrawBatch(); + drawBatch(); } -void Primitives::DrawTriangle( const Triangle2f& t ) { - DrawTriangle( t, mColor, mColor, mColor ); +void Primitives::drawTriangle( const Triangle2f& t ) { + drawTriangle( t, mColor, mColor, mColor ); } -void Primitives::DrawCircle( const Vector2f& p, const Float& radius, Uint32 segmentsCount ) { +void Primitives::drawCircle( const Vector2f& p, const Float& radius, Uint32 segmentsCount ) { if ( 0 == segmentsCount ) { // Optimized circle rendering static const float circleVAR[] = { @@ -116,60 +116,60 @@ void Primitives::DrawCircle( const Vector2f& p, const Float& radius, Uint32 segm }; static const int circleVAR_count = sizeof(circleVAR)/sizeof(float)/2; - GLi->Disable( GL_TEXTURE_2D ); + GLi->disable( GL_TEXTURE_2D ); - GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); - GLi->PushMatrix(); + GLi->pushMatrix(); - GLi->Translatef( p.x, p.y, 0.0f ); + GLi->translatef( p.x, p.y, 0.0f ); - GLi->Scalef( radius, radius, 1.0f); + GLi->scalef( radius, radius, 1.0f); - GLi->VertexPointer( 2, GL_FLOAT, 0, circleVAR, circleVAR_count * sizeof(float) * 2 ); + GLi->vertexPointer( 2, GL_FLOAT, 0, circleVAR, circleVAR_count * sizeof(float) * 2 ); std::vector colors( circleVAR_count - 1 ,mColor ); - GLi->ColorPointer( 4, GL_UNSIGNED_BYTE, 0, &colors[0], circleVAR_count * 4 ); + GLi->colorPointer( 4, GL_UNSIGNED_BYTE, 0, &colors[0], circleVAR_count * 4 ); switch( mFillMode ) { case DRAW_LINE: { - GLi->DrawArrays( GL_LINE_LOOP, 0, circleVAR_count - 1 ); + GLi->drawArrays( GL_LINE_LOOP, 0, circleVAR_count - 1 ); break; } case DRAW_FILL: { - GLi->DrawArrays( GL_TRIANGLE_FAN, 0, circleVAR_count - 1 ); + GLi->drawArrays( GL_TRIANGLE_FAN, 0, circleVAR_count - 1 ); break; } } - GLi->PopMatrix(); + GLi->popMatrix(); - GLi->Enable( GL_TEXTURE_2D ); + GLi->enable( GL_TEXTURE_2D ); - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); return; } - DrawArc( p, radius, segmentsCount, 360 ); + drawArc( p, radius, segmentsCount, 360 ); } -void Primitives::DrawArc( const Vector2f& p, const Float& radius, Uint32 segmentsCount, const Float& arcAngle, const Float& arcStartAngle ) { +void Primitives::drawArc( const Vector2f& p, const Float& radius, Uint32 segmentsCount, const Float& arcAngle, const Float& arcStartAngle ) { if(segmentsCount < 6) segmentsCount = 6; segmentsCount = segmentsCount > 360 ? 360 : segmentsCount; Float angle_shift = 360 / static_cast(segmentsCount); Float arcAngleA = arcAngle > 360 ? arcAngle - 360 * std::floor( arcAngle / 360 ) : arcAngle; - sBR->SetTexture( NULL ); + sBR->setTexture( NULL ); switch( mFillMode ) { case DRAW_LINE: { - sBR->SetLineWidth( mLineWidth ); + sBR->setLineWidth( mLineWidth ); segmentsCount = Uint32( (Float)segmentsCount * (Float)eeabs( arcAngleA ) / 360 ); Float startAngle = Math::radians(arcStartAngle); @@ -179,11 +179,11 @@ void Primitives::DrawArc( const Vector2f& p, const Float& radius, Uint32 segment Float x = radius * eecos(startAngle); Float y = radius * eesin(startAngle); - sBR->LineStripBegin(); - sBR->LineStripSetColor( mColor ); + sBR->lineStripBegin(); + sBR->lineStripSetColor( mColor ); for( Uint32 ii = 0; ii < segmentsCount; ii++ ) { - sBR->BatchLineStrip(x + p.x, y + p.y); + sBR->batchLineStrip(x + p.x, y + p.y); Float tx = -y; Float ty = x; @@ -199,13 +199,13 @@ void Primitives::DrawArc( const Vector2f& p, const Float& radius, Uint32 segment } case DRAW_FILL: { - sBR->TriangleFanBegin(); - sBR->TriangleFanSetColor( mColor ); + sBR->triangleFanBegin(); + sBR->triangleFanSetColor( mColor ); for( Float i = 0; i < arcAngleA; i+= angle_shift ) { Float startAngle = arcStartAngle + i; - sBR->BatchTriangleFan( p.x , p.y, + sBR->batchTriangleFan( p.x , p.y, p.x + radius * Math::sinAng( startAngle ), p.y + radius * Math::cosAng( startAngle ), p.x + radius * Math::sinAng( startAngle + angle_shift ), p.y + radius * Math::cosAng( startAngle + angle_shift ) ); } @@ -214,30 +214,30 @@ void Primitives::DrawArc( const Vector2f& p, const Float& radius, Uint32 segment } } - DrawBatch(); + drawBatch(); } -void Primitives::DrawRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const Vector2f& Scale ) { - sBR->SetTexture( NULL ); - sBR->SetBlendMode( mBlendMode ); +void Primitives::drawRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const Vector2f& Scale ) { + sBR->setTexture( NULL ); + sBR->setBlendMode( mBlendMode ); switch( mFillMode ) { case DRAW_FILL: { - sBR->QuadsBegin(); - sBR->QuadsSetColorFree( TopLeft, BottomLeft, BottomRight, TopRight ); + sBR->quadsBegin(); + sBR->quadsSetColorFree( TopLeft, BottomLeft, BottomRight, TopRight ); Sizef size = const_cast(&R)->size(); - sBR->BatchQuadEx( R.Left, R.Top, size.width(), size.height(), Angle, Scale ); + sBR->batchQuadEx( R.Left, R.Top, size.width(), size.height(), Angle, Scale ); break; } case DRAW_LINE: { - sBR->SetLineWidth( mLineWidth ); + sBR->setLineWidth( mLineWidth ); - sBR->LineLoopBegin(); - sBR->LineLoopSetColorFree( TopLeft, BottomLeft ); + sBR->lineLoopBegin(); + sBR->lineLoopSetColorFree( TopLeft, BottomLeft ); if ( Scale != 1.0f || Angle != 0.0f ) { Quad2f Q( R ); @@ -246,29 +246,29 @@ void Primitives::DrawRectangle( const Rectf& R, const ColorA& TopLeft, const Col Q.scale( Scale ); Q.rotate( Angle, Vector2f( R.Left + size.width() * 0.5f, R.Top + size.height() * 0.5f ) ); - sBR->BatchLineLoop( Q[0].x, Q[0].y, Q[1].x, Q[1].y ); - sBR->LineLoopSetColorFree( BottomRight, TopRight ); - sBR->BatchLineLoop( Q[2].x, Q[2].y, Q[3].x, Q[3].y ); + sBR->batchLineLoop( Q[0].x, Q[0].y, Q[1].x, Q[1].y ); + sBR->lineLoopSetColorFree( BottomRight, TopRight ); + sBR->batchLineLoop( Q[2].x, Q[2].y, Q[3].x, Q[3].y ); } else { - sBR->BatchLineLoop( R.Left, R.Top, R.Left, R.Bottom ); - sBR->LineLoopSetColorFree( BottomRight, TopRight ); - sBR->BatchLineLoop( R.Right, R.Bottom, R.Right, R.Top ); + sBR->batchLineLoop( R.Left, R.Top, R.Left, R.Bottom ); + sBR->lineLoopSetColorFree( BottomRight, TopRight ); + sBR->batchLineLoop( R.Right, R.Bottom, R.Right, R.Top ); } break; } } - DrawBatch(); + drawBatch(); } -void Primitives::DrawRectangle( const Rectf& R, const Float& Angle, const Vector2f& Scale ) { - DrawRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale ); +void Primitives::drawRectangle( const Rectf& R, const Float& Angle, const Vector2f& Scale ) { + drawRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale ); } -void Primitives::DrawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const Vector2f& Scale, const unsigned int& Corners ) { - sBR->SetTexture( NULL ); - sBR->SetBlendMode( mBlendMode ); +void Primitives::drawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const Vector2f& Scale, const unsigned int& Corners ) { + sBR->setTexture( NULL ); + sBR->setBlendMode( mBlendMode ); unsigned int i; Sizef size = const_cast( &R )->size(); @@ -284,25 +284,25 @@ void Primitives::DrawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, co case DRAW_FILL: { if ( TopLeft == BottomLeft && BottomLeft == BottomRight && BottomRight == TopRight ) { - sBR->PolygonSetColor( TopLeft ); + sBR->polygonSetColor( TopLeft ); - sBR->BatchPolygon( Poly ); + sBR->batchPolygon( Poly ); } else { for ( i = 0; i < Poly.size(); i++ ) { poly = Poly[i]; if ( poly.x <= Center.x && poly.y <= Center.y ) - sBR->PolygonSetColor( TopLeft ); + sBR->polygonSetColor( TopLeft ); else if ( poly.x <= Center.x && poly.y >= Center.y ) - sBR->PolygonSetColor( BottomLeft ); + sBR->polygonSetColor( BottomLeft ); else if ( poly.x > Center.x && poly.y > Center.y ) - sBR->PolygonSetColor( BottomRight ); + sBR->polygonSetColor( BottomRight ); else if ( poly.x > Center.x && poly.y < Center.y ) - sBR->PolygonSetColor( TopRight ); + sBR->polygonSetColor( TopRight ); else - sBR->PolygonSetColor( TopLeft ); + sBR->polygonSetColor( TopLeft ); - sBR->BatchPolygonByPoint( Poly[i] ); + sBR->batchPolygonByPoint( Poly[i] ); } } @@ -310,31 +310,31 @@ void Primitives::DrawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, co } case DRAW_LINE: { - sBR->SetLineWidth( mLineWidth ); + sBR->setLineWidth( mLineWidth ); - sBR->LineLoopBegin(); - sBR->LineLoopSetColor( TopLeft ); + sBR->lineLoopBegin(); + sBR->lineLoopSetColor( TopLeft ); if ( TopLeft == BottomLeft && BottomLeft == BottomRight && BottomRight == TopRight ) { for ( i = 0; i < Poly.size(); i+=2 ) { - sBR->BatchLineLoop( Poly[i], Poly[i+1] ); + sBR->batchLineLoop( Poly[i], Poly[i+1] ); } } else { for ( unsigned int i = 0; i < Poly.size(); i++ ) { poly = Poly[i]; if ( poly.x <= Center.x && poly.y <= Center.y ) - sBR->LineLoopSetColor( TopLeft ); + sBR->lineLoopSetColor( TopLeft ); else if ( poly.x < Center.x && poly.y > Center.y ) - sBR->LineLoopSetColor( BottomLeft ); + sBR->lineLoopSetColor( BottomLeft ); else if ( poly.x > Center.x && poly.y > Center.y ) - sBR->LineLoopSetColor( BottomRight ); + sBR->lineLoopSetColor( BottomRight ); else if ( poly.x > Center.x && poly.y < Center.y ) - sBR->LineLoopSetColor( TopRight ); + sBR->lineLoopSetColor( TopRight ); else - sBR->LineLoopSetColor( TopLeft ); + sBR->lineLoopSetColor( TopLeft ); - sBR->BatchLineLoop( Poly[i] ); + sBR->batchLineLoop( Poly[i] ); } } @@ -342,116 +342,116 @@ void Primitives::DrawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, co } } - DrawBatch(); + drawBatch(); } -void Primitives::DrawRoundedRectangle( const Rectf& R, const Float& Angle, const Vector2f& Scale, const unsigned int& Corners ) { - DrawRoundedRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale, Corners ); +void Primitives::drawRoundedRectangle( const Rectf& R, const Float& Angle, const Vector2f& Scale, const unsigned int& Corners ) { + drawRoundedRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale, Corners ); } -void Primitives::DrawQuad( const Quad2f& q, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const ColorA& Color4, const Float& OffsetX, const Float& OffsetY ) { - sBR->SetTexture( NULL ); - sBR->SetBlendMode( mBlendMode ); +void Primitives::drawQuad( const Quad2f& q, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const ColorA& Color4, const Float& OffsetX, const Float& OffsetY ) { + sBR->setTexture( NULL ); + sBR->setBlendMode( mBlendMode ); switch( mFillMode ) { case DRAW_LINE: { - sBR->SetLineWidth( mLineWidth ); + sBR->setLineWidth( mLineWidth ); - sBR->LineLoopBegin(); - sBR->LineLoopSetColorFree( Color1, Color2 ); - sBR->BatchLineLoop( OffsetX + q[0].x, OffsetY + q[0].y, OffsetX + q[1].x, OffsetY + q[1].y ); - sBR->LineLoopSetColorFree( Color2, Color3 ); - sBR->BatchLineLoop( OffsetX + q[2].x, OffsetY + q[2].y, OffsetX + q[3].x, OffsetY + q[3].y ); + sBR->lineLoopBegin(); + sBR->lineLoopSetColorFree( Color1, Color2 ); + sBR->batchLineLoop( OffsetX + q[0].x, OffsetY + q[0].y, OffsetX + q[1].x, OffsetY + q[1].y ); + sBR->lineLoopSetColorFree( Color2, Color3 ); + sBR->batchLineLoop( OffsetX + q[2].x, OffsetY + q[2].y, OffsetX + q[3].x, OffsetY + q[3].y ); break; } case DRAW_FILL: { - sBR->QuadsBegin(); - sBR->QuadsSetColorFree( Color1, Color2, Color3, Color4 ); - sBR->BatchQuadFree( OffsetX + q[0].x, OffsetY + q[0].y, OffsetX + q[1].x, OffsetY + q[1].y, OffsetX + q[2].x, OffsetY + q[2].y, OffsetX + q[3].x, OffsetY + q[3].y ); + sBR->quadsBegin(); + sBR->quadsSetColorFree( Color1, Color2, Color3, Color4 ); + sBR->batchQuadFree( OffsetX + q[0].x, OffsetY + q[0].y, OffsetX + q[1].x, OffsetY + q[1].y, OffsetX + q[2].x, OffsetY + q[2].y, OffsetX + q[3].x, OffsetY + q[3].y ); break; } } - DrawBatch(); + drawBatch(); } -void Primitives::DrawQuad( const Quad2f& q, const Float& OffsetX, const Float& OffsetY ) { - DrawQuad( q, mColor, mColor, mColor, mColor, OffsetX, OffsetY ); +void Primitives::drawQuad( const Quad2f& q, const Float& OffsetX, const Float& OffsetY ) { + drawQuad( q, mColor, mColor, mColor, mColor, OffsetX, OffsetY ); } -void Primitives::DrawPolygon( const Polygon2f& p ) { - sBR->SetTexture( NULL ); - sBR->SetBlendMode( mBlendMode ); +void Primitives::drawPolygon( const Polygon2f& p ) { + sBR->setTexture( NULL ); + sBR->setBlendMode( mBlendMode ); switch( mFillMode ) { case DRAW_LINE: { - sBR->SetLineWidth( mLineWidth ); + sBR->setLineWidth( mLineWidth ); - sBR->LineLoopBegin(); - sBR->LineLoopSetColor( mColor ); + sBR->lineLoopBegin(); + sBR->lineLoopSetColor( mColor ); for ( Uint32 i = 0; i < p.size(); i += 2 ) - sBR->BatchLineLoop( p.x() + p[i].x, p.y() + p[i].y, p.x() + p[i+1].x, p.y() + p[i+1].y ); + sBR->batchLineLoop( p.x() + p[i].x, p.y() + p[i].y, p.x() + p[i+1].x, p.y() + p[i+1].y ); break; } case DRAW_FILL: { - sBR->PolygonSetColor( mColor ); - sBR->BatchPolygon( p ); + sBR->polygonSetColor( mColor ); + sBR->batchPolygon( p ); break; } } - DrawBatch(); + drawBatch(); } -void Primitives::DrawBatch() { +void Primitives::drawBatch() { if ( mForceDraw ) - sBR->Draw(); + sBR->draw(); else - sBR->DrawOpt(); + sBR->drawOpt(); } -void Primitives::ForceDraw( const bool& force ) { +void Primitives::forceDraw( const bool& force ) { mForceDraw = force; if ( force ) - DrawBatch(); + drawBatch(); } -const bool& Primitives::ForceDraw() const { +const bool& Primitives::forceDraw() const { return mForceDraw; } -void Primitives::SetColor( const ColorA& Color ) { +void Primitives::setColor( const ColorA& Color ) { mColor = Color; } -void Primitives::FillMode( const EE_FILL_MODE& Mode ) { +void Primitives::fillMode( const EE_FILL_MODE& Mode ) { mFillMode = Mode; } -const EE_FILL_MODE& Primitives::FillMode() const { +const EE_FILL_MODE& Primitives::fillMode() const { return mFillMode; } -void Primitives::BlendMode( const EE_BLEND_MODE& Mode ) { +void Primitives::blendMode( const EE_BLEND_MODE& Mode ) { mBlendMode = Mode; } -const EE_BLEND_MODE& Primitives::BlendMode() const { +const EE_BLEND_MODE& Primitives::blendMode() const { return mBlendMode; } -void Primitives::LineWidth( const Float& width ) { +void Primitives::lineWidth( const Float& width ) { mLineWidth = width; } -const Float& Primitives::LineWidth() const { +const Float& Primitives::lineWidth() const { return mLineWidth; } diff --git a/src/eepp/graphics/renderer/gl.cpp b/src/eepp/graphics/renderer/gl.cpp index bb718c04f..ff481d380 100644 --- a/src/eepp/graphics/renderer/gl.cpp +++ b/src/eepp/graphics/renderer/gl.cpp @@ -124,70 +124,70 @@ cGL::~cGL() { GLi = NULL; } -RendererGL * cGL::GetRendererGL() { +RendererGL * cGL::getRendererGL() { return reinterpret_cast( this ); } -RendererGL3 * cGL::GetRendererGL3() { +RendererGL3 * cGL::getRendererGL3() { return reinterpret_cast( this ); } -RendererGL3CP * cGL::GetRendererGL3CP() { +RendererGL3CP * cGL::getRendererGL3CP() { return reinterpret_cast( this ); } -RendererGLES2 * cGL::GetRendererGLES2() { +RendererGLES2 * cGL::getRendererGLES2() { return reinterpret_cast( this ); } -void cGL::WriteExtension( Uint8 Pos, Uint32 BitWrite ) { +void cGL::writeExtension( Uint8 Pos, Uint32 BitWrite ) { BitOp::writeBitKey( &mExtensions, Pos, BitWrite ); } -void cGL::Init() { +void cGL::init() { #ifdef EE_GLEW_AVAILABLE glewExperimental = 1; bool glewOn = ( GLEW_OK == glewInit() ); if ( glewOn ) { - WriteExtension( EEGL_ARB_texture_non_power_of_two , GLEW_ARB_texture_non_power_of_two ); - WriteExtension( EEGL_ARB_point_parameters , GLEW_ARB_point_parameters ); - WriteExtension( EEGL_ARB_point_sprite , GLEW_ARB_point_sprite ); - WriteExtension( EEGL_ARB_shading_language_100 , GLEW_ARB_shading_language_100 ); - WriteExtension( EEGL_ARB_shader_objects , GLEW_ARB_shader_objects ); - WriteExtension( EEGL_ARB_vertex_shader , GLEW_ARB_vertex_shader ); - WriteExtension( EEGL_ARB_fragment_shader , GLEW_ARB_fragment_shader ); - WriteExtension( EEGL_EXT_framebuffer_object , GLEW_EXT_framebuffer_object ); - WriteExtension( EEGL_ARB_multitexture , GLEW_ARB_multitexture ); - WriteExtension( EEGL_EXT_texture_compression_s3tc , GLEW_EXT_texture_compression_s3tc ); - WriteExtension( EEGL_ARB_vertex_buffer_object , GLEW_ARB_vertex_buffer_object ); - WriteExtension( EEGL_ARB_pixel_buffer_object , GLEW_ARB_pixel_buffer_object ); - WriteExtension( EEGL_ARB_vertex_array_object , GLEW_ARB_vertex_array_object ); - WriteExtension( EEGL_EXT_blend_func_separate , GLEW_EXT_blend_func_separate ); + writeExtension( EEGL_ARB_texture_non_power_of_two , GLEW_ARB_texture_non_power_of_two ); + writeExtension( EEGL_ARB_point_parameters , GLEW_ARB_point_parameters ); + writeExtension( EEGL_ARB_point_sprite , GLEW_ARB_point_sprite ); + writeExtension( EEGL_ARB_shading_language_100 , GLEW_ARB_shading_language_100 ); + writeExtension( EEGL_ARB_shader_objects , GLEW_ARB_shader_objects ); + writeExtension( EEGL_ARB_vertex_shader , GLEW_ARB_vertex_shader ); + writeExtension( EEGL_ARB_fragment_shader , GLEW_ARB_fragment_shader ); + writeExtension( EEGL_EXT_framebuffer_object , GLEW_EXT_framebuffer_object ); + writeExtension( EEGL_ARB_multitexture , GLEW_ARB_multitexture ); + writeExtension( EEGL_EXT_texture_compression_s3tc , GLEW_EXT_texture_compression_s3tc ); + writeExtension( EEGL_ARB_vertex_buffer_object , GLEW_ARB_vertex_buffer_object ); + writeExtension( EEGL_ARB_pixel_buffer_object , GLEW_ARB_pixel_buffer_object ); + writeExtension( EEGL_ARB_vertex_array_object , GLEW_ARB_vertex_array_object ); + writeExtension( EEGL_EXT_blend_func_separate , GLEW_EXT_blend_func_separate ); } else #endif { - WriteExtension( EEGL_ARB_texture_non_power_of_two , IsExtension( "GL_ARB_texture_non_power_of_two" ) ); - WriteExtension( EEGL_ARB_point_parameters , IsExtension( "GL_ARB_point_parameters" ) ); - WriteExtension( EEGL_ARB_point_sprite , IsExtension( "GL_ARB_point_sprite" ) ); - WriteExtension( EEGL_ARB_shading_language_100 , IsExtension( "GL_ARB_shading_language_100" ) ); - WriteExtension( EEGL_ARB_shader_objects , IsExtension( "GL_ARB_shader_objects" ) ); - WriteExtension( EEGL_ARB_vertex_shader , IsExtension( "GL_ARB_vertex_shader" ) ); - WriteExtension( EEGL_ARB_fragment_shader , IsExtension( "GL_ARB_fragment_shader" ) ); - WriteExtension( EEGL_EXT_framebuffer_object , IsExtension( "GL_EXT_framebuffer_object" ) ); - WriteExtension( EEGL_ARB_multitexture , IsExtension( "GL_ARB_multitexture" ) ); - WriteExtension( EEGL_EXT_texture_compression_s3tc , IsExtension( "GL_EXT_texture_compression_s3tc" ) ); - WriteExtension( EEGL_ARB_vertex_buffer_object , IsExtension( "GL_ARB_vertex_buffer_object" ) ); - WriteExtension( EEGL_ARB_pixel_buffer_object , IsExtension( "GL_ARB_pixel_buffer_object" ) ); - WriteExtension( EEGL_ARB_vertex_array_object , IsExtension( "GL_ARB_vertex_array_object" ) ); - WriteExtension( EEGL_EXT_blend_func_separate , IsExtension( "GL_EXT_blend_func_separate" ) ); + writeExtension( EEGL_ARB_texture_non_power_of_two , isExtension( "GL_ARB_texture_non_power_of_two" ) ); + writeExtension( EEGL_ARB_point_parameters , isExtension( "GL_ARB_point_parameters" ) ); + writeExtension( EEGL_ARB_point_sprite , isExtension( "GL_ARB_point_sprite" ) ); + writeExtension( EEGL_ARB_shading_language_100 , isExtension( "GL_ARB_shading_language_100" ) ); + writeExtension( EEGL_ARB_shader_objects , isExtension( "GL_ARB_shader_objects" ) ); + writeExtension( EEGL_ARB_vertex_shader , isExtension( "GL_ARB_vertex_shader" ) ); + writeExtension( EEGL_ARB_fragment_shader , isExtension( "GL_ARB_fragment_shader" ) ); + writeExtension( EEGL_EXT_framebuffer_object , isExtension( "GL_EXT_framebuffer_object" ) ); + writeExtension( EEGL_ARB_multitexture , isExtension( "GL_ARB_multitexture" ) ); + writeExtension( EEGL_EXT_texture_compression_s3tc , isExtension( "GL_EXT_texture_compression_s3tc" ) ); + writeExtension( EEGL_ARB_vertex_buffer_object , isExtension( "GL_ARB_vertex_buffer_object" ) ); + writeExtension( EEGL_ARB_pixel_buffer_object , isExtension( "GL_ARB_pixel_buffer_object" ) ); + writeExtension( EEGL_ARB_vertex_array_object , isExtension( "GL_ARB_vertex_array_object" ) ); + writeExtension( EEGL_EXT_blend_func_separate , isExtension( "GL_EXT_blend_func_separate" ) ); } // NVIDIA added support for GL_OES_compressed_ETC1_RGB8_texture in desktop GPUs // GLEW doesn't return the correct result - WriteExtension( EEGL_OES_compressed_ETC1_RGB8_texture , SOIL_GL_ExtensionSupported( "GL_OES_compressed_ETC1_RGB8_texture" ) ); + writeExtension( EEGL_OES_compressed_ETC1_RGB8_texture , SOIL_GL_ExtensionSupported( "GL_OES_compressed_ETC1_RGB8_texture" ) ); #ifdef EE_GLES @@ -234,7 +234,7 @@ void cGL::Init() { #endif } -bool cGL::IsExtension( const std::string& name ) { +bool cGL::isExtension( const std::string& name ) { #ifdef EE_GLEW_AVAILABLE return 0 != glewIsSupported( name.c_str() ); #else @@ -242,27 +242,27 @@ bool cGL::IsExtension( const std::string& name ) { #endif } -bool cGL::IsExtension( EEGL_extensions name ) { +bool cGL::isExtension( EEGL_extensions name ) { return 0 != ( mExtensions & ( 1 << name ) ); } -bool cGL::PointSpriteSupported() { +bool cGL::pointSpriteSupported() { #ifdef EE_GLES return true; #else - return IsExtension( EEGL_ARB_point_sprite ); + return isExtension( EEGL_ARB_point_sprite ); #endif } -bool cGL::ShadersSupported() { +bool cGL::shadersSupported() { #ifdef EE_GLES return ( GLv_ES2 == Version() || GLv_3 == Version() || GLv_3CP == Version() ); #else - return GLv_3CP == Version() || ( IsExtension( EEGL_ARB_shader_objects ) && IsExtension( EEGL_ARB_vertex_shader ) && IsExtension( EEGL_ARB_fragment_shader ) ); + return GLv_3CP == version() || ( isExtension( EEGL_ARB_shader_objects ) && isExtension( EEGL_ARB_vertex_shader ) && isExtension( EEGL_ARB_fragment_shader ) ); #endif } -Uint32 cGL::GetTextureParamEnum( const EE_TEXTURE_PARAM& Type ) { +Uint32 cGL::getTextureParamEnum( const EE_TEXTURE_PARAM& Type ) { #ifndef EE_GLES switch( Type ) { case TEX_PARAM_COLOR_FUNC: return GL_COMBINE_RGB_ARB; @@ -287,7 +287,7 @@ Uint32 cGL::GetTextureParamEnum( const EE_TEXTURE_PARAM& Type ) { return 0; } -Uint32 cGL::GetTextureFuncEnum( const EE_TEXTURE_FUNC& Type ) { +Uint32 cGL::getTextureFuncEnum( const EE_TEXTURE_FUNC& Type ) { #ifndef EE_GLES2 switch( Type ) { case TEX_FUNC_MODULATE: return GL_MODULATE; @@ -303,7 +303,7 @@ Uint32 cGL::GetTextureFuncEnum( const EE_TEXTURE_FUNC& Type ) { return 0; } -Uint32 cGL::GetTextureSourceEnum( const EE_TEXTURE_SOURCE& Type ) { +Uint32 cGL::getTextureSourceEnum( const EE_TEXTURE_SOURCE& Type ) { #ifndef EE_GLES2 switch ( Type ) { case TEX_SRC_TEXTURE: return GL_TEXTURE; @@ -316,7 +316,7 @@ Uint32 cGL::GetTextureSourceEnum( const EE_TEXTURE_SOURCE& Type ) { return 0; } -Uint32 cGL::GetTextureOpEnum( const EE_TEXTURE_OP& Type ) { +Uint32 cGL::getTextureOpEnum( const EE_TEXTURE_OP& Type ) { #ifndef EE_GLES2 switch ( Type ) { case TEX_OP_COLOR: return GL_SRC_COLOR; @@ -329,11 +329,11 @@ Uint32 cGL::GetTextureOpEnum( const EE_TEXTURE_OP& Type ) { return 0; } -std::string cGL::GetExtensions() { +std::string cGL::getExtensions() { std::string exts; #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX - if ( GLv_3 == Version() || GLv_3CP == Version() ) { + if ( GLv_3 == version() || GLv_3CP == version() ) { static pglGetStringiFunc eeglGetStringiFunc = NULL; int num_exts = 0; @@ -371,11 +371,11 @@ std::string cGL::GetExtensions() { return exts; } -void cGL::Viewport( int x, int y, int width, int height ) { +void cGL::viewport( int x, int y, int width, int height ) { glViewport( x, y, width, height ); } -void cGL::Disable ( unsigned int cap ) { +void cGL::disable ( unsigned int cap ) { switch ( cap ) { case GL_BLEND: @@ -393,7 +393,7 @@ void cGL::Disable ( unsigned int cap ) { glDisable( cap ); } -void cGL::Enable( unsigned int cap ) { +void cGL::enable( unsigned int cap ) { switch ( cap ) { case GL_BLEND: @@ -411,83 +411,83 @@ void cGL::Enable( unsigned int cap ) { glEnable( cap ); } -const char * cGL::GetString( unsigned int name ) { +const char * cGL::getString( unsigned int name ) { return (const char*)glGetString( name ); } -void cGL::Clear ( unsigned int mask ) { +void cGL::clear ( unsigned int mask ) { glClear( mask ); } -void cGL::ClearColor( float red, float green, float blue, float alpha ) { +void cGL::clearColor( float red, float green, float blue, float alpha ) { glClearColor( red, green, blue, alpha ); } -void cGL::Scissor ( int x, int y, int width, int height ) { +void cGL::scissor ( int x, int y, int width, int height ) { glScissor( x, y, width, height ); } -void cGL::PolygonMode( unsigned int face, unsigned int mode ) { +void cGL::polygonMode( unsigned int face, unsigned int mode ) { #ifndef EE_GLES glPolygonMode( face, mode ); #endif } -void cGL::DrawArrays (unsigned int mode, int first, int count) { +void cGL::drawArrays (unsigned int mode, int first, int count) { glDrawArrays( mode, first, count ); } -void cGL::DrawElements( unsigned int mode, int count, unsigned int type, const void *indices ) { +void cGL::drawElements( unsigned int mode, int count, unsigned int type, const void *indices ) { glDrawElements( mode, count, type, indices ); } -void cGL::BindTexture ( unsigned int target, unsigned int texture ) { - if ( GLv_3CP == Version() && 0 == texture ) return; +void cGL::bindTexture ( unsigned int target, unsigned int texture ) { + if ( GLv_3CP == version() && 0 == texture ) return; glBindTexture( target, texture ); } -void cGL::ActiveTexture( unsigned int texture ) { +void cGL::activeTexture( unsigned int texture ) { glActiveTexture( texture ); } -void cGL::BlendFunc ( unsigned int sfactor, unsigned int dfactor ) { +void cGL::blendFunc ( unsigned int sfactor, unsigned int dfactor ) { glBlendFunc( sfactor, dfactor ); } -void cGL::SetShader( ShaderProgram * Shader ) { +void cGL::setShader( ShaderProgram * Shader ) { #ifdef EE_SHADERS_SUPPORTED if ( NULL != Shader ) { - glUseProgram( Shader->Handler() ); + glUseProgram( Shader->getHandler() ); } else { glUseProgram( 0 ); } #endif } -bool cGL::IsLineSmooth() { +bool cGL::isLineSmooth() { return BitOp::readBitKey( &mStateFlags, GLSF_LINE_SMOOTH ); } -void cGL::LineSmooth() { - LineSmooth( IsLineSmooth() ); +void cGL::lineSmooth() { + lineSmooth( isLineSmooth() ); } -void cGL::LineSmooth( const bool& Enable ) { +void cGL::lineSmooth( const bool& Enable ) { #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN if ( Enable ) { - GLi->Enable( GL_LINE_SMOOTH ); + GLi->enable( GL_LINE_SMOOTH ); } else { - GLi->Disable( GL_LINE_SMOOTH ); + GLi->disable( GL_LINE_SMOOTH ); } BitOp::writeBitKey( &mStateFlags, GLSF_LINE_SMOOTH, Enable ? 1 : 0 ); #endif } -void cGL::LineWidth(float width) { +void cGL::lineWidth(float width) { if ( width != mLineWidth ) { #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN - if ( GLv_3CP != Version() ) + if ( GLv_3CP != version() ) #endif { glLineWidth( width ); @@ -497,30 +497,30 @@ void cGL::LineWidth(float width) { } -void cGL::PolygonMode() { +void cGL::polygonMode() { EE_FILL_MODE Mode = DRAW_FILL; if ( BitOp::readBitKey( &mStateFlags, GLSF_POLYGON_MODE ) ) Mode = DRAW_LINE; - PolygonMode( Mode ); + polygonMode( Mode ); } -void cGL::PixelStorei(unsigned int pname, int param) { +void cGL::pixelStorei(unsigned int pname, int param) { glPixelStorei( pname, param ); } -void cGL::PolygonMode( const EE_FILL_MODE& Mode ) { +void cGL::polygonMode( const EE_FILL_MODE& Mode ) { if ( Mode == DRAW_FILL ) - PolygonMode( GL_FRONT_AND_BACK, GL_FILL ); + polygonMode( GL_FRONT_AND_BACK, GL_FILL ); else - PolygonMode( GL_FRONT_AND_BACK, GL_LINE ); + polygonMode( GL_FRONT_AND_BACK, GL_LINE ); BitOp::writeBitKey( &mStateFlags, GLSF_POLYGON_MODE, Mode == DRAW_LINE ? 1 : 0 ); } -std::string cGL::GetVendor() { - const char * str = GetString( GL_VENDOR ); +std::string cGL::getVendor() { + const char * str = getString( GL_VENDOR ); if ( NULL != str ) return std::string( str ); @@ -528,8 +528,8 @@ std::string cGL::GetVendor() { return std::string(); } -std::string cGL::GetRenderer() { - const char * str = GetString( GL_RENDERER ); +std::string cGL::getRenderer() { + const char * str = getString( GL_RENDERER ); if ( NULL != str ) return std::string( str ); @@ -537,8 +537,8 @@ std::string cGL::GetRenderer() { return std::string(); } -std::string cGL::GetVersion() { - const char * str = GetString( GL_VERSION ); +std::string cGL::getVersion() { + const char * str = getString( GL_VERSION ); if ( NULL != str ) return std::string( str ); @@ -546,10 +546,10 @@ std::string cGL::GetVersion() { return std::string(); } -std::string cGL::GetShadingLanguageVersion() { - if ( ShadersSupported() ) { +std::string cGL::getShadingLanguageVersion() { + if ( shadersSupported() ) { #ifdef GL_SHADING_LANGUAGE_VERSION - const char * str = GetString( GL_SHADING_LANGUAGE_VERSION ); + const char * str = getString( GL_SHADING_LANGUAGE_VERSION ); if ( NULL != str ) return std::string( str ); @@ -559,71 +559,71 @@ std::string cGL::GetShadingLanguageVersion() { return std::string( "Shaders not supported" ); } -void cGL::GetViewport( int * viewport ) { +void cGL::getViewport( int * viewport ) { glGetIntegerv( GL_VIEWPORT, viewport ); } -Vector3f cGL::ProjectCurrent( const Vector3f& point ) { +Vector3f cGL::projectCurrent( const Vector3f& point ) { float projMat[16]; - GetCurrentMatrix( GL_PROJECTION_MATRIX, projMat ); + getCurrentMatrix( GL_PROJECTION_MATRIX, projMat ); float modelMat[16]; - GetCurrentMatrix( GL_MODELVIEW_MATRIX, modelMat ); + getCurrentMatrix( GL_MODELVIEW_MATRIX, modelMat ); int viewPort[4]; - GetViewport( viewPort ); + getViewport( viewPort ); Vector3f fPoint( point ); fPoint.y = viewPort[3] - point.y; Vector3 tv3; - Project( (float)fPoint.x, (float)fPoint.y, (float)fPoint.z, projMat, modelMat, viewPort, &tv3.x, &tv3.y, &tv3.z ); + project( (float)fPoint.x, (float)fPoint.y, (float)fPoint.z, projMat, modelMat, viewPort, &tv3.x, &tv3.y, &tv3.z ); return Vector3f( tv3.x, tv3.y, tv3.z ); } -Vector3f cGL::UnProjectCurrent( const Vector3f& point ) { +Vector3f cGL::unProjectCurrent( const Vector3f& point ) { float projMat[16]; - GetCurrentMatrix( GL_PROJECTION_MATRIX, projMat ); + getCurrentMatrix( GL_PROJECTION_MATRIX, projMat ); float modelMat[16]; - GetCurrentMatrix( GL_MODELVIEW_MATRIX, modelMat ); + getCurrentMatrix( GL_MODELVIEW_MATRIX, modelMat ); int viewPort[4]; - GetViewport( viewPort ); + getViewport( viewPort ); Vector3f fPoint( point ); fPoint.y = viewPort[3] - point.y; Vector3 tv3; - UnProject( (float)fPoint.x, (float)fPoint.y, (float)fPoint.z, projMat, modelMat, viewPort, &tv3.x, &tv3.y, &tv3.z ); + unProject( (float)fPoint.x, (float)fPoint.y, (float)fPoint.z, projMat, modelMat, viewPort, &tv3.x, &tv3.y, &tv3.z ); return Vector3f( tv3.x, tv3.y, tv3.z ); } -void cGL::StencilFunc( unsigned int func, int ref, unsigned int mask ) { +void cGL::stencilFunc( unsigned int func, int ref, unsigned int mask ) { glStencilFunc( func, ref, mask ); } -void cGL::StencilOp( unsigned int fail, unsigned int zfail, unsigned int zpass ) { +void cGL::stencilOp( unsigned int fail, unsigned int zfail, unsigned int zpass ) { glStencilOp( fail, zfail, zpass ); } -void cGL::StencilMask ( unsigned int mask ) { +void cGL::stencilMask ( unsigned int mask ) { glStencilMask( mask ); } -void cGL::ColorMask ( Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha ) { +void cGL::colorMask ( Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha ) { glColorMask( red, green, blue, alpha ); } -const int& cGL::QuadVertexs() const { +const int& cGL::quadVertexs() const { return mQuadVertexs; } -void cGL::BindVertexArray ( unsigned int array ) { +void cGL::bindVertexArray ( unsigned int array ) { #if !defined( EE_GLES ) if ( mCurVAO != array ) { glBindVertexArray( array ); @@ -633,19 +633,19 @@ void cGL::BindVertexArray ( unsigned int array ) { #endif } -void cGL::DeleteVertexArrays ( int n, const unsigned int *arrays ) { +void cGL::deleteVertexArrays ( int n, const unsigned int *arrays ) { #if !defined( EE_GLES ) glDeleteVertexArrays( n, arrays ); #endif } -void cGL::GenVertexArrays ( int n, unsigned int *arrays ) { +void cGL::genVertexArrays ( int n, unsigned int *arrays ) { #if !defined( EE_GLES ) glGenVertexArrays( n, arrays ); #endif } -const bool& cGL::QuadsSupported() const { +const bool& cGL::quadsSupported() const { return mQuadsSupported; } diff --git a/src/eepp/graphics/renderer/renderergl.cpp b/src/eepp/graphics/renderer/renderergl.cpp index 6e21dc6fa..ad8ff4415 100644 --- a/src/eepp/graphics/renderer/renderergl.cpp +++ b/src/eepp/graphics/renderer/renderergl.cpp @@ -62,7 +62,7 @@ RendererGL::RendererGL() { RendererGL::~RendererGL() { } -EEGL_version RendererGL::Version() { +EEGL_version RendererGL::version() { #ifndef EE_GLES1 return GLv_2; #else @@ -70,7 +70,7 @@ EEGL_version RendererGL::Version() { #endif } -std::string RendererGL::VersionStr() { +std::string RendererGL::versionStr() { #ifndef EE_GLES1 return "OpenGL 2"; #else @@ -78,39 +78,39 @@ std::string RendererGL::VersionStr() { #endif } -void RendererGL::PushMatrix() { +void RendererGL::pushMatrix() { glPushMatrix(); } -void RendererGL::PopMatrix() { +void RendererGL::popMatrix() { glPopMatrix(); } -void RendererGL::LoadIdentity() { +void RendererGL::loadIdentity() { glLoadIdentity(); } -void RendererGL::Translatef( float x, float y, float z ) { +void RendererGL::translatef( float x, float y, float z ) { glTranslatef( x, y, z ); } -void RendererGL::Rotatef( float angle, float x, float y, float z ) { +void RendererGL::rotatef( float angle, float x, float y, float z ) { glRotatef( angle, x, y, z ); } -void RendererGL::Scalef( float x, float y, float z ) { +void RendererGL::scalef( float x, float y, float z ) { glScalef( x,y, z ); } -void RendererGL::MatrixMode(unsigned int mode) { +void RendererGL::matrixMode(unsigned int mode) { glMatrixMode( mode ); } -void RendererGL::Ortho( float left, float right, float bottom, float top, float zNear, float zFar ) { +void RendererGL::ortho( float left, float right, float bottom, float top, float zNear, float zFar ) { glOrtho( left, right, bottom, top, zNear, zFar ); } -void RendererGL::LookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) { +void RendererGL::lookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) { float m[16]; float x[3], y[3], z[3]; float mag; @@ -187,7 +187,7 @@ void RendererGL::LookAt( float eyeX, float eyeY, float eyeZ, float centerX, floa glTranslatef(-eyeX, -eyeY, -eyeZ); } -void RendererGL::Perspective ( float fovy, float aspect, float zNear, float zFar ) { +void RendererGL::perspective ( float fovy, float aspect, float zNear, float zFar ) { double xmin, xmax, ymin, ymax; ymax = zNear * eetan(fovy * EE_360_PI); @@ -195,40 +195,40 @@ void RendererGL::Perspective ( float fovy, float aspect, float zNear, float zFar xmin = ymin * aspect; xmax = ymax * aspect; - Frustum( xmin, xmax, ymin, ymax, zNear, zFar ); + frustum( xmin, xmax, ymin, ymax, zNear, zFar ); } -void RendererGL::EnableClientState( unsigned int array ) { +void RendererGL::enableClientState( unsigned int array ) { glEnableClientState( array ); } -void RendererGL::DisableClientState( unsigned int array ) { +void RendererGL::disableClientState( unsigned int array ) { glDisableClientState( array ); } -void RendererGL::VertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { +void RendererGL::vertexPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { glVertexPointer( size, type, stride, pointer ); } -void RendererGL::ColorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { +void RendererGL::colorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { glColorPointer( size, type, stride, pointer ); } -void RendererGL::TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { +void RendererGL::texCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { glTexCoordPointer( size, type, stride, pointer ); } -void RendererGL::ClientActiveTexture( unsigned int texture ) { +void RendererGL::clientActiveTexture( unsigned int texture ) { glClientActiveTexture( texture ); } -void RendererGL::PointSize( float size ) { +void RendererGL::pointSize( float size ) { #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN glPointSize( size ); #endif } -void RendererGL::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { +void RendererGL::clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { double tX = (double)x; double tY = (double)y; double tW = (double)Width; @@ -239,40 +239,40 @@ void RendererGL::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& double clip_top[] = { 0.0 , 1.0 , 0.0, -tY }; double clip_bottom[] = { 0.0 , -1.0 , 0.0, tY + tH }; - GLi->Enable(GL_CLIP_PLANE0); - GLi->Enable(GL_CLIP_PLANE1); - GLi->Enable(GL_CLIP_PLANE2); - GLi->Enable(GL_CLIP_PLANE3); + GLi->enable(GL_CLIP_PLANE0); + GLi->enable(GL_CLIP_PLANE1); + GLi->enable(GL_CLIP_PLANE2); + GLi->enable(GL_CLIP_PLANE3); - ClipPlane(GL_CLIP_PLANE0, clip_left); - ClipPlane(GL_CLIP_PLANE1, clip_right); - ClipPlane(GL_CLIP_PLANE2, clip_top); - ClipPlane(GL_CLIP_PLANE3, clip_bottom); + clipPlane(GL_CLIP_PLANE0, clip_left); + clipPlane(GL_CLIP_PLANE1, clip_right); + clipPlane(GL_CLIP_PLANE2, clip_top); + clipPlane(GL_CLIP_PLANE3, clip_bottom); if ( mPushClip ) { mPlanesClipped.push_back( Rectf( x, y, Width, Height ) ); } } -void RendererGL::Clip2DPlaneDisable() { +void RendererGL::clip2DPlaneDisable() { if ( ! mPlanesClipped.empty() ) { // This should always be true mPlanesClipped.pop_back(); } if ( mPlanesClipped.empty() ) { - GLi->Disable(GL_CLIP_PLANE0); - GLi->Disable(GL_CLIP_PLANE1); - GLi->Disable(GL_CLIP_PLANE2); - GLi->Disable(GL_CLIP_PLANE3); + GLi->disable(GL_CLIP_PLANE0); + GLi->disable(GL_CLIP_PLANE1); + GLi->disable(GL_CLIP_PLANE2); + GLi->disable(GL_CLIP_PLANE3); } else { Rectf R( mPlanesClipped.back() ); mPushClip = false; - Clip2DPlaneEnable( R.Left, R.Top, R.Right, R.Bottom ); + clip2DPlaneEnable( R.Left, R.Top, R.Right, R.Bottom ); mPushClip = true; } } -void RendererGL::ClipPlane( unsigned int plane, const double *equation ) { +void RendererGL::clipPlane( unsigned int plane, const double *equation ) { #ifdef EE_GLES1 float clip[] = { (float)equation[0], (float)equation[1], (float)equation[2], (float)equation[3] }; @@ -282,19 +282,19 @@ void RendererGL::ClipPlane( unsigned int plane, const double *equation ) { #endif } -void RendererGL::MultMatrixf ( const float *m ) { +void RendererGL::multMatrixf ( const float *m ) { glMultMatrixf( m ); } -void RendererGL::LoadMatrixf( const float *m ) { +void RendererGL::loadMatrixf( const float *m ) { glLoadMatrixf( m ); } -void RendererGL::TexEnvi( unsigned int target, unsigned int pname, int param ) { +void RendererGL::texEnvi( unsigned int target, unsigned int pname, int param ) { glTexEnvi( target, pname, param ); } -float RendererGL::PointSize() { +float RendererGL::pointSize() { float ps = 1; #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN @@ -304,15 +304,15 @@ float RendererGL::PointSize() { return ps; } -void RendererGL::Frustum( float left, float right, float bottom, float top, float near_val, float far_val ) { +void RendererGL::frustum( float left, float right, float bottom, float top, float near_val, float far_val ) { glFrustum( left, right, bottom, top, near_val, far_val ); } -void RendererGL::GetCurrentMatrix( unsigned int mode, float * m ) { +void RendererGL::getCurrentMatrix( unsigned int mode, float * m ) { glGetFloatv( mode, m ); } -unsigned int RendererGL::GetCurrentMatrixMode() { +unsigned int RendererGL::getCurrentMatrixMode() { int mode; glGetIntegerv( GL_MATRIX_MODE, &mode ); @@ -394,7 +394,7 @@ static void __gluMultMatrixVecd( const float matrix[16], const float in[4], floa } } -int RendererGL::Project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) { +int RendererGL::project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) { float in[4]; float out[4]; @@ -423,7 +423,7 @@ int RendererGL::Project( float objx, float objy, float objz, const float modelMa return GL_TRUE; } -int RendererGL::UnProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) { +int RendererGL::unProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) { float finalMatrix[16]; float in[4]; float out[4]; diff --git a/src/eepp/graphics/renderer/renderergl3.cpp b/src/eepp/graphics/renderer/renderergl3.cpp index 2eb038c8b..e566ec875 100644 --- a/src/eepp/graphics/renderer/renderergl3.cpp +++ b/src/eepp/graphics/renderer/renderergl3.cpp @@ -67,26 +67,26 @@ RendererGL3::RendererGL3() : mStack->mProjectionMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix mStack->mModelViewMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix - cGL::Enable( GL_VERTEX_PROGRAM_POINT_SIZE ); + cGL::enable( GL_VERTEX_PROGRAM_POINT_SIZE ); } RendererGL3::~RendererGL3() { eeSAFE_DELETE( mStack ); } -EEGL_version RendererGL3::Version() { +EEGL_version RendererGL3::version() { return GLv_3; } -std::string RendererGL3::VersionStr() { +std::string RendererGL3::versionStr() { return "OpenGL 3"; } -void RendererGL3::Init() { +void RendererGL3::init() { if ( !mLoaded ) { Uint32 i; - cGL::Init(); + cGL::init(); std::string vs( EEGL3_SHADER_BASE_VS ); std::string fs( EEGL3_SHADER_BASE_FS ); @@ -108,46 +108,46 @@ void RendererGL3::Init() { mTextureUnitsStates[i] = 0; } - Shader::Ensure( false ); + Shader::ensure( false ); mShaders[ EEGL3_SHADER_BASE ] = ShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGL3_SHADER_BASE ]->SetReloadCb( cb::Make1( this, &RendererGL3::ReloadShader ) ); + mShaders[ EEGL3_SHADER_BASE ]->setReloadCb( cb::Make1( this, &RendererGL3::reloadShader ) ); - Shader::Ensure( true ); + Shader::ensure( true ); - SetShader( EEGL3_SHADER_BASE ); + setShader( EEGL3_SHADER_BASE ); } else { mCurShader = NULL; - mShaders[ EEGL3_SHADER_BASE ]->Reload(); + mShaders[ EEGL3_SHADER_BASE ]->reload(); - SetShader( EEGL3_SHADER_BASE ); + setShader( EEGL3_SHADER_BASE ); } - ClientActiveTexture( GL_TEXTURE0 ); + clientActiveTexture( GL_TEXTURE0 ); mLoaded = true; } -unsigned int RendererGL3::BaseShaderId() { - return mCurShader->Handler(); +unsigned int RendererGL3::baseShaderId() { + return mCurShader->getHandler(); } -void RendererGL3::ReloadCurrentShader() { - ReloadShader( mCurShader ); +void RendererGL3::reloadCurrentShader() { + reloadShader( mCurShader ); } -void RendererGL3::ReloadShader( ShaderProgram * Shader ) { +void RendererGL3::reloadShader( ShaderProgram * Shader ) { mCurShader = NULL; - SetShader( Shader ); + setShader( Shader ); } -void RendererGL3::SetShader( const EEGL3_SHADERS& Shader ) { - SetShader( mShaders[ Shader ] ); +void RendererGL3::setShader( const EEGL3_SHADERS& Shader ) { + setShader( mShaders[ Shader ] ); } -void RendererGL3::SetShader( ShaderProgram * Shader ) { +void RendererGL3::setShader( ShaderProgram * Shader ) { if ( NULL == Shader ) { Shader = mShaders[ EEGL3_SHADER_BASE ]; } @@ -156,77 +156,77 @@ void RendererGL3::SetShader( ShaderProgram * Shader ) { return; } - DisableClientState( GL_VERTEX_ARRAY ); - DisableClientState( GL_TEXTURE_COORD_ARRAY ); - DisableClientState( GL_COLOR_ARRAY ); + disableClientState( GL_VERTEX_ARRAY ); + disableClientState( GL_TEXTURE_COORD_ARRAY ); + disableClientState( GL_COLOR_ARRAY ); mShaderPrev = mCurShader; mCurShader = Shader; - mProjectionMatrix_id = mCurShader->UniformLocation( "dgl_ProjectionMatrix" ); - mModelViewMatrix_id = mCurShader->UniformLocation( "dgl_ModelViewMatrix" ); - mTexActiveLoc = mCurShader->UniformLocation( "dgl_TexActive" ); - mPointSpriteLoc = mCurShader->UniformLocation( "dgl_PointSpriteActive" ); - mClippingEnabledLoc = mCurShader->UniformLocation( "dgl_ClippingEnabled" ); + mProjectionMatrix_id = mCurShader->uniformLocation( "dgl_ProjectionMatrix" ); + mModelViewMatrix_id = mCurShader->uniformLocation( "dgl_ModelViewMatrix" ); + mTexActiveLoc = mCurShader->uniformLocation( "dgl_TexActive" ); + mPointSpriteLoc = mCurShader->uniformLocation( "dgl_PointSpriteActive" ); + mClippingEnabledLoc = mCurShader->uniformLocation( "dgl_ClippingEnabled" ); mCurActiveTex = 0; Uint32 i; for ( i = 0; i < EEGL_ARRAY_STATES_COUNT; i++ ) { - mAttribsLoc[ i ] = mCurShader->AttributeLocation( EEGL3_STATES_NAME[ i ] ); + mAttribsLoc[ i ] = mCurShader->attributeLocation( EEGL3_STATES_NAME[ i ] ); } for ( i = 0; i < EE_MAX_PLANES; i++ ) { - mPlanes[ i ] = mCurShader->UniformLocation( EEGL3_PLANES_NAME[ i ] ); + mPlanes[ i ] = mCurShader->uniformLocation( EEGL3_PLANES_NAME[ i ] ); } for ( i = 0; i < EE_MAX_TEXTURE_UNITS; i++ ) { - mTextureUnits[ i ] = mCurShader->AttributeLocation( EEGL3_TEXTUREUNIT_NAMES[ i ] ); + mTextureUnits[ i ] = mCurShader->attributeLocation( EEGL3_TEXTUREUNIT_NAMES[ i ] ); } - glUseProgram( mCurShader->Handler() ); + glUseProgram( mCurShader->getHandler() ); if ( -1 != mAttribsLoc[ EEGL_VERTEX_ARRAY ] ) - EnableClientState( GL_VERTEX_ARRAY ); + enableClientState( GL_VERTEX_ARRAY ); if ( -1 != mAttribsLoc[ EEGL_COLOR_ARRAY ] ) - EnableClientState( GL_COLOR_ARRAY ); + enableClientState( GL_COLOR_ARRAY ); if ( -1 != mTextureUnits[ mCurActiveTex ] ) - EnableClientState( GL_TEXTURE_COORD_ARRAY ); + enableClientState( GL_TEXTURE_COORD_ARRAY ); unsigned int CM = mCurrentMode; - MatrixMode( GL_PROJECTION ); - UpdateMatrix(); - MatrixMode( GL_MODELVIEW ); - UpdateMatrix(); - MatrixMode( CM ); + matrixMode( GL_PROJECTION ); + updateMatrix(); + matrixMode( GL_MODELVIEW ); + updateMatrix(); + matrixMode( CM ); if ( -1 != mTexActiveLoc ) { - mCurShader->SetUniform( mTexActiveLoc, 1 ); + mCurShader->setUniform( mTexActiveLoc, 1 ); } - mCurShader->SetUniform( mClippingEnabledLoc, 0 ); + mCurShader->setUniform( mClippingEnabledLoc, 0 ); for ( i = 0; i < EE_MAX_PLANES; i++ ) { if ( -1 != mPlanes[ i ] ) { - mCurShader->SetUniform( EEGL3_PLANES_ENABLED_NAME[ i ], 0 ); + mCurShader->setUniform( EEGL3_PLANES_ENABLED_NAME[ i ], 0 ); } } if ( -1 != mPointSpriteLoc ) { - mCurShader->SetUniform( mPointSpriteLoc, 0 ); + mCurShader->setUniform( mPointSpriteLoc, 0 ); } } -void RendererGL3::Enable( unsigned int cap ) { +void RendererGL3::enable( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { if ( 0 == mTexActive ) { mTexActive = 1; - mCurShader->SetUniform( mTexActiveLoc, mTexActive ); + mCurShader->setUniform( mTexActiveLoc, mTexActive ); } return; @@ -243,32 +243,32 @@ void RendererGL3::Enable( unsigned int cap ) { if ( 0 == mPlanesStates[ plane ] ) { mPlanesStates[ plane ] = 1; - PlaneStateCheck( true ); + planeStateCheck( true ); - mCurShader->SetUniform( EEGL3_PLANES_ENABLED_NAME[ plane ], 1 ); + mCurShader->setUniform( EEGL3_PLANES_ENABLED_NAME[ plane ], 1 ); } return; } case GL_POINT_SPRITE: { - mCurShader->SetUniform( mPointSpriteLoc, 1 ); + mCurShader->setUniform( mPointSpriteLoc, 1 ); break; } } - cGL::Enable( cap ); + cGL::enable( cap ); } -void RendererGL3::Disable ( unsigned int cap ) { +void RendererGL3::disable ( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { if ( 1 == mTexActive ) { mTexActive = 0; - mCurShader->SetUniform( mTexActiveLoc, mTexActive ); + mCurShader->setUniform( mTexActiveLoc, mTexActive ); } return; @@ -285,25 +285,25 @@ void RendererGL3::Disable ( unsigned int cap ) { if ( 1 == mPlanesStates[ plane ] ) { mPlanesStates[ plane ] = 0; - PlaneStateCheck( false ); + planeStateCheck( false ); - mCurShader->SetUniform( EEGL3_PLANES_ENABLED_NAME[ plane ], 0 ); + mCurShader->setUniform( EEGL3_PLANES_ENABLED_NAME[ plane ], 0 ); } return; } case GL_POINT_SPRITE: { - mCurShader->SetUniform( mPointSpriteLoc, 0 ); + mCurShader->setUniform( mPointSpriteLoc, 0 ); break; } } - cGL::Disable( cap ); + cGL::disable( cap ); } -void RendererGL3::EnableClientState( unsigned int array ) { +void RendererGL3::enableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -323,7 +323,7 @@ void RendererGL3::EnableClientState( unsigned int array ) { } } -void RendererGL3::DisableClientState( unsigned int array ) { +void RendererGL3::disableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -343,7 +343,7 @@ void RendererGL3::DisableClientState( unsigned int array ) { } } -void RendererGL3::VertexPointer ( int size, unsigned int type, int stride, const void * pointer, unsigned int allocate ) { +void RendererGL3::vertexPointer ( int size, unsigned int type, int stride, const void * pointer, unsigned int allocate ) { const int index = mAttribsLoc[ EEGL_VERTEX_ARRAY ]; if ( -1 != index ) { @@ -357,7 +357,7 @@ void RendererGL3::VertexPointer ( int size, unsigned int type, int stride, const } } -void RendererGL3::ColorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { +void RendererGL3::colorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { const int index = mAttribsLoc[ EEGL_COLOR_ARRAY ]; if ( -1 != index ) { @@ -375,7 +375,7 @@ void RendererGL3::ColorPointer ( int size, unsigned int type, int stride, const } } -void RendererGL3::TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { +void RendererGL3::texCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { const int index = mTextureUnits[ mCurActiveTex ]; if ( -1 != index ) { @@ -389,7 +389,7 @@ void RendererGL3::TexCoordPointer ( int size, unsigned int type, int stride, con } } -int RendererGL3::GetStateIndex( const Uint32& State ) { +int RendererGL3::getStateIndex( const Uint32& State ) { eeASSERT( State < EEGL_ARRAY_STATES_COUNT ); if ( EEGL_TEXTURE_COORD_ARRAY == State ) @@ -398,13 +398,13 @@ int RendererGL3::GetStateIndex( const Uint32& State ) { return mAttribsLoc[ State ]; } -void RendererGL3::PlaneStateCheck( bool tryEnable ) { +void RendererGL3::planeStateCheck( bool tryEnable ) { int i; if ( tryEnable ) { for ( i = 0; i < EE_MAX_PLANES; i++ ) { if ( 0 != mPlanesStates[ i ] ) { - mCurShader->SetUniform( mClippingEnabledLoc, 1 ); + mCurShader->setUniform( mClippingEnabledLoc, 1 ); return; } } @@ -415,16 +415,16 @@ void RendererGL3::PlaneStateCheck( bool tryEnable ) { } } - mCurShader->SetUniform( mClippingEnabledLoc, 0 ); + mCurShader->setUniform( mClippingEnabledLoc, 0 ); } } -void RendererGL3::UpdateMatrix() { +void RendererGL3::updateMatrix() { switch ( mCurrentMode ) { case GL_PROJECTION: { if ( -1 != mProjectionMatrix_id ) { - mCurShader->SetUniformMatrix( mProjectionMatrix_id, &mStack->mProjectionMatrix.top()[0][0] ); + mCurShader->setUniformMatrix( mProjectionMatrix_id, &mStack->mProjectionMatrix.top()[0][0] ); } break; @@ -432,7 +432,7 @@ void RendererGL3::UpdateMatrix() { case GL_MODELVIEW: { if ( -1 != mModelViewMatrix_id ) { - mCurShader->SetUniformMatrix( mModelViewMatrix_id, &mStack->mModelViewMatrix.top()[0][0] ); + mCurShader->setUniformMatrix( mModelViewMatrix_id, &mStack->mModelViewMatrix.top()[0][0] ); } break; @@ -440,67 +440,67 @@ void RendererGL3::UpdateMatrix() { } } -void RendererGL3::PushMatrix() { +void RendererGL3::pushMatrix() { mStack->mCurMatrix->push( mStack->mCurMatrix->top() ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::PopMatrix() { +void RendererGL3::popMatrix() { mStack->mCurMatrix->pop(); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::LoadIdentity() { +void RendererGL3::loadIdentity() { mStack->mCurMatrix->top() = glm::mat4(1.0); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::MultMatrixf ( const float * m ) { +void RendererGL3::multMatrixf ( const float * m ) { mStack->mCurMatrix->top() *= toGLMmat4( m ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::Translatef( float x, float y, float z ) { +void RendererGL3::translatef( float x, float y, float z ) { mStack->mCurMatrix->top() *= glm::translate( glm::vec3( x, y, z ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::Rotatef( float angle, float x, float y, float z ) { +void RendererGL3::rotatef( float angle, float x, float y, float z ) { mStack->mCurMatrix->top() *= glm::rotate( angle, glm::vec3( x, y, z ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::Scalef( float x, float y, float z ) { +void RendererGL3::scalef( float x, float y, float z ) { mStack->mCurMatrix->top() *= glm::scale( glm::vec3( x, y, z ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::Ortho( float left, float right, float bottom, float top, float zNear, float zFar ) { +void RendererGL3::ortho( float left, float right, float bottom, float top, float zNear, float zFar ) { mStack->mCurMatrix->top() *= glm::ortho( left, right, bottom, top , zNear, zFar ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::LookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) { +void RendererGL3::lookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) { mStack->mCurMatrix->top() *= glm::lookAt( glm::vec3(eyeX, eyeY, eyeZ), glm::vec3(centerX, centerY, centerZ), glm::vec3(upX, upY, upZ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::Perspective ( float fovy, float aspect, float zNear, float zFar ) { +void RendererGL3::perspective ( float fovy, float aspect, float zNear, float zFar ) { mStack->mCurMatrix->top() *= glm::perspective( fovy, aspect, zNear, zFar ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::LoadMatrixf( const float * m ) { +void RendererGL3::loadMatrixf( const float * m ) { mStack->mCurMatrix->top() = toGLMmat4( m ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::Frustum( float left, float right, float bottom, float top, float near_val, float far_val ) { +void RendererGL3::frustum( float left, float right, float bottom, float top, float near_val, float far_val ) { mStack->mCurMatrix->top() *= glm::frustum( left, right, bottom, top, near_val, far_val ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3::GetCurrentMatrix( unsigned int mode, float * m ) { +void RendererGL3::getCurrentMatrix( unsigned int mode, float * m ) { switch ( mode ) { case GL_PROJECTION: case GL_PROJECTION_MATRIX: @@ -517,11 +517,11 @@ void RendererGL3::GetCurrentMatrix( unsigned int mode, float * m ) { } } -unsigned int RendererGL3::GetCurrentMatrixMode() { +unsigned int RendererGL3::getCurrentMatrixMode() { return mCurrentMode; } -void RendererGL3::MatrixMode(unsigned int mode) { +void RendererGL3::matrixMode(unsigned int mode) { mCurrentMode = mode; switch ( mCurrentMode ) { @@ -540,7 +540,7 @@ void RendererGL3::MatrixMode(unsigned int mode) { } } -void RendererGL3::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { +void RendererGL3::clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { float tX = (float)x; float tY = (float)y; float tW = (float)Width; @@ -558,10 +558,10 @@ void RendererGL3::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32 vclip_top = vclip_top * invMV; vclip_bottom = vclip_bottom * invMV; - GLi->Enable(GL_CLIP_PLANE0); - GLi->Enable(GL_CLIP_PLANE1); - GLi->Enable(GL_CLIP_PLANE2); - GLi->Enable(GL_CLIP_PLANE3); + GLi->enable(GL_CLIP_PLANE0); + GLi->enable(GL_CLIP_PLANE1); + GLi->enable(GL_CLIP_PLANE2); + GLi->enable(GL_CLIP_PLANE3); glUniform4fv( mPlanes[0], 1, static_cast( &vclip_left[0] ) ); glUniform4fv( mPlanes[1], 1, static_cast( &vclip_right[0] ) ); @@ -573,31 +573,31 @@ void RendererGL3::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32 } } -void RendererGL3::Clip2DPlaneDisable() { +void RendererGL3::clip2DPlaneDisable() { if ( ! mPlanesClipped.empty() ) { // This should always be true mPlanesClipped.pop_back(); } if ( mPlanesClipped.empty() ) { - GLi->Disable(GL_CLIP_PLANE0); - GLi->Disable(GL_CLIP_PLANE1); - GLi->Disable(GL_CLIP_PLANE2); - GLi->Disable(GL_CLIP_PLANE3); + GLi->disable(GL_CLIP_PLANE0); + GLi->disable(GL_CLIP_PLANE1); + GLi->disable(GL_CLIP_PLANE2); + GLi->disable(GL_CLIP_PLANE3); } else { Rectf R( mPlanesClipped.back() ); mPushClip = false; - Clip2DPlaneEnable( R.Left, R.Top, R.Right, R.Bottom ); + clip2DPlaneEnable( R.Left, R.Top, R.Right, R.Bottom ); mPushClip = true; } } -void RendererGL3::PointSize( float size ) { - mCurShader->SetUniform( "dgl_PointSize", size ); +void RendererGL3::pointSize( float size ) { + mCurShader->setUniform( "dgl_PointSize", size ); mPointSize = size; } -void RendererGL3::ClipPlane( unsigned int plane, const double * equation ) { +void RendererGL3::clipPlane( unsigned int plane, const double * equation ) { Int32 nplane = plane - GL_CLIP_PLANE0; Int32 location; @@ -606,7 +606,7 @@ void RendererGL3::ClipPlane( unsigned int plane, const double * equation ) { } else { std::string planeNum( "dgl_ClipPlane[" + String::toStr( nplane ) + "]" ); - location = glGetUniformLocation( mCurShader->Handler(), (GLchar*)&planeNum[0] ); + location = glGetUniformLocation( mCurShader->getHandler(), (GLchar*)&planeNum[0] ); } glm::vec4 teq( equation[0], equation[1], equation[2], equation[3] ); @@ -616,26 +616,26 @@ void RendererGL3::ClipPlane( unsigned int plane, const double * equation ) { glUniform4f( location, (float)teq[0], (float)teq[1], (float)teq[2], (float)teq[3] ); } -float RendererGL3::PointSize() { +float RendererGL3::pointSize() { return mPointSize; } -void RendererGL3::ClientActiveTexture( unsigned int texture ) { +void RendererGL3::clientActiveTexture( unsigned int texture ) { mCurActiveTex = texture - GL_TEXTURE0; if ( mCurActiveTex >= EE_MAX_TEXTURE_UNITS ) mCurActiveTex = 0; } -void RendererGL3::TexEnvi( unsigned int target, unsigned int pname, int param ) { +void RendererGL3::texEnvi( unsigned int target, unsigned int pname, int param ) { //! @TODO: Implement TexEnvi } -std::string RendererGL3::GetBaseVertexShader() { +std::string RendererGL3::getBaseVertexShader() { return mBaseVertexShader; } -int RendererGL3::Project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) { +int RendererGL3::project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) { glm::vec3 tv3( glm::project( glm::vec3( objx, objy, objz ), toGLMmat4( modelMatrix ), toGLMmat4( projMatrix ), glm::vec4( viewport[0], viewport[1], viewport[2], viewport[3] ) ) ); if ( NULL != winx ) @@ -650,7 +650,7 @@ int RendererGL3::Project( float objx, float objy, float objz, const float modelM return GL_TRUE; } -int RendererGL3::UnProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) { +int RendererGL3::unProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) { glm::vec3 tv3( glm::unProject( glm::vec3( winx, winy, winz ), toGLMmat4( modelMatrix ), toGLMmat4( projMatrix ), glm::vec4( viewport[0], viewport[1], viewport[2], viewport[3] ) ) ); if ( NULL != objx ) diff --git a/src/eepp/graphics/renderer/renderergl3cp.cpp b/src/eepp/graphics/renderer/renderergl3cp.cpp index 7b7c88468..d6eec5563 100644 --- a/src/eepp/graphics/renderer/renderergl3cp.cpp +++ b/src/eepp/graphics/renderer/renderergl3cp.cpp @@ -87,7 +87,7 @@ RendererGL3CP::~RendererGL3CP() { } } - DeleteVertexArrays( 1, &mVAO ); + deleteVertexArrays( 1, &mVAO ); eeSAFE_DELETE( mStack ); @@ -96,19 +96,19 @@ RendererGL3CP::~RendererGL3CP() { #endif } -EEGL_version RendererGL3CP::Version() { +EEGL_version RendererGL3CP::version() { return GLv_3CP; } -std::string RendererGL3CP::VersionStr() { +std::string RendererGL3CP::versionStr() { return "OpenGL 3 Core Profile"; } -void RendererGL3CP::Init() { +void RendererGL3CP::init() { if ( !mLoaded ) { Uint32 i; - cGL::Init(); + cGL::init(); std::string vs( EEGL3CP_SHADER_BASE_VS ); std::string fs( EEGL3CP_SHADER_BASE_FS ); @@ -133,51 +133,51 @@ void RendererGL3CP::Init() { mTextureUnitsStates[i] = 0; } - Shader::Ensure( false ); + Shader::ensure( false ); mShaders[ EEGL3CP_SHADER_BASE ] = ShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGL3CP_SHADER_BASE ]->SetReloadCb( cb::Make1( this, &RendererGL3CP::ReloadShader ) ); + mShaders[ EEGL3CP_SHADER_BASE ]->setReloadCb( cb::Make1( this, &RendererGL3CP::reloadShader ) ); - Shader::Ensure( true ); + Shader::ensure( true ); } else { mCurShader = NULL; - mShaders[ EEGL3CP_SHADER_BASE ]->Reload(); + mShaders[ EEGL3CP_SHADER_BASE ]->reload(); } - GenVertexArrays( 1, &mVAO ); - BindVertexArray( mVAO ); + genVertexArrays( 1, &mVAO ); + bindVertexArray( mVAO ); glGenBuffersARB( EEGL_ARRAY_STATES_COUNT+5, &mVBO[0] ); - AllocateBuffers( mVBOSizeAlloc ); + allocateBuffers( mVBOSizeAlloc ); - ClientActiveTexture( GL_TEXTURE0 ); + clientActiveTexture( GL_TEXTURE0 ); - SetShader( mShaders[ EEGL3CP_SHADER_BASE ] ); + setShader( mShaders[ EEGL3CP_SHADER_BASE ] ); mLoaded = true; } -unsigned int RendererGL3CP::BaseShaderId() { - return mCurShader->Handler(); +unsigned int RendererGL3CP::baseShaderId() { + return mCurShader->getHandler(); } -void RendererGL3CP::ReloadCurrentShader() { - ReloadShader( mCurShader ); +void RendererGL3CP::reloadCurrentShader() { + reloadShader( mCurShader ); } -void RendererGL3CP::ReloadShader( ShaderProgram * Shader ) { +void RendererGL3CP::reloadShader( ShaderProgram * Shader ) { mCurShader = NULL; - SetShader( Shader ); + setShader( Shader ); } -void RendererGL3CP::SetShader( const EEGL3CP_SHADERS& Shader ) { - SetShader( mShaders[ Shader ] ); +void RendererGL3CP::setShader( const EEGL3CP_SHADERS& Shader ) { + setShader( mShaders[ Shader ] ); } -void RendererGL3CP::SetShader( ShaderProgram * Shader ) { +void RendererGL3CP::setShader( ShaderProgram * Shader ) { if ( NULL == Shader ) { Shader = mShaders[ EEGL3CP_SHADER_BASE ]; } @@ -186,78 +186,78 @@ void RendererGL3CP::SetShader( ShaderProgram * Shader ) { return; } - DisableClientState( GL_VERTEX_ARRAY ); - DisableClientState( GL_TEXTURE_COORD_ARRAY ); - DisableClientState( GL_COLOR_ARRAY ); + disableClientState( GL_VERTEX_ARRAY ); + disableClientState( GL_TEXTURE_COORD_ARRAY ); + disableClientState( GL_COLOR_ARRAY ); mShaderPrev = mCurShader; mCurShader = Shader; - mProjectionMatrix_id = mCurShader->UniformLocation( "dgl_ProjectionMatrix" ); - mModelViewMatrix_id = mCurShader->UniformLocation( "dgl_ModelViewMatrix" ); - mTexActiveLoc = mCurShader->UniformLocation( "dgl_TexActive" ); - mPointSpriteLoc = mCurShader->UniformLocation( "dgl_PointSpriteActive" ); - mClippingEnabledLoc = mCurShader->UniformLocation( "dgl_ClippingEnabled" ); + mProjectionMatrix_id = mCurShader->uniformLocation( "dgl_ProjectionMatrix" ); + mModelViewMatrix_id = mCurShader->uniformLocation( "dgl_ModelViewMatrix" ); + mTexActiveLoc = mCurShader->uniformLocation( "dgl_TexActive" ); + mPointSpriteLoc = mCurShader->uniformLocation( "dgl_PointSpriteActive" ); + mClippingEnabledLoc = mCurShader->uniformLocation( "dgl_ClippingEnabled" ); mCurActiveTex = 0; Uint32 i; for ( i = 0; i < EEGL_ARRAY_STATES_COUNT; i++ ) { - mAttribsLoc[ i ] = mCurShader->AttributeLocation( EEGL3CP_STATES_NAME[ i ] ); + mAttribsLoc[ i ] = mCurShader->attributeLocation( EEGL3CP_STATES_NAME[ i ] ); } for ( i = 0; i < EE_MAX_PLANES; i++ ) { - mPlanes[ i ] = mCurShader->UniformLocation( EEGL3CP_PLANES_NAME[ i ] ); + mPlanes[ i ] = mCurShader->uniformLocation( EEGL3CP_PLANES_NAME[ i ] ); } for ( i = 0; i < EE_MAX_TEXTURE_UNITS; i++ ) { - mTextureUnits[ i ] = mCurShader->AttributeLocation( EEGL3CP_TEXTUREUNIT_NAMES[ i ] ); + mTextureUnits[ i ] = mCurShader->attributeLocation( EEGL3CP_TEXTUREUNIT_NAMES[ i ] ); } - glUseProgram( mCurShader->Handler() ); + glUseProgram( mCurShader->getHandler() ); if ( -1 != mAttribsLoc[ EEGL_VERTEX_ARRAY ] ) - EnableClientState( GL_VERTEX_ARRAY ); + enableClientState( GL_VERTEX_ARRAY ); if ( -1 != mAttribsLoc[ EEGL_COLOR_ARRAY ] ) - EnableClientState( GL_COLOR_ARRAY ); + enableClientState( GL_COLOR_ARRAY ); if ( -1 != mTextureUnits[ mCurActiveTex ] ) - EnableClientState( GL_TEXTURE_COORD_ARRAY ); + enableClientState( GL_TEXTURE_COORD_ARRAY ); unsigned int CM = mCurrentMode; - MatrixMode( GL_PROJECTION ); - UpdateMatrix(); - MatrixMode( GL_MODELVIEW ); - UpdateMatrix(); - MatrixMode( CM ); + matrixMode( GL_PROJECTION ); + updateMatrix(); + matrixMode( GL_MODELVIEW ); + updateMatrix(); + matrixMode( CM ); if ( -1 != mTexActiveLoc ) { - mCurShader->SetUniform( mTexActiveLoc, 1 ); + mCurShader->setUniform( mTexActiveLoc, 1 ); } - mCurShader->SetUniform( mClippingEnabledLoc, 0 ); + mCurShader->setUniform( mClippingEnabledLoc, 0 ); for ( i = 0; i < EE_MAX_PLANES; i++ ) { if ( -1 != mPlanes[ i ] ) { - mCurShader->SetUniform( EEGL3CP_PLANES_ENABLED_NAME[ i ], 0 ); + mCurShader->setUniform( EEGL3CP_PLANES_ENABLED_NAME[ i ], 0 ); } } if ( -1 != mPointSpriteLoc ) { - mCurShader->SetUniform( mPointSpriteLoc, 0 ); + mCurShader->setUniform( mPointSpriteLoc, 0 ); } } -void RendererGL3CP::Enable( unsigned int cap ) { +void RendererGL3CP::enable( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { if ( 0 == mTexActive ) { mTexActive = 1; - mCurShader->SetUniform( mTexActiveLoc, mTexActive ); - mCurShader->SetUniform( mTextureUnits[ mCurActiveTex ], mCurActiveTex ); + mCurShader->setUniform( mTexActiveLoc, mTexActive ); + mCurShader->setUniform( mTextureUnits[ mCurActiveTex ], mCurActiveTex ); } return; @@ -274,32 +274,32 @@ void RendererGL3CP::Enable( unsigned int cap ) { if ( 0 == mPlanesStates[ plane ] ) { mPlanesStates[ plane ] = 1; - PlaneStateCheck( true ); + planeStateCheck( true ); - mCurShader->SetUniform( EEGL3CP_PLANES_ENABLED_NAME[ plane ], 1 ); + mCurShader->setUniform( EEGL3CP_PLANES_ENABLED_NAME[ plane ], 1 ); } return; } case GL_POINT_SPRITE: { - mCurShader->SetUniform( mPointSpriteLoc, 1 ); + mCurShader->setUniform( mPointSpriteLoc, 1 ); return; } } - cGL::Enable( cap ); + cGL::enable( cap ); } -void RendererGL3CP::Disable ( unsigned int cap ) { +void RendererGL3CP::disable ( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { if ( 1 == mTexActive ) { mTexActive = 0; - mCurShader->SetUniform( mTexActiveLoc, mTexActive ); + mCurShader->setUniform( mTexActiveLoc, mTexActive ); } return; } @@ -315,25 +315,25 @@ void RendererGL3CP::Disable ( unsigned int cap ) { if ( 1 == mPlanesStates[ plane ] ) { mPlanesStates[ plane ] = 0; - PlaneStateCheck( false ); + planeStateCheck( false ); - mCurShader->SetUniform( EEGL3CP_PLANES_ENABLED_NAME[ plane ], 0 ); + mCurShader->setUniform( EEGL3CP_PLANES_ENABLED_NAME[ plane ], 0 ); } return; } case GL_POINT_SPRITE: { - mCurShader->SetUniform( mPointSpriteLoc, 0 ); + mCurShader->setUniform( mPointSpriteLoc, 0 ); return; } } - cGL::Disable( cap ); + cGL::disable( cap ); } -void RendererGL3CP::EnableClientState( unsigned int array ) { +void RendererGL3CP::enableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -353,7 +353,7 @@ void RendererGL3CP::EnableClientState( unsigned int array ) { } } -void RendererGL3CP::DisableClientState( unsigned int array ) { +void RendererGL3CP::disableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -373,7 +373,7 @@ void RendererGL3CP::DisableClientState( unsigned int array ) { } } -void RendererGL3CP::VertexPointer ( int size, unsigned int type, int stride, const void * pointer, unsigned int allocate ) { +void RendererGL3CP::vertexPointer ( int size, unsigned int type, int stride, const void * pointer, unsigned int allocate ) { const int index = mAttribsLoc[ EEGL_VERTEX_ARRAY ]; #ifdef EE_DEBUG @@ -381,10 +381,10 @@ void RendererGL3CP::VertexPointer ( int size, unsigned int type, int stride, con #endif if ( -1 != index ) { - BindVertexArray( mVAO ); + bindVertexArray( mVAO ); if ( allocate > mVBOSizeAlloc ) { - AllocateBuffers( allocate ); + allocateBuffers( allocate ); } glBindBufferARB( GL_ARRAY_BUFFER, mVBO[ EEGL_VERTEX_ARRAY ] ); @@ -404,7 +404,7 @@ void RendererGL3CP::VertexPointer ( int size, unsigned int type, int stride, con } } -void RendererGL3CP::ColorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { +void RendererGL3CP::colorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { const int index = mAttribsLoc[ EEGL_COLOR_ARRAY ]; #ifdef EE_DEBUG @@ -412,10 +412,10 @@ void RendererGL3CP::ColorPointer ( int size, unsigned int type, int stride, cons #endif if ( -1 != index ) { - BindVertexArray( mVAO ); + bindVertexArray( mVAO ); if ( allocate > mVBOSizeAlloc ) { - AllocateBuffers( allocate ); + allocateBuffers( allocate ); } glBindBufferARB( GL_ARRAY_BUFFER, mVBO[ EEGL_COLOR_ARRAY ] ); @@ -435,7 +435,7 @@ void RendererGL3CP::ColorPointer ( int size, unsigned int type, int stride, cons } } -void RendererGL3CP::TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { +void RendererGL3CP::texCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { const int index = mTextureUnits[ mCurActiveTex ]; #ifdef EE_DEBUG @@ -443,10 +443,10 @@ void RendererGL3CP::TexCoordPointer ( int size, unsigned int type, int stride, c #endif if ( -1 != index ) { - BindVertexArray( mVAO ); + bindVertexArray( mVAO ); if ( allocate > mVBOSizeAlloc ) { - AllocateBuffers( allocate ); + allocateBuffers( allocate ); } glBindBufferARB( GL_ARRAY_BUFFER, mCurTexCoordArray ); @@ -462,7 +462,7 @@ void RendererGL3CP::TexCoordPointer ( int size, unsigned int type, int stride, c } } -int RendererGL3CP::GetStateIndex( const Uint32& State ) { +int RendererGL3CP::getStateIndex( const Uint32& State ) { eeASSERT( State < EEGL_ARRAY_STATES_COUNT ); if ( EEGL_TEXTURE_COORD_ARRAY == State ) @@ -471,13 +471,13 @@ int RendererGL3CP::GetStateIndex( const Uint32& State ) { return mAttribsLoc[ State ]; } -void RendererGL3CP::PlaneStateCheck( bool tryEnable ) { +void RendererGL3CP::planeStateCheck( bool tryEnable ) { int i; if ( tryEnable ) { for ( i = 0; i < EE_MAX_PLANES; i++ ) { if ( 0 != mPlanesStates[ i ] ) { - mCurShader->SetUniform( mClippingEnabledLoc, 1 ); + mCurShader->setUniform( mClippingEnabledLoc, 1 ); return; } } @@ -488,16 +488,16 @@ void RendererGL3CP::PlaneStateCheck( bool tryEnable ) { } } - mCurShader->SetUniform( mClippingEnabledLoc, 0 ); + mCurShader->setUniform( mClippingEnabledLoc, 0 ); } } -void RendererGL3CP::UpdateMatrix() { +void RendererGL3CP::updateMatrix() { switch ( mCurrentMode ) { case GL_PROJECTION: { if ( -1 != mProjectionMatrix_id ) { - mCurShader->SetUniformMatrix( mProjectionMatrix_id, &mStack->mProjectionMatrix.top()[0][0] ); + mCurShader->setUniformMatrix( mProjectionMatrix_id, &mStack->mProjectionMatrix.top()[0][0] ); } break; @@ -505,7 +505,7 @@ void RendererGL3CP::UpdateMatrix() { case GL_MODELVIEW: { if ( -1 != mModelViewMatrix_id ) { - mCurShader->SetUniformMatrix( mModelViewMatrix_id, &mStack->mModelViewMatrix.top()[0][0] ); + mCurShader->setUniformMatrix( mModelViewMatrix_id, &mStack->mModelViewMatrix.top()[0][0] ); } break; @@ -513,67 +513,67 @@ void RendererGL3CP::UpdateMatrix() { } } -void RendererGL3CP::PushMatrix() { +void RendererGL3CP::pushMatrix() { mStack->mCurMatrix->push( mStack->mCurMatrix->top() ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::PopMatrix() { +void RendererGL3CP::popMatrix() { mStack->mCurMatrix->pop(); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::LoadIdentity() { +void RendererGL3CP::loadIdentity() { mStack->mCurMatrix->top() = glm::mat4(1.0); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::MultMatrixf ( const float * m ) { +void RendererGL3CP::multMatrixf ( const float * m ) { mStack->mCurMatrix->top() *= toGLMmat4( m ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::Translatef( float x, float y, float z ) { +void RendererGL3CP::translatef( float x, float y, float z ) { mStack->mCurMatrix->top() *= glm::translate( glm::vec3( x, y, z ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::Rotatef( float angle, float x, float y, float z ) { +void RendererGL3CP::rotatef( float angle, float x, float y, float z ) { mStack->mCurMatrix->top() *= glm::rotate( angle, glm::vec3( x, y, z ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::Scalef( float x, float y, float z ) { +void RendererGL3CP::scalef( float x, float y, float z ) { mStack->mCurMatrix->top() *= glm::scale( glm::vec3( x, y, z ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::Ortho( float left, float right, float bottom, float top, float zNear, float zFar ) { +void RendererGL3CP::ortho( float left, float right, float bottom, float top, float zNear, float zFar ) { mStack->mCurMatrix->top() *= glm::ortho( left, right, bottom, top , zNear, zFar ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::LookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) { +void RendererGL3CP::lookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) { mStack->mCurMatrix->top() *= glm::lookAt( glm::vec3(eyeX, eyeY, eyeZ), glm::vec3(centerX, centerY, centerZ), glm::vec3(upX, upY, upZ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::Perspective ( float fovy, float aspect, float zNear, float zFar ) { +void RendererGL3CP::perspective ( float fovy, float aspect, float zNear, float zFar ) { mStack->mCurMatrix->top() *= glm::perspective( fovy, aspect, zNear, zFar ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::LoadMatrixf( const float * m ) { +void RendererGL3CP::loadMatrixf( const float * m ) { mStack->mCurMatrix->top() = toGLMmat4( m ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::Frustum( float left, float right, float bottom, float top, float near_val, float far_val ) { +void RendererGL3CP::frustum( float left, float right, float bottom, float top, float near_val, float far_val ) { mStack->mCurMatrix->top() *= glm::frustum( left, right, bottom, top, near_val, far_val ); - UpdateMatrix(); + updateMatrix(); } -void RendererGL3CP::GetCurrentMatrix( unsigned int mode, float * m ) { +void RendererGL3CP::getCurrentMatrix( unsigned int mode, float * m ) { switch ( mode ) { case GL_PROJECTION: case GL_PROJECTION_MATRIX: @@ -590,11 +590,11 @@ void RendererGL3CP::GetCurrentMatrix( unsigned int mode, float * m ) { } } -unsigned int RendererGL3CP::GetCurrentMatrixMode() { +unsigned int RendererGL3CP::getCurrentMatrixMode() { return mCurrentMode; } -void RendererGL3CP::MatrixMode(unsigned int mode) { +void RendererGL3CP::matrixMode(unsigned int mode) { mCurrentMode = mode; switch ( mCurrentMode ) { @@ -613,7 +613,7 @@ void RendererGL3CP::MatrixMode(unsigned int mode) { } } -void RendererGL3CP::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { +void RendererGL3CP::clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { float tX = (float)x; float tY = (float)y; float tW = (float)Width; @@ -631,10 +631,10 @@ void RendererGL3CP::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int vclip_top = vclip_top * invMV; vclip_bottom = vclip_bottom * invMV; - GLi->Enable(GL_CLIP_PLANE0); - GLi->Enable(GL_CLIP_PLANE1); - GLi->Enable(GL_CLIP_PLANE2); - GLi->Enable(GL_CLIP_PLANE3); + GLi->enable(GL_CLIP_PLANE0); + GLi->enable(GL_CLIP_PLANE1); + GLi->enable(GL_CLIP_PLANE2); + GLi->enable(GL_CLIP_PLANE3); glUniform4fv( mPlanes[0], 1, static_cast( &vclip_left[0] ) ); glUniform4fv( mPlanes[1], 1, static_cast( &vclip_right[0] ) ); @@ -646,31 +646,31 @@ void RendererGL3CP::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int } } -void RendererGL3CP::Clip2DPlaneDisable() { +void RendererGL3CP::clip2DPlaneDisable() { if ( ! mPlanesClipped.empty() ) { // This should always be true mPlanesClipped.pop_back(); } if ( mPlanesClipped.empty() ) { - GLi->Disable(GL_CLIP_PLANE0); - GLi->Disable(GL_CLIP_PLANE1); - GLi->Disable(GL_CLIP_PLANE2); - GLi->Disable(GL_CLIP_PLANE3); + GLi->disable(GL_CLIP_PLANE0); + GLi->disable(GL_CLIP_PLANE1); + GLi->disable(GL_CLIP_PLANE2); + GLi->disable(GL_CLIP_PLANE3); } else { Rectf R( mPlanesClipped.back() ); mPushClip = false; - Clip2DPlaneEnable( R.Left, R.Top, R.Right, R.Bottom ); + clip2DPlaneEnable( R.Left, R.Top, R.Right, R.Bottom ); mPushClip = true; } } -void RendererGL3CP::PointSize( float size ) { - mCurShader->SetUniform( "dgl_PointSize", size ); +void RendererGL3CP::pointSize( float size ) { + mCurShader->setUniform( "dgl_PointSize", size ); mPointSize = size; } -void RendererGL3CP::ClipPlane( unsigned int plane, const double * equation ) { +void RendererGL3CP::clipPlane( unsigned int plane, const double * equation ) { Int32 nplane = plane - GL_CLIP_PLANE0; Int32 location; @@ -679,7 +679,7 @@ void RendererGL3CP::ClipPlane( unsigned int plane, const double * equation ) { } else { std::string planeNum( "dgl_ClipPlane[" + String::toStr( nplane ) + "]" ); - location = glGetUniformLocation( mCurShader->Handler(), (GLchar*)&planeNum[0] ); + location = glGetUniformLocation( mCurShader->getHandler(), (GLchar*)&planeNum[0] ); } glm::vec4 teq( equation[0], equation[1], equation[2], equation[3] ); @@ -689,11 +689,11 @@ void RendererGL3CP::ClipPlane( unsigned int plane, const double * equation ) { glUniform4f( location, (float)teq[0], (float)teq[1], (float)teq[2], (float)teq[3] ); } -float RendererGL3CP::PointSize() { +float RendererGL3CP::pointSize() { return mPointSize; } -void RendererGL3CP::ClientActiveTexture( unsigned int texture ) { +void RendererGL3CP::clientActiveTexture( unsigned int texture ) { mCurActiveTex = texture - GL_TEXTURE0; if ( mCurActiveTex >= EE_MAX_TEXTURE_UNITS ) @@ -708,15 +708,15 @@ void RendererGL3CP::ClientActiveTexture( unsigned int texture ) { } } -void RendererGL3CP::TexEnvi( unsigned int target, unsigned int pname, int param ) { +void RendererGL3CP::texEnvi( unsigned int target, unsigned int pname, int param ) { //! @TODO: Implement TexEnvi } -std::string RendererGL3CP::GetBaseVertexShader() { +std::string RendererGL3CP::getBaseVertexShader() { return mBaseVertexShader; } -int RendererGL3CP::Project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) { +int RendererGL3CP::project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) { glm::vec3 tv3( glm::project( glm::vec3( objx, objy, objz ), toGLMmat4( modelMatrix ), toGLMmat4( projMatrix ), glm::vec4( viewport[0], viewport[1], viewport[2], viewport[3] ) ) ); if ( NULL != winx ) @@ -731,7 +731,7 @@ int RendererGL3CP::Project( float objx, float objy, float objz, const float mode return GL_TRUE; } -int RendererGL3CP::UnProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) { +int RendererGL3CP::unProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) { glm::vec3 tv3( glm::unProject( glm::vec3( winx, winy, winz ), toGLMmat4( modelMatrix ), toGLMmat4( projMatrix ), glm::vec4( viewport[0], viewport[1], viewport[2], viewport[3] ) ) ); if ( NULL != objx ) @@ -746,11 +746,11 @@ int RendererGL3CP::UnProject( float winx, float winy, float winz, const float mo return GL_TRUE; } -void RendererGL3CP::BindGlobalVAO() { - BindVertexArray( mVAO ); +void RendererGL3CP::bindGlobalVAO() { + bindVertexArray( mVAO ); } -void RendererGL3CP::AllocateBuffers( const Uint32& size ) { +void RendererGL3CP::allocateBuffers( const Uint32& size ) { if ( mVBOSizeAlloc != size ) Log::instance()->write( "Allocating new VBO buffers size: " + String::toStr( size ) ); diff --git a/src/eepp/graphics/renderer/renderergles2.cpp b/src/eepp/graphics/renderer/renderergles2.cpp index e5e567052..dc20811ea 100644 --- a/src/eepp/graphics/renderer/renderergles2.cpp +++ b/src/eepp/graphics/renderer/renderergles2.cpp @@ -90,19 +90,19 @@ RendererGLES2::~RendererGLES2() { eeSAFE_DELETE( mStack ); } -EEGL_version RendererGLES2::Version() { +EEGL_version RendererGLES2::version() { return GLv_ES2; } -std::string RendererGLES2::VersionStr() { +std::string RendererGLES2::versionStr() { return "OpenGL ES 2"; } -void RendererGLES2::Init() { +void RendererGLES2::init() { if ( !mLoaded ) { Uint32 i; - cGL::Init(); + cGL::init(); std::string vs( EEGLES2_SHADER_BASE_VS ); std::string fs( EEGLES2_SHADER_BASE_FS ); @@ -124,64 +124,64 @@ void RendererGLES2::Init() { mTextureUnitsStates[i] = 0; } - Shader::Ensure( false ); + Shader::ensure( false ); mShaders[ EEGLES2_SHADER_BASE ] = ShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGLES2_SHADER_BASE ]->SetReloadCb( cb::Make1( this, &RendererGLES2::ReloadShader ) ); + mShaders[ EEGLES2_SHADER_BASE ]->setReloadCb( cb::Make1( this, &RendererGLES2::reloadShader ) ); vs = EEGLES2_SHADER_CLIPPED_VS; fs = EEGLES2_SHADER_CLIPPED_FS; mShaders[ EEGLES2_SHADER_CLIPPED ] = ShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGLES2_SHADER_CLIPPED ]->SetReloadCb( cb::Make1( this, &RendererGLES2::ReloadShader ) ); + mShaders[ EEGLES2_SHADER_CLIPPED ]->setReloadCb( cb::Make1( this, &RendererGLES2::reloadShader ) ); vs = EEGLES2_SHADER_POINTSPRITE_VS; fs = EEGLES2_SHADER_POINTSPRITE_FS; mShaders[ EEGLES2_SHADER_POINTSPRITE ] = ShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGLES2_SHADER_POINTSPRITE ]->SetReloadCb( cb::Make1( this, &RendererGLES2::ReloadShader ) ); + mShaders[ EEGLES2_SHADER_POINTSPRITE ]->setReloadCb( cb::Make1( this, &RendererGLES2::reloadShader ) ); vs = EEGLES2_SHADER_PRIMITIVE_VS; fs = EEGLES2_SHADER_PRIMITIVE_FS; mShaders[ EEGLES2_SHADER_PRIMITIVE ] = ShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGLES2_SHADER_PRIMITIVE ]->SetReloadCb( cb::Make1( this, &RendererGLES2::ReloadShader ) ); + mShaders[ EEGLES2_SHADER_PRIMITIVE ]->setReloadCb( cb::Make1( this, &RendererGLES2::reloadShader ) ); - Shader::Ensure( true ); + Shader::ensure( true ); - SetShader( EEGLES2_SHADER_BASE ); + setShader( EEGLES2_SHADER_BASE ); } else { mCurShader = NULL; - mShaders[ EEGLES2_SHADER_BASE ]->Reload(); + mShaders[ EEGLES2_SHADER_BASE ]->reload(); - SetShader( EEGLES2_SHADER_BASE ); + setShader( EEGLES2_SHADER_BASE ); } - ClientActiveTexture( GL_TEXTURE0 ); + clientActiveTexture( GL_TEXTURE0 ); mLoaded = true; } -unsigned int RendererGLES2::BaseShaderId() { - return mCurShader->Handler(); +unsigned int RendererGLES2::baseShaderId() { + return mCurShader->getHandler(); } -void RendererGLES2::ReloadCurrentShader() { - ReloadShader( mCurShader ); +void RendererGLES2::reloadCurrentShader() { + reloadShader( mCurShader ); } -void RendererGLES2::ReloadShader( ShaderProgram * Shader ) { +void RendererGLES2::reloadShader( ShaderProgram * Shader ) { mCurShader = NULL; - SetShader( Shader ); + setShader( Shader ); } -void RendererGLES2::SetShader( const EEGLES2_SHADERS& Shader ) { - SetShader( mShaders[ Shader ] ); +void RendererGLES2::setShader( const EEGLES2_SHADERS& Shader ) { + setShader( mShaders[ Shader ] ); } -void RendererGLES2::CheckLocalShader() { +void RendererGLES2::checkLocalShader() { for ( Uint32 i = 0; i < EEGLES2_SHADERS_COUNT; i++ ) { if ( mShaders[i] == mCurShader ) { mCurShaderLocal = true; @@ -192,7 +192,7 @@ void RendererGLES2::CheckLocalShader() { mCurShaderLocal = false; } -void RendererGLES2::SetShader( ShaderProgram * Shader ) { +void RendererGLES2::setShader( ShaderProgram * Shader ) { if ( NULL == Shader ) { Shader = mShaders[ EEGLES2_SHADER_BASE ]; } @@ -201,81 +201,81 @@ void RendererGLES2::SetShader( ShaderProgram * Shader ) { return; } - DisableClientState( GL_VERTEX_ARRAY ); - DisableClientState( GL_TEXTURE_COORD_ARRAY ); - DisableClientState( GL_COLOR_ARRAY ); + disableClientState( GL_VERTEX_ARRAY ); + disableClientState( GL_TEXTURE_COORD_ARRAY ); + disableClientState( GL_COLOR_ARRAY ); mShaderPrev = mCurShader; mCurShader = Shader; - CheckLocalShader(); + checkLocalShader(); - mProjectionMatrix_id = mCurShader->UniformLocation( "dgl_ProjectionMatrix" ); - mModelViewMatrix_id = mCurShader->UniformLocation( "dgl_ModelViewMatrix" ); - mTexActiveLoc = mCurShader->UniformLocation( "dgl_TexActive" ); - mClippingEnabledLoc = mCurShader->UniformLocation( "dgl_ClippingEnabled" ); + mProjectionMatrix_id = mCurShader->uniformLocation( "dgl_ProjectionMatrix" ); + mModelViewMatrix_id = mCurShader->uniformLocation( "dgl_ModelViewMatrix" ); + mTexActiveLoc = mCurShader->uniformLocation( "dgl_TexActive" ); + mClippingEnabledLoc = mCurShader->uniformLocation( "dgl_ClippingEnabled" ); mCurActiveTex = 0; Uint32 i; for ( i = 0; i < EEGL_ARRAY_STATES_COUNT; i++ ) { - mAttribsLoc[ i ] = mCurShader->AttributeLocation( EEGLES2_STATES_NAME[ i ] ); + mAttribsLoc[ i ] = mCurShader->attributeLocation( EEGLES2_STATES_NAME[ i ] ); } for ( i = 0; i < EE_MAX_PLANES; i++ ) { if ( -1 != mClippingEnabledLoc ) { - mPlanes[ i ] = mCurShader->UniformLocation( EEGLES2_PLANES_NAMENABLED_NAME[ i ] ); + mPlanes[ i ] = mCurShader->uniformLocation( EEGLES2_PLANES_NAMENABLED_NAME[ i ] ); } else { mPlanes[ i ] = -1; } } for ( i = 0; i < EE_MAX_TEXTURE_UNITS; i++ ) { - mTextureUnits[ i ] = mCurShader->AttributeLocation( EEGLES2_TEXTUREUNIT_NAMES[ i ] ); + mTextureUnits[ i ] = mCurShader->attributeLocation( EEGLES2_TEXTUREUNIT_NAMES[ i ] ); } - glUseProgram( mCurShader->Handler() ); + glUseProgram( mCurShader->getHandler() ); if ( -1 != mAttribsLoc[ EEGL_VERTEX_ARRAY ] ) - EnableClientState( GL_VERTEX_ARRAY ); + enableClientState( GL_VERTEX_ARRAY ); if ( -1 != mAttribsLoc[ EEGL_COLOR_ARRAY ] ) - EnableClientState( GL_COLOR_ARRAY ); + enableClientState( GL_COLOR_ARRAY ); if ( -1 != mTextureUnits[ mCurActiveTex ] ) - EnableClientState( GL_TEXTURE_COORD_ARRAY ); + enableClientState( GL_TEXTURE_COORD_ARRAY ); unsigned int CM = mCurrentMode; - MatrixMode( GL_PROJECTION ); - UpdateMatrix(); - MatrixMode( GL_MODELVIEW ); - UpdateMatrix(); - MatrixMode( CM ); + matrixMode( GL_PROJECTION ); + updateMatrix(); + matrixMode( GL_MODELVIEW ); + updateMatrix(); + matrixMode( CM ); if ( -1 != mTexActiveLoc ) { - mCurShader->SetUniform( mTexActiveLoc, mTexActive ); + mCurShader->setUniform( mTexActiveLoc, mTexActive ); } if ( -1 != mClippingEnabledLoc ) { - mCurShader->SetUniform( mClippingEnabledLoc, 0 ); + mCurShader->setUniform( mClippingEnabledLoc, 0 ); } for ( i = 0; i < EE_MAX_PLANES; i++ ) { if ( -1 != mPlanes[ i ] ) { - mCurShader->SetUniform( EEGLES2_PLANES_ENABLED_NAME[ i ], 0 ); + mCurShader->setUniform( EEGLES2_PLANES_ENABLED_NAME[ i ], 0 ); } } } -void RendererGLES2::Enable( unsigned int cap ) { +void RendererGLES2::enable( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { if ( 0 == mTexActive ) { mTexActive = 1; - SetShader( EEGLES2_SHADER_BASE ); + setShader( EEGLES2_SHADER_BASE ); } return; @@ -289,13 +289,13 @@ void RendererGLES2::Enable( unsigned int cap ) { { int plane = cap - GL_CLIP_PLANE0; - SetShader( EEGLES2_SHADER_CLIPPED ); + setShader( EEGLES2_SHADER_CLIPPED ); mPlanesStates[ plane ] = 1; - PlaneStateCheck( true ); + planeStateCheck( true ); - mCurShader->SetUniform( EEGLES2_PLANES_ENABLED_NAME[ plane ], 1 ); + mCurShader->setUniform( EEGLES2_PLANES_ENABLED_NAME[ plane ], 1 ); return; } @@ -305,23 +305,23 @@ void RendererGLES2::Enable( unsigned int cap ) { //cGL::Enable( GL_VERTEX_PROGRAM_POINT_SIZE ); - SetShader( EEGLES2_SHADER_POINTSPRITE ); + setShader( EEGLES2_SHADER_POINTSPRITE ); return; } } - cGL::Enable( cap ); + cGL::enable( cap ); } -void RendererGLES2::Disable ( unsigned int cap ) { +void RendererGLES2::disable ( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { if ( 1 == mTexActive ) { mTexActive = 0; - SetShader( EEGLES2_SHADER_PRIMITIVE ); + setShader( EEGLES2_SHADER_PRIMITIVE ); } return; @@ -336,14 +336,14 @@ void RendererGLES2::Disable ( unsigned int cap ) { int plane = cap - GL_CLIP_PLANE0; if ( mTexActive ) { - SetShader( EEGLES2_SHADER_BASE ); + setShader( EEGLES2_SHADER_BASE ); } else { - SetShader( EEGLES2_SHADER_PRIMITIVE ); + setShader( EEGLES2_SHADER_PRIMITIVE ); } mPlanesStates[ plane ] = 0; - PlaneStateCheck( false ); + planeStateCheck( false ); return; } @@ -353,16 +353,16 @@ void RendererGLES2::Disable ( unsigned int cap ) { //cGL::Disable( GL_VERTEX_PROGRAM_POINT_SIZE ); - SetShader( EEGLES2_SHADER_BASE ); + setShader( EEGLES2_SHADER_BASE ); return; } } - cGL::Disable( cap ); + cGL::disable( cap ); } -void RendererGLES2::EnableClientState( unsigned int array ) { +void RendererGLES2::enableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -382,7 +382,7 @@ void RendererGLES2::EnableClientState( unsigned int array ) { } } -void RendererGLES2::DisableClientState( unsigned int array ) { +void RendererGLES2::disableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -402,7 +402,7 @@ void RendererGLES2::DisableClientState( unsigned int array ) { } } -void RendererGLES2::VertexPointer ( int size, unsigned int type, int stride, const void * pointer, unsigned int allocate ) { +void RendererGLES2::vertexPointer( int size, unsigned int type, int stride, const void * pointer, unsigned int allocate ) { const int index = mAttribsLoc[ EEGL_VERTEX_ARRAY ]; if ( -1 != index ) { @@ -416,7 +416,7 @@ void RendererGLES2::VertexPointer ( int size, unsigned int type, int stride, con } } -void RendererGLES2::ColorPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { +void RendererGLES2::colorPointer( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { const int index = mAttribsLoc[ EEGL_COLOR_ARRAY ]; if ( -1 != index ) { @@ -434,16 +434,16 @@ void RendererGLES2::ColorPointer ( int size, unsigned int type, int stride, cons } } -void RendererGLES2::TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { +void RendererGLES2::texCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) { if ( mCurShaderLocal ) { if ( 1 == mTexActive ) { if ( mCurShader == mShaders[ EEGLES2_SHADER_PRIMITIVE ] ) { if ( mClippingEnabled ) { - SetShader( EEGLES2_SHADER_CLIPPED ); + setShader( EEGLES2_SHADER_CLIPPED ); } else if ( mPointSpriteEnabled ) { - SetShader( EEGLES2_SHADER_POINTSPRITE ); + setShader( EEGLES2_SHADER_POINTSPRITE ); } else { - SetShader( EEGLES2_SHADER_BASE ); + setShader( EEGLES2_SHADER_BASE ); } } } @@ -462,7 +462,7 @@ void RendererGLES2::TexCoordPointer ( int size, unsigned int type, int stride, c } } -int RendererGLES2::GetStateIndex( const Uint32& State ) { +int RendererGLES2::getStateIndex( const Uint32& State ) { eeASSERT( State < EEGL_ARRAY_STATES_COUNT ); if ( EEGL_TEXTURE_COORD_ARRAY == State ) @@ -471,13 +471,13 @@ int RendererGLES2::GetStateIndex( const Uint32& State ) { return mAttribsLoc[ State ]; } -void RendererGLES2::PlaneStateCheck( bool tryEnable ) { +void RendererGLES2::planeStateCheck( bool tryEnable ) { int i; if ( tryEnable ) { for ( i = 0; i < EE_MAX_PLANES; i++ ) { if ( 0 != mPlanesStates[ i ] ) { - mCurShader->SetUniform( mClippingEnabledLoc, 1 ); + mCurShader->setUniform( mClippingEnabledLoc, 1 ); mClippingEnabled = 1; @@ -495,12 +495,12 @@ void RendererGLES2::PlaneStateCheck( bool tryEnable ) { } } -void RendererGLES2::UpdateMatrix() { +void RendererGLES2::updateMatrix() { switch ( mCurrentMode ) { case GL_PROJECTION: { if ( -1 != mProjectionMatrix_id ) { - mCurShader->SetUniformMatrix( mProjectionMatrix_id, &mStack->mProjectionMatrix.top()[0][0] ); + mCurShader->setUniformMatrix( mProjectionMatrix_id, &mStack->mProjectionMatrix.top()[0][0] ); } break; @@ -508,7 +508,7 @@ void RendererGLES2::UpdateMatrix() { case GL_MODELVIEW: { if ( -1 != mModelViewMatrix_id ) { - mCurShader->SetUniformMatrix( mModelViewMatrix_id, &mStack->mModelViewMatrix.top()[0][0] ); + mCurShader->setUniformMatrix( mModelViewMatrix_id, &mStack->mModelViewMatrix.top()[0][0] ); } break; @@ -516,67 +516,67 @@ void RendererGLES2::UpdateMatrix() { } } -void RendererGLES2::PushMatrix() { +void RendererGLES2::pushMatrix() { mStack->mCurMatrix->push( mStack->mCurMatrix->top() ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::PopMatrix() { +void RendererGLES2::popMatrix() { mStack->mCurMatrix->pop(); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::LoadIdentity() { +void RendererGLES2::loadIdentity() { mStack->mCurMatrix->top() = glm::mat4(1.0); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::MultMatrixf ( const float * m ) { +void RendererGLES2::multMatrixf ( const float * m ) { mStack->mCurMatrix->top() *= toGLMmat4( m ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::Translatef( float x, float y, float z ) { +void RendererGLES2::translatef( float x, float y, float z ) { mStack->mCurMatrix->top() *= glm::translate( glm::vec3( x, y, z ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::Rotatef( float angle, float x, float y, float z ) { +void RendererGLES2::rotatef( float angle, float x, float y, float z ) { mStack->mCurMatrix->top() *= glm::rotate( angle, glm::vec3( x, y, z ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::Scalef( float x, float y, float z ) { +void RendererGLES2::scalef( float x, float y, float z ) { mStack->mCurMatrix->top() *= glm::scale( glm::vec3( x, y, z ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::Ortho( float left, float right, float bottom, float top, float zNear, float zFar ) { +void RendererGLES2::ortho( float left, float right, float bottom, float top, float zNear, float zFar ) { mStack->mCurMatrix->top() *= glm::ortho( left, right, bottom, top , zNear, zFar ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::LookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) { +void RendererGLES2::lookAt( float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ ) { mStack->mCurMatrix->top() *= glm::lookAt( glm::vec3(eyeX, eyeY, eyeZ), glm::vec3(centerX, centerY, centerZ), glm::vec3(upX, upY, upZ) ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::Perspective ( float fovy, float aspect, float zNear, float zFar ) { +void RendererGLES2::perspective( float fovy, float aspect, float zNear, float zFar ) { mStack->mCurMatrix->top() *= glm::perspective( fovy, aspect, zNear, zFar ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::LoadMatrixf( const float * m ) { +void RendererGLES2::loadMatrixf( const float * m ) { mStack->mCurMatrix->top() = toGLMmat4( m ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::Frustum( float left, float right, float bottom, float top, float near_val, float far_val ) { +void RendererGLES2::frustum( float left, float right, float bottom, float top, float near_val, float far_val ) { mStack->mCurMatrix->top() *= glm::frustum( left, right, bottom, top, near_val, far_val ); - UpdateMatrix(); + updateMatrix(); } -void RendererGLES2::GetCurrentMatrix( unsigned int mode, float * m ) { +void RendererGLES2::getCurrentMatrix( unsigned int mode, float * m ) { switch ( mode ) { case GL_PROJECTION: case GL_PROJECTION_MATRIX: @@ -593,11 +593,11 @@ void RendererGLES2::GetCurrentMatrix( unsigned int mode, float * m ) { } } -unsigned int RendererGLES2::GetCurrentMatrixMode() { +unsigned int RendererGLES2::getCurrentMatrixMode() { return mCurrentMode; } -void RendererGLES2::MatrixMode(unsigned int mode) { +void RendererGLES2::matrixMode(unsigned int mode) { mCurrentMode = mode; switch ( mCurrentMode ) { @@ -616,7 +616,7 @@ void RendererGLES2::MatrixMode(unsigned int mode) { } } -void RendererGLES2::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { +void RendererGLES2::clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { float tX = (float)x; float tY = (float)y; float tW = (float)Width; @@ -634,10 +634,10 @@ void RendererGLES2::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int vclip_top = vclip_top * invMV; vclip_bottom = vclip_bottom * invMV; - GLi->Enable(GL_CLIP_PLANE0); - GLi->Enable(GL_CLIP_PLANE1); - GLi->Enable(GL_CLIP_PLANE2); - GLi->Enable(GL_CLIP_PLANE3); + GLi->enable(GL_CLIP_PLANE0); + GLi->enable(GL_CLIP_PLANE1); + GLi->enable(GL_CLIP_PLANE2); + GLi->enable(GL_CLIP_PLANE3); glUniform4fv( mPlanes[0], 1, static_cast( &vclip_left[0] ) ); glUniform4fv( mPlanes[1], 1, static_cast( &vclip_right[0] ) ); @@ -649,35 +649,35 @@ void RendererGLES2::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int } } -void RendererGLES2::Clip2DPlaneDisable() { +void RendererGLES2::clip2DPlaneDisable() { if ( ! mPlanesClipped.empty() ) { // This should always be true mPlanesClipped.pop_back(); } if ( mPlanesClipped.empty() ) { - GLi->Disable(GL_CLIP_PLANE0); - GLi->Disable(GL_CLIP_PLANE1); - GLi->Disable(GL_CLIP_PLANE2); - GLi->Disable(GL_CLIP_PLANE3); + GLi->disable(GL_CLIP_PLANE0); + GLi->disable(GL_CLIP_PLANE1); + GLi->disable(GL_CLIP_PLANE2); + GLi->disable(GL_CLIP_PLANE3); } else { Rectf R( mPlanesClipped.back() ); mPushClip = false; - Clip2DPlaneEnable( R.Left, R.Top, R.Right, R.Bottom ); + clip2DPlaneEnable( R.Left, R.Top, R.Right, R.Bottom ); mPushClip = true; } } -void RendererGLES2::PointSize( float size ) { +void RendererGLES2::pointSize( float size ) { #if !defined( EE_GLES2 ) && EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN glPointSize( size ); #endif - mCurShader->SetUniform( "dgl_PointSize", size ); + mCurShader->setUniform( "dgl_PointSize", size ); mPointSize = size; } -void RendererGLES2::ClipPlane( unsigned int plane, const double * equation ) { +void RendererGLES2::clipPlane( unsigned int plane, const double * equation ) { Int32 nplane = plane - GL_CLIP_PLANE0; Int32 location; @@ -686,7 +686,7 @@ void RendererGLES2::ClipPlane( unsigned int plane, const double * equation ) { } else { std::string planeNum( "dgl_ClipPlane[" + String::toStr( nplane ) + "]" ); - location = glGetUniformLocation( mCurShader->Handler(), (GLchar*)&planeNum[0] ); + location = glGetUniformLocation( mCurShader->getHandler(), (GLchar*)&planeNum[0] ); } glm::vec4 teq( equation[0], equation[1], equation[2], equation[3] ); @@ -696,26 +696,26 @@ void RendererGLES2::ClipPlane( unsigned int plane, const double * equation ) { glUniform4f( location, (float)teq[0], (float)teq[1], (float)teq[2], (float)teq[3] ); } -float RendererGLES2::PointSize() { +float RendererGLES2::pointSize() { return mPointSize; } -void RendererGLES2::ClientActiveTexture( unsigned int texture ) { +void RendererGLES2::clientActiveTexture( unsigned int texture ) { mCurActiveTex = texture - GL_TEXTURE0; if ( mCurActiveTex >= EE_MAX_TEXTURE_UNITS ) mCurActiveTex = 0; } -void RendererGLES2::TexEnvi( unsigned int target, unsigned int pname, int param ) { +void RendererGLES2::texEnvi( unsigned int target, unsigned int pname, int param ) { //! @TODO: Implement TexEnvi } -std::string RendererGLES2::GetBaseVertexShader() { +std::string RendererGLES2::getBaseVertexShader() { return mBaseVertexShader; } -int RendererGLES2::Project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) { +int RendererGLES2::project( float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *winx, float *winy, float *winz ) { glm::vec3 tv3( glm::project( glm::vec3( objx, objy, objz ), toGLMmat4( modelMatrix ), toGLMmat4( projMatrix ), glm::vec4( viewport[0], viewport[1], viewport[2], viewport[3] ) ) ); if ( NULL != winx ) @@ -730,7 +730,7 @@ int RendererGLES2::Project( float objx, float objy, float objz, const float mode return GL_TRUE; } -int RendererGLES2::UnProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) { +int RendererGLES2::unProject( float winx, float winy, float winz, const float modelMatrix[16], const float projMatrix[16], const int viewport[4], float *objx, float *objy, float *objz ) { glm::vec3 tv3( glm::unProject( glm::vec3( winx, winy, winz ), toGLMmat4( modelMatrix ), toGLMmat4( projMatrix ), glm::vec4( viewport[0], viewport[1], viewport[2], viewport[3] ) ) ); if ( NULL != objx ) diff --git a/src/eepp/graphics/scrollparallax.cpp b/src/eepp/graphics/scrollparallax.cpp index d1f2f638a..51e9ddda2 100755 --- a/src/eepp/graphics/scrollparallax.cpp +++ b/src/eepp/graphics/scrollparallax.cpp @@ -13,34 +13,34 @@ ScrollParallax::~ScrollParallax() {} ScrollParallax::ScrollParallax( Graphics::SubTexture * SubTexture, const Vector2f& Position, const Sizef& Size, const Vector2f& Speed, const ColorA& Color, const EE_BLEND_MODE& Blend ) { - Create( SubTexture, Position, Size, Speed, Color, Blend ); + create( SubTexture, Position, Size, Speed, Color, Blend ); } -Graphics::SubTexture * ScrollParallax::SubTexture() const { +Graphics::SubTexture * ScrollParallax::subTexture() const { return mSubTexture; } -void ScrollParallax::SubTexture( Graphics::SubTexture * subTexture ) { +void ScrollParallax::subTexture( Graphics::SubTexture * subTexture ) { mSubTexture = subTexture; - SetSubTexture(); + setSubTexture(); } -void ScrollParallax::SetSubTexture() { +void ScrollParallax::setSubTexture() { if ( NULL != mSubTexture ) { - mRect = mSubTexture->SrcRect(); - mRealSize = Vector2f( (Float)mSubTexture->RealSize().width(), (Float)mSubTexture->RealSize().height() ); + mRect = mSubTexture->srcRect(); + mRealSize = Vector2f( (Float)mSubTexture->realSize().width(), (Float)mSubTexture->realSize().height() ); - mTiles.x = ( (Int32)mSize.width() / mSubTexture->RealSize().width() ) + 1; - mTiles.y = ( (Int32)mSize.height() / mSubTexture->RealSize().height() ) + 1; + mTiles.x = ( (Int32)mSize.width() / mSubTexture->realSize().width() ) + 1; + mTiles.y = ( (Int32)mSize.height() / mSubTexture->realSize().height() ) + 1; } } -void ScrollParallax::SetAABB() { +void ScrollParallax::setAABB() { mAABB = Rectf( mInitPos.x, mInitPos.y, mInitPos.x + mSize.width(), mInitPos.y + mSize.height() ); } -bool ScrollParallax::Create( Graphics::SubTexture * SubTexture, const Vector2f& Position, const Sizef& Size, const Vector2f& Speed, const ColorA& Color, const EE_BLEND_MODE& Blend ) { +bool ScrollParallax::create( Graphics::SubTexture * SubTexture, const Vector2f& Position, const Sizef& Size, const Vector2f& Speed, const ColorA& Color, const EE_BLEND_MODE& Blend ) { mSubTexture = SubTexture; mPos = Position; mSize = Size; @@ -49,38 +49,38 @@ bool ScrollParallax::Create( Graphics::SubTexture * SubTexture, const Vector2f& mColor = Color; mBlend = Blend; - SetAABB(); - SetSubTexture(); + setAABB(); + setSubTexture(); return true; } -void ScrollParallax::Size( const Sizef& size ) { +void ScrollParallax::size( const Sizef& size ) { mSize = size; - SetSubTexture(); - SetAABB(); + setSubTexture(); + setAABB(); } -void ScrollParallax::Position( const Vector2f& Pos ) { +void ScrollParallax::position( const Vector2f& Pos ) { Vector2f Diff = mPos - mInitPos; mInitPos = Pos; mPos = Pos + Diff; - SetAABB(); + setAABB(); } -const Sizef& ScrollParallax::Size() const { +const Sizef& ScrollParallax::size() const { return mSize; } -const Vector2f& ScrollParallax::Position() const { +const Vector2f& ScrollParallax::position() const { return mInitPos; } -void ScrollParallax::Draw() { +void ScrollParallax::draw() { if ( NULL != mSubTexture && mAABB.Left != mAABB.Right && mAABB.Top != mAABB.Bottom && 0 != mColor.Alpha ) { mPos += mSpeed * (Float)mElapsed.elapsed().asSeconds(); @@ -125,11 +125,11 @@ void ScrollParallax::Draw() { Rect.Bottom -= (Int32)( ( Pos.y + mRealSize.height() ) - mAABB.Bottom ); } - mSubTexture->SrcRect( Rect ); - mSubTexture->ResetDestSize(); + mSubTexture->srcRect( Rect ); + mSubTexture->resetDestSize(); if ( !( Rect.Right == 0 || Rect.Bottom == 0 ) ) - mSubTexture->Draw( AABB.Left, AABB.Top, mColor, 0.f, Vector2f::One, mBlend ); + mSubTexture->draw( AABB.Left, AABB.Top, mColor, 0.f, Vector2f::One, mBlend ); } Pos.x += mRealSize.width(); @@ -143,16 +143,16 @@ void ScrollParallax::Draw() { Pos.y += mRealSize.height(); } - mSubTexture->SrcRect( mRect ); - mSubTexture->ResetDestSize(); + mSubTexture->srcRect( mRect ); + mSubTexture->resetDestSize(); } } -void ScrollParallax::Speed( const Vector2f& speed ) { +void ScrollParallax::speed( const Vector2f& speed ) { mSpeed = speed; } -const Vector2f& ScrollParallax::Speed() const { +const Vector2f& ScrollParallax::speed() const { return mSpeed; } diff --git a/src/eepp/graphics/shader.cpp b/src/eepp/graphics/shader.cpp index 562d73eb0..998507a71 100644 --- a/src/eepp/graphics/shader.cpp +++ b/src/eepp/graphics/shader.cpp @@ -9,11 +9,11 @@ namespace EE { namespace Graphics { bool Shader::sEnsure = true; -void Shader::Ensure( bool ensure ) { +void Shader::ensure( bool ensure ) { sEnsure = ensure; } -bool Shader::Ensure() { +bool Shader::ensure() { return sEnsure; } @@ -31,7 +31,7 @@ Shader::Shader( const Uint32& Type, const std::string& Filename ) { FileSystem::fileGet( Filename, PData ); - SetSource( (const char*)PData.Data, PData.DataSize ); + setSource( (const char*)PData.Data, PData.DataSize ); } else { std::string tPath = Filename; Pack * tPack = NULL; @@ -41,21 +41,21 @@ Shader::Shader( const Uint32& Type, const std::string& Filename ) { tPack->extractFileToMemory( tPath, PData ); - SetSource( reinterpret_cast ( PData.Data ), PData.DataSize ); + setSource( reinterpret_cast ( PData.Data ), PData.DataSize ); } else { eePRINTL( "Couldn't open shader object: %s", Filename.c_str() ); } } - Compile(); + compile(); } Shader::Shader( const Uint32& Type, const char * Data, const Uint32& DataSize ) { Init( Type ); - SetSource( Data, DataSize ); + setSource( Data, DataSize ); - Compile(); + compile(); } Shader::Shader( const Uint32& Type, Pack * Pack, const std::string& Filename ) { @@ -68,18 +68,18 @@ Shader::Shader( const Uint32& Type, Pack * Pack, const std::string& Filename ) { if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( Filename ) ) { Pack->extractFileToMemory( Filename, PData ); - SetSource( reinterpret_cast ( PData.Data ), PData.DataSize ); + setSource( reinterpret_cast ( PData.Data ), PData.DataSize ); } - Compile(); + compile(); } Shader::Shader( const Uint32& Type, const char ** Data, const Uint32& NumLines ) { Init( Type ); - SetSource( Data, NumLines ); + setSource( Data, NumLines ); - Compile(); + compile(); } Shader::~Shader() { @@ -99,17 +99,17 @@ void Shader::Init( const Uint32& Type ) { #endif } -void Shader::Reload() { +void Shader::reload() { Init( mType ); - Shader::Ensure( false ); - SetSource( mSource ); - Shader::Ensure( true ); + Shader::ensure( false ); + setSource( mSource ); + Shader::ensure( true ); - Compile(); + compile(); } -std::string Shader::GetName() { +std::string Shader::getName() { std::string name; if ( mFilename.size() ) { @@ -121,25 +121,25 @@ std::string Shader::GetName() { return name; } -void Shader::EnsureVersion() { +void Shader::ensureVersion() { #ifdef EE_GL3_ENABLED - if ( Shader::Ensure() && ( GLi->Version() == GLv_3 || GLi->Version() == GLv_3CP || GLi->Version() == GLv_ES2 ) ) { - eePRINTL( "Shader %s converted to programmable pipeline automatically.", GetName().c_str() ); + if ( Shader::ensure() && ( GLi->version() == GLv_3 || GLi->version() == GLv_3CP || GLi->version() == GLv_ES2 ) ) { + eePRINTL( "Shader %s converted to programmable pipeline automatically.", getName().c_str() ); if ( GL_VERTEX_SHADER == mType ) { if ( mSource.find( "ftransform" ) != std::string::npos || mSource.find("dgl_Vertex") == std::string::npos ) { - if ( GLi->Version() == GLv_3 ) { - mSource = GLi->GetRendererGL3()->GetBaseVertexShader(); - } else if ( GLi->Version() == GLv_3CP ) { - mSource = GLi->GetRendererGL3CP()->GetBaseVertexShader(); + if ( GLi->version() == GLv_3 ) { + mSource = GLi->getRendererGL3()->getBaseVertexShader(); + } else if ( GLi->version() == GLv_3CP ) { + mSource = GLi->getRendererGL3CP()->getBaseVertexShader(); } else { - mSource = GLi->GetRendererGLES2()->GetBaseVertexShader(); + mSource = GLi->getRendererGLES2()->getBaseVertexShader(); } } } else { if ( mSource.find( "gl_FragColor" ) != std::string::npos ) { #ifndef EE_GLES - if ( GLi->Version() != GLv_3CP ) + if ( GLi->version() != GLv_3CP ) #else if ( true ) #endif @@ -158,7 +158,7 @@ void Shader::EnsureVersion() { String::replaceAll( mSource, "gl_Color" , "dgl_Color" ); String::replaceAll( mSource, "gl_TexCoord" , "dgl_TexCoord" ); - if ( GLi->Version() == GLv_3CP ) { + if ( GLi->version() == GLv_3CP ) { #ifndef EE_GLES String::replaceAll( mSource, "gl_FragColor" , "dgl_FragColor" ); #endif @@ -167,7 +167,7 @@ void Shader::EnsureVersion() { } } - if ( GLi->Version() == GLv_3CP ) { + if ( GLi->version() == GLv_3CP ) { #ifndef EE_GLES String::replaceAll( mSource, "texture2D" , "texture" ); #endif @@ -175,15 +175,15 @@ void Shader::EnsureVersion() { #endif } -void Shader::SetSource( const std::string& Source ) { - if ( IsCompiled() ) { - eePRINTL( "Shader %s report: can't set source for compiled shaders", GetName().c_str() ); +void Shader::setSource( const std::string& Source ) { + if ( isCompiled() ) { + eePRINTL( "Shader %s report: can't set source for compiled shaders", getName().c_str() ); return; } mSource = Source; - EnsureVersion(); + ensureVersion(); #ifdef EE_SHADERS_SUPPORTED const char * src = reinterpret_cast ( &mSource[0] ); @@ -192,62 +192,62 @@ void Shader::SetSource( const std::string& Source ) { #endif } -void Shader::SetSource( const char** Data, const Uint32& NumLines ) { +void Shader::setSource( const char** Data, const Uint32& NumLines ) { std::string tstr; for ( Uint32 i = 0; i < NumLines; i++ ) { tstr += std::string( Data[i] ); } - SetSource( tstr ); + setSource( tstr ); } -void Shader::SetSource( const char * Data, const Uint32& DataSize ) { +void Shader::setSource( const char * Data, const Uint32& DataSize ) { std::string _dst( DataSize, 0 ); memcpy( reinterpret_cast( &_dst[0] ), reinterpret_cast( &Data[0] ), DataSize ); - SetSource( _dst ); + setSource( _dst ); } -void Shader::SetSource( const std::vector& Source ) { +void Shader::setSource( const std::vector& Source ) { std::string _dst( Source.size(), 0 ); memcpy( reinterpret_cast( &_dst[0] ), reinterpret_cast( &Source[0] ), Source.size() ); - SetSource( _dst ); + setSource( _dst ); } -bool Shader::Compile() { - if ( IsCompiled() ) { - eePRINTL( "Shader %s report: can't compile a shader twice", GetName().c_str() ); +bool Shader::compile() { + if ( isCompiled() ) { + eePRINTL( "Shader %s report: can't compile a shader twice", getName().c_str() ); return false; } #ifdef EE_SHADERS_SUPPORTED - glCompileShader( GetId() ); + glCompileShader( getId() ); mCompiled = true; int Compiled; - glGetShaderiv( GetId(), GL_COMPILE_STATUS, &Compiled ); + glGetShaderiv( getId(), GL_COMPILE_STATUS, &Compiled ); mValid = 0 != Compiled; if ( !mValid ) { int logsize = 0, logarraysize = 0; - glGetShaderiv( GetId(), GL_INFO_LOG_LENGTH, &logarraysize ); + glGetShaderiv( getId(), GL_INFO_LOG_LENGTH, &logarraysize ); if ( logarraysize > 0 ) { mCompileLog.resize( logarraysize - 1 ); - glGetShaderInfoLog( GetId(), logarraysize, &logsize, reinterpret_cast( &mCompileLog[0] ) ); + glGetShaderInfoLog( getId(), logarraysize, &logsize, reinterpret_cast( &mCompileLog[0] ) ); } - eePRINTL( "Couldn't compile shader %s. Log follows:\n", GetName().c_str() ); + eePRINTL( "Couldn't compile shader %s. Log follows:\n", getName().c_str() ); eePRINTL( mCompileLog.c_str() ); eePRINTL( mSource.c_str() ); } else { - eePRINTL( "Shader %s compiled succesfully", GetName().c_str() ); + eePRINTL( "Shader %s compiled succesfully", getName().c_str() ); } #endif @@ -255,23 +255,23 @@ bool Shader::Compile() { return mValid; } -bool Shader::IsValid() const { +bool Shader::isValid() const { return mValid; } -bool Shader::IsCompiled() const { +bool Shader::isCompiled() const { return mCompiled; } -std::string Shader::CompileLog() const { +std::string Shader::compileLog() const { return mCompileLog; } -Uint32 Shader::GetType() const { +Uint32 Shader::getType() const { return mType; } -Uint32 Shader::GetId() const { +Uint32 Shader::getId() const { return mGLId; } diff --git a/src/eepp/graphics/shaderprogram.cpp b/src/eepp/graphics/shaderprogram.cpp index 94cbdb994..b59843d0f 100644 --- a/src/eepp/graphics/shaderprogram.cpp +++ b/src/eepp/graphics/shaderprogram.cpp @@ -34,18 +34,18 @@ ShaderProgram::ShaderProgram( const std::string& name ) : mHandler(0), mId(0) { - AddToManager( name ); - Init(); + addToManager( name ); + init(); } ShaderProgram::ShaderProgram( const std::vector& Shaders, const std::string& name ) : mHandler(0), mId(0) { - AddToManager( name ); - Init(); + addToManager( name ); + init(); - AddShaders( Shaders ); + addShaders( Shaders ); Link(); } @@ -54,20 +54,20 @@ ShaderProgram::ShaderProgram( const std::string& VertexShaderFile, const std::st mHandler(0), mId(0) { - AddToManager( name ); - Init(); + addToManager( name ); + init(); VertexShader * vs = eeNew( VertexShader, ( VertexShaderFile ) ); FragmentShader * fs = eeNew( FragmentShader, ( FragmentShaderFile ) ); - if ( !vs->IsValid() || !fs->IsValid() ) { + if ( !vs->isValid() || !fs->isValid() ) { eeSAFE_DELETE( vs ); eeSAFE_DELETE( fs ); return; } - AddShader( vs ); - AddShader( fs ); + addShader( vs ); + addShader( fs ); Link(); } @@ -76,21 +76,21 @@ ShaderProgram::ShaderProgram( Pack * Pack, const std::string& VertexShaderPath, mHandler(0), mId(0) { - AddToManager( name ); - Init(); + addToManager( name ); + init(); if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( VertexShaderPath ) && -1 != Pack->exists( FragmentShaderPath ) ) { VertexShader * vs = eeNew( VertexShader, ( Pack, VertexShaderPath ) ); FragmentShader * fs = eeNew( FragmentShader, ( Pack, FragmentShaderPath ) ); - if ( !vs->IsValid() || !fs->IsValid() ) { + if ( !vs->isValid() || !fs->isValid() ) { eeSAFE_DELETE( vs ); eeSAFE_DELETE( fs ); return; } - AddShader( vs ); - AddShader( fs ); + addShader( vs ); + addShader( fs ); Link(); } @@ -100,20 +100,20 @@ ShaderProgram::ShaderProgram( const char * VertexShaderData, const Uint32& Verte mHandler(0), mId(0) { - AddToManager( name ); - Init(); + addToManager( name ); + init(); VertexShader * vs = eeNew( VertexShader, ( VertexShaderData, VertexShaderDataSize ) ); FragmentShader * fs = eeNew( FragmentShader, ( FragmentShaderData, FragmentShaderDataSize ) ); - if ( !vs->IsValid() || !fs->IsValid() ) { + if ( !vs->isValid() || !fs->isValid() ) { eeSAFE_DELETE( vs ); eeSAFE_DELETE( fs ); return; } - AddShader( vs ); - AddShader( fs ); + addShader( vs ); + addShader( fs ); Link(); } @@ -122,28 +122,28 @@ ShaderProgram::ShaderProgram( const char ** VertexShaderData, const Uint32& NumL mHandler(0), mId(0) { - AddToManager( name ); - Init(); + addToManager( name ); + init(); VertexShader * vs = eeNew( VertexShader, ( VertexShaderData, NumLinesVS ) ); FragmentShader * fs = eeNew( FragmentShader, ( FragmentShaderData, NumLinesFS ) ); - if ( !vs->IsValid() || !fs->IsValid() ) { + if ( !vs->isValid() || !fs->isValid() ) { eeSAFE_DELETE( vs ); eeSAFE_DELETE( fs ); return; } - AddShader( vs ); - AddShader( fs ); + addShader( vs ); + addShader( fs ); Link(); } ShaderProgram::~ShaderProgram() { - if ( Handler() > 0 ) { + if ( getHandler() > 0 ) { #ifdef EE_SHADERS_SUPPORTED - glDeleteProgram( Handler() ); + glDeleteProgram( getHandler() ); #endif } @@ -154,22 +154,22 @@ ShaderProgram::~ShaderProgram() { eeSAFE_DELETE( mShaders[i] ); if ( !ShaderProgramManager::instance()->isDestroying() ) { - RemoveFromManager(); + removeFromManager(); } } -void ShaderProgram::AddToManager( const std::string& name ) { - Name( name ); +void ShaderProgram::addToManager( const std::string& name ) { + setName( name ); ShaderProgramManager::instance()->add( this ); } -void ShaderProgram::RemoveFromManager() { +void ShaderProgram::removeFromManager() { ShaderProgramManager::instance()->remove( this, false ); } -void ShaderProgram::Init() { - if ( GLi->ShadersSupported() && 0 == Handler() ) { +void ShaderProgram::init() { + if ( GLi->shadersSupported() && 0 == getHandler() ) { #ifdef EE_SHADERS_SUPPORTED mHandler = glCreateProgram(); #endif @@ -181,18 +181,18 @@ void ShaderProgram::Init() { } } -void ShaderProgram::Reload() { +void ShaderProgram::reload() { mHandler = 0; - Init(); + init(); std::vector tmpShader = mShaders; mShaders.clear(); for ( unsigned int i = 0; i < tmpShader.size(); i++ ) { - tmpShader[i]->Reload(); - AddShader( tmpShader[i] ); + tmpShader[i]->reload(); + addShader( tmpShader[i] ); } Link(); @@ -202,41 +202,41 @@ void ShaderProgram::Reload() { } } -void ShaderProgram::AddShader( Shader* Shader ) { - if ( !Shader->IsValid() ) { +void ShaderProgram::addShader( Shader* Shader ) { + if ( !Shader->isValid() ) { eePRINTL( "ShaderProgram::AddShader() %s: Cannot add invalid shader", mName.c_str() ); return; } - if ( 0 != Handler() ) { + if ( 0 != getHandler() ) { #ifdef EE_SHADERS_SUPPORTED - glAttachShader( Handler(), Shader->GetId() ); + glAttachShader( getHandler(), Shader->getId() ); #endif mShaders.push_back( Shader ); } } -void ShaderProgram::AddShaders( const std::vector& Shaders ) { +void ShaderProgram::addShaders( const std::vector& Shaders ) { for ( Uint32 i = 0; i < Shaders.size(); i++ ) - AddShader( Shaders[i] ); + addShader( Shaders[i] ); } bool ShaderProgram::Link() { #ifdef EE_SHADERS_SUPPORTED - glLinkProgram( Handler() ); + glLinkProgram( getHandler() ); Int32 linked; - glGetProgramiv( Handler(), GL_LINK_STATUS, &linked ); + glGetProgramiv( getHandler(), GL_LINK_STATUS, &linked ); mValid = 0 != linked; int logsize = 0, logarraysize = 0; - glGetProgramiv( Handler(), GL_INFO_LOG_LENGTH, &logarraysize ); + glGetProgramiv( getHandler(), GL_INFO_LOG_LENGTH, &logarraysize ); if ( logarraysize > 0 ) { mLinkLog.resize( logarraysize ); - glGetProgramInfoLog( Handler(), logarraysize, &logsize, reinterpret_cast( &mLinkLog[0] ) ); + glGetProgramInfoLog( getHandler(), logarraysize, &logsize, reinterpret_cast( &mLinkLog[0] ) ); mLinkLog.resize( logsize ); } @@ -256,53 +256,53 @@ bool ShaderProgram::Link() { return mValid; } -void ShaderProgram::Bind() const { - GlobalBatchRenderer::instance()->Draw(); +void ShaderProgram::bind() const { + GlobalBatchRenderer::instance()->draw(); - GLi->SetShader( const_cast( this ) ); + GLi->setShader( const_cast( this ) ); } -void ShaderProgram::Unbind() const { - GlobalBatchRenderer::instance()->Draw(); +void ShaderProgram::unbind() const { + GlobalBatchRenderer::instance()->draw(); - GLi->SetShader( NULL ); + GLi->setShader( NULL ); } -Int32 ShaderProgram::UniformLocation( const std::string& Name ) { +Int32 ShaderProgram::uniformLocation( const std::string& Name ) { if ( !mValid ) return -1; std::map::iterator it = mUniformLocations.find( Name ); if ( it == mUniformLocations.end() ) { #ifdef EE_SHADERS_SUPPORTED - Int32 Location = glGetUniformLocation( Handler(), Name.c_str() ); + Int32 Location = glGetUniformLocation( getHandler(), Name.c_str() ); mUniformLocations[Name] = Location; #endif } return mUniformLocations[Name]; } -Int32 ShaderProgram::AttributeLocation( const std::string& Name ) { +Int32 ShaderProgram::attributeLocation( const std::string& Name ) { if ( !mValid ) return -1; std::map::iterator it = mAttributeLocations.find( Name ); if ( it == mAttributeLocations.end() ) { #ifdef EE_SHADERS_SUPPORTED - Int32 Location = glGetAttribLocation( Handler(), Name.c_str() ); + Int32 Location = glGetAttribLocation( getHandler(), Name.c_str() ); mAttributeLocations[Name] = Location; #endif } return mAttributeLocations[Name]; } -void ShaderProgram::InvalidateLocations() { +void ShaderProgram::invalidateLocations() { mUniformLocations.clear(); mAttributeLocations.clear(); } -bool ShaderProgram::SetUniform( const std::string& Name, float Value ) { - Int32 Location = UniformLocation( Name ); +bool ShaderProgram::setUniform( const std::string& Name, float Value ) { + Int32 Location = uniformLocation( Name ); if ( Location >= 0 ) { #ifdef EE_SHADERS_SUPPORTED @@ -313,8 +313,8 @@ bool ShaderProgram::SetUniform( const std::string& Name, float Value ) { return ( Location >= 0 ); } -bool ShaderProgram::SetUniform( const std::string& Name, Vector2ff Value ) { - Int32 Location = UniformLocation( Name ); +bool ShaderProgram::setUniform( const std::string& Name, Vector2ff Value ) { + Int32 Location = uniformLocation( Name ); if ( Location >= 0 ) { #ifdef EE_SHADERS_SUPPORTED @@ -325,8 +325,8 @@ bool ShaderProgram::SetUniform( const std::string& Name, Vector2ff Value ) { return ( Location >= 0 ); } -bool ShaderProgram::SetUniform( const std::string& Name, Vector3ff Value ) { - Int32 Location = UniformLocation( Name ); +bool ShaderProgram::setUniform( const std::string& Name, Vector3ff Value ) { + Int32 Location = uniformLocation( Name ); if ( Location >= 0 ) { #ifdef EE_SHADERS_SUPPORTED @@ -337,8 +337,8 @@ bool ShaderProgram::SetUniform( const std::string& Name, Vector3ff Value ) { return ( Location >= 0 ); } -bool ShaderProgram::SetUniform( const std::string& Name, float x, float y, float z, float w ) { - Int32 Location = UniformLocation( Name ); +bool ShaderProgram::setUniform( const std::string& Name, float x, float y, float z, float w ) { + Int32 Location = uniformLocation( Name ); if ( Location >= 0 ) { #ifdef EE_SHADERS_SUPPORTED @@ -349,8 +349,8 @@ bool ShaderProgram::SetUniform( const std::string& Name, float x, float y, float return ( Location >= 0 ); } -bool ShaderProgram::SetUniform( const std::string& Name, Int32 Value ) { - Int32 Location = UniformLocation( Name ); +bool ShaderProgram::setUniform( const std::string& Name, Int32 Value ) { + Int32 Location = uniformLocation( Name ); if ( Location >= 0 ) { #ifdef EE_SHADERS_SUPPORTED @@ -361,7 +361,7 @@ bool ShaderProgram::SetUniform( const std::string& Name, Int32 Value ) { return ( Location >= 0 ); } -bool ShaderProgram::SetUniform( const Int32& Location, Int32 Value ) { +bool ShaderProgram::setUniform( const Int32& Location, Int32 Value ) { if ( -1 != Location ) { #ifdef EE_SHADERS_SUPPORTED glUniform1i( Location, Value ); @@ -373,7 +373,7 @@ bool ShaderProgram::SetUniform( const Int32& Location, Int32 Value ) { return false; } -bool ShaderProgram::SetUniform( const Int32& Location, float Value ) { +bool ShaderProgram::setUniform( const Int32& Location, float Value ) { if ( -1 != Location ) { #ifdef EE_SHADERS_SUPPORTED glUniform1f( Location, Value ); @@ -385,7 +385,7 @@ bool ShaderProgram::SetUniform( const Int32& Location, float Value ) { return false; } -bool ShaderProgram::SetUniform( const Int32& Location, Vector2ff Value ) { +bool ShaderProgram::setUniform( const Int32& Location, Vector2ff Value ) { if ( -1 != Location ) { #ifdef EE_SHADERS_SUPPORTED glUniform2fv( Location, 1, reinterpret_cast( &Value ) ); @@ -397,7 +397,7 @@ bool ShaderProgram::SetUniform( const Int32& Location, Vector2ff Value ) { return false; } -bool ShaderProgram::SetUniform( const Int32& Location, Vector3ff Value ) { +bool ShaderProgram::setUniform( const Int32& Location, Vector3ff Value ) { if ( -1 != Location ) { #ifdef EE_SHADERS_SUPPORTED glUniform3fv( Location, 1, reinterpret_cast( &Value ) ); @@ -409,7 +409,7 @@ bool ShaderProgram::SetUniform( const Int32& Location, Vector3ff Value ) { return false; } -bool ShaderProgram::SetUniform( const Int32& Location, float x, float y, float z, float w ) { +bool ShaderProgram::setUniform( const Int32& Location, float x, float y, float z, float w ) { if ( -1 != Location ) { #ifdef EE_SHADERS_SUPPORTED glUniform4f( Location, x, y, z, w ); @@ -421,7 +421,7 @@ bool ShaderProgram::SetUniform( const Int32& Location, float x, float y, float z return false; } -bool ShaderProgram::SetUniformMatrix( const Int32& Location, const float * Value ) { +bool ShaderProgram::setUniformMatrix( const Int32& Location, const float * Value ) { if ( -1 != Location ) { #ifdef EE_SHADERS_SUPPORTED glUniformMatrix4fv( Location, 1, false, Value ); @@ -433,8 +433,8 @@ bool ShaderProgram::SetUniformMatrix( const Int32& Location, const float * Value return false; } -bool ShaderProgram::SetUniformMatrix( const std::string Name, const float * Value ) { - Int32 Location = UniformLocation( Name ); +bool ShaderProgram::setUniformMatrix( const std::string Name, const float * Value ) { + Int32 Location = uniformLocation( Name ); if ( Location >= 0 ) { #ifdef EE_SHADERS_SUPPORTED @@ -445,40 +445,40 @@ bool ShaderProgram::SetUniformMatrix( const std::string Name, const float * Valu return ( Location >= 0 ); } -const std::string& ShaderProgram::Name() const { +const std::string& ShaderProgram::getName() const { return mName; } -void ShaderProgram::Name( const std::string& name ) { +void ShaderProgram::setName( const std::string& name ) { mName = name; mId = String::hash( mName ); Uint32 NameCount = ShaderProgramManager::instance()->exists( mName ); if ( 0 != NameCount || 0 == name.size() ) { - Name( name + String::toStr( NameCount + 1 ) ); + setName( name + String::toStr( NameCount + 1 ) ); } } -void ShaderProgram::SetReloadCb( ShaderProgramReloadCb Cb ) { +void ShaderProgram::setReloadCb( ShaderProgramReloadCb Cb ) { mReloadCb = Cb; } -void ShaderProgram::EnableVertexAttribArray( const std::string& Name ) { - EnableVertexAttribArray( AttributeLocation( Name ) ); +void ShaderProgram::enableVertexAttribArray( const std::string& Name ) { + enableVertexAttribArray( attributeLocation( Name ) ); } -void ShaderProgram::EnableVertexAttribArray( const Int32& Location ) { +void ShaderProgram::enableVertexAttribArray( const Int32& Location ) { #ifdef EE_SHADERS_SUPPORTED glEnableVertexAttribArray( Location ); #endif } -void ShaderProgram::DisableVertexAttribArray( const std::string& Name ) { - DisableVertexAttribArray( AttributeLocation( Name ) ); +void ShaderProgram::disableVertexAttribArray( const std::string& Name ) { + disableVertexAttribArray( attributeLocation( Name ) ); } -void ShaderProgram::DisableVertexAttribArray( const Int32& Location ) { +void ShaderProgram::disableVertexAttribArray( const Int32& Location ) { #ifdef EE_SHADERS_SUPPORTED glDisableVertexAttribArray( Location ); #endif diff --git a/src/eepp/graphics/shaderprogrammanager.cpp b/src/eepp/graphics/shaderprogrammanager.cpp index 7c099b5cb..86c9a3e13 100644 --- a/src/eepp/graphics/shaderprogrammanager.cpp +++ b/src/eepp/graphics/shaderprogrammanager.cpp @@ -12,11 +12,11 @@ ShaderProgramManager::~ShaderProgramManager() { } -void ShaderProgramManager::Reload() { +void ShaderProgramManager::reload() { std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) - (*it)->Reload(); + (*it)->reload(); } }} diff --git a/src/eepp/graphics/sprite.cpp b/src/eepp/graphics/sprite.cpp index 519421ecb..6dcc6b91b 100755 --- a/src/eepp/graphics/sprite.cpp +++ b/src/eepp/graphics/sprite.cpp @@ -50,7 +50,7 @@ Sprite::Sprite( const std::string& name, const std::string& extension, TextureAt mUserData( NULL ) { mCb.Reset(); - AddFramesByPattern( name, extension, SearchInTextureAtlas ); + addFramesByPattern( name, extension, SearchInTextureAtlas ); } Sprite::Sprite( SubTexture * SubTexture ) : @@ -72,7 +72,7 @@ Sprite::Sprite( SubTexture * SubTexture ) : mUserData( NULL ) { mCb.Reset(); - CreateStatic( SubTexture ); + createStatic( SubTexture ); } Sprite::Sprite( const Uint32& TexId, const Sizef &DestSize, const Vector2i &Offset, const Recti& TexSector ) : @@ -94,7 +94,7 @@ Sprite::Sprite( const Uint32& TexId, const Sizef &DestSize, const Vector2i &Offs mUserData( NULL ) { mCb.Reset(); - CreateStatic( TexId, DestSize, Offset, TexSector ); + createStatic( TexId, DestSize, Offset, TexSector ); } Sprite::~Sprite() { @@ -132,7 +132,7 @@ Sprite& Sprite::operator =( const Sprite& Other ) { return *this; } -Sprite * Sprite::Copy() { +Sprite * Sprite::copy() { Sprite * Spr = eeNew( Sprite, () ); Spr->mFrames = mFrames; @@ -165,15 +165,15 @@ Sprite * Sprite::Copy() { return Spr; } -void Sprite::ClearFrame() { +void Sprite::clearFrame() { for ( unsigned int i = 0; i < mFrames.size(); i++ ) mFrames[i].Spr.clear(); mFrames.clear(); } -void Sprite::Reset() { - ClearFrame(); +void Sprite::reset() { + clearFrame(); mFlags = SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED; @@ -193,10 +193,10 @@ void Sprite::Reset() { mSubFrames = 1; mAnimTo = 0; - DisableVertexColors(); + disableVertexColors(); } -void Sprite::CurrentFrame ( unsigned int CurFrame ) { +void Sprite::currentFrame ( unsigned int CurFrame ) { if ( CurFrame ) CurFrame--; @@ -214,19 +214,19 @@ void Sprite::CurrentFrame ( unsigned int CurFrame ) { } } -void Sprite::CurrentSubFrame( const unsigned int& CurSubFrame ) { +void Sprite::currentSubFrame( const unsigned int& CurSubFrame ) { if ( CurSubFrame < mSubFrames ) mCurrentSubFrame = CurSubFrame; } -Quad2f Sprite::GetQuad() { +Quad2f Sprite::getQuad() { SubTexture * S; - if ( mFrames.size() && ( S = GetCurrentSubTexture() ) ) { + if ( mFrames.size() && ( S = getCurrentSubTexture() ) ) { Rectf TmpR( mPos.x, mPos.y, - mPos.x + S->DestSize().x, - mPos.y + S->DestSize().y + mPos.x + S->destSize().x, + mPos.y + S->destSize().y ); Quad2f Q = Quad2f( Vector2f( TmpR.Left, TmpR.Top ), @@ -276,15 +276,15 @@ Quad2f Sprite::GetQuad() { return Quad2f(); } -eeAABB Sprite::GetAABB() { +eeAABB Sprite::getAABB() { eeAABB TmpR; SubTexture * S; - if ( mFrames.size() && ( S = GetCurrentSubTexture() ) ) { + if ( mFrames.size() && ( S = getCurrentSubTexture() ) ) { if ( mAngle != 0 || mEffect >= 4 ) { - return GetQuad().toAABB(); + return getQuad().toAABB(); } else { // The method used if mAngle != 0 works for mAngle = 0, but i prefer to use the faster way - TmpR = Rectf( mPos.x, mPos.y, mPos.x + S->DestSize().x, mPos.y + S->DestSize().y ); + TmpR = Rectf( mPos.x, mPos.y, mPos.x + S->destSize().x, mPos.y + S->destSize().y ); Vector2f Center; @@ -303,20 +303,20 @@ eeAABB Sprite::GetAABB() { return TmpR; } -const Vector2f Sprite::Position() const { +const Vector2f Sprite::position() const { return mPos; } -void Sprite::Position(const Float& x, const Float& y) { +void Sprite::position(const Float& x, const Float& y) { mPos.x = x; mPos.y = y; } -void Sprite::Position( const Vector2f& NewPos ) { +void Sprite::position( const Vector2f& NewPos ) { mPos = NewPos; } -void Sprite::UpdateVertexColors( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { +void Sprite::updateVertexColors( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { if ( NULL == mVertexColors ) mVertexColors = eeNewArray( ColorA, 4 ); @@ -326,28 +326,28 @@ void Sprite::UpdateVertexColors( const ColorA& Color0, const ColorA& Color1, con mVertexColors[3] = Color3; } -void Sprite::DisableVertexColors() { +void Sprite::disableVertexColors() { eeSAFE_DELETE_ARRAY( mVertexColors ); } -unsigned int Sprite::FramePos() { +unsigned int Sprite::framePos() { mFrames.push_back( Frame() ); return (unsigned int)mFrames.size() - 1; } -bool Sprite::CreateStatic( SubTexture * SubTexture ) { - Reset(); +bool Sprite::createStatic( SubTexture * SubTexture ) { + reset(); - AddFrame( SubTexture ); + addFrame( SubTexture ); return true; } -bool Sprite::CreateStatic( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector ) { - if ( TextureFactory::instance()->TextureIdExists( TexId ) ) { - Reset(); +bool Sprite::createStatic( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector ) { + if ( TextureFactory::instance()->textureIdExists( TexId ) ) { + reset(); - AddFrame( TexId, DestSize, Offset, TexSector ); + addFrame( TexId, DestSize, Offset, TexSector ); return true; } @@ -355,8 +355,8 @@ bool Sprite::CreateStatic( const Uint32& TexId, const Sizef& DestSize, const Vec return false; } -void Sprite::CreateAnimation( const unsigned int& SubFramesNum ) { - Reset(); +void Sprite::createAnimation( const unsigned int& SubFramesNum ) { + reset(); if ( SubFramesNum < 1 ) mSubFrames = 1; @@ -364,11 +364,11 @@ void Sprite::CreateAnimation( const unsigned int& SubFramesNum ) { mSubFrames = SubFramesNum; } -bool Sprite::AddFrames( const std::vector SubTextures ) { +bool Sprite::addFrames( const std::vector SubTextures ) { if ( SubTextures.size() ) { for ( unsigned int i = 0; i < SubTextures.size(); i++ ) { if ( NULL != SubTextures[i] ) { - AddFrame( SubTextures[i] ); + addFrame( SubTextures[i] ); } } @@ -378,11 +378,11 @@ bool Sprite::AddFrames( const std::vector SubTextures ) { return false; } -bool Sprite::AddFramesByPatternId( const Uint32& SubTextureId, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { - std::vector SubTextures = TextureAtlasManager::instance()->GetSubTexturesByPatternId( SubTextureId, extension, SearchInTextureAtlas ); +bool Sprite::addFramesByPatternId( const Uint32& SubTextureId, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { + std::vector SubTextures = TextureAtlasManager::instance()->getSubTexturesByPatternId( SubTextureId, extension, SearchInTextureAtlas ); if ( SubTextures.size() ) { - AddFrames( SubTextures ); + addFrames( SubTextures ); return true; } @@ -392,11 +392,11 @@ bool Sprite::AddFramesByPatternId( const Uint32& SubTextureId, const std::string return false; } -bool Sprite::AddFramesByPattern( const std::string& name, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { - std::vector SubTextures = TextureAtlasManager::instance()->GetSubTexturesByPattern( name, extension, SearchInTextureAtlas ); +bool Sprite::addFramesByPattern( const std::string& name, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { + std::vector SubTextures = TextureAtlasManager::instance()->getSubTexturesByPattern( name, extension, SearchInTextureAtlas ); if ( SubTextures.size() ) { - AddFrames( SubTextures ); + addFrames( SubTextures ); return true; } @@ -406,7 +406,7 @@ bool Sprite::AddFramesByPattern( const std::string& name, const std::string& ext return false; } -bool Sprite::AddSubFrame( SubTexture * SubTexture, const unsigned int& NumFrame, const unsigned int& NumSubFrame ) { +bool Sprite::addSubFrame( SubTexture * SubTexture, const unsigned int& NumFrame, const unsigned int& NumSubFrame ) { unsigned int NF, NSF; if ( NumFrame >= mFrames.size() ) @@ -431,60 +431,60 @@ bool Sprite::AddSubFrame( SubTexture * SubTexture, const unsigned int& NumFrame, return false; } -unsigned int Sprite::AddFrame( SubTexture * SubTexture ) { - unsigned int id = FramePos(); +unsigned int Sprite::addFrame( SubTexture * SubTexture ) { + unsigned int id = framePos(); - AddSubFrame( SubTexture, id, mCurrentSubFrame ); + addSubFrame( SubTexture, id, mCurrentSubFrame ); return id; } -unsigned int Sprite::AddFrame( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector ) { - unsigned int id = FramePos(); +unsigned int Sprite::addFrame( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector ) { + unsigned int id = framePos(); - if ( AddSubFrame( TexId, id, mCurrentSubFrame, DestSize, Offset, TexSector ) ) + if ( addSubFrame( TexId, id, mCurrentSubFrame, DestSize, Offset, TexSector ) ) return id; return 0; } -bool Sprite::AddSubFrame(const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector) { - if ( !TextureFactory::instance()->TextureIdExists( TexId ) ) +bool Sprite::addSubFrame(const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector) { + if ( !TextureFactory::instance()->textureIdExists( TexId ) ) return false; - Texture * Tex = TextureFactory::instance()->GetTexture( TexId ); + Texture * Tex = TextureFactory::instance()->getTexture( TexId ); SubTexture * S = GlobalTextureAtlas::instance()->add( eeNew( SubTexture, () ) ); - S->Texture( TexId ); + S->texture( TexId ); if ( TexSector.Right > 0 && TexSector.Bottom > 0 ) - S->SrcRect( TexSector ); + S->srcRect( TexSector ); else - S->SrcRect( Recti( 0, 0, (Int32)Tex->ImgWidth(), (Int32)Tex->ImgHeight() ) ); + S->srcRect( Recti( 0, 0, (Int32)Tex->imgWidth(), (Int32)Tex->imgHeight() ) ); Sizef destSize( DestSize ); if ( destSize.x <= 0 ) { - destSize.x = static_cast ( S->SrcRect().Right - S->SrcRect().Left ); + destSize.x = static_cast ( S->srcRect().Right - S->srcRect().Left ); } if ( destSize.y <= 0 ) { - destSize.y = static_cast ( S->SrcRect().Bottom - S->SrcRect().Top ); + destSize.y = static_cast ( S->srcRect().Bottom - S->srcRect().Top ); } - S->DestSize( destSize ); - S->Offset( Offset ); + S->destSize( destSize ); + S->offset( Offset ); - AddSubFrame( S, NumFrame, NumSubFrame ); + addSubFrame( S, NumFrame, NumSubFrame ); return true; } -void Sprite::Update() { - Update( Engine::instance()->elapsed() ); +void Sprite::update() { + update( Engine::instance()->elapsed() ); } -void Sprite::Update( const Time& ElapsedTime ) { +void Sprite::update( const Time& ElapsedTime ) { if ( mFrames.size() > 1 && !SPR_FGET( SPRITE_FLAG_ANIM_PAUSED ) && Time::Zero != ElapsedTime ) { unsigned int Size = (unsigned int)mFrames.size() - 1; @@ -502,9 +502,9 @@ void Sprite::Update( const Time& ElapsedTime ) { if ( mAnimTo == mCurrentFrame ) { mFlags &= ~SPRITE_FLAG_ANIM_TO_FRAME_AND_STOP; - GoToAndStop( mAnimTo ); + goToAndStop( mAnimTo ); - FireEvent( SPRITE_EVENT_END_ANIM_TO ); + fireEvent( SPRITE_EVENT_END_ANIM_TO ); return; } @@ -514,34 +514,34 @@ void Sprite::Update( const Time& ElapsedTime ) { if ( mRepeations < 0 ) { mfCurrentFrame = 0.0f; mCurrentFrame = 0; - FireEvent( SPRITE_EVENT_FIRST_FRAME ); + fireEvent( SPRITE_EVENT_FIRST_FRAME ); } else { if ( mRepeations == 0 ) { mfCurrentFrame = (Float)Size; mCurrentFrame = Size; - FireEvent( SPRITE_EVENT_LAST_FRAME ); + fireEvent( SPRITE_EVENT_LAST_FRAME ); } else { mfCurrentFrame = 0.0f; mCurrentFrame = 0; mRepeations--; - FireEvent( SPRITE_EVENT_FIRST_FRAME ); + fireEvent( SPRITE_EVENT_FIRST_FRAME ); } } } else if ( SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) && mfCurrentFrame < 0.0f ) { if ( mRepeations < 0 ) { mfCurrentFrame = Size + 1.0f; mCurrentFrame = Size; - FireEvent( SPRITE_EVENT_LAST_FRAME ); + fireEvent( SPRITE_EVENT_LAST_FRAME ); } else { if ( mRepeations == 0 ) { mfCurrentFrame = 0.0f; mCurrentFrame = 0; - FireEvent( SPRITE_EVENT_FIRST_FRAME ); + fireEvent( SPRITE_EVENT_FIRST_FRAME ); } else { mfCurrentFrame = Size + 1.0f; mCurrentFrame = Size; mRepeations--; - FireEvent( SPRITE_EVENT_LAST_FRAME ); + fireEvent( SPRITE_EVENT_LAST_FRAME ); } } } @@ -550,17 +550,17 @@ void Sprite::Update( const Time& ElapsedTime ) { if ( SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) ) { mfCurrentFrame = 0.0f; mCurrentFrame = 0; - FireEvent( SPRITE_EVENT_FIRST_FRAME ); + fireEvent( SPRITE_EVENT_FIRST_FRAME ); } else { mfCurrentFrame = (Float)Size; mCurrentFrame = Size; - FireEvent( SPRITE_EVENT_LAST_FRAME ); + fireEvent( SPRITE_EVENT_LAST_FRAME ); } } } } -unsigned int Sprite::GetEndFrame() { +unsigned int Sprite::getEndFrame() { if ( SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) ) { return 0; } else { @@ -568,7 +568,7 @@ unsigned int Sprite::GetEndFrame() { } } -void Sprite::SetReverseFromStart() { +void Sprite::setReverseFromStart() { if ( !SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) ) mFlags |= SPRITE_FLAG_REVERSE_ANIM; @@ -578,34 +578,34 @@ void Sprite::SetReverseFromStart() { mCurrentFrame = Size; } -void Sprite::Draw( const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect ) { +void Sprite::draw( const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect ) { if ( SPR_FGET( SPRITE_FLAG_AUTO_ANIM ) ) - Update(); + update(); - SubTexture * S = GetCurrentSubTexture(); + SubTexture * S = getCurrentSubTexture(); if ( S == NULL ) return; if ( NULL == mVertexColors ) - S->Draw( mPos.x, mPos.y, mColor, mAngle, mScale, Blend, Effect, mOrigin ); + S->draw( mPos.x, mPos.y, mColor, mAngle, mScale, Blend, Effect, mOrigin ); else - S->Draw( mPos.x, mPos.y, mAngle, mScale, mVertexColors[0], mVertexColors[1], mVertexColors[2], mVertexColors[3], Blend, Effect, mOrigin ); + S->draw( mPos.x, mPos.y, mAngle, mScale, mVertexColors[0], mVertexColors[1], mVertexColors[2], mVertexColors[3], Blend, Effect, mOrigin ); } -void Sprite::Draw() { - Draw( mBlend, mEffect ); +void Sprite::draw() { + draw( mBlend, mEffect ); } -void Sprite::Draw( const EE_BLEND_MODE& Blend ) { - Draw( Blend, mEffect ); +void Sprite::draw( const EE_BLEND_MODE& Blend ) { + draw( Blend, mEffect ); } -void Sprite::Draw( const EE_RENDER_MODE& Effect ) { - Draw( mBlend, Effect ); +void Sprite::draw( const EE_RENDER_MODE& Effect ) { + draw( mBlend, Effect ); } -unsigned int Sprite::GetFrame( const unsigned int& FrameNum ) { +unsigned int Sprite::getFrame( const unsigned int& FrameNum ) { unsigned int FN; if ( FrameNum >= mFrames.size() ) @@ -616,7 +616,7 @@ unsigned int Sprite::GetFrame( const unsigned int& FrameNum ) { return FN; } -unsigned int Sprite::GetSubFrame( const unsigned int& SubFrame ) { +unsigned int Sprite::getSubFrame( const unsigned int& SubFrame ) { unsigned int SFN; if ( SubFrame >= mSubFrames ) @@ -627,44 +627,44 @@ unsigned int Sprite::GetSubFrame( const unsigned int& SubFrame ) { return SFN; } -Vector2i Sprite::Offset() { - SubTexture* S = GetCurrentSubTexture(); +Vector2i Sprite::offset() { + SubTexture* S = getCurrentSubTexture(); if ( S != NULL ) - return S->Offset(); + return S->offset(); return Vector2i(); } -void Sprite::Offset( const Vector2i& offset ) { - SubTexture* S = GetCurrentSubTexture(); +void Sprite::offset( const Vector2i& offset ) { + SubTexture* S = getCurrentSubTexture(); if ( S != NULL ) { - S->Offset( offset ); + S->offset( offset ); } } -void Sprite::Size( const Sizef& Size, const unsigned int& FrameNum, const unsigned int& SubFrame ) { - mFrames[ GetFrame(FrameNum) ].Spr[ GetSubFrame(SubFrame) ]->DestSize( Size ); +void Sprite::size( const Sizef& Size, const unsigned int& FrameNum, const unsigned int& SubFrame ) { + mFrames[ getFrame(FrameNum) ].Spr[ getSubFrame(SubFrame) ]->destSize( Size ); } -void Sprite::Size( const Sizef& Size ) { - mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->DestSize( Size ); +void Sprite::size( const Sizef& Size ) { + mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->destSize( Size ); } -Sizef Sprite::Size( const unsigned int& FrameNum, const unsigned int& SubFrame ) { - return mFrames[ GetFrame(FrameNum) ].Spr[ GetSubFrame(SubFrame) ]->DestSize(); +Sizef Sprite::size( const unsigned int& FrameNum, const unsigned int& SubFrame ) { + return mFrames[ getFrame(FrameNum) ].Spr[ getSubFrame(SubFrame) ]->destSize(); } -Sizef Sprite::Size() { - return mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->DestSize(); +Sizef Sprite::size() { + return mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->destSize(); } -void Sprite::SetRepeations( const int& Repeations ) { +void Sprite::setRepetitions( const int& Repeations ) { mRepeations = Repeations; } -void Sprite::AutoAnimate( const bool& Autoanim ) { +void Sprite::autoAnimate( const bool& Autoanim ) { if ( Autoanim ) { if ( !SPR_FGET( SPRITE_FLAG_AUTO_ANIM ) ) mFlags |= SPRITE_FLAG_AUTO_ANIM; @@ -675,80 +675,80 @@ void Sprite::AutoAnimate( const bool& Autoanim ) { } -bool Sprite::AutoAnimate() const { +bool Sprite::autoAnimate() const { return 0 != SPR_FGET( SPRITE_FLAG_AUTO_ANIM ); } -SubTexture* Sprite::GetCurrentSubTexture() { +SubTexture* Sprite::getCurrentSubTexture() { if ( mFrames.size() ) return mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]; return NULL; } -SubTexture * Sprite::GetSubTexture( const unsigned int& frame ) { +SubTexture * Sprite::getSubTexture( const unsigned int& frame ) { if ( frame < mFrames.size() ) return mFrames[ frame ].Spr[ mCurrentSubFrame ]; return NULL; } -SubTexture * Sprite::GetSubTexture( const unsigned int& frame, const unsigned int& SubFrame ) { +SubTexture * Sprite::getSubTexture( const unsigned int& frame, const unsigned int& SubFrame ) { if ( frame < mFrames.size() ) return mFrames[ frame ].Spr[ SubFrame ]; return NULL; } -void Sprite::X( const Float& X ) { +void Sprite::x( const Float& X ) { mPos.x = X; } -Float Sprite::X() const { +Float Sprite::x() const { return mPos.x; } -void Sprite::Y( const Float& Y ) { +void Sprite::y( const Float& Y ) { mPos.y = Y; } -Float Sprite::Y() const { +Float Sprite::y() const { return mPos.y; } -void Sprite::Angle( const Float& Angle) { +void Sprite::angle( const Float& Angle) { mAngle = Angle; } -Float Sprite::Angle() const { +Float Sprite::angle() const { return mAngle; } -void Sprite::Scale( const Float& Scale ) { - this->Scale( Vector2f( Scale, Scale ) ); +void Sprite::scale( const Float& Scale ) { + this->scale( Vector2f( Scale, Scale ) ); } -void Sprite::Scale( const Vector2f& Scale ) { +void Sprite::scale( const Vector2f& Scale ) { mScale = Scale; } -const Vector2f& Sprite::Scale() const { +const Vector2f& Sprite::scale() const { return mScale; } -void Sprite::AnimSpeed( const Float& AnimSpeed ) { +void Sprite::animSpeed( const Float& AnimSpeed ) { mAnimSpeed = AnimSpeed; } -Float Sprite::AnimSpeed() const { +Float Sprite::animSpeed() const { return mAnimSpeed; } -bool Sprite::AnimPaused() const { +bool Sprite::animPaused() const { return 0 != SPR_FGET( SPRITE_FLAG_ANIM_PAUSED ); } -void Sprite::AnimPaused( const bool& Pause ) { +void Sprite::animPaused( const bool& Pause ) { if ( Pause ) { if ( !SPR_FGET( SPRITE_FLAG_ANIM_PAUSED ) ) mFlags |= SPRITE_FLAG_ANIM_PAUSED; @@ -758,55 +758,55 @@ void Sprite::AnimPaused( const bool& Pause ) { } } -void Sprite::Color( const ColorA& Color) { +void Sprite::color( const ColorA& Color) { mColor = Color; } -const ColorA& Sprite::Color() const { +const ColorA& Sprite::color() const { return mColor; } -void Sprite::Alpha( const Uint8& Alpha ) { +void Sprite::alpha( const Uint8& Alpha ) { mColor.Alpha = Alpha; } -const Uint8& Sprite::Alpha() const { +const Uint8& Sprite::alpha() const { return mColor.Alpha; } -const unsigned int& Sprite::CurrentFrame() const { +const unsigned int& Sprite::currentFrame() const { return mCurrentFrame; } -const Float& Sprite::ExactCurrentFrame() const { +const Float& Sprite::exactCurrentFrame() const { return mfCurrentFrame; } -void Sprite::ExactCurrentFrame( const Float& CurrentFrame ) { +void Sprite::exactCurrentFrame( const Float& CurrentFrame ) { mfCurrentFrame = CurrentFrame; } -const unsigned int& Sprite::CurrentSubFrame() const { +const unsigned int& Sprite::currentSubFrame() const { return mCurrentSubFrame; } -void Sprite::RenderMode( const EE_RENDER_MODE& Effect ) { +void Sprite::renderMode( const EE_RENDER_MODE& Effect ) { mEffect = Effect; } -const EE_RENDER_MODE& Sprite::RenderMode() const { +const EE_RENDER_MODE& Sprite::renderMode() const { return mEffect; } -void Sprite::BlendMode( const EE_BLEND_MODE& Blend ) { +void Sprite::blendMode( const EE_BLEND_MODE& Blend ) { mBlend = Blend; } -const EE_BLEND_MODE& Sprite::BlendMode() const { +const EE_BLEND_MODE& Sprite::blendMode() const { return mBlend; } -void Sprite::ReverseAnim( const bool& Reverse ) { +void Sprite::reverseAnim( const bool& Reverse ) { if ( Reverse ) { if ( !SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) ) mFlags |= SPRITE_FLAG_REVERSE_ANIM; @@ -816,15 +816,15 @@ void Sprite::ReverseAnim( const bool& Reverse ) { } } -bool Sprite::ReverseAnim() const { +bool Sprite::reverseAnim() const { return 0 != SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ); } -Uint32 Sprite::GetNumFrames() { +Uint32 Sprite::getNumFrames() { return (Uint32)mFrames.size(); } -void Sprite::GoToAndPlay( Uint32 GoTo ) { +void Sprite::goToAndPlay( Uint32 GoTo ) { if ( GoTo ) GoTo--; @@ -832,16 +832,16 @@ void Sprite::GoToAndPlay( Uint32 GoTo ) { mCurrentFrame = GoTo; mfCurrentFrame = (Float)GoTo; - AnimPaused( false ); + animPaused( false ); } } -void Sprite::GoToAndStop( Uint32 GoTo ) { - GoToAndPlay( GoTo ); - AnimPaused( true ); +void Sprite::goToAndStop( Uint32 GoTo ) { + goToAndPlay( GoTo ); + animPaused( true ); } -void Sprite::AnimToFrameAndStop( Uint32 GoTo ) { +void Sprite::animToFrameAndStop( Uint32 GoTo ) { if ( GoTo ) GoTo--; @@ -850,34 +850,34 @@ void Sprite::AnimToFrameAndStop( Uint32 GoTo ) { mFlags |= SPRITE_FLAG_ANIM_TO_FRAME_AND_STOP; - AnimPaused( false ); + animPaused( false ); } } -void Sprite::SetEventsCallback(const SpriteCallback& Cb , void * UserData ) { +void Sprite::setEventsCallback(const SpriteCallback& Cb , void * UserData ) { mCb = Cb; mUserData = UserData; } -void Sprite::ClearCallback() { +void Sprite::clearCallback() { mCb.Reset(); } -void Sprite::FireEvent( const Uint32& Event ) { +void Sprite::fireEvent( const Uint32& Event ) { if ( SPR_FGET( SPRITE_FLAG_EVENTS_ENABLED ) && mCb.IsSet() ) { mCb( Event, this, mUserData ); } } -void Sprite::Origin( const OriginPoint& origin ) { +void Sprite::origin( const OriginPoint& origin ) { mOrigin = origin; } -const OriginPoint& Sprite:: Origin() const { +const OriginPoint& Sprite:: origin() const { return mOrigin; } -void Sprite::Rotate( const Float& angle ) { +void Sprite::rotate( const Float& angle ) { mAngle += angle; } diff --git a/src/eepp/graphics/subtexture.cpp b/src/eepp/graphics/subtexture.cpp index 15813556a..516a15eda 100644 --- a/src/eepp/graphics/subtexture.cpp +++ b/src/eepp/graphics/subtexture.cpp @@ -18,7 +18,7 @@ SubTexture::SubTexture() : mDestSize(0,0), mOffset(0,0) { - CreateUnnamed(); + createUnnamed(); } SubTexture::SubTexture( const Uint32& TexId, const std::string& Name ) : @@ -27,12 +27,12 @@ SubTexture::SubTexture( const Uint32& TexId, const std::string& Name ) : mName( Name ), mId( String::hash( mName ) ), mTexId( TexId ), - mTexture( TextureFactory::instance()->GetTexture( TexId ) ), - mSrcRect( Recti( 0, 0, NULL != mTexture ? mTexture->ImgWidth() : 0, NULL != mTexture ? mTexture->ImgHeight() : 0 ) ), + mTexture( TextureFactory::instance()->getTexture( TexId ) ), + mSrcRect( Recti( 0, 0, NULL != mTexture ? mTexture->imgWidth() : 0, NULL != mTexture ? mTexture->imgHeight() : 0 ) ), mDestSize( (Float)mSrcRect.size().width(), (Float)mSrcRect.size().height() ), mOffset(0,0) { - CreateUnnamed(); + createUnnamed(); } SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const std::string& Name ) : @@ -41,12 +41,12 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const std::st mName( Name ), mId( String::hash( mName ) ), mTexId( TexId ), - mTexture( TextureFactory::instance()->GetTexture( TexId ) ), + mTexture( TextureFactory::instance()->getTexture( TexId ) ), mSrcRect( SrcRect ), mDestSize( (Float)( mSrcRect.Right - mSrcRect.Left ), (Float)( mSrcRect.Bottom - mSrcRect.Top ) ), mOffset(0,0) { - CreateUnnamed(); + createUnnamed(); } SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name ) : @@ -55,12 +55,12 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& mName( Name ), mId( String::hash( mName ) ), mTexId( TexId ), - mTexture( TextureFactory::instance()->GetTexture( TexId ) ), + mTexture( TextureFactory::instance()->getTexture( TexId ) ), mSrcRect(SrcRect), mDestSize(DestSize), mOffset(0,0) { - CreateUnnamed(); + createUnnamed(); } SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i &Offset, const std::string& Name ) : @@ -69,122 +69,122 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& mName( Name ), mId( String::hash( mName ) ), mTexId( TexId ), - mTexture( TextureFactory::instance()->GetTexture( TexId ) ), + mTexture( TextureFactory::instance()->getTexture( TexId ) ), mSrcRect(SrcRect), mDestSize(DestSize), mOffset(Offset) { - CreateUnnamed(); + createUnnamed(); } SubTexture::~SubTexture() { - ClearCache(); + clearCache(); } -void SubTexture::CreateUnnamed() { +void SubTexture::createUnnamed() { if ( !mName.size() ) - Name( std::string( "unnamed" ) ); + setName( std::string( "unnamed" ) ); } -const Uint32& SubTexture::Id() const { +const Uint32& SubTexture::getId() const { return mId; } -const std::string SubTexture::Name() const { +const std::string SubTexture::getName() const { return mName; } -void SubTexture::Name( const std::string& name ) { +void SubTexture::setName( const std::string& name ) { mName = name; mId = String::hash( mName ); } -const Uint32& SubTexture::Texture() { +const Uint32& SubTexture::texture() { return mTexId; } -void SubTexture::Texture( const Uint32& TexId ) { +void SubTexture::texture( const Uint32& TexId ) { mTexId = TexId; - mTexture = TextureFactory::instance()->GetTexture( TexId ); + mTexture = TextureFactory::instance()->getTexture( TexId ); } -const Recti& SubTexture::SrcRect() const { +const Recti& SubTexture::srcRect() const { return mSrcRect; } -void SubTexture::SrcRect( const Recti& Rect ) { +void SubTexture::srcRect( const Recti& Rect ) { mSrcRect = Rect; if ( NULL != mPixels ) - CacheColors(); + cacheColors(); if ( NULL != mAlpha ) - CacheAlphaMask(); + cacheAlphaMask(); } -const Sizef& SubTexture::DestSize() const { +const Sizef& SubTexture::destSize() const { return mDestSize; } -void SubTexture::DestSize( const Sizef& destSize ) { +void SubTexture::destSize( const Sizef& destSize ) { mDestSize = destSize; } -const Vector2i& SubTexture::Offset() const { +const Vector2i& SubTexture::offset() const { return mOffset; } -void SubTexture::Offset( const Vector2i& offset ) { +void SubTexture::offset( const Vector2i& offset ) { mOffset = offset; } -void SubTexture::Draw( const Float& X, const Float& Y, const ColorA& Color, const Float& Angle, const Vector2f& Scale, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, OriginPoint Center ) { +void SubTexture::draw( const Float& X, const Float& Y, const ColorA& Color, const Float& Angle, const Vector2f& Scale, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, OriginPoint Center ) { if ( NULL != mTexture ) - mTexture->DrawEx( X + mOffset.x, Y + mOffset.y, mDestSize.x, mDestSize.y, Angle, Scale, Color, Color, Color, Color, Blend, Effect, Center, mSrcRect ); + mTexture->drawEx( X + mOffset.x, Y + mOffset.y, mDestSize.x, mDestSize.y, Angle, Scale, Color, Color, Color, Color, Blend, Effect, Center, mSrcRect ); } -void SubTexture::Draw( const Float& X, const Float& Y, const Float& Angle, const Vector2f& Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, OriginPoint Center ) { +void SubTexture::draw( const Float& X, const Float& Y, const Float& Angle, const Vector2f& Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect, OriginPoint Center ) { if ( NULL != mTexture ) - mTexture->DrawEx( X + mOffset.x, Y + mOffset.y, mDestSize.x, mDestSize.y, Angle, Scale, Color0, Color1, Color2, Color3, Blend, Effect, Center, mSrcRect ); + mTexture->drawEx( X + mOffset.x, Y + mOffset.y, mDestSize.x, mDestSize.y, Angle, Scale, Color0, Color1, Color2, Color3, Blend, Effect, Center, mSrcRect ); } -void SubTexture::Draw( const Quad2f Q, const Vector2f& Offset, const Float& Angle, const Vector2f& Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE& Blend ) { +void SubTexture::draw( const Quad2f Q, const Vector2f& Offset, const Float& Angle, const Vector2f& Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE& Blend ) { if ( NULL != mTexture ) - mTexture->DrawQuadEx( Q, Offset, Angle, Scale, Color0, Color1, Color2, Color3, Blend, mSrcRect ); + mTexture->drawQuadEx( Q, Offset, Angle, Scale, Color0, Color1, Color2, Color3, Blend, mSrcRect ); } -Graphics::Texture * SubTexture::GetTexture() { +Graphics::Texture * SubTexture::getTexture() { return mTexture; } -void SubTexture::ReplaceColor( ColorA ColorKey, ColorA NewColor ) { - mTexture->Lock(); +void SubTexture::replaceColor( ColorA ColorKey, ColorA NewColor ) { + mTexture->lock(); for ( int y = mSrcRect.Top; y < mSrcRect.Bottom; y++ ) { for ( int x = mSrcRect.Left; x < mSrcRect.Right; x++ ) { - if ( mTexture->GetPixel( x, y ) == ColorKey ) - mTexture->SetPixel( x, y, NewColor ); + if ( mTexture->getPixel( x, y ) == ColorKey ) + mTexture->setPixel( x, y, NewColor ); } } - mTexture->Unlock( false, true ); + mTexture->unlock( false, true ); } -void SubTexture::CreateMaskFromColor(ColorA ColorKey, Uint8 Alpha) { - ReplaceColor( ColorKey, ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), Alpha ) ); +void SubTexture::createMaskFromColor(ColorA ColorKey, Uint8 Alpha) { + replaceColor( ColorKey, ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), Alpha ) ); } -void SubTexture::CreateMaskFromColor(RGB ColorKey, Uint8 Alpha) { - CreateMaskFromColor( ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), 255 ), Alpha ); +void SubTexture::createMaskFromColor(RGB ColorKey, Uint8 Alpha) { + createMaskFromColor( ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), 255 ), Alpha ); } -void SubTexture::CacheAlphaMask() { +void SubTexture::cacheAlphaMask() { Uint32 size = ( mSrcRect.Right - mSrcRect.Left ) * ( mSrcRect.Bottom - mSrcRect.Top ); eeSAFE_DELETE_ARRAY( mAlpha ); mAlpha = eeNewArray( Uint8, size ); - mTexture->Lock(); + mTexture->lock(); int rY = 0; int rX = 0; @@ -196,17 +196,17 @@ void SubTexture::CacheAlphaMask() { for ( int x = mSrcRect.Left; x < mSrcRect.Right; x++ ) { rX = x - mSrcRect.Left; - mAlpha[ rX + rY * rW ] = mTexture->GetPixel( x, y ).a(); + mAlpha[ rX + rY * rW ] = mTexture->getPixel( x, y ).a(); } } - mTexture->Unlock(); + mTexture->unlock(); } -void SubTexture::CacheColors() { - mTexture->Lock(); +void SubTexture::cacheColors() { + mTexture->lock(); - Uint32 size = ( mSrcRect.Right - mSrcRect.Left ) * ( mSrcRect.Bottom - mSrcRect.Top ) * mTexture->Channels(); + Uint32 size = ( mSrcRect.Right - mSrcRect.Left ) * ( mSrcRect.Bottom - mSrcRect.Top ) * mTexture->channels(); eeSAFE_DELETE_ARRAY( mPixels ); @@ -216,7 +216,7 @@ void SubTexture::CacheColors() { int rX = 0; int rW = mSrcRect.Right - mSrcRect.Left; ColorA tColor; - Uint32 Channels = mTexture->Channels(); + Uint32 Channels = mTexture->channels(); int Pos; for ( int y = mSrcRect.Top; y < mSrcRect.Bottom; y++ ) { @@ -225,7 +225,7 @@ void SubTexture::CacheColors() { for ( int x = mSrcRect.Left; x < mSrcRect.Right; x++ ) { rX = x - mSrcRect.Left; - tColor = mTexture->GetPixel( x, y ); + tColor = mTexture->getPixel( x, y ); Pos = ( rX + rY * rW ) * Channels; @@ -236,30 +236,30 @@ void SubTexture::CacheColors() { } } - mTexture->Unlock(); + mTexture->unlock(); } -Uint8 SubTexture::GetAlphaAt( const Int32& X, const Int32& Y ) { - if ( mTexture->LocalCopy() ) - return mTexture->GetPixel( mSrcRect.Left + X, mSrcRect.Right + Y ).a(); +Uint8 SubTexture::getAlphaAt( const Int32& X, const Int32& Y ) { + if ( mTexture->localCopy() ) + return mTexture->getPixel( mSrcRect.Left + X, mSrcRect.Right + Y ).a(); if ( NULL != mAlpha ) return mAlpha[ X + Y * ( mSrcRect.Right - mSrcRect.Left ) ]; if ( NULL != mPixels ) - return mPixels[ ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * mTexture->Channels() + 3 ]; + return mPixels[ ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * mTexture->channels() + 3 ]; - CacheAlphaMask(); + cacheAlphaMask(); - return GetAlphaAt( X, Y ); + return getAlphaAt( X, Y ); } -ColorA SubTexture::GetColorAt( const Int32& X, const Int32& Y ) { - if ( mTexture->LocalCopy() ) - return mTexture->GetPixel( mSrcRect.Left + X, mSrcRect.Right + Y ); +ColorA SubTexture::getColorAt( const Int32& X, const Int32& Y ) { + if ( mTexture->localCopy() ) + return mTexture->getPixel( mSrcRect.Left + X, mSrcRect.Right + Y ); if ( NULL != mPixels ) { - Uint32 Channels = mTexture->Channels(); + Uint32 Channels = mTexture->channels(); unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels; if ( 4 == Channels ) @@ -272,14 +272,14 @@ ColorA SubTexture::GetColorAt( const Int32& X, const Int32& Y ) { return ColorA( mPixels[ Pos ], 255, 255, 255 ); } - CacheColors(); + cacheColors(); - return GetColorAt( X, Y ); + return getColorAt( X, Y ); } -void SubTexture::SetColorAt( const Int32& X, const Int32& Y, const ColorA& Color ) { +void SubTexture::setColorAt( const Int32& X, const Int32& Y, const ColorA& Color ) { if ( NULL != mPixels ) { - Uint32 Channels = mTexture->Channels(); + Uint32 Channels = mTexture->channels(); unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels; if ( Channels >= 1 ) mPixels[ Pos ] = Color.r(); @@ -287,28 +287,28 @@ void SubTexture::SetColorAt( const Int32& X, const Int32& Y, const ColorA& Color if ( Channels >= 3 ) mPixels[ Pos + 2 ] = Color.b(); if ( Channels >= 4 ) mPixels[ Pos + 3 ] = Color.a(); } else { - CacheColors(); - SetColorAt( X, Y, Color ); + cacheColors(); + setColorAt( X, Y, Color ); } } -void SubTexture::ClearCache() { +void SubTexture::clearCache() { eeSAFE_DELETE_ARRAY( mPixels ); eeSAFE_DELETE_ARRAY( mAlpha ); } -Uint8 * SubTexture::Lock() { - CacheColors(); +Uint8 * SubTexture::lock() { + cacheColors(); return &mPixels[0]; } -bool SubTexture::Unlock( const bool& KeepData, const bool& Modified ) { +bool SubTexture::unlock( const bool& KeepData, const bool& Modified ) { if ( NULL != mPixels && NULL != mTexture ) { if ( Modified ) { - TextureSaver saver( mTexture->Handle() ); + TextureSaver saver( mTexture->handle() ); - Uint32 Channels = mTexture->Channels(); + Uint32 Channels = mTexture->channels(); Uint32 Channel = GL_RGBA; if ( 3 == Channels ) @@ -331,44 +331,44 @@ bool SubTexture::Unlock( const bool& KeepData, const bool& Modified ) { return false; } -Sizei SubTexture::RealSize() { +Sizei SubTexture::realSize() { return mSrcRect.size(); } -Sizei SubTexture::Size() { +Sizei SubTexture::size() { return Sizei( (Int32)mDestSize.x, (Int32)mDestSize.y ); } -const Uint8* SubTexture::GetPixelsPtr() { +const Uint8* SubTexture::getPixelsPtr() { if ( mPixels == NULL ) { - Lock(); - Unlock(true); + lock(); + unlock(true); } return reinterpret_cast (&mPixels[0]); } -bool SubTexture::SaveToFile(const std::string& filepath, const EE_SAVE_TYPE& Format) { +bool SubTexture::saveToFile(const std::string& filepath, const EE_SAVE_TYPE& Format) { bool Res = false; - Lock(); + lock(); if ( NULL != mTexture ) { if ( SAVE_TYPE_JPG != Format ) { - Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, RealSize().width(), RealSize().height(), mTexture->Channels(), GetPixelsPtr() ) ); + Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, realSize().width(), realSize().height(), mTexture->channels(), getPixelsPtr() ) ); } else { jpge::params params; - params.m_quality = Image::JpegQuality(); - Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), RealSize().width(), RealSize().height(), mTexture->Channels(), GetPixelsPtr(), params); + params.m_quality = Image::jpegQuality(); + Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), realSize().width(), realSize().height(), mTexture->channels(), getPixelsPtr(), params); } } - Unlock(); + unlock(); return Res; } -void SubTexture::ResetDestSize() { +void SubTexture::resetDestSize() { Sizei Size = mSrcRect.size(); mDestSize.x = (Float)Size.width(); mDestSize.y = (Float)Size.height(); diff --git a/src/eepp/graphics/textcache.cpp b/src/eepp/graphics/textcache.cpp index 216af9fe9..3fad7325a 100644 --- a/src/eepp/graphics/textcache.cpp +++ b/src/eepp/graphics/textcache.cpp @@ -28,45 +28,45 @@ TextCache::TextCache( Graphics::Font * font, const String& text, ColorA FontColo mVertexNumCached(0), mCachedCoords(false) { - Cache(); - UpdateCoords(); - Color( FontColor ); - ShadowColor( FontShadowColor ); + cache(); + updateCoords(); + color( FontColor ); + shadowColor( FontShadowColor ); } TextCache::~TextCache() { } -void TextCache::Create( Graphics::Font * font, const String& text, ColorA FontColor, ColorA FontShadowColor ) { +void TextCache::create( Graphics::Font * font, const String& text, ColorA FontColor, ColorA FontShadowColor ) { mFont = font; mText = text; - UpdateCoords(); - Color( FontColor ); - ShadowColor( FontShadowColor ); - Cache(); + updateCoords(); + color( FontColor ); + shadowColor( FontShadowColor ); + cache(); } -Graphics::Font * TextCache::Font() const { +Graphics::Font * TextCache::font() const { return mFont; } -void TextCache::Font( Graphics::Font * font ) { +void TextCache::font( Graphics::Font * font ) { mFont = font; - Cache(); + cache(); } -String& TextCache::Text() { +String& TextCache::text() { return mText; } -void TextCache::UpdateCoords() { - Uint32 size = (Uint32)mText.size() * GLi->QuadVertexs(); +void TextCache::updateCoords() { + Uint32 size = (Uint32)mText.size() * GLi->quadVertexs(); mRenderCoords.resize( size ); mColors.resize( size, mFontColor ); } -void TextCache::Text( const String& text ) { +void TextCache::text( const String& text ) { bool needUpdate = false; if ( mText.size() != text.size() ) @@ -75,32 +75,32 @@ void TextCache::Text( const String& text ) { mText = text; if ( needUpdate ) - UpdateCoords(); + updateCoords(); - Cache(); + cache(); } -const ColorA& TextCache::Color() const { +const ColorA& TextCache::color() const { return mFontColor; } -void TextCache::Alpha( const Uint8& alpha ) { +void TextCache::alpha( const Uint8& alpha ) { std::size_t s = mColors.size(); for ( Uint32 i = 0; i < s; i++ ) { mColors[ i ].Alpha = alpha; } } -void TextCache::Color( const ColorA& color ) { +void TextCache::color( const ColorA& color ) { if ( mFontColor != color ) { mFontColor = color; - mColors.assign( mText.size() * GLi->QuadVertexs(), mFontColor ); + mColors.assign( mText.size() * GLi->quadVertexs(), mFontColor ); } } -void TextCache::Color( const ColorA& color, Uint32 from, Uint32 to ) { - std::vector colors( GLi->QuadVertexs(), color ); +void TextCache::color( const ColorA& color, Uint32 from, Uint32 to ) { + std::vector colors( GLi->quadVertexs(), color ); std::size_t s = mText.size(); if ( to >= s ) { @@ -112,7 +112,7 @@ void TextCache::Color( const ColorA& color, Uint32 from, Uint32 to ) { Int32 rpos = from; Int32 lpos = 0; Uint32 i; - Uint32 qsize = sizeof(ColorA) * GLi->QuadVertexs(); + Uint32 qsize = sizeof(ColorA) * GLi->quadVertexs(); String::StringBaseType curChar; // New lines and tabs are not rendered, and not counted as a color @@ -139,30 +139,30 @@ void TextCache::Color( const ColorA& color, Uint32 from, Uint32 to ) { } } - memcpy( &(mColors[ lpos * GLi->QuadVertexs() ]), &colors[0], qsize ); + memcpy( &(mColors[ lpos * GLi->quadVertexs() ]), &colors[0], qsize ); } } } -const ColorA& TextCache::ShadowColor() const { +const ColorA& TextCache::shadowColor() const { return mFontShadowColor; } -void TextCache::ShadowColor(const ColorA& color) { +void TextCache::shadowColor(const ColorA& color) { mFontShadowColor = color; } -std::vector& TextCache::VertextCoords() { +std::vector& TextCache::vertextCoords() { return mRenderCoords; } -std::vector& TextCache::Colors() { +std::vector& TextCache::colors() { return mColors; } -void TextCache::Cache() { +void TextCache::cache() { if ( NULL != mFont && mText.size() ) { - mFont->CacheWidth( mText, mLinesWidth, mCachedWidth, mNumLines, mLargestLineCharCount ); + mFont->cacheWidth( mText, mLinesWidth, mCachedWidth, mNumLines, mLargestLineCharCount ); }else { mCachedWidth = 0; } @@ -170,66 +170,66 @@ void TextCache::Cache() { mCachedCoords = false; } -Float TextCache::GetTextWidth() { - return ( mFlags & FONT_DRAW_VERTICAL ) ? (Float)mFont->GetFontHeight() * (Float)mNumLines : mCachedWidth; +Float TextCache::getTextWidth() { + return ( mFlags & FONT_DRAW_VERTICAL ) ? (Float)mFont->getFontHeight() * (Float)mNumLines : mCachedWidth; } -Float TextCache::GetTextHeight() { - return ( mFlags & FONT_DRAW_VERTICAL ) ? mLargestLineCharCount * (Float)mFont->GetFontHeight() : (Float)mFont->GetFontHeight() * (Float)mNumLines; +Float TextCache::getTextHeight() { + return ( mFlags & FONT_DRAW_VERTICAL ) ? mLargestLineCharCount * (Float)mFont->getFontHeight() : (Float)mFont->getFontHeight() * (Float)mNumLines; } -const int& TextCache::GetNumLines() const { +const int& TextCache::getNumLines() const { return mNumLines; } -const std::vector& TextCache::LinesWidth() { +const std::vector& TextCache::linesWidth() { return mLinesWidth; } -void TextCache::Draw( const Float& X, const Float& Y, const Vector2f& Scale, const Float& Angle, EE_BLEND_MODE Effect ) { +void TextCache::draw( const Float& X, const Float& Y, const Vector2f& Scale, const Float& Angle, EE_BLEND_MODE Effect ) { if ( NULL != mFont ) { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); if ( Angle != 0.0f || Scale != 1.0f ) { - mFont->Draw( *this, X, Y, mFlags, Scale, Angle, Effect ); + mFont->draw( *this, X, Y, mFlags, Scale, Angle, Effect ); } else { - GLi->Translatef( X, Y, 0.f ); + GLi->translatef( X, Y, 0.f ); - mFont->Draw( *this, 0, 0, mFlags, Scale, Angle, Effect ); + mFont->draw( *this, 0, 0, mFlags, Scale, Angle, Effect ); - GLi->Translatef( -X, -Y, 0.f ); + GLi->translatef( -X, -Y, 0.f ); } } } -const bool& TextCache::CachedCoords() const { +const bool& TextCache::cachedCoords() const { return mCachedCoords; } -void TextCache::CachedCoords( const bool& cached ) { +void TextCache::cachedCoords( const bool& cached ) { mCachedCoords = cached; } -const unsigned int& TextCache::CachedVerts() const { +const unsigned int& TextCache::cachedVerts() const { return mVertexNumCached; } -void TextCache::CachedVerts( const unsigned int& num ) { +void TextCache::cachedVerts( const unsigned int& num ) { mVertexNumCached = num; } -void TextCache::Flags( const Uint32& flags ) { +void TextCache::flags( const Uint32& flags ) { if ( mFlags != flags ) { mFlags = flags; mCachedCoords = false; if ( ( mFlags & FONT_DRAW_VERTICAL ) != ( flags & FONT_DRAW_VERTICAL ) ) { - Cache(); + cache(); } } } -const Uint32& TextCache::Flags() const { +const Uint32& TextCache::flags() const { return mFlags; } diff --git a/src/eepp/graphics/texture.cpp b/src/eepp/graphics/texture.cpp index 29fcce0a6..0278a65f7 100755 --- a/src/eepp/graphics/texture.cpp +++ b/src/eepp/graphics/texture.cpp @@ -44,18 +44,18 @@ Texture::Texture( const Texture& Copy ) : mChannels = Copy.mChannels; mSize = Copy.mSize; - SetPixels( reinterpret_cast( &Copy.mPixels[0] ) ); + setPixels( reinterpret_cast( &Copy.mPixels[0] ) ); } Texture::~Texture() { - DeleteTexture(); + deleteTexture(); - if ( !TextureFactory::instance()->IsErasing() ) { - TextureFactory::instance()->RemoveReference( this ); + if ( !TextureFactory::instance()->isErasing() ) { + TextureFactory::instance()->removeReference( this ); } } -void Texture::DeleteTexture() { +void Texture::deleteTexture() { if ( mTexture ) { unsigned int Texture = static_cast(mTexture); glDeleteTextures(1, &Texture); @@ -63,15 +63,15 @@ void Texture::DeleteTexture() { mTexture = 0; mFlags = 0; - ClearCache(); + clearCache(); } } Texture::Texture( const Uint32& texture, const unsigned int& width, const unsigned int& height, const unsigned int& imgwidth, const unsigned int& imgheight, const bool& UseMipmap, const unsigned int& Channels, const std::string& filepath, const EE_CLAMP_MODE& ClampMode, const bool& CompressedTexture, const Uint32& MemSize, const Uint8* data ) { - Create( texture, width, height, imgwidth, imgheight, UseMipmap, Channels, filepath, ClampMode, CompressedTexture, MemSize, data ); + create( texture, width, height, imgwidth, imgheight, UseMipmap, Channels, filepath, ClampMode, CompressedTexture, MemSize, data ); } -void Texture::Create( const Uint32& texture, const unsigned int& width, const unsigned int& height, const unsigned int& imgwidth, const unsigned int& imgheight, const bool& UseMipmap, const unsigned int& Channels, const std::string& filepath, const EE_CLAMP_MODE& ClampMode, const bool& CompressedTexture, const Uint32& MemSize, const Uint8* data ) { +void Texture::create( const Uint32& texture, const unsigned int& width, const unsigned int& height, const unsigned int& imgwidth, const unsigned int& imgheight, const bool& UseMipmap, const unsigned int& Channels, const std::string& filepath, const EE_CLAMP_MODE& ClampMode, const bool& CompressedTexture, const Uint32& MemSize, const Uint8* data ) { mFilepath = filepath; mId = String::hash( mFilepath ); mTexture = texture; @@ -90,7 +90,7 @@ void Texture::Create( const Uint32& texture, const unsigned int& width, const un if ( CompressedTexture ) mFlags |= TEX_FLAG_COMPRESSED; - SetPixels( data ); + setPixels( data ); } Uint8 * Texture::iLock( const bool& ForceRGBA, const bool& KeepFormat ) { @@ -114,7 +114,7 @@ Uint8 * Texture::iLock( const bool& ForceRGBA, const bool& KeepFormat ) { glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &size ); } - Allocate( (unsigned int)size ); + allocate( (unsigned int)size ); if ( KeepFormat && ( mFlags & TEX_FLAG_COMPRESSED ) ) { glGetCompressedTexImage( GL_TEXTURE_2D, 0, reinterpret_cast (&mPixels[0]) ); @@ -140,11 +140,11 @@ Uint8 * Texture::iLock( const bool& ForceRGBA, const bool& KeepFormat ) { #endif } -Uint8 * Texture::Lock( const bool& ForceRGBA ) { +Uint8 * Texture::lock( const bool& ForceRGBA ) { return iLock( ForceRGBA, false ); } -bool Texture::Unlock( const bool& KeepData, const bool& Modified ) { +bool Texture::unlock( const bool& KeepData, const bool& Modified ) { #ifndef EE_GLES if ( ( mFlags & TEX_FLAG_LOCKED ) ) { Int32 width = mWidth, height = mHeight; @@ -167,7 +167,7 @@ bool Texture::Unlock( const bool& KeepData, const bool& Modified ) { } if ( !KeepData ) - ClearCache(); + clearCache(); mFlags &= ~TEX_FLAG_LOCKED; @@ -181,40 +181,40 @@ bool Texture::Unlock( const bool& KeepData, const bool& Modified ) { #endif } -const Uint8 * Texture::GetPixelsPtr() { - if ( !LocalCopy() ) { - Lock(); - Unlock(true); +const Uint8 * Texture::getPixelsPtr() { + if ( !localCopy() ) { + lock(); + unlock(true); } - return Image::GetPixelsPtr(); + return Image::getPixelsPtr(); } -void Texture::SetPixel( const unsigned int& x, const unsigned int& y, const ColorA& Color ) { - Image::SetPixel( x, y, Color ); +void Texture::setPixel( const unsigned int& x, const unsigned int& y, const ColorA& Color ) { + Image::setPixel( x, y, Color ); mFlags |= TEX_FLAG_MODIFIED; } -void Texture::Bind() { - TextureFactory::instance()->Bind( this ); +void Texture::bind() { + TextureFactory::instance()->bind( this ); } -bool Texture::SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ) { +bool Texture::saveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format ) { bool Res = false; if ( mTexture ) { - Lock(); + lock(); - Res = Image::SaveToFile( filepath, Format ); + Res = Image::saveToFile( filepath, Format ); - Unlock(); + unlock(); } return Res; } -void Texture::Filter(const EE_TEX_FILTER& filter) { +void Texture::filter(const EE_TEX_FILTER& filter) { if ( mFilter != filter ) { iTextureFilter( filter ); } @@ -235,81 +235,81 @@ void Texture::iTextureFilter( const EE_TEX_FILTER& filter ) { } } -const EE_TEX_FILTER& Texture::Filter() const { +const EE_TEX_FILTER& Texture::filter() const { return mFilter; } -void Texture::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { - Lock(); +void Texture::replaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { + lock(); - Image::ReplaceColor( ColorKey, NewColor ); + Image::replaceColor( ColorKey, NewColor ); - Unlock( false, true ); + unlock( false, true ); } -void Texture::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { - Lock( true ); +void Texture::createMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { + lock( true ); - Image::ReplaceColor( ColorKey, ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), Alpha ) ); + Image::replaceColor( ColorKey, ColorA( ColorKey.r(), ColorKey.g(), ColorKey.b(), Alpha ) ); - Unlock( false, true ); + unlock( false, true ); } -void Texture::FillWithColor( const ColorA& Color ) { - Lock(); +void Texture::fillWithColor( const ColorA& Color ) { + lock(); - Image::FillWithColor( Color ); + Image::fillWithColor( Color ); - Unlock( false, true ); + unlock( false, true ); } -void Texture::Resize( const Uint32& newWidth, const Uint32& newHeight , EE_RESAMPLER_FILTER filter ) { - Lock(); +void Texture::resize( const Uint32& newWidth, const Uint32& newHeight , EE_RESAMPLER_FILTER filter ) { + lock(); - Image::Resize( newWidth, newHeight, filter ); + Image::resize( newWidth, newHeight, filter ); - Unlock( false, true ); + unlock( false, true ); } -void Texture::Scale( const Float& scale, EE_RESAMPLER_FILTER filter ) { - Lock(); +void Texture::scale( const Float& scale, EE_RESAMPLER_FILTER filter ) { + lock(); - Image::Scale( scale, filter ); + Image::scale( scale, filter ); - Unlock( false, true ); + unlock( false, true ); } -void Texture::CopyImage(Image * image, const Uint32& x, const Uint32& y ) { - Lock(); +void Texture::copyImage(Image * image, const Uint32& x, const Uint32& y ) { + lock(); - Image::CopyImage( image, x, y ); + Image::copyImage( image, x, y ); - Unlock( false, true ); + unlock( false, true ); } -void Texture::Flip() { - Lock(); +void Texture::flip() { + lock(); - Image::Flip(); + Image::flip(); - Unlock( false, true ); + unlock( false, true ); mImgWidth = mWidth; mImgHeight = mHeight; } -bool Texture::LocalCopy() { +bool Texture::localCopy() { return ( mPixels != NULL ); } -void Texture::ClampMode( const EE_CLAMP_MODE& clampmode ) { +void Texture::clampMode( const EE_CLAMP_MODE& clampmode ) { if ( mClampMode != clampmode ) { mClampMode = clampmode; - ApplyClampMode(); + applyClampMode(); } } -void Texture::ApplyClampMode() { +void Texture::applyClampMode() { if (mTexture) { TextureSaver saver( mTexture ); @@ -324,16 +324,16 @@ void Texture::ApplyClampMode() { } } -void Texture::Id( const Uint32& id ) { +void Texture::setId( const Uint32& id ) { mTexId = id; } -const Uint32& Texture::Id() const { +const Uint32& Texture::getId() const { return mTexId; } -void Texture::Reload() { - if ( LocalCopy() ) { +void Texture::reload() { + if ( localCopy() ) { Int32 width = (Int32)mWidth; Int32 height = (Int32)mHeight; @@ -343,7 +343,7 @@ void Texture::Reload() { flags = (mClampMode == CLAMP_REPEAT) ? (flags | SOIL_FLAG_TEXTURE_REPEATS) : flags; if ( ( mFlags & TEX_FLAG_COMPRESSED ) ) { - if ( Grabed() ) + if ( grabed() ) mTexture = SOIL_create_OGL_texture( reinterpret_cast ( &mPixels[0] ), &width, &height, mChannels, mTexture, flags | SOIL_FLAG_COMPRESS_TO_DXT ); else glCompressedTexImage2D( mTexture, 0, mInternalFormat, width, height, 0, mSize, &mPixels[0] ); @@ -354,7 +354,7 @@ void Texture::Reload() { mSize = mWidth * mHeight * mChannels; - if ( Mipmap() ) { + if ( mipmap() ) { int w = mWidth; int h = mHeight; @@ -371,12 +371,12 @@ void Texture::Reload() { iTextureFilter( mFilter ); } else { iLock(false,true); - Reload(); - Unlock(); + reload(); + unlock(); } } -void Texture::Update( const Uint8* pixels, Uint32 width, Uint32 height, Uint32 x, Uint32 y, EE_PIXEL_FORMAT pf ) { +void Texture::update( const Uint8* pixels, Uint32 width, Uint32 height, Uint32 x, Uint32 y, EE_PIXEL_FORMAT pf ) { if ( NULL != pixels && mTexture && x + width <= mWidth && y + height <= mHeight ) { TextureSaver saver( mTexture ); @@ -384,19 +384,19 @@ void Texture::Update( const Uint8* pixels, Uint32 width, Uint32 height, Uint32 x } } -void Texture::Update( const Uint8* pixels ) { - Update( pixels, mWidth, mHeight, 0, 0, ChannelsToPixelFormat( mChannels ) ); +void Texture::update( const Uint8* pixels ) { + update( pixels, mWidth, mHeight, 0, 0, channelsToPixelFormat( mChannels ) ); } -void Texture::Update( Image *image, Uint32 x, Uint32 y ) { - Update( image->GetPixelsPtr(), image->Width(), image->Height(), x, y, ChannelsToPixelFormat( image->Channels() ) ); +void Texture::update( Image *image, Uint32 x, Uint32 y ) { + update( image->getPixelsPtr(), image->width(), image->height(), x, y, channelsToPixelFormat( image->channels() ) ); } -const Uint32& Texture::HashName() const { +const Uint32& Texture::hashName() const { return mId; } -void Texture::Mipmap( const bool& UseMipmap ) { +void Texture::mipmap( const bool& UseMipmap ) { if ( mFlags & TEX_FLAG_MIPMAP ) { if ( !UseMipmap ) mFlags &= ~TEX_FLAG_MIPMAP; @@ -406,11 +406,11 @@ void Texture::Mipmap( const bool& UseMipmap ) { } } -bool Texture::Mipmap() const { +bool Texture::mipmap() const { return mFlags & TEX_FLAG_MIPMAP; } -void Texture::Grabed( const bool& isGrabed ) { +void Texture::grabed( const bool& isGrabed ) { if ( mFlags & TEX_FLAG_GRABED ) { if ( !isGrabed ) mFlags &= ~TEX_FLAG_GRABED; @@ -420,42 +420,42 @@ void Texture::Grabed( const bool& isGrabed ) { } } -bool Texture::Grabed() const { +bool Texture::grabed() const { return 0 != ( mFlags & TEX_FLAG_GRABED ); } -bool Texture::IsCompressed() const { +bool Texture::isCompressed() const { return 0 != ( mFlags & TEX_FLAG_COMPRESSED ); } -void Texture::Draw( const Float &x, const Float &y, const Float &Angle, const Vector2f &Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector) { - DrawEx( x, y, 0, 0, Angle, Scale, Color, Color, Color, Color, Blend, Effect, Center, texSector ); +void Texture::draw( const Float &x, const Float &y, const Float &Angle, const Vector2f &Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector) { + drawEx( x, y, 0, 0, Angle, Scale, Color, Color, Color, Color, Blend, Effect, Center, texSector ); } -void Texture::DrawFast( const Float& x, const Float& y, const Float& Angle, const Vector2f& Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const Float &width, const Float &height ) { - Float w = 0.f != width ? width : (Float)ImgWidth(); - Float h = 0.f != height ? height : (Float)ImgHeight(); +void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, const Vector2f& Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const Float &width, const Float &height ) { + Float w = 0.f != width ? width : (Float)imgWidth(); + Float h = 0.f != height ? height : (Float)imgHeight(); - sBR->SetTexture( this ); - sBR->SetBlendMode( Blend ); + sBR->setTexture( this ); + sBR->setBlendMode( Blend ); - sBR->QuadsBegin(); - sBR->QuadsSetColor( Color ); + sBR->quadsBegin(); + sBR->quadsSetColor( Color ); - if ( ClampMode() == CLAMP_REPEAT ) { - sBR->QuadsSetSubsetFree( 0, 0, 0, height / h, width / w, height / h, width / w, 0 ); + if ( clampMode() == CLAMP_REPEAT ) { + sBR->quadsSetSubsetFree( 0, 0, 0, height / h, width / w, height / h, width / w, 0 ); } - sBR->BatchQuadEx( x, y, w, h, Angle, Scale ); + sBR->batchQuadEx( x, y, w, h, Angle, Scale ); - sBR->DrawOpt(); + sBR->drawOpt(); } -void Texture::DrawEx( Float x, Float y, Float width, Float height, const Float &Angle, const Vector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector ) { +void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &Angle, const Vector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, const EE_RENDER_MODE &Effect, OriginPoint Center, const Recti& texSector ) { bool renderSector = true; Recti Sector = texSector; - Float w = (Float)ImgWidth(); - Float h = (Float)ImgHeight(); + Float w = (Float)imgWidth(); + Float h = (Float)imgHeight(); if ( Sector.Right == 0 && Sector.Bottom == 0 ) { Sector.Left = 0; @@ -471,17 +471,17 @@ void Texture::DrawEx( Float x, Float y, Float width, Float height, const Float & renderSector = !( Sector.Left == 0 && Sector.Top == 0 && Sector.Right == w && Sector.Bottom == h ); - sBR->SetTexture( this ); - sBR->SetBlendMode( Blend ); + sBR->setTexture( this ); + sBR->setBlendMode( Blend ); - sBR->QuadsBegin(); - sBR->QuadsSetColorFree( Color0, Color1, Color2, Color3 ); + sBR->quadsBegin(); + sBR->quadsSetColorFree( Color0, Color1, Color2, Color3 ); if ( Effect <= RN_FLIPMIRROR ) { - if ( ClampMode() == CLAMP_REPEAT ) { + if ( clampMode() == CLAMP_REPEAT ) { if ( Effect == RN_NORMAL ) { if ( renderSector ) { - sBR->QuadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h ); + sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h ); Float sw = (Float)( Sector.Right - Sector.Left ); Float sh = (Float)( Sector.Bottom - Sector.Top ); @@ -492,10 +492,10 @@ void Texture::DrawEx( Float x, Float y, Float width, Float height, const Float & Int32 tmpY; Int32 tmpX; - sBR->Draw(); - Vector2f oCenter( sBR->BatchCenter() ); - Float oAngle = sBR->BatchRotation(); - Vector2f oScale = sBR->BatchScale(); + sBR->draw(); + Vector2f oCenter( sBR->batchCenter() ); + Float oAngle = sBR->batchRotation(); + Vector2f oScale = sBR->batchScale(); if ( Center.OriginType == OriginPoint::OriginCenter ) { Center.x = x + width * 0.5f; @@ -508,13 +508,13 @@ void Texture::DrawEx( Float x, Float y, Float width, Float height, const Float & Center.y += y; } - sBR->BatchCenter( Center ); - sBR->BatchRotation( Angle ); - sBR->BatchScale( Scale ); + sBR->batchCenter( Center ); + sBR->batchRotation( Angle ); + sBR->batchScale( Scale ); for ( tmpY = 0; tmpY < tty; tmpY++ ) { for ( tmpX = 0; tmpX < ttx; tmpX++ ) { - sBR->BatchQuad( x + tmpX * sw, y + tmpY * sh, sw, sh ); + sBR->batchQuad( x + tmpX * sw, y + tmpY * sh, sw, sh ); } } @@ -522,10 +522,10 @@ void Texture::DrawEx( Float x, Float y, Float width, Float height, const Float & Float swn = ( Sector.Right - Sector.Left ) * ( tx - (Float)ttx ); Float tor = Sector.Left + swn ; - sBR->QuadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, tor / w, Sector.Bottom / h, tor / w, Sector.Top / h ); + sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, tor / w, Sector.Bottom / h, tor / w, Sector.Top / h ); for ( Int32 tmpY = 0; tmpY < tty; tmpY++ ) { - sBR->BatchQuad( x + ttx * sw, y + tmpY * sh, swn, sh ); + sBR->batchQuad( x + ttx * sw, y + tmpY * sh, swn, sh ); } } @@ -533,55 +533,55 @@ void Texture::DrawEx( Float x, Float y, Float width, Float height, const Float & Float shn = ( Sector.Bottom - Sector.Top ) * ( ty - (Float)tty ); Float tob = Sector.Top + shn; - sBR->QuadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, tob / h, Sector.Right / w, tob / h, Sector.Right / w, Sector.Top / h ); + sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, tob / h, Sector.Right / w, tob / h, Sector.Right / w, Sector.Top / h ); for ( Int32 tmpX = 0; tmpX < ttx; tmpX++ ) { - sBR->BatchQuad( x + tmpX * sw, y + tty * sh, sw, shn ); + sBR->batchQuad( x + tmpX * sw, y + tty * sh, sw, shn ); } } - sBR->Draw(); - sBR->BatchCenter( oCenter ); - sBR->BatchRotation( oAngle ); - sBR->BatchScale( oScale ); + sBR->draw(); + sBR->batchCenter( oCenter ); + sBR->batchRotation( oAngle ); + sBR->batchScale( oScale ); return; } else { - sBR->QuadsSetSubsetFree( 0, 0, 0, height / h, width / w, height / h, width / w, 0 ); + sBR->quadsSetSubsetFree( 0, 0, 0, height / h, width / w, height / h, width / w, 0 ); } } else if ( Effect == RN_MIRROR ) { - sBR->QuadsSetSubsetFree( width / w, 0, width / w, height / h, 0, height / h, 0, 0 ); + sBR->quadsSetSubsetFree( width / w, 0, width / w, height / h, 0, height / h, 0, 0 ); } else if ( RN_FLIP ) { - sBR->QuadsSetSubsetFree( 0, height / h, 0, 0, width / w, 0, width / w, height / h ); + sBR->quadsSetSubsetFree( 0, height / h, 0, 0, width / w, 0, width / w, height / h ); } else { - sBR->QuadsSetSubsetFree( width / w, height / h, width / w, 0, 0, 0, 0, height / h ); + sBR->quadsSetSubsetFree( width / w, height / h, width / w, 0, 0, 0, 0, height / h ); } } else { if ( Effect == RN_NORMAL ) { if ( renderSector ) - sBR->QuadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h ); + sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h ); } else if ( Effect == RN_MIRROR ) { if ( renderSector ) - sBR->QuadsSetSubsetFree( Sector.Right / w, Sector.Top / h, Sector.Right / w, Sector.Bottom / h, Sector.Left / w, Sector.Bottom / h, Sector.Left / w, Sector.Top / h ); + sBR->quadsSetSubsetFree( Sector.Right / w, Sector.Top / h, Sector.Right / w, Sector.Bottom / h, Sector.Left / w, Sector.Bottom / h, Sector.Left / w, Sector.Top / h ); else - sBR->QuadsSetSubsetFree( 1, 0, 1, 1, 0, 1, 0, 0 ); + sBR->quadsSetSubsetFree( 1, 0, 1, 1, 0, 1, 0, 0 ); } else if ( Effect == RN_FLIP ) { if ( renderSector ) - sBR->QuadsSetSubsetFree( Sector.Left / w, Sector.Bottom / h, Sector.Left / w, Sector.Top / h, Sector.Right / w, Sector.Top / h, Sector.Right / w, Sector.Bottom / h ); + sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Bottom / h, Sector.Left / w, Sector.Top / h, Sector.Right / w, Sector.Top / h, Sector.Right / w, Sector.Bottom / h ); else - sBR->QuadsSetSubsetFree( 0, 1, 0, 0, 1, 0, 1, 1 ); + sBR->quadsSetSubsetFree( 0, 1, 0, 0, 1, 0, 1, 1 ); } else if ( Effect == RN_FLIPMIRROR ) { if ( renderSector ) - sBR->QuadsSetSubsetFree( Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h, Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h ); + sBR->quadsSetSubsetFree( Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h, Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h ); else - sBR->QuadsSetSubsetFree( 1, 1, 1, 0, 0, 0, 0, 1 ); + sBR->quadsSetSubsetFree( 1, 1, 1, 0, 0, 0, 0, 1 ); } } - sBR->BatchQuadEx( x, y, width, height, Angle, Scale, Center ); + sBR->batchQuadEx( x, y, width, height, Angle, Scale, Center ); } else { if ( renderSector ) - sBR->QuadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h ); + sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h ); Rectf TmpR( x, y, x + width, y + height ); Quad2f Q = Quad2f( Vector2f( TmpR.Left, TmpR.Top ), Vector2f( TmpR.Left, TmpR.Bottom ), Vector2f( TmpR.Right, TmpR.Bottom ), Vector2f( TmpR.Right, TmpR.Top ) ); @@ -612,35 +612,35 @@ void Texture::DrawEx( Float x, Float y, Float width, Float height, const Float & Q.scale( Scale, Center ); } - sBR->BatchQuadFree( Q[0].x, Q[0].y, Q[1].x, Q[1].y, Q[2].x, Q[2].y, Q[3].x, Q[3].y ); + sBR->batchQuadFree( Q[0].x, Q[0].y, Q[1].x, Q[1].y, Q[2].x, Q[2].y, Q[3].x, Q[3].y ); } - sBR->DrawOpt(); + sBR->drawOpt(); } -void Texture::DrawQuad( const Quad2f& Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const Recti& texSector) { - DrawQuadEx( Q, Offset, Angle, Scale, Color, Color, Color, Color, Blend, texSector ); +void Texture::drawQuad( const Quad2f& Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const Recti& texSector) { + drawQuadEx( Q, Offset, Angle, Scale, Color, Color, Color, Color, Blend, texSector ); } -void Texture::DrawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, Recti texSector ) { +void Texture::drawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const ColorA& Color0, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const EE_BLEND_MODE &Blend, Recti texSector ) { bool renderSector = true; - Float w = (Float)ImgWidth(); - Float h = (Float)ImgHeight(); + Float w = (Float)imgWidth(); + Float h = (Float)imgHeight(); if ( texSector.Right == 0 && texSector.Bottom == 0 ) { texSector.Left = 0; texSector.Top = 0; - texSector.Right = ImgWidth(); - texSector.Bottom = ImgHeight(); + texSector.Right = imgWidth(); + texSector.Bottom = imgHeight(); } renderSector = !( texSector.Left == 0 && texSector.Top == 0 && texSector.Right == w && texSector.Bottom == h ); - sBR->SetTexture( this ); - sBR->SetBlendMode( Blend ); + sBR->setTexture( this ); + sBR->setBlendMode( Blend ); - sBR->QuadsBegin(); - sBR->QuadsSetColorFree( Color0, Color1, Color2, Color3 ); + sBR->quadsBegin(); + sBR->quadsSetColorFree( Color0, Color1, Color2, Color3 ); if ( Angle != 0 || Scale != 1.0f ) { Vector2f QCenter( Q.getCenter() ); @@ -648,17 +648,17 @@ void Texture::DrawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle, Q.scale( Scale, QCenter ); } - if ( ClampMode() == CLAMP_REPEAT ) { - sBR->QuadsSetSubsetFree( 0, 0, 0, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, 0 ); + if ( clampMode() == CLAMP_REPEAT ) { + sBR->quadsSetSubsetFree( 0, 0, 0, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, 0 ); } else if ( renderSector ) { - sBR->QuadsSetSubsetFree( texSector.Left / w, texSector.Top / h, texSector.Left / w, texSector.Bottom / h, texSector.Right / w, texSector.Bottom / h, texSector.Right / w, texSector.Top / h ); + sBR->quadsSetSubsetFree( texSector.Left / w, texSector.Top / h, texSector.Left / w, texSector.Bottom / h, texSector.Right / w, texSector.Bottom / h, texSector.Right / w, texSector.Top / h ); } Q.move( Offset ); - sBR->BatchQuadFreeEx( Q[0].x, Q[0].y, Q[1].x, Q[1].y, Q[2].x, Q[2].y, Q[3].x, Q[3].y ); + sBR->batchQuadFreeEx( Q[0].x, Q[0].y, Q[1].x, Q[1].y, Q[2].x, Q[2].y, Q[3].x, Q[3].y ); - sBR->DrawOpt(); + sBR->drawOpt(); } }} diff --git a/src/eepp/graphics/textureatlas.cpp b/src/eepp/graphics/textureatlas.cpp index 5025d9559..a9803de42 100644 --- a/src/eepp/graphics/textureatlas.cpp +++ b/src/eepp/graphics/textureatlas.cpp @@ -5,30 +5,30 @@ namespace EE { namespace Graphics { TextureAtlas::TextureAtlas( const std::string& name ) : ResourceManager ( true ) { - Name( name ); + setName( name ); } TextureAtlas::~TextureAtlas() { } -const std::string& TextureAtlas::Name() const { +const std::string& TextureAtlas::getName() const { return mName; } -void TextureAtlas::Name( const std::string& name ) { +void TextureAtlas::setName( const std::string& name ) { mName = name; mId = String::hash( mName ); } -const std::string& TextureAtlas::Path() const { +const std::string& TextureAtlas::path() const { return mPath; } -void TextureAtlas::Path( const std::string& path ) { +void TextureAtlas::path( const std::string& path ) { mPath = path; } -const Uint32& TextureAtlas::Id() const { +const Uint32& TextureAtlas::getId() const { return mId; } @@ -56,16 +56,16 @@ Uint32 TextureAtlas::count() { return ResourceManager::count(); } -void TextureAtlas::SetTextures( std::vector textures ) { +void TextureAtlas::setTextures( std::vector textures ) { mTextures = textures; } -Texture * TextureAtlas::GetTexture( const Uint32& texnum ) const { +Texture * TextureAtlas::getTexture( const Uint32& texnum ) const { eeASSERT( texnum < mTextures.size() ); return mTextures[ texnum ]; } -Uint32 TextureAtlas::GetTexturesCount() { +Uint32 TextureAtlas::getTexturesCount() { return mTextures.size(); } diff --git a/src/eepp/graphics/textureatlasloader.cpp b/src/eepp/graphics/textureatlasloader.cpp index dcc7bb287..34324c010 100644 --- a/src/eepp/graphics/textureatlasloader.cpp +++ b/src/eepp/graphics/textureatlasloader.cpp @@ -32,7 +32,7 @@ TextureAtlasLoader::TextureAtlasLoader( const std::string& TextureAtlasPath, con mTextureAtlas(NULL), mLoadCallback( LoadCallback ) { - Load(); + load(); } TextureAtlasLoader::TextureAtlasLoader( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName, const bool& Threaded, GLLoadCallback LoadCallback ) : @@ -45,7 +45,7 @@ TextureAtlasLoader::TextureAtlasLoader( const Uint8* Data, const Uint32& DataSiz mTextureAtlas(NULL), mLoadCallback( LoadCallback ) { - LoadFromMemory( Data, DataSize, TextureAtlasName ); + loadFromMemory( Data, DataSize, TextureAtlasName ); } TextureAtlasLoader::TextureAtlasLoader( Pack * Pack, const std::string& FilePackPath, const bool& Threaded, GLLoadCallback LoadCallback ) : @@ -58,7 +58,7 @@ TextureAtlasLoader::TextureAtlasLoader( Pack * Pack, const std::string& FilePack mTextureAtlas(NULL), mLoadCallback( LoadCallback ) { - LoadFromPack( Pack, FilePackPath ); + loadFromPack( Pack, FilePackPath ); } TextureAtlasLoader::TextureAtlasLoader( IOStream& IOS, const bool& Threaded, GLLoadCallback LoadCallback ) : @@ -70,25 +70,25 @@ TextureAtlasLoader::TextureAtlasLoader( IOStream& IOS, const bool& Threaded, GLL mTextureAtlas(NULL), mLoadCallback( LoadCallback ) { - LoadFromStream( IOS ); + loadFromStream( IOS ); } TextureAtlasLoader::~TextureAtlasLoader() { } -void TextureAtlasLoader::SetLoadCallback( GLLoadCallback LoadCallback ) { +void TextureAtlasLoader::setLoadCallback( GLLoadCallback LoadCallback ) { mLoadCallback = LoadCallback; } -void TextureAtlasLoader::Update() { +void TextureAtlasLoader::update() { mRL.update(); if ( mRL.isLoaded() && !mLoaded ) - CreateSubTextures(); + createSubTextures(); } -void TextureAtlasLoader::LoadFromStream( IOStream& IOS ) { +void TextureAtlasLoader::loadFromStream( IOStream& IOS ) { mRL.threaded( mThreaded ); if ( IOS.isOpen() ) { @@ -108,7 +108,7 @@ void TextureAtlasLoader::LoadFromStream( IOStream& IOS ) { std::string path( FileSystem::fileRemoveFileName( mTextureAtlasPath ) + name ); //! Checks if the texture is already loaded - Texture * tTex = TextureFactory::instance()->GetByName( path ); + Texture * tTex = TextureFactory::instance()->getByName( path ); if ( !mSkipResourceLoad && NULL == tTex ) { if ( NULL != mPack ) { @@ -129,31 +129,31 @@ void TextureAtlasLoader::LoadFromStream( IOStream& IOS ) { mRL.load(); if ( !mThreaded || ( !mSkipResourceLoad && 0 == mRL.count() ) ) - CreateSubTextures(); + createSubTextures(); } } } -void TextureAtlasLoader::Load( const std::string& TextureAtlasPath ) { +void TextureAtlasLoader::load( const std::string& TextureAtlasPath ) { if ( TextureAtlasPath.size() ) mTextureAtlasPath = TextureAtlasPath; if ( FileSystem::fileExists( mTextureAtlasPath ) ) { IOStreamFile IOS( mTextureAtlasPath, std::ios::in | std::ios::binary ); - LoadFromStream( IOS ); + loadFromStream( IOS ); } else if ( PackManager::instance()->fallbackToPacks() ) { std::string tgPath( mTextureAtlasPath ); Pack * tPack = PackManager::instance()->exists( tgPath ); if ( NULL != tPack ) { - LoadFromPack( tPack, tgPath ); + loadFromPack( tPack, tgPath ); } } } -void TextureAtlasLoader::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { +void TextureAtlasLoader::loadFromPack( Pack * Pack, const std::string& FilePackPath ) { if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( FilePackPath ) ) { mPack = Pack; @@ -161,24 +161,24 @@ void TextureAtlasLoader::LoadFromPack( Pack * Pack, const std::string& FilePackP Pack->extractFileToMemory( FilePackPath, PData ); - LoadFromMemory( reinterpret_cast ( PData.Data ), PData.DataSize, FilePackPath ); + loadFromMemory( reinterpret_cast ( PData.Data ), PData.DataSize, FilePackPath ); } } -void TextureAtlasLoader::LoadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ) { +void TextureAtlasLoader::loadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ) { if ( TextureAtlasName.size() ) mTextureAtlasPath = TextureAtlasName; IOStreamMemory IOS( (const char*)Data, DataSize ); - LoadFromStream( IOS ); + loadFromStream( IOS ); } -TextureAtlas * TextureAtlasLoader::GetTextureAtlas() const { +TextureAtlas * TextureAtlasLoader::getTextureAtlas() const { return mTextureAtlas; } -void TextureAtlasLoader::CreateSubTextures() { +void TextureAtlasLoader::createSubTextures() { mIsLoading = false; bool IsAlreadyLoaded = false; @@ -191,7 +191,7 @@ void TextureAtlasLoader::CreateSubTextures() { FileSystem::filePathRemoveProcessPath( path ); - Texture * tTex = TextureFactory::instance()->GetByName( path ); + Texture * tTex = TextureFactory::instance()->getByName( path ); if ( NULL != tTex ) mTexuresLoaded.push_back( tTex ); @@ -205,14 +205,14 @@ void TextureAtlasLoader::CreateSubTextures() { TextureAtlas * tTextureAtlas = TextureAtlasManager::instance()->getByName( name ); - if ( NULL != tTextureAtlas && tTextureAtlas->Path() == etapath ) { + if ( NULL != tTextureAtlas && tTextureAtlas->path() == etapath ) { mTextureAtlas = tTextureAtlas; IsAlreadyLoaded = true; } else { mTextureAtlas = eeNew( TextureAtlas, ( name ) ); - mTextureAtlas->Path( etapath ); + mTextureAtlas->path( etapath ); TextureAtlasManager::instance()->add( mTextureAtlas ); } @@ -230,7 +230,7 @@ void TextureAtlasLoader::CreateSubTextures() { Recti tRect( tSh->X, tSh->Y, tSh->X + tSh->Width, tSh->Y + tSh->Height ); - SubTexture * tSubTexture = eeNew( SubTexture, ( tTex->Id(), tRect, Sizef( (Float)tSh->DestWidth, (Float)tSh->DestHeight ), Vector2i( tSh->OffsetX, tSh->OffsetY ), SubTextureName ) ); + SubTexture * tSubTexture = eeNew( SubTexture, ( tTex->getId(), tRect, Sizef( (Float)tSh->DestWidth, (Float)tSh->DestHeight ), Vector2i( tSh->OffsetX, tSh->OffsetY ), SubTextureName ) ); //if ( tSh->Flags & HDR_SUBTEXTURE_FLAG_FLIPED ) // Should rotate the sub texture, but.. sub texture rotation is not stored. @@ -248,7 +248,7 @@ void TextureAtlasLoader::CreateSubTextures() { } if ( NULL != mTextureAtlas && mTexuresLoaded.size() ) { - mTextureAtlas->SetTextures( mTexuresLoaded ); + mTextureAtlas->setTextures( mTexuresLoaded ); } mLoaded = true; @@ -258,32 +258,32 @@ void TextureAtlasLoader::CreateSubTextures() { } } -bool TextureAtlasLoader::Threaded() const { +bool TextureAtlasLoader::threaded() const { return mThreaded; } -void TextureAtlasLoader::Threaded( const bool& threaded ) { +void TextureAtlasLoader::threaded( const bool& threaded ) { mThreaded = threaded; } -const bool& TextureAtlasLoader::IsLoaded() const { +const bool& TextureAtlasLoader::isLoaded() const { return mLoaded; } -const bool& TextureAtlasLoader::IsLoading() const { +const bool& TextureAtlasLoader::isLoading() const { return mIsLoading; } -Texture * TextureAtlasLoader::GetTexture( const Uint32& texnum ) const { +Texture * TextureAtlasLoader::getTexture( const Uint32& texnum ) const { eeASSERT( texnum < mTexuresLoaded.size() ); return mTexuresLoaded[ texnum ]; } -Uint32 TextureAtlasLoader::GetTexturesLoadedCount() { +Uint32 TextureAtlasLoader::getTexturesLoadedCount() { return mTexuresLoaded.size(); } -bool TextureAtlasLoader::UpdateTextureAtlas() { +bool TextureAtlasLoader::updateTextureAtlas() { if ( NULL == mTextureAtlas || !mTextureAtlasPath.size() ) return false; @@ -297,10 +297,10 @@ bool TextureAtlasLoader::UpdateTextureAtlas() { SubTexture * tSubTexture = mTextureAtlas->getById( tSh->ResourceID ); if ( NULL != tSubTexture ) { - tSh->OffsetX = tSubTexture->Offset().x; - tSh->OffsetY = tSubTexture->Offset().x; - tSh->DestWidth = (Int32)tSubTexture->DestSize().x; - tSh->DestHeight = (Int32)tSubTexture->DestSize().x; + tSh->OffsetX = tSubTexture->offset().x; + tSh->OffsetY = tSubTexture->offset().x; + tSh->DestWidth = (Int32)tSubTexture->destSize().x; + tSh->DestHeight = (Int32)tSubTexture->destSize().x; } } } @@ -346,19 +346,19 @@ static bool IsImage( std::string path ) { ) { return true; } else { - return Image::IsImage( path ); + return Image::isImage( path ); } } return false; } -bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std::string ImagesPath ) { +bool TextureAtlasLoader::updateTextureAtlas( std::string TextureAtlasPath, std::string ImagesPath ) { if ( !TextureAtlasPath.size() || !ImagesPath.size() || !FileSystem::fileExists( TextureAtlasPath ) || !FileSystem::isDirectory( ImagesPath ) ) return false; mSkipResourceLoad = true; - Load( TextureAtlasPath ); + load( TextureAtlasPath ); mSkipResourceLoad = false; if ( !mTempAtlass.size() ) @@ -430,16 +430,16 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: } if ( NeedUpdate ) { - std::string tapath( FileSystem::fileRemoveExtension( TextureAtlasPath ) + "." + Image::SaveTypeToExtension( mTexGrHdr.Format ) ); + std::string tapath( FileSystem::fileRemoveExtension( TextureAtlasPath ) + "." + Image::saveTypeToExtension( mTexGrHdr.Format ) ); if ( 2 == NeedUpdate ) { TexturePacker tp( mTexGrHdr.Width, mTexGrHdr.Height, 0 != ( mTexGrHdr.Flags & HDR_TEXTURE_ATLAS_POW_OF_TWO ), mTexGrHdr.PixelBorder, mTexGrHdr.Flags & HDR_TEXTURE_ATLAS_ALLOW_FLIPPING ); - tp.AddTexturesPath( ImagesPath ); + tp.addTexturesPath( ImagesPath ); - tp.PackTextures(); + tp.packTextures(); - tp.Save( tapath, (EE_SAVE_TYPE)mTexGrHdr.Format ); + tp.save( tapath, (EE_SAVE_TYPE)mTexGrHdr.Format ); } else if ( 1 == NeedUpdate ) { std::string etapath = FileSystem::fileRemoveExtension( tapath ) + EE_TEXTURE_ATLAS_EXTENSION; @@ -452,14 +452,14 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: for ( Uint32 z = 0; z < mTempAtlass.size(); z++ ) { if ( z != 0 ) { - tapath = FileSystem::fileRemoveExtension( TextureAtlasPath ) + "_ch" + String::toStr( z ) + "." + Image::SaveTypeToExtension( mTexGrHdr.Format ); + tapath = FileSystem::fileRemoveExtension( TextureAtlasPath ) + "_ch" + String::toStr( z ) + "." + Image::saveTypeToExtension( mTexGrHdr.Format ); } unsigned char * imgPtr = stbi_load( tapath.c_str(), &x, &y, &c, 0 ); if ( NULL != imgPtr ) { Image Img( imgPtr, x, y, c ); - Img.AvoidFreeImage( true ); + Img.avoidFreeImage( true ); sTempTexAtlas * tTexAtlas = &mTempAtlass[z]; sTextureHdr * tTexHdr = &tTexAtlas->Texture; @@ -480,9 +480,9 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: if ( NULL != imgCopyPtr ) { Image ImgCopy( imgCopyPtr, x, y, c ); - ImgCopy.AvoidFreeImage( true ); + ImgCopy.avoidFreeImage( true ); - Img.CopyImage( &ImgCopy, tSh->X, tSh->Y ); // Update the image into the texture atlas + Img.copyImage( &ImgCopy, tSh->X, tSh->Y ); // Update the image into the texture atlas if ( imgCopyPtr ) free( imgCopyPtr ); @@ -493,7 +493,7 @@ bool TextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std:: fs.write( reinterpret_cast (&tTexAtlas->SubTextures[0]), sizeof(sSubTextureHdr) * tTexHdr->SubTextureCount ); - Img.SaveToFile( tapath, (EE_SAVE_TYPE)mTexGrHdr.Format ); + Img.saveToFile( tapath, (EE_SAVE_TYPE)mTexGrHdr.Format ); if ( imgPtr ) free( imgPtr ); diff --git a/src/eepp/graphics/textureatlasmanager.cpp b/src/eepp/graphics/textureatlasmanager.cpp index 305da8bc3..2d0ff952d 100644 --- a/src/eepp/graphics/textureatlasmanager.cpp +++ b/src/eepp/graphics/textureatlasmanager.cpp @@ -15,32 +15,32 @@ TextureAtlasManager::TextureAtlasManager() : TextureAtlasManager::~TextureAtlasManager() { } -TextureAtlas * TextureAtlasManager::Load( const std::string& TextureAtlasPath ) { +TextureAtlas * TextureAtlasManager::load( const std::string& TextureAtlasPath ) { TextureAtlasLoader loader( TextureAtlasPath ); - return loader.GetTextureAtlas(); + return loader.getTextureAtlas(); } -TextureAtlas * TextureAtlasManager::LoadFromStream( IOStream& IOS ) { +TextureAtlas * TextureAtlasManager::loadFromStream( IOStream& IOS ) { TextureAtlasLoader loader( IOS ); - return loader.GetTextureAtlas(); + return loader.getTextureAtlas(); } -TextureAtlas * TextureAtlasManager::LoadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ) { +TextureAtlas * TextureAtlasManager::loadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ) { TextureAtlasLoader loader( Data, DataSize, TextureAtlasName ); - return loader.GetTextureAtlas(); + return loader.getTextureAtlas(); } -TextureAtlas * TextureAtlasManager::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { +TextureAtlas * TextureAtlasManager::loadFromPack( Pack * Pack, const std::string& FilePackPath ) { TextureAtlasLoader loader( Pack, FilePackPath ); - return loader.GetTextureAtlas(); + return loader.getTextureAtlas(); } -SubTexture * TextureAtlasManager::GetSubTextureByName( const std::string& Name ) { - SubTexture * tSubTexture = GetSubTextureById( String::hash( Name ) ); +SubTexture * TextureAtlasManager::getSubTextureByName( const std::string& Name ) { + SubTexture * tSubTexture = getSubTextureById( String::hash( Name ) ); if ( mWarnings ) { eePRINTC( NULL == tSubTexture, "TextureAtlasManager::GetSubTextureByName SubTexture '%s' not found\n", Name.c_str() ); @@ -49,7 +49,7 @@ SubTexture * TextureAtlasManager::GetSubTextureByName( const std::string& Name ) return tSubTexture; } -SubTexture * TextureAtlasManager::GetSubTextureById( const Uint32& Id ) { +SubTexture * TextureAtlasManager::getSubTextureById( const Uint32& Id ) { std::list::iterator it; TextureAtlas * tSG = NULL; @@ -67,43 +67,43 @@ SubTexture * TextureAtlasManager::GetSubTextureById( const Uint32& Id ) { return NULL; } -void TextureAtlasManager::PrintResources() { +void TextureAtlasManager::printResources() { std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) (*it)->printNames(); } -std::vector TextureAtlasManager::GetSubTexturesByPatternId( const Uint32& SubTextureId, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { +std::vector TextureAtlasManager::getSubTexturesByPatternId( const Uint32& SubTextureId, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { SubTexture * tSubTexture = NULL; std::string tName; if ( NULL == SearchInTextureAtlas ) - tSubTexture = GetSubTextureById( SubTextureId ); + tSubTexture = getSubTextureById( SubTextureId ); else tSubTexture = SearchInTextureAtlas->getById( SubTextureId ); if ( NULL != tSubTexture ) { if ( extension.size() ) - tName = String::removeNumbersAtEnd( FileSystem::fileRemoveExtension( tSubTexture->Name() ) ) + extension; + tName = String::removeNumbersAtEnd( FileSystem::fileRemoveExtension( tSubTexture->getName() ) ) + extension; else - tName = tSubTexture->Name(); + tName = tSubTexture->getName(); - return GetSubTexturesByPattern( String::removeNumbersAtEnd( tSubTexture->Name() ), "", SearchInTextureAtlas ); + return getSubTexturesByPattern( String::removeNumbersAtEnd( tSubTexture->getName() ), "", SearchInTextureAtlas ); } return std::vector(); } -void TextureAtlasManager::PrintWarnings( const bool& warn ) { +void TextureAtlasManager::printWarnings( const bool& warn ) { mWarnings = warn; } -const bool& TextureAtlasManager::PrintWarnings() const { +const bool& TextureAtlasManager::printWarnings() const { return mWarnings; } -std::vector TextureAtlasManager::GetSubTexturesByPattern( const std::string& name, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { +std::vector TextureAtlasManager::getSubTexturesByPattern( const std::string& name, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { std::vector SubTextures; std::string search; bool found = true; @@ -121,7 +121,7 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std search = String::strFormated( "%s%d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) - tSubTexture = GetSubTextureByName( search ); + tSubTexture = getSubTextureByName( search ); else tSubTexture = SearchInTextureAtlas->getByName( search ); @@ -138,7 +138,7 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std search = String::strFormated( "%s%02d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) - tSubTexture = GetSubTextureByName( search ); + tSubTexture = getSubTextureByName( search ); else tSubTexture = SearchInTextureAtlas->getByName( search ); @@ -155,7 +155,7 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std search = String::strFormated( "%s%03d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) - tSubTexture = GetSubTextureByName( search ); + tSubTexture = getSubTextureByName( search ); else tSubTexture = SearchInTextureAtlas->getByName( search ); @@ -171,7 +171,7 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std search = String::strFormated( "%s%04d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) - tSubTexture = GetSubTextureByName( search ); + tSubTexture = getSubTextureByName( search ); else tSubTexture = SearchInTextureAtlas->getByName( search ); @@ -187,7 +187,7 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std search = String::strFormated( "%s%05d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) - tSubTexture = GetSubTextureByName( search ); + tSubTexture = getSubTextureByName( search ); else tSubTexture = SearchInTextureAtlas->getByName( search ); @@ -203,7 +203,7 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std search = String::strFormated( "%s%06d%s", name.c_str(), i, realext.c_str() ); if ( NULL == SearchInTextureAtlas ) - tSubTexture = GetSubTextureByName( search ); + tSubTexture = getSubTextureByName( search ); else tSubTexture = SearchInTextureAtlas->getByName( search ); @@ -233,7 +233,7 @@ std::vector TextureAtlasManager::GetSubTexturesByPattern( const std if ( found ) { if ( NULL == SearchInTextureAtlas ) - tSubTexture = GetSubTextureByName( search ); + tSubTexture = getSubTextureByName( search ); else tSubTexture = SearchInTextureAtlas->getByName( search ); diff --git a/src/eepp/graphics/texturefactory.cpp b/src/eepp/graphics/texturefactory.cpp index ee4fd14d8..be919bcb8 100755 --- a/src/eepp/graphics/texturefactory.cpp +++ b/src/eepp/graphics/texturefactory.cpp @@ -23,45 +23,45 @@ TextureFactory::TextureFactory() : } TextureFactory::~TextureFactory() { - UnloadTextures(); + unloadTextures(); } -Uint32 TextureFactory::CreateEmptyTexture( const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const ColorA& DefaultColor, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { +Uint32 TextureFactory::createEmptyTexture( const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const ColorA& DefaultColor, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { Image TmpImg( Width, Height, Channels, DefaultColor ); - return LoadFromPixels( TmpImg.GetPixelsPtr(), Width, Height, Channels, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); + return loadFromPixels( TmpImg.getPixelsPtr(), Width, Height, Channels, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); } -Uint32 TextureFactory::LoadFromPixels( const unsigned char * Pixels, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy, const std::string& FileName ) { +Uint32 TextureFactory::loadFromPixels( const unsigned char * Pixels, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy, const std::string& FileName ) { TextureLoader myTex( Pixels, Width, Height, Channels, Mipmap, ClampMode, CompressTexture, KeepLocalCopy, FileName ); myTex.load(); - return myTex.Id(); + return myTex.getId(); } -Uint32 TextureFactory::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { +Uint32 TextureFactory::loadFromPack( Pack* Pack, const std::string& FilePackPath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { TextureLoader myTex( Pack, FilePackPath, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); myTex.load(); - return myTex.Id(); + return myTex.getId(); } -Uint32 TextureFactory::LoadFromMemory( const unsigned char * ImagePtr, const unsigned int& Size, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { +Uint32 TextureFactory::loadFromMemory( const unsigned char * ImagePtr, const unsigned int& Size, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { TextureLoader myTex( ImagePtr, Size, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); myTex.load(); - return myTex.Id(); + return myTex.getId(); } -Uint32 TextureFactory::LoadFromStream( IOStream& Stream, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { +Uint32 TextureFactory::loadFromStream( IOStream& Stream, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { TextureLoader myTex( Stream, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); myTex.load(); - return myTex.Id(); + return myTex.getId(); } -Uint32 TextureFactory::Load( const std::string& Filepath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { +Uint32 TextureFactory::load( const std::string& Filepath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { TextureLoader myTex( Filepath, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); myTex.load(); - return myTex.Id(); + return myTex.getId(); } -Uint32 TextureFactory::PushTexture( const std::string& Filepath, const Uint32& TexId, const unsigned int& Width, const unsigned int& Height, const unsigned int& ImgWidth, const unsigned int& ImgHeight, const bool& Mipmap, const unsigned int& Channels, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& LocalCopy, const Uint32& MemSize ) { +Uint32 TextureFactory::pushTexture( const std::string& Filepath, const Uint32& TexId, const unsigned int& Width, const unsigned int& Height, const unsigned int& ImgWidth, const unsigned int& ImgHeight, const bool& Mipmap, const unsigned int& Channels, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& LocalCopy, const Uint32& MemSize ) { lock(); Texture * Tex = NULL; @@ -71,15 +71,15 @@ Uint32 TextureFactory::PushTexture( const std::string& Filepath, const Uint32& T FileSystem::filePathRemoveProcessPath( FPath ); - Pos = FindFreeSlot(); + Pos = findFreeSlot(); Tex = mTextures[ Pos ] = eeNew( Texture, () ); - Tex->Create( TexId, Width, Height, ImgWidth, ImgHeight, Mipmap, Channels, FPath, ClampMode, CompressTexture, MemSize ); - Tex->Id( Pos ); + Tex->create( TexId, Width, Height, ImgWidth, ImgHeight, Mipmap, Channels, FPath, ClampMode, CompressTexture, MemSize ); + Tex->setId( Pos ); if ( LocalCopy ) { - Tex->Lock(); - Tex->Unlock( true, false ); + Tex->lock(); + Tex->unlock( true, false ); } mMemSize += MemSize; @@ -89,7 +89,7 @@ Uint32 TextureFactory::PushTexture( const std::string& Filepath, const Uint32& T return Pos; } -Uint32 TextureFactory::FindFreeSlot() { +Uint32 TextureFactory::findFreeSlot() { if ( mVectorFreeSlots.size() ) { Uint32 Pos = mVectorFreeSlots.front(); @@ -103,25 +103,25 @@ Uint32 TextureFactory::FindFreeSlot() { return (Uint32)mTextures.size() - 1; } -void TextureFactory::Bind( const Texture* Tex, const Uint32& TextureUnit ) { - if( NULL != Tex && mCurrentTexture[ TextureUnit ] != (Int32)Tex->Handle() ) { - if ( TextureUnit && GLi->IsExtension( EEGL_ARB_multitexture ) ) - SetActiveTextureUnit( TextureUnit ); +void TextureFactory::bind( const Texture* Tex, const Uint32& TextureUnit ) { + if( NULL != Tex && mCurrentTexture[ TextureUnit ] != (Int32)Tex->handle() ) { + if ( TextureUnit && GLi->isExtension( EEGL_ARB_multitexture ) ) + setActiveTextureUnit( TextureUnit ); - GLi->BindTexture( GL_TEXTURE_2D, Tex->Handle() ); + GLi->bindTexture( GL_TEXTURE_2D, Tex->handle() ); - mCurrentTexture[ TextureUnit ] = Tex->Handle(); + mCurrentTexture[ TextureUnit ] = Tex->handle(); - if ( TextureUnit && GLi->IsExtension( EEGL_ARB_multitexture ) ) - SetActiveTextureUnit( 0 ); + if ( TextureUnit && GLi->isExtension( EEGL_ARB_multitexture ) ) + setActiveTextureUnit( 0 ); } } -void TextureFactory::Bind( const Uint32& TexId, const Uint32& TextureUnit ) { - Bind( GetTexture( TexId ), TextureUnit ); +void TextureFactory::bind( const Uint32& TexId, const Uint32& TextureUnit ) { + bind( getTexture( TexId ), TextureUnit ); } -void TextureFactory::UnloadTextures() { +void TextureFactory::unloadTextures() { mErasing = true; for ( Uint32 i = 1; i < mTextures.size(); i++ ) @@ -134,11 +134,11 @@ void TextureFactory::UnloadTextures() { eePRINTL( "Textures Unloaded." ); } -bool TextureFactory::Remove( Uint32 TexId ) { +bool TextureFactory::remove( Uint32 TexId ) { Texture * Tex; if ( TexId < mTextures.size() && NULL != ( Tex = mTextures[ TexId ] ) ) { - RemoveReference( mTextures[ TexId ] ); + removeReference( mTextures[ TexId ] ); mErasing = true; eeDelete( Tex ); @@ -150,121 +150,121 @@ bool TextureFactory::Remove( Uint32 TexId ) { return false; } -void TextureFactory::RemoveReference( Texture * Tex ) { - mMemSize -= Tex->MemSize(); +void TextureFactory::removeReference( Texture * Tex ) { + mMemSize -= Tex->memSize(); - int glTexId = Tex->Handle(); + int glTexId = Tex->handle(); - mTextures[ Tex->Id() ] = NULL; + mTextures[ Tex->getId() ] = NULL; for ( Uint32 i = 0; i < EE_MAX_TEXTURE_UNITS; i++ ) { if ( mCurrentTexture[ i ] == (Int32)glTexId ) mCurrentTexture[ i ] = 0; } - mVectorFreeSlots.push_back( Tex->Id() ); + mVectorFreeSlots.push_back( Tex->getId() ); } -const bool& TextureFactory::IsErasing() const { +const bool& TextureFactory::isErasing() const { return mErasing; } -int TextureFactory::GetCurrentTexture( const Uint32& TextureUnit ) const { +int TextureFactory::getCurrentTexture( const Uint32& TextureUnit ) const { eeASSERT( TextureUnit < EE_MAX_TEXTURE_UNITS ); return mCurrentTexture[ TextureUnit ]; } -void TextureFactory::SetCurrentTexture( const int& TexId, const Uint32& TextureUnit ) { +void TextureFactory::setCurrentTexture( const int& TexId, const Uint32& TextureUnit ) { eeASSERT( TextureUnit < EE_MAX_TEXTURE_UNITS ); mCurrentTexture[ TextureUnit ] = TexId; } -void TextureFactory::ReloadAllTextures() { +void TextureFactory::reloadAllTextures() { for ( Uint32 i = 1; i < mTextures.size(); i++ ) { - Texture* Tex = GetTexture(i); + Texture* Tex = getTexture(i); if ( Tex ) - Tex->Reload(); + Tex->reload(); } eePRINTL("Textures Reloaded."); } -void TextureFactory::GrabTextures() { +void TextureFactory::grabTextures() { for ( Uint32 i = 1; i < mTextures.size(); i++ ) { - Texture* Tex = GetTexture(i); + Texture* Tex = getTexture(i); - if ( Tex && !Tex->LocalCopy() ) { - Tex->Lock(); - Tex->Grabed(true); + if ( Tex && !Tex->localCopy() ) { + Tex->lock(); + Tex->grabed(true); } } } -void TextureFactory::UngrabTextures() { +void TextureFactory::ungrabTextures() { for ( Uint32 i = 1; i < mTextures.size(); i++ ) { - Texture* Tex = GetTexture(i); + Texture* Tex = getTexture(i); - if ( NULL != Tex && Tex->Grabed() ) { - Tex->Reload(); - Tex->Unlock(); - Tex->Grabed(false); + if ( NULL != Tex && Tex->grabed() ) { + Tex->reload(); + Tex->unlock(); + Tex->grabed(false); } } } -void TextureFactory::SetActiveTextureUnit( const Uint32& Unit ) { - GLi->ActiveTexture( GL_TEXTURE0 + Unit ); +void TextureFactory::setActiveTextureUnit( const Uint32& Unit ) { + GLi->activeTexture( GL_TEXTURE0 + Unit ); } -void TextureFactory::SetTextureEnv( const EE_TEXTURE_PARAM& Param, const Int32& Val ) { +void TextureFactory::setTextureEnv( const EE_TEXTURE_PARAM& Param, const Int32& Val ) { #ifndef EE_GLES2 - unsigned int lParam = (unsigned int)GLi->GetTextureParamEnum( Param ); + unsigned int lParam = (unsigned int)GLi->getTextureParamEnum( Param ); - GLi->TexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB ); + GLi->texEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB ); if( Param == TEX_PARAM_COLOR_FUNC || Param == TEX_PARAM_ALPHA_FUNC ) { - GLi->TexEnvi( GL_TEXTURE_ENV, lParam, GLi->GetTextureFuncEnum( (EE_TEXTURE_FUNC)Val ) ); + GLi->texEnvi( GL_TEXTURE_ENV, lParam, GLi->getTextureFuncEnum( (EE_TEXTURE_FUNC)Val ) ); } else if( Param >= TEX_PARAM_COLOR_SOURCE_0 && Param <= TEX_PARAM_ALPHA_SOURCE_2 ) { - GLi->TexEnvi( GL_TEXTURE_ENV, lParam, GLi->GetTextureSourceEnum( (EE_TEXTURE_SOURCE)Val ) ); + GLi->texEnvi( GL_TEXTURE_ENV, lParam, GLi->getTextureSourceEnum( (EE_TEXTURE_SOURCE)Val ) ); } else if( Param >= TEX_PARAM_COLOR_OP_0 && Param <= TEX_PARAM_ALPHA_OP_2 ) { - GLi->TexEnvi( GL_TEXTURE_ENV, lParam, GLi->GetTextureOpEnum( (EE_TEXTURE_OP)Val ) ); + GLi->texEnvi( GL_TEXTURE_ENV, lParam, GLi->getTextureOpEnum( (EE_TEXTURE_OP)Val ) ); } else { - GLi->TexEnvi( GL_TEXTURE_ENV, lParam, Val ); + GLi->texEnvi( GL_TEXTURE_ENV, lParam, Val ); } #endif } -unsigned int TextureFactory::GetValidTextureSize( const unsigned int& Size ) { - if ( GLi->IsExtension( EEGL_ARB_texture_non_power_of_two ) ) +unsigned int TextureFactory::getValidTextureSize( const unsigned int& Size ) { + if ( GLi->isExtension( EEGL_ARB_texture_non_power_of_two ) ) return Size; else return Math::nextPowOfTwo(Size); } -bool TextureFactory::SaveImage( const std::string& filepath, const EE_SAVE_TYPE& Format, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const unsigned char* data ) { +bool TextureFactory::saveImage( const std::string& filepath, const EE_SAVE_TYPE& Format, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, const unsigned char* data ) { bool Res; if ( SAVE_TYPE_JPG != Format ) { Res = 0 != SOIL_save_image ( filepath.c_str(), Format, Width, Height, Channels, data ); } else { jpge::params params; - params.m_quality = Image::JpegQuality(); + params.m_quality = Image::jpegQuality(); Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), Width, Height, Channels, data, params); } return Res; } -bool TextureFactory::TextureIdExists( const Uint32& TexId ) { +bool TextureFactory::textureIdExists( const Uint32& TexId ) { return ( TexId < mTextures.size() && TexId > 0 && NULL != mTextures[ TexId ] ); } -Texture * TextureFactory::GetTexture( const Uint32& TexId ) { +Texture * TextureFactory::getTexture( const Uint32& TexId ) { return mTextures[TexId]; } -void TextureFactory::Allocate( const unsigned int& size ) { +void TextureFactory::allocate( const unsigned int& size ) { if ( size > mTextures.size() ) { mTextures.resize( size + 1, NULL ); @@ -273,17 +273,17 @@ void TextureFactory::Allocate( const unsigned int& size ) { } } -Texture * TextureFactory::GetByName( const std::string& Name ) { - return GetByHash( String::hash( Name ) ); +Texture * TextureFactory::getByName( const std::string& Name ) { + return getByHash( String::hash( Name ) ); } -Texture * TextureFactory::GetByHash( const Uint32& Hash ) { +Texture * TextureFactory::getByHash( const Uint32& Hash ) { Texture * tTex = NULL; for ( Uint32 i = (Uint32)mTextures.size() - 1; i > 0; i-- ) { tTex = mTextures[ i ]; - if ( NULL != tTex && tTex->HashName() == Hash ) + if ( NULL != tTex && tTex->hashName() == Hash ) return mTextures[ i ]; } diff --git a/src/eepp/graphics/texturefont.cpp b/src/eepp/graphics/texturefont.cpp index a9b1d5ef8..e04081830 100755 --- a/src/eepp/graphics/texturefont.cpp +++ b/src/eepp/graphics/texturefont.cpp @@ -20,8 +20,8 @@ TextureFont::TextureFont( const std::string FontName ) : TextureFont::~TextureFont() { } -bool TextureFont::Load( const Uint32& TexId, const unsigned int& StartChar, const unsigned int& Spacing, const unsigned int& TexColumns, const unsigned int& TexRows, const Uint16& NumChars ) { - Texture * Tex = TextureFactory::instance()->GetTexture( TexId ); +bool TextureFont::load( const Uint32& TexId, const unsigned int& StartChar, const unsigned int& Spacing, const unsigned int& TexColumns, const unsigned int& TexRows, const Uint16& NumChars ) { + Texture * Tex = TextureFactory::instance()->getTexture( TexId ); mTexId = TexId; @@ -34,8 +34,8 @@ bool TextureFont::Load( const Uint32& TexId, const unsigned int& StartChar, cons mtX = ( 1 / static_cast( mTexColumns ) ); mtY = ( 1 / static_cast( mTexRows ) ); - mFWidth = (Float)( Tex->Width() / mTexColumns ); - mFHeight = (Float)( Tex->Height() / mTexRows ); + mFWidth = (Float)( Tex->width() / mTexColumns ); + mFHeight = (Float)( Tex->height() / mTexRows ); mHeight = mSize = mLineSkip = (unsigned int)mFHeight; if ( Spacing == 0 ) @@ -43,9 +43,9 @@ bool TextureFont::Load( const Uint32& TexId, const unsigned int& StartChar, cons else mSpacing = Spacing; - BuildFont(); + buildFont(); - eePRINTL( "Texture Font %s loaded.", Tex->Filepath().c_str() ); + eePRINTL( "Texture Font %s loaded.", Tex->filepath().c_str() ); return true; } @@ -55,13 +55,13 @@ bool TextureFont::Load( const Uint32& TexId, const unsigned int& StartChar, cons return false; } -void TextureFont::BuildFont() { +void TextureFont::buildFont() { Float cX = 0, cY = 0; mTexCoords.resize( mNumChars ); mGlyphs.resize( mNumChars ); - TextureFactory::instance()->Bind( mTexId ); + TextureFactory::instance()->bind( mTexId ); int c = 0; @@ -99,26 +99,26 @@ void TextureFont::BuildFont() { } } -void TextureFont::BuildFromGlyphs() { +void TextureFont::buildFromGlyphs() { Float Top, Bottom; Rectf tR; mTexCoords.resize( mNumChars ); - Texture * Tex = TextureFactory::instance()->GetTexture( mTexId ); + Texture * Tex = TextureFactory::instance()->getTexture( mTexId ); - TextureFactory::instance()->Bind( Tex ); + TextureFactory::instance()->bind( Tex ); eeGlyph tGlyph; for (unsigned int i = 0; i < mNumChars; i++) { tGlyph = mGlyphs[i]; - tR.Left = (Float)tGlyph.CurX / Tex->Width(); - tR.Top = (Float)tGlyph.CurY / Tex->Height(); + tR.Left = (Float)tGlyph.CurX / Tex->width(); + tR.Top = (Float)tGlyph.CurY / Tex->height(); - tR.Right = (Float)(tGlyph.CurX + tGlyph.CurW) / Tex->Width(); - tR.Bottom = (Float)(tGlyph.CurY + tGlyph.CurH) / Tex->Height(); + tR.Right = (Float)(tGlyph.CurX + tGlyph.CurW) / Tex->width(); + tR.Bottom = (Float)(tGlyph.CurY + tGlyph.CurH) / Tex->height(); Top = mHeight + mDescent - tGlyph.GlyphH - tGlyph.MinY; Bottom = mHeight + mDescent + tGlyph.GlyphH - tGlyph.MaxY; @@ -142,43 +142,43 @@ void TextureFont::BuildFromGlyphs() { } } -bool TextureFont::Load( const Uint32& TexId, const std::string& CoordinatesDatPath ) { +bool TextureFont::load( const Uint32& TexId, const std::string& CoordinatesDatPath ) { if ( FileSystem::fileExists( CoordinatesDatPath ) ) { IOStreamFile IOS( CoordinatesDatPath, std::ios::in | std::ios::binary ); - return LoadFromStream( TexId, IOS ); + return loadFromStream( TexId, IOS ); } else if ( PackManager::instance()->fallbackToPacks() ) { std::string tPath( CoordinatesDatPath ); Pack * tPack = PackManager::instance()->exists( tPath ); if ( NULL != tPack ) { - return LoadFromPack( TexId, tPack, tPath ); + return loadFromPack( TexId, tPack, tPath ); } } return false; } -bool TextureFont::LoadFromPack( const Uint32& TexId, Pack* Pack, const std::string& FilePackPath ) { +bool TextureFont::loadFromPack( const Uint32& TexId, Pack* Pack, const std::string& FilePackPath ) { if ( NULL != Pack && Pack->isOpen() && -1 != Pack->exists( FilePackPath ) ) { SafeDataPointer PData; Pack->extractFileToMemory( FilePackPath, PData ); - return LoadFromMemory( TexId, reinterpret_cast ( PData.Data ), PData.DataSize ); + return loadFromMemory( TexId, reinterpret_cast ( PData.Data ), PData.DataSize ); } return false; } -bool TextureFont::LoadFromMemory( const Uint32& TexId, const char* CoordData, const Uint32& CoordDataSize ) { +bool TextureFont::loadFromMemory( const Uint32& TexId, const char* CoordData, const Uint32& CoordDataSize ) { IOStreamMemory IOS( CoordData, CoordDataSize ); - return LoadFromStream( TexId, IOS ); + return loadFromStream( TexId, IOS ); } -bool TextureFont::LoadFromStream( const Uint32& TexId, IOStream& IOS ) { +bool TextureFont::loadFromStream( const Uint32& TexId, IOStream& IOS ) { mTexId = TexId; if ( mTexId > 0 ) { @@ -203,7 +203,7 @@ bool TextureFont::LoadFromStream( const Uint32& TexId, IOStream& IOS ) { // Read the glyphs IOS.read( (char*)&mGlyphs[0], sizeof(eeGlyph) * mNumChars ); - BuildFromGlyphs(); + buildFromGlyphs(); mLoadedCoords = true; diff --git a/src/eepp/graphics/texturefontloader.cpp b/src/eepp/graphics/texturefontloader.cpp index bdc2ff87f..9a2ca9fd3 100644 --- a/src/eepp/graphics/texturefontloader.cpp +++ b/src/eepp/graphics/texturefontloader.cpp @@ -78,7 +78,7 @@ void TextureFontLoader::update() { } if ( mTexLoaded && !mFontLoaded ) { - LoadFont(); + loadFont(); } if ( mFontLoaded ) { @@ -87,42 +87,42 @@ void TextureFontLoader::update() { } } -const std::string& TextureFontLoader::Id() const { +const std::string& TextureFontLoader::getId() const { return mFontName; } -void TextureFontLoader::LoadFromPath() { - mFont->Load( mTexLoader->Id(), mFilepath ); +void TextureFontLoader::loadFromPath() { + mFont->load( mTexLoader->getId(), mFilepath ); } -void TextureFontLoader::LoadFromMemory() { - mFont->LoadFromMemory( mTexLoader->Id(), mData, mDataSize ); +void TextureFontLoader::loadFromMemory() { + mFont->loadFromMemory( mTexLoader->getId(), mData, mDataSize ); } -void TextureFontLoader::LoadFromPack() { - mFont->LoadFromPack( mTexLoader->Id(), mPack, mFilepath ); +void TextureFontLoader::loadFromPack() { + mFont->loadFromPack( mTexLoader->getId(), mPack, mFilepath ); } -void TextureFontLoader::LoadFromTex() { - mFont->Load( mTexLoader->Id(), mStartChar, mSpacing, mTexColumns, mTexRows, mNumChars ); +void TextureFontLoader::loadFromTex() { + mFont->load( mTexLoader->getId(), mStartChar, mSpacing, mTexColumns, mTexRows, mNumChars ); } -void TextureFontLoader::LoadFont() { +void TextureFontLoader::loadFont() { mFont = TextureFont::New( mFontName ); if ( TEF_LT_PATH == mLoadType ) - LoadFromPath(); + loadFromPath(); else if ( TEF_LT_MEM == mLoadType ) - LoadFromMemory(); + loadFromMemory(); else if ( TEF_LT_PACK == mLoadType ) - LoadFromPack(); + loadFromPack(); else if ( TEF_LT_TEX == mLoadType ) - LoadFromTex(); + loadFromTex(); mFontLoaded = true; } -Graphics::Font * TextureFontLoader::Font() const { +Graphics::Font * TextureFontLoader::getFont() const { return mFont; } diff --git a/src/eepp/graphics/textureloader.cpp b/src/eepp/graphics/textureloader.cpp index e0f7da18b..9440981bc 100644 --- a/src/eepp/graphics/textureloader.cpp +++ b/src/eepp/graphics/textureloader.cpp @@ -232,22 +232,22 @@ void TextureLoader::start() { mTE.restart(); if ( TEX_LT_PATH == mLoadType ) - LoadFromPath(); + loadFromPath(); else if ( TEX_LT_MEM == mLoadType ) - LoadFromMemory(); + loadFromMemory(); else if ( TEX_LT_PACK == mLoadType ) - LoadFromPack(); + loadFromPack(); else if ( TEX_LT_STREAM == mLoadType ) - LoadFromStream(); + loadFromStream(); mTexLoaded = true; if ( !mThreaded || ( Engine::instance()->isSharedGLContextEnabled() && Engine::instance()->getCurrentWindow()->isThreadedGLContext() ) ) { - LoadFromPixels(); + loadFromPixels(); } } -void TextureLoader::LoadFile() { +void TextureLoader::loadFile() { IOStreamFile fs( mFilepath , std::ios::in | std::ios::binary ); mSize = FileSystem::fileSize( mFilepath ); @@ -255,24 +255,24 @@ void TextureLoader::LoadFile() { fs.read( reinterpret_cast ( mPixels ), mSize ); } -void TextureLoader::LoadFromPath() { +void TextureLoader::loadFromPath() { if ( FileSystem::fileExists( mFilepath ) ) { mImgType = stbi_test( mFilepath.c_str() ); - if ( STBI_dds == mImgType && GLi->IsExtension( EEGL_EXT_texture_compression_s3tc ) ) { - LoadFile(); + if ( STBI_dds == mImgType && GLi->isExtension( EEGL_EXT_texture_compression_s3tc ) ) { + loadFile(); mDirectUpload = true; stbi__dds_info_from_memory( mPixels, mSize, &mImgWidth, &mImgHeight, &mChannels, &mIsCompressed ); } else if ( STBI_pvr == mImgType && stbi__pvr_info_from_path( mFilepath.c_str(), &mImgWidth, &mImgHeight, &mChannels, &mIsCompressed ) && - ( !mIsCompressed || GLi->IsExtension( EEGL_IMG_texture_compression_pvrtc ) ) ) + ( !mIsCompressed || GLi->isExtension( EEGL_IMG_texture_compression_pvrtc ) ) ) { // If the PVR is valid, and the pvrtc extension is present or it's not compressed ( so it doesn't need the extension ) // means that it can be uploaded directly to the GPU. - LoadFile(); + loadFile(); mDirectUpload = true; - } else if ( STBI_pkm == mImgType && GLi->IsExtension( EEGL_OES_compressed_ETC1_RGB8_texture ) ) { - LoadFile(); + } else if ( STBI_pkm == mImgType && GLi->isExtension( EEGL_OES_compressed_ETC1_RGB8_texture ) ) { + loadFile(); mIsCompressed = mDirectUpload = true; stbi__pkm_info_from_memory( mPixels, mSize, &mImgWidth, &mImgHeight, &mChannels ); } else { @@ -300,38 +300,38 @@ void TextureLoader::LoadFromPath() { if ( NULL != mPack ) { mLoadType = TEX_LT_PACK; - LoadFromPack(); + loadFromPack(); } } } -void TextureLoader::LoadFromPack() { +void TextureLoader::loadFromPack() { SafeDataPointer PData; if ( NULL != mPack && mPack->isOpen() && mPack->extractFileToMemory( mFilepath, PData ) ) { mImagePtr = PData.Data; mSize = PData.DataSize; - LoadFromMemory(); + loadFromMemory(); } } -void TextureLoader::LoadFromMemory() { +void TextureLoader::loadFromMemory() { mImgType = stbi_test_from_memory( mImagePtr, mSize ); - if ( STBI_dds == mImgType && GLi->IsExtension( EEGL_EXT_texture_compression_s3tc ) ) { + if ( STBI_dds == mImgType && GLi->isExtension( EEGL_EXT_texture_compression_s3tc ) ) { mPixels = (Uint8*) eeMalloc( mSize ); memcpy( mPixels, mImagePtr, mSize ); stbi__dds_info_from_memory( mPixels, mSize, &mImgWidth, &mImgHeight, &mChannels, &mIsCompressed ); mDirectUpload = true; } else if ( STBI_pvr == mImgType && stbi__pvr_info_from_memory( mImagePtr, mSize, &mImgWidth, &mImgHeight, &mChannels, &mIsCompressed ) && - ( !mIsCompressed || GLi->IsExtension( EEGL_IMG_texture_compression_pvrtc ) ) ) + ( !mIsCompressed || GLi->isExtension( EEGL_IMG_texture_compression_pvrtc ) ) ) { mPixels = (Uint8*) eeMalloc( mSize ); memcpy( mPixels, mImagePtr, mSize ); mDirectUpload = true; - } else if ( STBI_pkm == mImgType && GLi->IsExtension( EEGL_OES_compressed_ETC1_RGB8_texture ) ) { + } else if ( STBI_pkm == mImgType && GLi->isExtension( EEGL_OES_compressed_ETC1_RGB8_texture ) ) { mPixels = (Uint8*) eeMalloc( mSize ); memcpy( mPixels, mImagePtr, mSize ); stbi__pkm_info_from_memory( mPixels, mSize, &mImgWidth, &mImgHeight, &mChannels ); @@ -353,7 +353,7 @@ void TextureLoader::LoadFromMemory() { } } -void TextureLoader::LoadFromStream() { +void TextureLoader::loadFromStream() { if ( mStream->isOpen() ) { mSize = mStream->getSize(); @@ -364,7 +364,7 @@ void TextureLoader::LoadFromStream() { mImgType = stbi_test_from_callbacks( &callbacks, mStream ); - if ( STBI_dds == mImgType && GLi->IsExtension( EEGL_EXT_texture_compression_s3tc ) ) { + if ( STBI_dds == mImgType && GLi->isExtension( EEGL_EXT_texture_compression_s3tc ) ) { mSize = mStream->getSize(); mPixels = (Uint8*) eeMalloc( mSize ); mStream->seek( 0 ); @@ -375,7 +375,7 @@ void TextureLoader::LoadFromStream() { mDirectUpload = true; } else if ( STBI_pvr == mImgType && stbi__pvr_info_from_callbacks( &callbacks, mStream, &mImgWidth, &mImgHeight, &mChannels, &mIsCompressed ) && - ( !mIsCompressed || GLi->IsExtension( EEGL_IMG_texture_compression_pvrtc ) ) ) + ( !mIsCompressed || GLi->isExtension( EEGL_IMG_texture_compression_pvrtc ) ) ) { mSize = mStream->getSize(); mPixels = (Uint8*) eeMalloc( mSize ); @@ -383,7 +383,7 @@ void TextureLoader::LoadFromStream() { mStream->read( reinterpret_cast ( mPixels ), mSize ); mStream->seek( 0 ); mDirectUpload = true; - } else if ( STBI_pkm == mImgType && GLi->IsExtension( EEGL_OES_compressed_ETC1_RGB8_texture ) ) { + } else if ( STBI_pkm == mImgType && GLi->isExtension( EEGL_OES_compressed_ETC1_RGB8_texture ) ) { mSize = mStream->getSize(); mPixels = (Uint8*) eeMalloc( mSize ); mStream->seek( 0 ); @@ -411,7 +411,7 @@ void TextureLoader::LoadFromStream() { } } -void TextureLoader::LoadFromPixels() { +void TextureLoader::loadFromPixels() { if ( !mLoaded && mTexLoaded ) { Uint32 tTexId = 0; @@ -450,9 +450,9 @@ void TextureLoader::LoadFromPixels() { Image * tImg = eeNew ( Image, ( mPixels, mImgWidth, mImgHeight, mChannels ) ); - tImg->CreateMaskFromColor( ColorA( mColorKey->r(), mColorKey->g(), mColorKey->b(), 255 ), 0 ); + tImg->createMaskFromColor( ColorA( mColorKey->r(), mColorKey->g(), mColorKey->b(), 255 ), 0 ); - tImg->AvoidFreeImage( true ); + tImg->avoidFreeImage( true ); eeSAFE_DELETE( tImg ); } @@ -460,7 +460,7 @@ void TextureLoader::LoadFromPixels() { tTexId = SOIL_create_OGL_texture( mPixels, &width, &height, mChannels, SOIL_CREATE_NEW_ID, flags ); } - GLi->BindTexture( GL_TEXTURE_2D, PreviousTexture ); + GLi->bindTexture( GL_TEXTURE_2D, PreviousTexture ); if ( ( mThreaded || ForceGLThreaded ) && ( ForceGLThreaded || Engine::instance()->isSharedGLContextEnabled() ) && @@ -494,7 +494,7 @@ void TextureLoader::LoadFromPixels() { } } - mTexId = TextureFactory::instance()->PushTexture( mFilepath, tTexId, width, height, mImgWidth, mImgHeight, mMipmap, mChannels, mClampMode, mCompressTexture || mIsCompressed, mLocalCopy, mSize ); + mTexId = TextureFactory::instance()->pushTexture( mFilepath, tTexId, width, height, mImgWidth, mImgHeight, mMipmap, mChannels, mClampMode, mCompressTexture || mIsCompressed, mLocalCopy, mSize ); eePRINTL( "Texture %s loaded in %4.3f ms.", mFilepath.c_str(), mTE.elapsed().asMilliseconds() ); } else { @@ -528,33 +528,33 @@ void TextureLoader::LoadFromPixels() { void TextureLoader::update() { if ( !( Engine::instance()->isSharedGLContextEnabled() && Engine::instance()->getCurrentWindow()->isThreadedGLContext() ) ) { - LoadFromPixels(); + loadFromPixels(); } } -const Uint32& TextureLoader::Id() const { +const Uint32& TextureLoader::getId() const { return mTexId; } -void TextureLoader::SetColorKey( RGB Color ) { +void TextureLoader::setColorKey( RGB Color ) { eeSAFE_DELETE( mColorKey ); mColorKey = eeNew( RGB, ( Color.r(), Color.g(), Color.b() ) ); } -const std::string& TextureLoader::Filepath() const { +const std::string& TextureLoader::filepath() const { return mFilepath; } -Texture * TextureLoader::GetTexture() const { +Texture * TextureLoader::getTexture() const { if ( 0 != mTexId ) - return TextureFactory::instance()->GetTexture( mTexId ); + return TextureFactory::instance()->getTexture( mTexId ); return NULL; } void TextureLoader::unload() { if ( mLoaded ) { - TextureFactory::instance()->Remove( mTexId ); + TextureFactory::instance()->remove( mTexId ); reset(); } diff --git a/src/eepp/graphics/texturepacker.cpp b/src/eepp/graphics/texturepacker.cpp index f42af5628..f4d4e0429 100644 --- a/src/eepp/graphics/texturepacker.cpp +++ b/src/eepp/graphics/texturepacker.cpp @@ -24,7 +24,7 @@ TexturePacker::TexturePacker( const Uint32& MaxWidth, const Uint32& MaxHeight, c mForcePowOfTwo(true), mPixelBorder(0) { - SetOptions( MaxWidth, MaxHeight, ForcePowOfTwo, PixelBorder, AllowFlipping ); + setOptions( MaxWidth, MaxHeight, ForcePowOfTwo, PixelBorder, AllowFlipping ); } TexturePacker::TexturePacker() : @@ -47,10 +47,10 @@ TexturePacker::TexturePacker() : TexturePacker::~TexturePacker() { - Close(); + close(); } -void TexturePacker::Close() { +void TexturePacker::close() { mLongestEdge = 0; mTotalArea = 0; @@ -69,7 +69,7 @@ void TexturePacker::Close() { while ( NULL != next ) { kill = next; - next = next->GetNext(); + next = next->getNext(); eeSAFE_DELETE( kill ); } @@ -78,7 +78,7 @@ void TexturePacker::Close() { eeSAFE_DELETE( mChild ); } -void TexturePacker::SetOptions( const Uint32& MaxWidth, const Uint32& MaxHeight, const bool& ForcePowOfTwo, const Uint32& PixelBorder, const bool& AllowFlipping ) { +void TexturePacker::setOptions( const Uint32& MaxWidth, const Uint32& MaxHeight, const bool& ForcePowOfTwo, const Uint32& PixelBorder, const bool& AllowFlipping ) { if ( !mTextures.size() ) { // only can change the dimensions before adding any texture mWidth = MaxWidth; mHeight = MaxHeight; @@ -95,13 +95,13 @@ void TexturePacker::SetOptions( const Uint32& MaxWidth, const Uint32& MaxHeight, } } -void TexturePacker::NewFree( Int32 x, Int32 y, Int32 width, Int32 height ) { +void TexturePacker::newFree( Int32 x, Int32 y, Int32 width, Int32 height ) { TexturePackerNode * node = eeNew( TexturePackerNode, ( x, y, width, height ) ); - node->SetNext( mFreeList ); + node->setNext( mFreeList ); mFreeList = node; } -bool TexturePacker::MergeNodes() { +bool TexturePacker::mergeNodes() { TexturePackerNode *f = mFreeList; while ( f ) { @@ -110,11 +110,11 @@ bool TexturePacker::MergeNodes() { while ( c ) { if ( f != c ) { - if ( f->Merge( *c ) ) { + if ( f->merge( *c ) ) { eeASSERT( prev ); if ( NULL != prev ) { - prev->SetNext( c->GetNext() ); + prev->setNext( c->getNext() ); } eeSAFE_DELETE( c ); @@ -124,16 +124,16 @@ bool TexturePacker::MergeNodes() { } prev = c; - c = c->GetNext(); + c = c->getNext(); } - f = f->GetNext(); + f = f->getNext(); } return false; } -void TexturePacker::Validate() { +void TexturePacker::validate() { #ifdef EE_DEBUG TexturePackerNode * f = mFreeList; while ( f ) { @@ -141,22 +141,22 @@ void TexturePacker::Validate() { while ( c ) { if ( f != c ) - f->Validate(c); + f->validate(c); - c = c->GetNext(); + c = c->getNext(); } - f = f->GetNext(); + f = f->getNext(); } #endif } -TexturePackerTex * TexturePacker::GetLonguestEdge() { +TexturePackerTex * TexturePacker::getLonguestEdge() { TexturePackerTex * t = NULL; std::list::iterator it; for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { - if ( !(*it)->Placed() ) { + if ( !(*it)->placed() ) { t = (*it); break; } @@ -165,12 +165,12 @@ TexturePackerTex * TexturePacker::GetLonguestEdge() { return t; } -TexturePackerTex * TexturePacker::GetShortestEdge() { +TexturePackerTex * TexturePacker::getShortestEdge() { TexturePackerTex * t = NULL; std::list::reverse_iterator it; for ( it = mTextures.rbegin(); it != mTextures.rend(); it++ ) { - if ( !(*it)->Placed() ) { + if ( !(*it)->placed() ) { t = (*it); break; } @@ -179,7 +179,7 @@ TexturePackerTex * TexturePacker::GetShortestEdge() { return t; } -void TexturePacker::AddBorderToTextures( const Int32& BorderSize ) { +void TexturePacker::addBorderToTextures( const Int32& BorderSize ) { TexturePackerTex * t; if ( 0 != BorderSize ) { @@ -188,15 +188,15 @@ void TexturePacker::AddBorderToTextures( const Int32& BorderSize ) { for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { t = (*it); - t->Width ( t->Width() + BorderSize ); - t->Height ( t->Height() + BorderSize ); + t->width ( t->width() + BorderSize ); + t->height ( t->height() + BorderSize ); } mLongestEdge += BorderSize; } } -TexturePackerNode * TexturePacker::GetBestFit( TexturePackerTex * t, TexturePackerNode ** prevBestFit, Int32 * EdgeCount ) { +TexturePackerNode * TexturePacker::getBestFit( TexturePackerTex * t, TexturePackerNode ** prevBestFit, Int32 * EdgeCount ) { Int32 leastY = 0x7FFFFFFF; Int32 leastX = 0x7FFFFFFF; TexturePackerNode * previousBestFit = NULL; @@ -211,7 +211,7 @@ TexturePackerNode * TexturePacker::GetBestFit( TexturePackerTex * t, TexturePack Int32 ec; // see if the texture will fit into this slot, and if so how many edges does it share. - if ( search->Fits( t->Width(), t->Height(), ec, mAllowFlipping ) ) { + if ( search->fits( t->width(), t->height(), ec, mAllowFlipping ) ) { if ( ec == 2 ) { previousBestFit = previous; // record the pointer previous to this one (used to patch the linked list) @@ -221,14 +221,14 @@ TexturePackerNode * TexturePacker::GetBestFit( TexturePackerTex * t, TexturePack break; } - if ( search->Y() < leastY ) { - leastY = search->Y(); - leastX = search->X(); + if ( search->y() < leastY ) { + leastY = search->y(); + leastX = search->x(); previousBestFit = previous; bestFit = search; edgeCount = ec; - } else if ( search->Y() == leastY && search->X() < leastX ) { - leastX = search->X(); + } else if ( search->y() == leastY && search->x() < leastX ) { + leastX = search->x(); previousBestFit = previous; bestFit = search; edgeCount = ec; @@ -236,7 +236,7 @@ TexturePackerNode * TexturePacker::GetBestFit( TexturePackerTex * t, TexturePack } previous = search; - search = search->GetNext(); + search = search->getNext(); } *EdgeCount = edgeCount; @@ -245,102 +245,102 @@ TexturePackerNode * TexturePacker::GetBestFit( TexturePackerTex * t, TexturePack return bestFit; } -void TexturePacker::InsertTexture( TexturePackerTex * t, TexturePackerNode * bestFit, Int32 edgeCount, TexturePackerNode * previousBestFit ) { +void TexturePacker::insertTexture( TexturePackerTex * t, TexturePackerNode * bestFit, Int32 edgeCount, TexturePackerNode * previousBestFit ) { if ( NULL != bestFit ) { - Validate(); + validate(); switch ( edgeCount ) { case 0: { bool flipped = false; - int w = t->Width(); - int h = t->Height(); + int w = t->width(); + int h = t->height(); if ( mAllowFlipping ) { - if ( t->LongestEdge() <= bestFit->Width() ) { + if ( t->longestEdge() <= bestFit->width() ) { if ( h > w ) { - w = t->Height(); - h = t->Width(); + w = t->height(); + h = t->width(); flipped = true; } } else { - eeASSERT( t->LongestEdge() <= bestFit->Height() ); + eeASSERT( t->longestEdge() <= bestFit->height() ); if ( h < w ) { - w = t->Height(); - h = t->Width(); + w = t->height(); + h = t->width(); flipped = true; } } } - t->Place( bestFit->X(), bestFit->Y(), flipped ); // place it. + t->place( bestFit->x(), bestFit->y(), flipped ); // place it. - NewFree( bestFit->X(), bestFit->Y() + h, bestFit->Width(), bestFit->Height() - h ); + newFree( bestFit->x(), bestFit->y() + h, bestFit->width(), bestFit->height() - h ); - bestFit->X ( bestFit->X() + w ); - bestFit->Width ( bestFit->Width() - w ); - bestFit->Height ( h ); + bestFit->x ( bestFit->x() + w ); + bestFit->width ( bestFit->width() - w ); + bestFit->height ( h ); - Validate(); + validate(); } break; case 1: { - if ( t->Width() == bestFit->Width() ) { - t->Place( bestFit->X(), bestFit->Y(), false ); + if ( t->width() == bestFit->width() ) { + t->place( bestFit->x(), bestFit->y(), false ); - bestFit->Y ( bestFit->Y() + t->Height() ); - bestFit->Height ( bestFit->Height() - t->Height() ); + bestFit->y ( bestFit->y() + t->height() ); + bestFit->height ( bestFit->height() - t->height() ); - Validate(); - } else if ( t->Height() == bestFit->Height() ) { - t->Place( bestFit->X(), bestFit->Y(), false ); + validate(); + } else if ( t->height() == bestFit->height() ) { + t->place( bestFit->x(), bestFit->y(), false ); - bestFit->X ( bestFit->X() + t->Width() ); - bestFit->Width ( bestFit->Width() - t->Width() ); + bestFit->x ( bestFit->x() + t->width() ); + bestFit->width ( bestFit->width() - t->width() ); - Validate(); - } else if ( mAllowFlipping && t->Width() == bestFit->Height() ) { - t->Place( bestFit->X(), bestFit->Y(), true ); + validate(); + } else if ( mAllowFlipping && t->width() == bestFit->height() ) { + t->place( bestFit->x(), bestFit->y(), true ); - bestFit->X ( bestFit->X() + t->Height() ); - bestFit->Width ( bestFit->Width() - t->Height() ); + bestFit->x ( bestFit->x() + t->height() ); + bestFit->width ( bestFit->width() - t->height() ); - Validate(); - } else if ( mAllowFlipping && t->Height() == bestFit->Width() ) { - t->Place( bestFit->X(), bestFit->Y(), true ); + validate(); + } else if ( mAllowFlipping && t->height() == bestFit->width() ) { + t->place( bestFit->x(), bestFit->y(), true ); - bestFit->Y ( bestFit->Y() + t->Width() ); - bestFit->Height ( bestFit->Height() - t->Width() ); + bestFit->y ( bestFit->y() + t->width() ); + bestFit->height ( bestFit->height() - t->width() ); - Validate(); + validate(); } } break; case 2: { - bool flipped = t->Width() != bestFit->Width() || t->Height() != bestFit->Height(); + bool flipped = t->width() != bestFit->width() || t->height() != bestFit->height(); - t->Place( bestFit->X(), bestFit->Y(), flipped ); + t->place( bestFit->x(), bestFit->y(), flipped ); if ( previousBestFit ) - previousBestFit->SetNext( bestFit->GetNext() ); + previousBestFit->setNext( bestFit->getNext() ); else - mFreeList = bestFit->GetNext(); + mFreeList = bestFit->getNext(); eeSAFE_DELETE( bestFit ); - Validate(); + validate(); } break; } - while ( MergeNodes() ); // keep merging nodes as much as we can... + while ( mergeNodes() ); // keep merging nodes as much as we can... } } -void TexturePacker::CreateChild() { +void TexturePacker::createChild() { mChild = eeNew( TexturePacker, ( mWidth, mHeight, mForcePowOfTwo, mPixelBorder, mAllowFlipping ) ); std::list::iterator it; @@ -351,11 +351,11 @@ void TexturePacker::CreateChild() { for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { t = (*it); - if ( !t->Placed() ) { - mChild->AddTexture( t->Name() ); + if ( !t->placed() ) { + mChild->addTexture( t->name() ); mChild->mParent = this; - t->Disabled( true ); + t->disabled( true ); remove.push_back( it ); @@ -370,10 +370,10 @@ void TexturePacker::CreateChild() { mTextures.erase( *itit ); } - mChild->PackTextures(); + mChild->packTextures(); } -bool TexturePacker::AddTexturesPath( std::string TexturesPath ) { +bool TexturePacker::addTexturesPath( std::string TexturesPath ) { if ( FileSystem::isDirectory( TexturesPath ) ) { FileSystem::dirPathAddSlashAtEnd( TexturesPath ); @@ -384,7 +384,7 @@ bool TexturePacker::AddTexturesPath( std::string TexturesPath ) { for ( Uint32 i = 0; i < files.size(); i++ ) { std::string path( TexturesPath + files[i] ); if ( !FileSystem::isDirectory( path ) ) - AddTexture( path ); + addTexture( path ); } return true; @@ -393,14 +393,14 @@ bool TexturePacker::AddTexturesPath( std::string TexturesPath ) { return false; } -bool TexturePacker::AddPackerTex( TexturePackerTex * TPack ) { - if ( TPack->LoadedInfo() ) { +bool TexturePacker::addPackerTex( TexturePackerTex * TPack ) { + if ( TPack->loadedInfo() ) { // Only add the texture if can fit inside the atlas, otherwise it will ignore it - if ( ( TPack->Width() + mPixelBorder <= mWidth && TPack->Height() + mPixelBorder <= mHeight ) || - ( mAllowFlipping && ( TPack->Width() + mPixelBorder <= mHeight && TPack->Height() + mPixelBorder <= mWidth ) ) + if ( ( TPack->width() + mPixelBorder <= mWidth && TPack->height() + mPixelBorder <= mHeight ) || + ( mAllowFlipping && ( TPack->width() + mPixelBorder <= mHeight && TPack->height() + mPixelBorder <= mWidth ) ) ) { - mTotalArea += TPack->Area(); + mTotalArea += TPack->area(); // Insert ordered std::list::iterator it; @@ -408,7 +408,7 @@ bool TexturePacker::AddPackerTex( TexturePackerTex * TPack ) { bool Added = false; for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { - if ( (*it)->Area() < TPack->Area() ) { + if ( (*it)->area() < TPack->area() ) { mTextures.insert( it, TPack ); Added = true; break; @@ -426,29 +426,29 @@ bool TexturePacker::AddPackerTex( TexturePackerTex * TPack ) { return false; } -bool TexturePacker::AddImage( Image * Img, const std::string& Name ) { +bool TexturePacker::addImage( Image * Img, const std::string& Name ) { TexturePackerTex * TPack = eeNew( TexturePackerTex, ( Img, Name ) ); - return AddPackerTex( TPack ); + return addPackerTex( TPack ); } -bool TexturePacker::AddTexture( const std::string& TexturePath ) { +bool TexturePacker::addTexture( const std::string& TexturePath ) { if ( FileSystem::fileExists( TexturePath ) ) { TexturePackerTex * TPack = eeNew( TexturePackerTex, ( TexturePath ) ); - return AddPackerTex( TPack ); + return addPackerTex( TPack ); } return false; } -Int32 TexturePacker::PackTextures() { // pack the textures, the return code is the amount of wasted/unused area. +Int32 TexturePacker::packTextures() { // pack the textures, the return code is the amount of wasted/unused area. if ( mWidth <= 0 || mHeight <= 0 ) return 0; TexturePackerTex * t = NULL; - AddBorderToTextures( (Int32)mPixelBorder ); + addBorderToTextures( (Int32)mPixelBorder ); - NewFree( 0, 0, mWidth, mHeight ); + newFree( 0, 0, mWidth, mHeight ); mCount = (Int32)mTextures.size(); @@ -461,46 +461,46 @@ Int32 TexturePacker::PackTextures() { // pack the textures, the return code is t // (3) No edges match, so look for the node which leaves the least amount of area left over after the split. if ( PackBig == mStrategy ) - t = GetLonguestEdge(); + t = getLonguestEdge(); else if ( PackTiny == mStrategy ) - t = GetShortestEdge(); + t = getShortestEdge(); TexturePackerNode * previousBestFit = NULL; Int32 edgeCount = 0; - TexturePackerNode * bestFit = GetBestFit( t, &previousBestFit, &edgeCount ); + TexturePackerNode * bestFit = getBestFit( t, &previousBestFit, &edgeCount ); if ( NULL == bestFit ) { if ( PackBig == mStrategy ) { mStrategy = PackTiny; - eePRINTL( "Chaging Strategy to Tiny. %s faults.", t->Name().c_str() ); + eePRINTL( "Chaging Strategy to Tiny. %s faults.", t->name().c_str() ); } else if ( PackTiny == mStrategy ) { mStrategy = PackFail; - eePRINTL( "Strategy fail, must create a new image. %s faults.", t->Name().c_str() ); + eePRINTL( "Strategy fail, must create a new image. %s faults.", t->name().c_str() ); } } else { - InsertTexture( t, bestFit, edgeCount, previousBestFit ); + insertTexture( t, bestFit, edgeCount, previousBestFit ); mCount--; } if ( PackFail == mStrategy ) { eePRINTL( "Creating a new image as a child." ); - CreateChild(); + createChild(); break; } } if ( mCount > 0 ) { eePRINTL( "Creating a new image as a child. Some textures couldn't get it: %d", mCount ); - CreateChild(); + createChild(); } - AddBorderToTextures( -( (Int32)mPixelBorder ) ); + addBorderToTextures( -( (Int32)mPixelBorder ) ); mPacked = true; for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { - if ( !(*it)->Placed() ) - mTotalArea -= (*it)->Area(); + if ( !(*it)->placed() ) + mTotalArea -= (*it)->area(); } eePRINTL( "Total Area Used: %d. This represents the %4.3f percent", mTotalArea, ( (double)mTotalArea / (double)( mWidth * mHeight ) ) * 100.0 ); @@ -508,9 +508,9 @@ Int32 TexturePacker::PackTextures() { // pack the textures, the return code is t return ( mWidth * mHeight ) - mTotalArea; } -void TexturePacker::Save( const std::string& Filepath, const EE_SAVE_TYPE& Format, const bool& SaveExtensions ) { +void TexturePacker::save( const std::string& Filepath, const EE_SAVE_TYPE& Format, const bool& SaveExtensions ) { if ( !mPacked ) - PackTextures(); + packTextures(); if ( !mTextures.size() ) return; @@ -520,7 +520,7 @@ void TexturePacker::Save( const std::string& Filepath, const EE_SAVE_TYPE& Forma Image Img( (Uint32)mWidth, (Uint32)mHeight, (Uint32)4 ); - Img.FillWithColor( ColorA(0,0,0,0) ); + Img.fillWithColor( ColorA(0,0,0,0) ); TexturePackerTex * t = NULL; int w, h, c; @@ -529,21 +529,21 @@ void TexturePacker::Save( const std::string& Filepath, const EE_SAVE_TYPE& Forma for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { t = (*it); - if ( t->Placed() ) { + if ( t->placed() ) { Uint8 * data; - if ( NULL == t->Image() ) { - data = stbi_load( t->Name().c_str(), &w, &h, &c, 0 ); + if ( NULL == t->getImage() ) { + data = stbi_load( t->name().c_str(), &w, &h, &c, 0 ); - if ( NULL != data && t->Width() == w && t->Height() == h ) { + if ( NULL != data && t->width() == w && t->height() == h ) { Image * ImgCopy = eeNew( Image, ( data, w, h, c ) ); - if ( t->Flipped() ) - ImgCopy->Flip(); + if ( t->flipped() ) + ImgCopy->flip(); - Img.CopyImage( ImgCopy, t->X(), t->Y() ); + Img.copyImage( ImgCopy, t->x(), t->y() ); - ImgCopy->AvoidFreeImage( true ); + ImgCopy->avoidFreeImage( true ); eeSAFE_DELETE( ImgCopy ); @@ -553,13 +553,13 @@ void TexturePacker::Save( const std::string& Filepath, const EE_SAVE_TYPE& Forma mPlacedCount++; } } else { - data = t->Image()->GetPixels(); + data = t->getImage()->getPixels(); if ( NULL != data ) { - if ( t->Flipped() ) - t->Image()->Flip(); + if ( t->flipped() ) + t->getImage()->flip(); - Img.CopyImage( t->Image(), t->X(), t->Y() ); + Img.copyImage( t->getImage(), t->x(), t->y() ); mPlacedCount++; } @@ -569,33 +569,33 @@ void TexturePacker::Save( const std::string& Filepath, const EE_SAVE_TYPE& Forma mFormat = Format; - Img.SaveToFile( Filepath, Format ); + Img.saveToFile( Filepath, Format ); - ChildSave( Format ); + childSave( Format ); - SaveSubTextures(); + saveSubTextures(); } -Int32 TexturePacker::GetChildCount() { +Int32 TexturePacker::getChildCount() { TexturePacker * Child = mChild; Int32 ChildCount = 0; while ( NULL != Child ) { ChildCount++; - Child = Child->GetChild(); + Child = Child->getChild(); } return ChildCount; } -void TexturePacker::SaveSubTextures() { +void TexturePacker::saveSubTextures() { if ( NULL != mParent ) return; sTextureAtlasHdr TexGrHdr; TexGrHdr.Magic = EE_TEXTURE_ATLAS_MAGIC; - TexGrHdr.TextureCount = 1 + GetChildCount(); + TexGrHdr.TextureCount = 1 + getChildCount(); TexGrHdr.Format = mFormat; TexGrHdr.Width = mWidth; TexGrHdr.Height = mHeight; @@ -613,14 +613,14 @@ void TexturePacker::SaveSubTextures() { std::vector TexHdr( TexGrHdr.TextureCount ); - TexHdr[ 0 ] = CreateTextureHdr( this ); + TexHdr[ 0 ] = createTextureHdr( this ); Int32 HdrPos = 1; TexturePacker * Child = mChild; while ( NULL != Child ) { - TexHdr[ HdrPos ] = CreateTextureHdr( Child ); - Child = Child->GetChild(); + TexHdr[ HdrPos ] = createTextureHdr( Child ); + Child = Child->getChild(); HdrPos++; } @@ -634,7 +634,7 @@ void TexturePacker::SaveSubTextures() { fs.write( reinterpret_cast (&TexHdr[ 0 ]), sizeof(sTextureHdr) ); - CreateSubTexturesHdr( this, tSubTexturesHdr ); + createSubTexturesHdr( this, tSubTexturesHdr ); if ( tSubTexturesHdr.size() ) fs.write( reinterpret_cast (&tSubTexturesHdr[ 0 ]), sizeof(sSubTextureHdr) * (std::streamsize)tSubTexturesHdr.size() ); @@ -645,25 +645,25 @@ void TexturePacker::SaveSubTextures() { while ( NULL != Child ) { fs.write( reinterpret_cast (&TexHdr[ HdrPos ]), sizeof(sTextureHdr) ); - CreateSubTexturesHdr( Child, tSubTexturesHdr ); + createSubTexturesHdr( Child, tSubTexturesHdr ); if ( tSubTexturesHdr.size() ) fs.write( reinterpret_cast (&tSubTexturesHdr[ 0 ]), sizeof(sSubTextureHdr) * (std::streamsize)tSubTexturesHdr.size() ); - Child = Child->GetChild(); + Child = Child->getChild(); HdrPos++; } } } -void TexturePacker::CreateSubTexturesHdr( TexturePacker * Packer, std::vector& SubTextures ) { +void TexturePacker::createSubTexturesHdr( TexturePacker * Packer, std::vector& SubTextures ) { SubTextures.clear(); sSubTextureHdr tSubTextureHdr; Uint32 c = 0; - std::list tTextures = *(Packer->GetTexturePackPtr()); + std::list tTextures = *(Packer->getTexturePackPtr()); std::list::iterator it; TexturePackerTex * tTex; @@ -672,8 +672,8 @@ void TexturePacker::CreateSubTexturesHdr( TexturePacker * Packer, std::vectorPlaced() ) { - std::string name = FileSystem::fileNameFromPath( tTex->Name() ); + if ( tTex->placed() ) { + std::string name = FileSystem::fileNameFromPath( tTex->name() ); memset( tSubTextureHdr.Name, 0, HDR_NAME_SIZE ); @@ -683,19 +683,19 @@ void TexturePacker::CreateSubTexturesHdr( TexturePacker * Packer, std::vectorWidth(); - tSubTextureHdr.Height = tTex->Height(); - tSubTextureHdr.Channels = tTex->Channels(); - tSubTextureHdr.DestWidth = tTex->Width(); - tSubTextureHdr.DestHeight = tTex->Height(); + tSubTextureHdr.Width = tTex->width(); + tSubTextureHdr.Height = tTex->height(); + tSubTextureHdr.Channels = tTex->channels(); + tSubTextureHdr.DestWidth = tTex->width(); + tSubTextureHdr.DestHeight = tTex->height(); tSubTextureHdr.OffsetX = 0; tSubTextureHdr.OffsetY = 0; - tSubTextureHdr.X = tTex->X(); - tSubTextureHdr.Y = tTex->Y(); - tSubTextureHdr.Date = FileSystem::fileGetModificationDate( tTex->Name() ); + tSubTextureHdr.X = tTex->x(); + tSubTextureHdr.Y = tTex->y(); + tSubTextureHdr.Date = FileSystem::fileGetModificationDate( tTex->name() ); tSubTextureHdr.Flags = 0; - if ( tTex->Flipped() ) + if ( tTex->flipped() ) tSubTextureHdr.Flags |= HDR_SUBTEXTURE_FLAG_FLIPED; SubTextures[c] = tSubTextureHdr; @@ -705,25 +705,25 @@ void TexturePacker::CreateSubTexturesHdr( TexturePacker * Packer, std::vectorGetFilepath() ) ); + std::string name( FileSystem::fileNameFromPath( Packer->getFilepath() ) ); memset( TexHdr.Name, 0, HDR_NAME_SIZE ); String::strCopy( TexHdr.Name, name.c_str(), HDR_NAME_SIZE ); TexHdr.ResourceID = String::hash( name ); - TexHdr.Size = FileSystem::fileSize( Packer->GetFilepath() ); - TexHdr.SubTextureCount = Packer->GetPlacedCount(); + TexHdr.Size = FileSystem::fileSize( Packer->getFilepath() ); + TexHdr.SubTextureCount = Packer->getPlacedCount(); return TexHdr; } -void TexturePacker::ChildSave( const EE_SAVE_TYPE& Format ) { +void TexturePacker::childSave( const EE_SAVE_TYPE& Format ) { if ( NULL != mChild ) { - TexturePacker * Parent = mChild->GetParent(); + TexturePacker * Parent = mChild->getParent(); TexturePacker * LastParent = NULL; Int32 ParentCount = 0; @@ -731,52 +731,52 @@ void TexturePacker::ChildSave( const EE_SAVE_TYPE& Format ) { while ( NULL != Parent ) { ParentCount++; LastParent = Parent; - Parent = Parent->GetParent(); + Parent = Parent->getParent(); } if ( NULL != LastParent ) { - std::string fFpath = FileSystem::fileRemoveExtension( LastParent->GetFilepath() ); - std::string fExt = FileSystem::fileExtension( LastParent->GetFilepath() ); + std::string fFpath = FileSystem::fileRemoveExtension( LastParent->getFilepath() ); + std::string fExt = FileSystem::fileExtension( LastParent->getFilepath() ); std::string fName = fFpath + "_ch" + String::toStr( ParentCount ) + "." + fExt; - mChild->Save( fName, Format, mSaveExtensions ); + mChild->save( fName, Format, mSaveExtensions ); } } } -TexturePacker * TexturePacker::GetChild() const { +TexturePacker * TexturePacker::getChild() const { return mChild; } -TexturePacker * TexturePacker::GetParent() const { +TexturePacker * TexturePacker::getParent() const { return mParent; } -std::list * TexturePacker::GetTexturePackPtr() { +std::list * TexturePacker::getTexturePackPtr() { return &mTextures; } -const std::string& TexturePacker::GetFilepath() const { +const std::string& TexturePacker::getFilepath() const { return mFilepath; } -const Int32& TexturePacker::GetWidth() const { +const Int32& TexturePacker::getWidth() const { return mWidth; } -const Int32& TexturePacker::GetHeight() const { +const Int32& TexturePacker::getHeight() const { return mHeight; } -const Int32& TexturePacker::GetPlacedCount() const { +const Int32& TexturePacker::getPlacedCount() const { return mPlacedCount; } -const Int32& TexturePacker::Width() const { +const Int32& TexturePacker::width() const { return mWidth; } -const Int32& TexturePacker::Height() const { +const Int32& TexturePacker::height() const { return mHeight; } diff --git a/src/eepp/graphics/texturepackernode.cpp b/src/eepp/graphics/texturepackernode.cpp index 4c84e2617..9eaf51157 100644 --- a/src/eepp/graphics/texturepackernode.cpp +++ b/src/eepp/graphics/texturepackernode.cpp @@ -10,11 +10,11 @@ TexturePackerNode::TexturePackerNode( Int32 x, Int32 y, Int32 width, Int32 heigh mNext = NULL; } -TexturePackerNode * TexturePackerNode::GetNext() const { +TexturePackerNode * TexturePackerNode::getNext() const { return mNext; } -bool TexturePackerNode::Fits( Int32 width, Int32 height, Int32 &edgeCount, const bool& AllowFlipping ) const { +bool TexturePackerNode::fits( Int32 width, Int32 height, Int32 &edgeCount, const bool& AllowFlipping ) const { bool ret = false; edgeCount = 0; @@ -45,26 +45,26 @@ bool TexturePackerNode::Fits( Int32 width, Int32 height, Int32 &edgeCount, const return ret; } -void TexturePackerNode::GetRect( Recti &r ) const { +void TexturePackerNode::getRect( Recti &r ) const { r = Recti( mX, mY, mX + mWidth - 1, mY + mHeight - 1 ); } -void TexturePackerNode::Validate( TexturePackerNode * n ) { +void TexturePackerNode::validate( TexturePackerNode * n ) { Recti r1; Recti r2; - GetRect( r1 ); - n->GetRect( r2 ); + getRect( r1 ); + n->getRect( r2 ); eeASSERT( !r1.intersect(r2) ); } -bool TexturePackerNode::Merge( const TexturePackerNode& n ) { +bool TexturePackerNode::merge( const TexturePackerNode& n ) { bool ret = false; Recti r1; Recti r2; - GetRect( r1 ); - n.GetRect( r2 ); + getRect( r1 ); + n.getRect( r2 ); r1.Right++; r1.Bottom++; @@ -73,24 +73,24 @@ bool TexturePackerNode::Merge( const TexturePackerNode& n ) { if ( r1.Left == r2.Left && r1.Right == r2.Right && r1.Top == r2.Bottom ) // if we share the top edge then.. { - mY = n.Y(); - mHeight += n.Height(); + mY = n.y(); + mHeight += n.height(); ret = true; } else if ( r1.Left == r2.Left && r1.Right == r2.Right && r1.Bottom == r2.Top ) // if we share the bottom edge { - mHeight += n.Height(); + mHeight += n.height(); ret = true; } else if ( r1.Top == r2.Top && r1.Bottom == r2.Top && r1.Left == r2.Right ) // if we share the left edge { - mX = n.X(); - mWidth += n.Width(); + mX = n.x(); + mWidth += n.width(); ret = true; } else if ( r1.Top == r2.Top && r1.Bottom == r2.Top && r1.Right == r2.Left ) // if we share the left edge { - mWidth += n.Width(); + mWidth += n.width(); ret = true; } diff --git a/src/eepp/graphics/texturepackernode.hpp b/src/eepp/graphics/texturepackernode.hpp index 2412f75a9..129caa6a6 100644 --- a/src/eepp/graphics/texturepackernode.hpp +++ b/src/eepp/graphics/texturepackernode.hpp @@ -9,33 +9,33 @@ class TexturePackerNode { public: TexturePackerNode( Int32 x, Int32 y, Int32 width, Int32 height ); - bool Fits( Int32 wid, Int32 hit, Int32 &edgeCount, const bool& AllowFlipping = false ) const; + bool fits( Int32 wid, Int32 hit, Int32 &edgeCount, const bool& AllowFlipping = false ) const; - void GetRect( Recti &r ) const; + void getRect( Recti &r ) const; - void Validate( TexturePackerNode * n ); + void validate( TexturePackerNode * n ); - bool Merge( const TexturePackerNode &n ); + bool merge( const TexturePackerNode &n ); - TexturePackerNode * GetNext() const; + TexturePackerNode * getNext() const; - inline void SetNext( TexturePackerNode * Next ) { mNext = Next; } + inline void setNext( TexturePackerNode * Next ) { mNext = Next; } - inline const Int32& X() const { return mX; } + inline const Int32& x() const { return mX; } - inline const Int32& Y() const { return mY; } + inline const Int32& y() const { return mY; } - inline void X( const Int32& x ) { mX = x; } + inline void x( const Int32& x ) { mX = x; } - inline void Y( const Int32& y ) { mY = y; } + inline void y( const Int32& y ) { mY = y; } - inline const Int32& Width() const { return mWidth; } + inline const Int32& width() const { return mWidth; } - inline const Int32& Height() const { return mHeight; } + inline const Int32& height() const { return mHeight; } - inline void Width( const Int32& W ) { mWidth = W; } + inline void width( const Int32& W ) { mWidth = W; } - inline void Height( const Int32& H ) { mHeight = H; } + inline void height( const Int32& H ) { mHeight = H; } protected: TexturePackerNode * mNext; Int32 mX; diff --git a/src/eepp/graphics/texturepackertex.cpp b/src/eepp/graphics/texturepackertex.cpp index 305fdadf7..e5daf4302 100644 --- a/src/eepp/graphics/texturepackertex.cpp +++ b/src/eepp/graphics/texturepackertex.cpp @@ -28,9 +28,9 @@ TexturePackerTex::TexturePackerTex( const std::string& Name ) : TexturePackerTex::TexturePackerTex( EE::Graphics::Image * Img , const std::string& Name ) : mName( Name ), - mWidth( Img->Width() ), - mHeight( Img->Height() ), - mChannels( Img->Channels() ), + mWidth( Img->width() ), + mHeight( Img->height() ), + mChannels( Img->channels() ), mX(0), mY(0), mLongestEdge(0), @@ -46,7 +46,7 @@ TexturePackerTex::TexturePackerTex( EE::Graphics::Image * Img , const std::strin mLoadedInfo = true; } -void TexturePackerTex::Place( Int32 x, Int32 y, bool flipped ) { +void TexturePackerTex::place( Int32 x, Int32 y, bool flipped ) { if ( !mPlaced ) { mX = x; mY = y; @@ -55,7 +55,7 @@ void TexturePackerTex::Place( Int32 x, Int32 y, bool flipped ) { } } -EE::Graphics::Image * TexturePackerTex::Image() const { +EE::Graphics::Image * TexturePackerTex::getImage() const { return mImg; } diff --git a/src/eepp/graphics/texturepackertex.hpp b/src/eepp/graphics/texturepackertex.hpp index 8f3f1b45d..849a21f26 100644 --- a/src/eepp/graphics/texturepackertex.hpp +++ b/src/eepp/graphics/texturepackertex.hpp @@ -11,63 +11,63 @@ namespace Private { class TexturePackerTex { public: - TexturePackerTex( const std::string& Name ); + TexturePackerTex( const std::string& name ); - TexturePackerTex( EE::Graphics::Image * Img, const std::string& Name ); + TexturePackerTex( EE::Graphics::Image * Img, const std::string& name ); - void Place( Int32 x, Int32 y, bool flipped ); + void place( Int32 x, Int32 y, bool flipped ); - inline const std::string& Name() const { return mName; } + inline const std::string& name() const { return mName; } - inline const Int32& X() const { return mX; } + inline const Int32& x() const { return mX; } - inline const Int32& Y() const { return mY; } + inline const Int32& y() const { return mY; } - inline const Int32& Channels() { return mChannels; } + inline const Int32& channels() { return mChannels; } - inline void X( const Int32& x ) { mX = x; } + inline void x( const Int32& x ) { mX = x; } - inline void Y( const Int32& y ) { mY = y; } + inline void y( const Int32& y ) { mY = y; } - inline const Int32& Width() const { return mWidth; } + inline const Int32& width() const { return mWidth; } - inline const Int32& Height() const { return mHeight; } + inline const Int32& height() const { return mHeight; } - inline void Width( const Int32& W ) { mWidth = W; } + inline void width( const Int32& W ) { mWidth = W; } - inline void Height( const Int32& H ) { mHeight = H; } + inline void height( const Int32& H ) { mHeight = H; } - inline const bool& LoadedInfo() const { return mLoadedInfo; } + inline const bool& loadedInfo() const { return mLoadedInfo; } - inline const Int32& Area() const { return mArea; } + inline const Int32& area() const { return mArea; } - inline const bool& Placed() const { return mPlaced; } + inline const bool& placed() const { return mPlaced; } - inline const bool& Flipped() const { return mFlipped; } + inline const bool& flipped() const { return mFlipped; } - inline const Int32& LongestEdge() const { return mLongestEdge; } + inline const Int32& longestEdge() const { return mLongestEdge; } - inline const bool& Disabled() const { return mDisabled; } + inline const bool& disabled() const { return mDisabled; } - inline void Disabled( const bool& d ) { mDisabled = d; } + inline void disabled( const bool& d ) { mDisabled = d; } - inline const Int32& DestWidth() const { return mDestWidth; } + inline const Int32& destWidth() const { return mDestWidth; } - inline const Int32& DestHeight() const { return mDestHeight; } + inline const Int32& destHeight() const { return mDestHeight; } - inline void DestWidth( const Int32& W ) { mDestWidth = W; } + inline void destWidth( const Int32& W ) { mDestWidth = W; } - inline void DestHeight( const Int32& H ){ mDestHeight = H; } + inline void destHeight( const Int32& H ){ mDestHeight = H; } - inline const Int32& OffsetX() const { return mOffsetX; } + inline const Int32& offsetX() const { return mOffsetX; } - inline const Int32& OffsetY() const { return mOffsetY; } + inline const Int32& offsetY() const { return mOffsetY; } - inline void OffsetX( const Int32& offx ){ mOffsetX = offx; } + inline void offsetX( const Int32& offx ){ mOffsetX = offx; } - inline void OffsetY( const Int32& offy ){ mDestHeight = offy; } + inline void offsetY( const Int32& offy ){ mDestHeight = offy; } - EE::Graphics::Image * Image() const; + EE::Graphics::Image * getImage() const; protected: std::string mName; Int32 mWidth; diff --git a/src/eepp/graphics/texturesaver.cpp b/src/eepp/graphics/texturesaver.cpp index 9639255b6..af2a8dad3 100644 --- a/src/eepp/graphics/texturesaver.cpp +++ b/src/eepp/graphics/texturesaver.cpp @@ -10,12 +10,12 @@ TextureSaver::TextureSaver( int textureBind ) : glGetIntegerv( GL_TEXTURE_BINDING_2D, &mTextureBinded ); if ( mTextureToBind > 0 && mTextureBinded != mTextureToBind ) - GLi->BindTexture( GL_TEXTURE_2D, mTextureToBind ); + GLi->bindTexture( GL_TEXTURE_2D, mTextureToBind ); } TextureSaver::~TextureSaver() { if ( mTextureBinded != mTextureToBind ) - GLi->BindTexture( GL_TEXTURE_2D, mTextureBinded ); + GLi->bindTexture( GL_TEXTURE_2D, mTextureBinded ); } }}} diff --git a/src/eepp/graphics/ttffont.cpp b/src/eepp/graphics/ttffont.cpp index e9032df11..4aaa8c2fe 100755 --- a/src/eepp/graphics/ttffont.cpp +++ b/src/eepp/graphics/ttffont.cpp @@ -26,20 +26,20 @@ TTFFont::~TTFFont() { hkFontManager::instance()->Destroy(); } -bool TTFFont::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) { +bool TTFFont::loadFromPack( Pack* Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) { bool Ret = false; SafeDataPointer PData; if ( Pack->isOpen() && Pack->extractFileToMemory( FilePackPath, PData ) ) { mFilepath = FilePackPath; - Ret = LoadFromMemory( PData.Data, PData.DataSize, Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); + Ret = loadFromMemory( PData.Data, PData.DataSize, Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); } return Ret; } -bool TTFFont::LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) { +bool TTFFont::loadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) { if ( !mFilepath.size() ) mFilepath = "from memory"; @@ -55,7 +55,7 @@ bool TTFFont::LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, c return iLoad( Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); } -bool TTFFont::Load( const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) { +bool TTFFont::load( const std::string& Filepath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) { mFilepath = Filepath; if ( FileSystem::fileExists( Filepath ) ) { @@ -73,7 +73,7 @@ bool TTFFont::Load( const std::string& Filepath, const unsigned int& Size, EE_TT Pack * tPack = PackManager::instance()->exists( mFilepath ); if ( NULL != tPack ) { - return LoadFromPack( tPack, mFilepath, Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); + return loadFromPack( tPack, mFilepath, Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); } } @@ -188,13 +188,13 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui TempGlyph.MaxX = TempGlyph.MinX + GlyphRect.x; } - Image out( TempOutGlyphSurface, GlyphRect.x, GlyphRect.y, 4 ); out.AvoidFreeImage( true ); - Image in( TempGlyphSurface, mFont->Current()->Pixmap()->width, mFont->Current()->Pixmap()->rows, 4 ); in.AvoidFreeImage( true ); + Image out( TempOutGlyphSurface, GlyphRect.x, GlyphRect.y, 4 ); out.avoidFreeImage( true ); + Image in( TempGlyphSurface, mFont->Current()->Pixmap()->width, mFont->Current()->Pixmap()->rows, 4 ); in.avoidFreeImage( true ); - Uint32 px = ( ( (Float)out.Width() - (Float)in.Width() ) * 0.5f ); - Uint32 py = ( ( (Float)out.Height() - (Float)in.Height() ) * 0.5f ); + Uint32 px = ( ( (Float)out.width() - (Float)in.width() ) * 0.5f ); + Uint32 py = ( ( (Float)out.height() - (Float)in.height() ) * 0.5f ); - out.Blit( &in, px, py ); + out.blit( &in, px, py ); TexGlyph = reinterpret_cast ( TempOutGlyphSurface ); } else { @@ -272,7 +272,7 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui } // Create the outline - MakeOutline( alpha_init, alpha_final, nGlyphS.x, nGlyphS.y, OutlineSize ); + makeOutline( alpha_init, alpha_final, nGlyphS.x, nGlyphS.y, OutlineSize ); for ( Int32 y = 0; y < nGlyphS.y; y++ ) { for( Int32 x = 0; x < nGlyphS.x; x++) { @@ -306,45 +306,45 @@ bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Ui mTexReady = true; if ( !mThreadedLoading ) - UpdateLoading(); + updateLoading(); return true; } -void TTFFont::UpdateLoading() { +void TTFFont::updateLoading() { if ( mTexReady && NULL != mPixels ) { std::string name( FileSystem::fileRemoveExtension( FileSystem::fileNameFromPath( mFilepath ) ) ); - mTexId = TextureFactory::instance()->LoadFromPixels( reinterpret_cast ( &mPixels[0] ), (Uint32)mTexWidth, (Uint32)mTexHeight, 4, false, CLAMP_TO_EDGE, false, false, name ); + mTexId = TextureFactory::instance()->loadFromPixels( reinterpret_cast ( &mPixels[0] ), (Uint32)mTexWidth, (Uint32)mTexHeight, 4, false, CLAMP_TO_EDGE, false, false, name ); eeSAFE_DELETE_ARRAY( mPixels ); - RebuildFromGlyphs(); + rebuildFromGlyphs(); eePRINTL( "TTF Font %s loaded.", mFilepath.c_str() ); } } -void TTFFont::RebuildFromGlyphs() { +void TTFFont::rebuildFromGlyphs() { Float Top, Bottom; Rectf tR; mTexCoords.resize( mNumChars ); - Texture * Tex = TextureFactory::instance()->GetTexture( mTexId ); + Texture * Tex = TextureFactory::instance()->getTexture( mTexId ); - TextureFactory::instance()->Bind( Tex ); + TextureFactory::instance()->bind( Tex ); eeGlyph tGlyph; for (unsigned int i = 0; i < mNumChars; i++) { tGlyph = mGlyphs[i]; - tR.Left = (Float)tGlyph.CurX / Tex->Width(); - tR.Top = (Float)tGlyph.CurY / Tex->Height(); + tR.Left = (Float)tGlyph.CurX / Tex->width(); + tR.Top = (Float)tGlyph.CurY / Tex->height(); - tR.Right = (Float)(tGlyph.CurX + tGlyph.CurW) / Tex->Width(); - tR.Bottom = (Float)(tGlyph.CurY + tGlyph.CurH) / Tex->Height(); + tR.Right = (Float)(tGlyph.CurX + tGlyph.CurW) / Tex->width(); + tR.Bottom = (Float)(tGlyph.CurY + tGlyph.CurH) / Tex->height(); Top = (Float)mHeight + mDescent - tGlyph.GlyphH - tGlyph.MinY; Bottom = (Float)mHeight + mDescent + tGlyph.GlyphH - tGlyph.MaxY; @@ -368,16 +368,16 @@ void TTFFont::RebuildFromGlyphs() { } } -bool TTFFont::SaveTexture( const std::string& Filepath, const EE_SAVE_TYPE& Format ) { - Texture* Tex = TextureFactory::instance()->GetTexture(mTexId); +bool TTFFont::saveTexture( const std::string& Filepath, const EE_SAVE_TYPE& Format ) { + Texture* Tex = TextureFactory::instance()->getTexture(mTexId); if ( Tex != NULL ) - return Tex->SaveToFile( Filepath, Format ); + return Tex->saveToFile( Filepath, Format ); return false; } -bool TTFFont::SaveCoordinates( const std::string& Filepath ) { +bool TTFFont::saveCoordinates( const std::string& Filepath ) { IOStreamFile fs( Filepath, std::ios::out | std::ios::binary ); if ( fs.isOpen() ) { @@ -398,7 +398,7 @@ bool TTFFont::SaveCoordinates( const std::string& Filepath ) { // Write the glyphs fs.write( reinterpret_cast (&mGlyphs[0]), sizeof(eeGlyph) * mGlyphs.size() ); - RebuildFromGlyphs(); + rebuildFromGlyphs(); return true; } else { @@ -408,11 +408,11 @@ bool TTFFont::SaveCoordinates( const std::string& Filepath ) { return false; } -bool TTFFont::Save( const std::string& TexturePath, const std::string& CoordinatesDatPath, const EE_SAVE_TYPE& Format ) { - return SaveTexture(TexturePath, Format) && SaveCoordinates( CoordinatesDatPath ); +bool TTFFont::save( const std::string& TexturePath, const std::string& CoordinatesDatPath, const EE_SAVE_TYPE& Format ) { + return saveTexture(TexturePath, Format) && saveCoordinates( CoordinatesDatPath ); } -void TTFFont::MakeOutline( Uint8 *in, Uint8 *out, Int16 w, Int16 h , Int16 OutlineSize ) { +void TTFFont::makeOutline( Uint8 *in, Uint8 *out, Int16 w, Int16 h , Int16 OutlineSize ) { int y, x, s_y, s_x, get_y, get_x, index, pos; Uint8 c; @@ -441,11 +441,11 @@ void TTFFont::MakeOutline( Uint8 *in, Uint8 *out, Int16 w, Int16 h , Int16 Outli } } -bool TTFFont::ThreadedLoading() const { +bool TTFFont::threadedLoading() const { return mThreadedLoading; } -void TTFFont::ThreadedLoading( const bool& isThreaded ) { +void TTFFont::threadedLoading( const bool& isThreaded ) { mThreadedLoading = isThreaded; } diff --git a/src/eepp/graphics/ttffontloader.cpp b/src/eepp/graphics/ttffontloader.cpp index c01f2c360..12d809b37 100644 --- a/src/eepp/graphics/ttffontloader.cpp +++ b/src/eepp/graphics/ttffontloader.cpp @@ -18,7 +18,7 @@ TTFFontLoader::TTFFontLoader( const std::string& FontName, const std::string& Fi mAddPixelSeparator( AddPixelSeparator ), mFontLoaded( false ) { - Create(); + create(); } TTFFontLoader::TTFFontLoader( const std::string& FontName, Pack * Pack, const std::string& FilePackPath, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) : @@ -36,7 +36,7 @@ TTFFontLoader::TTFFontLoader( const std::string& FontName, Pack * Pack, const st mPack( Pack ), mFontLoaded( false ) { - Create(); + create(); } TTFFontLoader::TTFFontLoader( const std::string& FontName, Uint8* TTFData, const unsigned int& TTFDataSize, const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, const Uint8& OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) : @@ -54,27 +54,27 @@ TTFFontLoader::TTFFontLoader( const std::string& FontName, Uint8* TTFData, const mDataSize( TTFDataSize ), mFontLoaded( false ) { - Create(); + create(); } TTFFontLoader::~TTFFontLoader() { } -void TTFFontLoader::Create() { +void TTFFontLoader::create() { mFont = TTFFont::New( mFontName ); } void TTFFontLoader::start() { ObjectLoader::start(); - mFont->ThreadedLoading( mThreaded ); + mFont->threadedLoading( mThreaded ); if ( TTF_LT_PATH == mLoadType ) - LoadFromPath(); + loadFromPath(); else if ( TTF_LT_MEM == mLoadType ) - LoadFromMemory(); + loadFromMemory(); else if ( TTF_LT_PACK == mLoadType ) - LoadFromPack(); + loadFromPack(); mFontLoaded = true; @@ -84,35 +84,35 @@ void TTFFontLoader::start() { void TTFFontLoader::update() { if ( !mLoaded && mFontLoaded ) { - mFont->UpdateLoading(); + mFont->updateLoading(); setLoaded(); } } -const std::string& TTFFontLoader::Id() const { +const std::string& TTFFontLoader::getId() const { return mFontName; } -void TTFFontLoader::LoadFromPath() { - mFont->Load( mFilepath, mSize, mStyle, mNumCharsToGen, mFontColor, mOutlineSize, mOutlineColor, mAddPixelSeparator ); +void TTFFontLoader::loadFromPath() { + mFont->load( mFilepath, mSize, mStyle, mNumCharsToGen, mFontColor, mOutlineSize, mOutlineColor, mAddPixelSeparator ); } -void TTFFontLoader::LoadFromMemory() { - mFont->LoadFromMemory( mData, mDataSize, mSize, mStyle, mNumCharsToGen, mFontColor, mOutlineSize, mOutlineColor, mAddPixelSeparator ); +void TTFFontLoader::loadFromMemory() { + mFont->loadFromMemory( mData, mDataSize, mSize, mStyle, mNumCharsToGen, mFontColor, mOutlineSize, mOutlineColor, mAddPixelSeparator ); } -void TTFFontLoader::LoadFromPack() { - mFont->LoadFromPack( mPack, mFilepath, mSize, mStyle, mNumCharsToGen, mFontColor, mOutlineSize, mOutlineColor, mAddPixelSeparator ); +void TTFFontLoader::loadFromPack() { + mFont->loadFromPack( mPack, mFilepath, mSize, mStyle, mNumCharsToGen, mFontColor, mOutlineSize, mOutlineColor, mAddPixelSeparator ); } -Graphics::Font * TTFFontLoader::Font() const { +Graphics::Font * TTFFontLoader::getFont() const { return mFont; } void TTFFontLoader::unload() { if ( mLoaded ) { - TextureFactory::instance()->Remove( mFont->GetTexId() ); + TextureFactory::instance()->remove( mFont->getTexId() ); FontManager::instance()->remove( mFont ); diff --git a/src/eepp/graphics/vertexbuffer.cpp b/src/eepp/graphics/vertexbuffer.cpp index 5e8032396..3cc666943 100644 --- a/src/eepp/graphics/vertexbuffer.cpp +++ b/src/eepp/graphics/vertexbuffer.cpp @@ -8,7 +8,7 @@ using namespace EE::Graphics::Private; namespace EE { namespace Graphics { VertexBuffer * VertexBuffer::New( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, EE_VBO_USAGE_TYPE UsageType ) { - if ( GLi->IsExtension( EEGL_ARB_vertex_buffer_object ) ) + if ( GLi->isExtension( EEGL_ARB_vertex_buffer_object ) ) return eeNew( VertexBufferVBO, ( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) ); return eeNew( VertexBufferOGL, ( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) ); @@ -38,75 +38,75 @@ VertexBuffer::~VertexBuffer() { VertexBufferManager::instance()->remove( this ); } -void VertexBuffer::AddVertex( const Uint32& Type, const Vector2f& Vertex ) { +void VertexBuffer::addVertex( const Uint32& Type, const Vector2f& Vertex ) { if ( Type < VERTEX_FLAGS_COUNT_ARR ) { mVertexArray[ Type ].push_back( Vertex.x ); mVertexArray[ Type ].push_back( Vertex.y ); } } -void VertexBuffer::AddVertex( const Vector2f& Vertex ) { - AddVertex( VERTEX_FLAG_POSITION, Vertex ); +void VertexBuffer::addVertex( const Vector2f& Vertex ) { + addVertex( VERTEX_FLAG_POSITION, Vertex ); } -void VertexBuffer::AddVertexCoord( const Vector2f& VertexCoord, const Uint32& TextureLevel ) { - AddVertex( VERTEX_FLAG_TEXTURE0 + TextureLevel, VertexCoord ); +void VertexBuffer::addVertexCoord( const Vector2f& VertexCoord, const Uint32& TextureLevel ) { + addVertex( VERTEX_FLAG_TEXTURE0 + TextureLevel, VertexCoord ); } -void VertexBuffer::AddColor( const ColorA& Color ) { +void VertexBuffer::addColor( const ColorA& Color ) { mColorArray.push_back( Color.r() ); mColorArray.push_back( Color.g() ); mColorArray.push_back( Color.b() ); mColorArray.push_back( Color.a() ); } -void VertexBuffer::AddIndex( const Uint32& Index ) { +void VertexBuffer::addIndex( const Uint32& Index ) { mIndexArray.push_back( Index ); VERTEX_FLAG_SET( mVertexFlags, VERTEX_FLAG_USE_INDICES ); } -void VertexBuffer::ResizeArray( const Uint32& Type, const Uint32& Size ) { +void VertexBuffer::resizeArray( const Uint32& Type, const Uint32& Size ) { if ( Type != VERTEX_FLAG_COLOR ) mVertexArray[ Type ].resize( Size ); else mColorArray.resize( Size ); } -void VertexBuffer::ResizeIndices( const Uint32& Size ) { +void VertexBuffer::resizeIndices( const Uint32& Size ) { mIndexArray.resize( Size ); } -Float * VertexBuffer::GetArray( const Uint32& Type ) { +Float * VertexBuffer::getArray( const Uint32& Type ) { if ( Type < VERTEX_FLAGS_COUNT_ARR && mVertexArray[ Type ].size() ) return &mVertexArray[ Type - 1 ][0]; return NULL; } -Uint8 * VertexBuffer::GetColorArray() { +Uint8 * VertexBuffer::getColorArray() { if ( mColorArray.size() ) return &mColorArray[0]; return NULL; } -Uint32 * VertexBuffer::GetIndices() { +Uint32 * VertexBuffer::getIndices() { if ( mIndexArray.size() ) return &mIndexArray[0]; return NULL; } -Uint32 VertexBuffer::GetVertexCount() { +Uint32 VertexBuffer::getVertexCount() { return (Uint32)mVertexArray[ VERTEX_FLAG_POSITION ].size() / eeVertexElements[ VERTEX_FLAG_POSITION ]; } -Uint32 VertexBuffer::GetIndexCount() { +Uint32 VertexBuffer::getIndexCount() { return (Uint32)mIndexArray.size(); } -Vector2f VertexBuffer::GetVector2( const Uint32& Type, const Uint32& Index ) { +Vector2f VertexBuffer::getVector2( const Uint32& Type, const Uint32& Index ) { eeASSERT( Type < VERTEX_FLAGS_COUNT_ARR && !VERTEX_FLAG_QUERY( mVertexFlags, Type ) ) Int32 pos = Index * eeVertexElements[ Type ]; @@ -114,7 +114,7 @@ Vector2f VertexBuffer::GetVector2( const Uint32& Type, const Uint32& Index ) { return Vector2f( mVertexArray[ Type ][ pos ], mVertexArray[ Type ][ pos + 1 ] ); } -ColorA VertexBuffer::GetColor( const Uint32& Index ) { +ColorA VertexBuffer::getColor( const Uint32& Index ) { eeASSERT( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_COLOR ) ); Int32 pos = Index * eeVertexElements[ VERTEX_FLAG_COLOR ]; @@ -122,20 +122,20 @@ ColorA VertexBuffer::GetColor( const Uint32& Index ) { return ColorA( mColorArray[ pos ], mColorArray[ pos + 1 ], mColorArray[ pos + 2 ], mColorArray[ pos + 3 ] ); } -Uint32 VertexBuffer::GetIndex( const Uint32& Index ) { +Uint32 VertexBuffer::getIndex( const Uint32& Index ) { eeASSERT( Index < mIndexArray.size() ); return mIndexArray[ Index ]; } -void VertexBuffer::SetElementNum( Int32 Num ) { +void VertexBuffer::setElementNum( Int32 Num ) { mElemDraw = Num; } -const Int32& VertexBuffer::GetElementNum() const { +const Int32& VertexBuffer::getElementNum() const { return mElemDraw; } -void VertexBuffer::Clear() { +void VertexBuffer::clear() { for ( int i = 0; i < VERTEX_FLAGS_COUNT; i++ ) mVertexArray[i].clear(); diff --git a/src/eepp/graphics/vertexbuffermanager.cpp b/src/eepp/graphics/vertexbuffermanager.cpp index 8acab62bd..77d8bb1e2 100644 --- a/src/eepp/graphics/vertexbuffermanager.cpp +++ b/src/eepp/graphics/vertexbuffermanager.cpp @@ -12,11 +12,11 @@ VertexBufferManager::~VertexBufferManager() { } -void VertexBufferManager::Reload() { +void VertexBufferManager::reload() { std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) - (*it)->Reload(); + (*it)->reload(); } }}} diff --git a/src/eepp/graphics/vertexbuffermanager.hpp b/src/eepp/graphics/vertexbuffermanager.hpp index 685c23824..8f5f0d2c1 100644 --- a/src/eepp/graphics/vertexbuffermanager.hpp +++ b/src/eepp/graphics/vertexbuffermanager.hpp @@ -12,7 +12,7 @@ class EE_API VertexBufferManager : public Container { public: virtual ~VertexBufferManager(); - void Reload(); + void reload(); protected: VertexBufferManager(); }; diff --git a/src/eepp/graphics/vertexbufferogl.cpp b/src/eepp/graphics/vertexbufferogl.cpp index 4ad6cc59a..409ec9420 100644 --- a/src/eepp/graphics/vertexbufferogl.cpp +++ b/src/eepp/graphics/vertexbufferogl.cpp @@ -12,96 +12,96 @@ VertexBufferOGL::VertexBufferOGL( const Uint32& VertexFlags, EE_DRAW_MODE DrawTy VertexBufferOGL::~VertexBufferOGL() { } -void VertexBufferOGL::Bind() { - SetVertexStates(); +void VertexBufferOGL::bind() { + setVertexStates(); } -bool VertexBufferOGL::Compile() { +bool VertexBufferOGL::compile() { return true; } -void VertexBufferOGL::Draw() { +void VertexBufferOGL::draw() { if( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_USE_INDICES ) ) { Int32 lSize = mElemDraw; if( mElemDraw < 0 ) - lSize = GetIndexCount(); + lSize = getIndexCount(); - GLi->DrawElements( mDrawType, lSize, GL_UNSIGNED_INT, &mIndexArray[0] ); + GLi->drawElements( mDrawType, lSize, GL_UNSIGNED_INT, &mIndexArray[0] ); } else { - GLi->DrawArrays( mDrawType, 0, GetVertexCount() ); + GLi->drawArrays( mDrawType, 0, getVertexCount() ); } } -void VertexBufferOGL::SetVertexStates() { - Uint32 alloc = GetVertexCount() * sizeof(Float) * 2; - Uint32 allocC = GetVertexCount() * 4; +void VertexBufferOGL::setVertexStates() { + Uint32 alloc = getVertexCount() * sizeof(Float) * 2; + Uint32 allocC = getVertexCount() * 4; /// POSITION if( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_POSITION ) ) { - GLi->EnableClientState( GL_VERTEX_ARRAY ); - GLi->VertexPointer( eeVertexElements[ VERTEX_FLAG_POSITION ], GL_FP, sizeof(Float) * eeVertexElements[ VERTEX_FLAG_POSITION ], &mVertexArray[ VERTEX_FLAG_POSITION ][0], alloc ); + GLi->enableClientState( GL_VERTEX_ARRAY ); + GLi->vertexPointer( eeVertexElements[ VERTEX_FLAG_POSITION ], GL_FP, sizeof(Float) * eeVertexElements[ VERTEX_FLAG_POSITION ], &mVertexArray[ VERTEX_FLAG_POSITION ][0], alloc ); } else { - GLi->DisableClientState( GL_VERTEX_ARRAY ); + GLi->disableClientState( GL_VERTEX_ARRAY ); } /// COLOR if( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_COLOR ) ) { - GLi->EnableClientState( GL_COLOR_ARRAY ); - GLi->ColorPointer( eeVertexElements[ VERTEX_FLAG_COLOR ], GL_UNSIGNED_BYTE, sizeof(Uint8) * eeVertexElements[ VERTEX_FLAG_COLOR ], &mColorArray[0], allocC ); + GLi->enableClientState( GL_COLOR_ARRAY ); + GLi->colorPointer( eeVertexElements[ VERTEX_FLAG_COLOR ], GL_UNSIGNED_BYTE, sizeof(Uint8) * eeVertexElements[ VERTEX_FLAG_COLOR ], &mColorArray[0], allocC ); } else { - GLi->DisableClientState( GL_COLOR_ARRAY ); + GLi->disableClientState( GL_COLOR_ARRAY ); } /// TEXTURES - if ( GLi->IsExtension( EEGL_ARB_multitexture ) ) { + if ( GLi->isExtension( EEGL_ARB_multitexture ) ) { for ( Int32 i = 0; i < EE_MAX_TEXTURE_UNITS; i++ ) { if( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_TEXTURE0 + i ) ) { - GLi->ClientActiveTexture( GL_TEXTURE0 + i ); - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->clientActiveTexture( GL_TEXTURE0 + i ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); - GLi->TexCoordPointer( eeVertexElements[ VERTEX_FLAG_TEXTURE0 + i ], GL_FP, sizeof(Float) * eeVertexElements[ VERTEX_FLAG_TEXTURE0 + i ], &mVertexArray[ VERTEX_FLAG_TEXTURE0 + i ][0], alloc ); + GLi->texCoordPointer( eeVertexElements[ VERTEX_FLAG_TEXTURE0 + i ], GL_FP, sizeof(Float) * eeVertexElements[ VERTEX_FLAG_TEXTURE0 + i ], &mVertexArray[ VERTEX_FLAG_TEXTURE0 + i ][0], alloc ); } else { if ( 0 == i ) { - GLi->Disable( GL_TEXTURE_2D ); - GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->disable( GL_TEXTURE_2D ); + GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); break; } } } } else { if ( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_TEXTURE0 ) ) { - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); - GLi->TexCoordPointer( eeVertexElements[ VERTEX_FLAG_TEXTURE0 ], GL_FP, sizeof(Float) * eeVertexElements[ VERTEX_FLAG_TEXTURE0 ], &mVertexArray[ VERTEX_FLAG_TEXTURE0 ][0], alloc ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->texCoordPointer( eeVertexElements[ VERTEX_FLAG_TEXTURE0 ], GL_FP, sizeof(Float) * eeVertexElements[ VERTEX_FLAG_TEXTURE0 ], &mVertexArray[ VERTEX_FLAG_TEXTURE0 ][0], alloc ); } else { - GLi->Disable( GL_TEXTURE_2D ); - GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->disable( GL_TEXTURE_2D ); + GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); } } - GLi->ClientActiveTexture( GL_TEXTURE0 ); + GLi->clientActiveTexture( GL_TEXTURE0 ); } -void VertexBufferOGL::Unbind() { +void VertexBufferOGL::unbind() { if( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_POSITION ) ) { - GLi->EnableClientState( GL_VERTEX_ARRAY ); + GLi->enableClientState( GL_VERTEX_ARRAY ); } if( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_COLOR ) ) { - GLi->EnableClientState( GL_COLOR_ARRAY ); + GLi->enableClientState( GL_COLOR_ARRAY ); } if( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_TEXTURE0 ) ) { - GLi->Enable( GL_TEXTURE_2D ); - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->enable( GL_TEXTURE_2D ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); } } -void VertexBufferOGL::Update( const Uint32& Types, bool Indices ) { +void VertexBufferOGL::update( const Uint32& Types, bool Indices ) { } -void VertexBufferOGL::Reload() { +void VertexBufferOGL::reload() { } }} diff --git a/src/eepp/graphics/vertexbuffervbo.cpp b/src/eepp/graphics/vertexbuffervbo.cpp index 1fee610e6..f1bb5b1dc 100644 --- a/src/eepp/graphics/vertexbuffervbo.cpp +++ b/src/eepp/graphics/vertexbuffervbo.cpp @@ -29,32 +29,32 @@ VertexBufferVBO::~VertexBufferVBO() { glDeleteBuffersARB( 1, (unsigned int *)&mElementHandle ); } - if ( GLv_3CP == GLi->Version() && mVAO ) { - GLi->DeleteVertexArrays( 1, &mVAO ); + if ( GLv_3CP == GLi->version() && mVAO ) { + GLi->deleteVertexArrays( 1, &mVAO ); } } -void VertexBufferVBO::Bind() { +void VertexBufferVBO::bind() { if ( !mCompiled ) { - Compile(); + compile(); if ( !mCompiled ) return; } - SetVertexStates(); + setVertexStates(); } -bool VertexBufferVBO::Compile() { +bool VertexBufferVBO::compile() { if( mCompiled ) return false; int curVAO = 0; #ifndef EE_GLES - if ( GLv_3CP == GLi->Version() ) { + if ( GLv_3CP == GLi->version() ) { glGetIntegerv( GL_VERTEX_ARRAY_BINDING, &curVAO ); - GLi->GenVertexArrays( 1, &mVAO ); - GLi->BindVertexArray( mVAO ); + GLi->genVertexArrays( 1, &mVAO ); + GLi->bindVertexArray( mVAO ); } #endif @@ -80,7 +80,7 @@ bool VertexBufferVBO::Compile() { } } - if ( GLv_3CP != GLi->Version() ) { + if ( GLv_3CP != GLi->version() ) { glBindBufferARB( GL_ARRAY_BUFFER, 0 ); } @@ -90,7 +90,7 @@ bool VertexBufferVBO::Compile() { glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, mElementHandle ); - glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER, GetIndexCount() * sizeof(Uint32), &mIndexArray[0], usageType ); + glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER, getIndexCount() * sizeof(Uint32), &mIndexArray[0], usageType ); glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, 0 ); } @@ -98,28 +98,28 @@ bool VertexBufferVBO::Compile() { mCompiled = true; mBuffersSet = false; - if ( GLv_3CP == GLi->Version() ) { - GLi->BindVertexArray( curVAO ); + if ( GLv_3CP == GLi->version() ) { + GLi->bindVertexArray( curVAO ); } return true; } -void VertexBufferVBO::Draw() { +void VertexBufferVBO::draw() { if ( !mCompiled ) return; int curVAO = 0; #ifndef EE_GLES - if ( GLv_3CP == GLi->Version() ) { + if ( GLv_3CP == GLi->version() ) { glGetIntegerv( GL_VERTEX_ARRAY_BINDING, &curVAO ); - GLi->BindVertexArray( mVAO ); + GLi->bindVertexArray( mVAO ); } #endif - if ( GLv_3 == GLi->Version() || GLv_3CP == GLi->Version() || GLv_ES2 == GLi->Version() ) { + if ( GLv_3 == GLi->version() || GLv_3CP == GLi->version() || GLv_ES2 == GLi->version() ) { if ( !mTextured ) { - GLi->Disable( GL_TEXTURE_2D ); + GLi->disable( GL_TEXTURE_2D ); } } @@ -127,7 +127,7 @@ void VertexBufferVBO::Draw() { Int32 lSize = mElemDraw; if( mElemDraw < 0 ) - lSize = GetIndexCount(); + lSize = getIndexCount(); glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, mElementHandle ); @@ -135,48 +135,48 @@ void VertexBufferVBO::Draw() { glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, 0 ); } else { - glDrawArrays( mDrawType, 0, GetVertexCount() ); + glDrawArrays( mDrawType, 0, getVertexCount() ); } - if ( GLv_3CP == GLi->Version() ) { - GLi->BindVertexArray( curVAO ); + if ( GLv_3CP == GLi->version() ) { + GLi->bindVertexArray( curVAO ); } } -void VertexBufferVBO::SetVertexStates() { +void VertexBufferVBO::setVertexStates() { #ifdef EE_GL3_ENABLED int index; #endif int curVAO = 0; #ifndef EE_GLES - if ( GLv_3CP == GLi->Version() ) { + if ( GLv_3CP == GLi->version() ) { if ( mBuffersSet ) { return; } glGetIntegerv( GL_VERTEX_ARRAY_BINDING, &curVAO ); - GLi->BindVertexArray( mVAO ); + GLi->bindVertexArray( mVAO ); } #endif /// TEXTURES - if ( GLi->IsExtension( EEGL_ARB_multitexture ) ) { + if ( GLi->isExtension( EEGL_ARB_multitexture ) ) { mTextured = false; for ( Int32 i = 0; i < EE_MAX_TEXTURE_UNITS; i++ ) { if( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_TEXTURE0 + i ) ) { - GLi->ClientActiveTexture( GL_TEXTURE0 + i ); - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->clientActiveTexture( GL_TEXTURE0 + i ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); glBindBufferARB( GL_ARRAY_BUFFER, mArrayHandle[ VERTEX_FLAG_TEXTURE0 + i ] ); #ifdef EE_GL3_ENABLED - if ( GLv_3 == GLi->Version() || GLv_3CP == GLi->Version() || GLv_ES2 == GLi->Version() ) { - index = GLv_3 == GLi->Version() ? - GLi->GetRendererGL3()->GetStateIndex( EEGL_TEXTURE_COORD_ARRAY ) : - ( GLv_3CP == GLi->Version() ? GLi->GetRendererGL3CP()->GetStateIndex( EEGL_TEXTURE_COORD_ARRAY ) : - GLi->GetRendererGLES2()->GetStateIndex( EEGL_TEXTURE_COORD_ARRAY ) ); + if ( GLv_3 == GLi->version() || GLv_3CP == GLi->version() || GLv_ES2 == GLi->version() ) { + index = GLv_3 == GLi->version() ? + GLi->getRendererGL3()->getStateIndex( EEGL_TEXTURE_COORD_ARRAY ) : + ( GLv_3CP == GLi->version() ? GLi->getRendererGL3CP()->getStateIndex( EEGL_TEXTURE_COORD_ARRAY ) : + GLi->getRendererGLES2()->getStateIndex( EEGL_TEXTURE_COORD_ARRAY ) ); if ( -1 != index ) glVertexAttribPointerARB( index, eeVertexElements[ VERTEX_FLAG_TEXTURE0 + i ], GL_FP, GL_FALSE, 0, 0 ); @@ -184,29 +184,29 @@ void VertexBufferVBO::SetVertexStates() { else #endif { - GLi->TexCoordPointer( eeVertexElements[ VERTEX_FLAG_TEXTURE0 + i ], GL_FP, 0, (char*)NULL, 0 ); + GLi->texCoordPointer( eeVertexElements[ VERTEX_FLAG_TEXTURE0 + i ], GL_FP, 0, (char*)NULL, 0 ); } mTextured = true; } else { if ( 0 == i ) { - GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); - GLi->Disable( GL_TEXTURE_2D ); + GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->disable( GL_TEXTURE_2D ); break; } } } } else { if ( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_TEXTURE0 ) ) { - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); glBindBufferARB( GL_ARRAY_BUFFER, mArrayHandle[ VERTEX_FLAG_TEXTURE0 ] ); #ifdef EE_GL3_ENABLED - if ( GLv_3 == GLi->Version() || GLv_3CP == GLi->Version() || GLv_ES2 == GLi->Version() ) { - index = GLv_3 == GLi->Version() ? - GLi->GetRendererGL3()->GetStateIndex( EEGL_TEXTURE_COORD_ARRAY ) : - ( GLv_3CP == GLi->Version() ? GLi->GetRendererGL3CP()->GetStateIndex( EEGL_TEXTURE_COORD_ARRAY ) : - GLi->GetRendererGLES2()->GetStateIndex( EEGL_TEXTURE_COORD_ARRAY ) ); + if ( GLv_3 == GLi->version() || GLv_3CP == GLi->version() || GLv_ES2 == GLi->version() ) { + index = GLv_3 == GLi->version() ? + GLi->getRendererGL3()->getStateIndex( EEGL_TEXTURE_COORD_ARRAY ) : + ( GLv_3CP == GLi->version() ? GLi->getRendererGL3CP()->getStateIndex( EEGL_TEXTURE_COORD_ARRAY ) : + GLi->getRendererGLES2()->getStateIndex( EEGL_TEXTURE_COORD_ARRAY ) ); if ( -1 != index ) glVertexAttribPointerARB( index, eeVertexElements[ VERTEX_FLAG_TEXTURE0 ], GL_FP, GL_FALSE, 0, 0 ); @@ -214,13 +214,13 @@ void VertexBufferVBO::SetVertexStates() { else #endif { - GLi->TexCoordPointer( eeVertexElements[ VERTEX_FLAG_TEXTURE0 ], GL_FP, 0, (char*)NULL, 0 ); + GLi->texCoordPointer( eeVertexElements[ VERTEX_FLAG_TEXTURE0 ], GL_FP, 0, (char*)NULL, 0 ); } mTextured = true; } else { - GLi->Disable( GL_TEXTURE_2D ); - GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->disable( GL_TEXTURE_2D ); + GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); mTextured = false; } @@ -228,15 +228,15 @@ void VertexBufferVBO::SetVertexStates() { /// POSITION if ( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_POSITION ) ) { - GLi->EnableClientState( GL_VERTEX_ARRAY ); + GLi->enableClientState( GL_VERTEX_ARRAY ); glBindBufferARB( GL_ARRAY_BUFFER, mArrayHandle[ VERTEX_FLAG_POSITION ] ); #ifdef EE_GL3_ENABLED - if ( GLv_3 == GLi->Version() || GLv_3CP == GLi->Version() || GLv_ES2 == GLi->Version() ) { - index = GLv_3 == GLi->Version() ? - GLi->GetRendererGL3()->GetStateIndex( EEGL_VERTEX_ARRAY ) : - ( GLv_3CP == GLi->Version() ? GLi->GetRendererGL3CP()->GetStateIndex( EEGL_VERTEX_ARRAY ) : - GLi->GetRendererGLES2()->GetStateIndex( EEGL_VERTEX_ARRAY ) ); + if ( GLv_3 == GLi->version() || GLv_3CP == GLi->version() || GLv_ES2 == GLi->version() ) { + index = GLv_3 == GLi->version() ? + GLi->getRendererGL3()->getStateIndex( EEGL_VERTEX_ARRAY ) : + ( GLv_3CP == GLi->version() ? GLi->getRendererGL3CP()->getStateIndex( EEGL_VERTEX_ARRAY ) : + GLi->getRendererGLES2()->getStateIndex( EEGL_VERTEX_ARRAY ) ); if ( -1 != index ) glVertexAttribPointerARB( index, eeVertexElements[ VERTEX_FLAG_POSITION ], GL_FP, GL_FALSE, 0, 0 ); @@ -244,23 +244,23 @@ void VertexBufferVBO::SetVertexStates() { else #endif { - GLi->VertexPointer( eeVertexElements[ VERTEX_FLAG_POSITION ], GL_FP, 0, (char*)NULL, 0 ); + GLi->vertexPointer( eeVertexElements[ VERTEX_FLAG_POSITION ], GL_FP, 0, (char*)NULL, 0 ); } } else { - GLi->DisableClientState( GL_VERTEX_ARRAY ); + GLi->disableClientState( GL_VERTEX_ARRAY ); } /// COLOR if ( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_COLOR ) ) { - GLi->EnableClientState( GL_COLOR_ARRAY ); + GLi->enableClientState( GL_COLOR_ARRAY ); glBindBufferARB( GL_ARRAY_BUFFER, mArrayHandle[ VERTEX_FLAG_COLOR ] ); #ifdef EE_GL3_ENABLED - if ( GLv_3 == GLi->Version() || GLv_3CP == GLi->Version() || GLv_ES2 == GLi->Version() ) { - index = GLv_3 == GLi->Version() ? - GLi->GetRendererGL3()->GetStateIndex( EEGL_COLOR_ARRAY ) : - ( GLv_3CP == GLi->Version() ? GLi->GetRendererGL3CP()->GetStateIndex( EEGL_COLOR_ARRAY ) : - GLi->GetRendererGLES2()->GetStateIndex( EEGL_COLOR_ARRAY ) ); + if ( GLv_3 == GLi->version() || GLv_3CP == GLi->version() || GLv_ES2 == GLi->version() ) { + index = GLv_3 == GLi->version() ? + GLi->getRendererGL3()->getStateIndex( EEGL_COLOR_ARRAY ) : + ( GLv_3CP == GLi->version() ? GLi->getRendererGL3CP()->getStateIndex( EEGL_COLOR_ARRAY ) : + GLi->getRendererGLES2()->getStateIndex( EEGL_COLOR_ARRAY ) ); if ( -1 != index ) glVertexAttribPointerARB( index, eeVertexElements[ VERTEX_FLAG_COLOR ], GL_UNSIGNED_BYTE, GL_TRUE, 0, 0 ); @@ -268,20 +268,20 @@ void VertexBufferVBO::SetVertexStates() { else #endif { - GLi->ColorPointer( eeVertexElements[ VERTEX_FLAG_COLOR ], GL_UNSIGNED_BYTE, 0, (char*)NULL, 0 ); + GLi->colorPointer( eeVertexElements[ VERTEX_FLAG_COLOR ], GL_UNSIGNED_BYTE, 0, (char*)NULL, 0 ); } } else { - GLi->DisableClientState( GL_COLOR_ARRAY ); + GLi->disableClientState( GL_COLOR_ARRAY ); } mBuffersSet = true; - if ( GLv_3CP == GLi->Version() ) { - GLi->BindVertexArray( curVAO ); + if ( GLv_3CP == GLi->version() ) { + GLi->bindVertexArray( curVAO ); } } -void VertexBufferVBO::Update( const Uint32& Types, bool Indices ) { +void VertexBufferVBO::update( const Uint32& Types, bool Indices ) { unsigned int usageType = GL_STATIC_DRAW; if( mUsageType== VBO_USAGE_TYPE_DYNAMIC ) usageType = GL_DYNAMIC_DRAW; else if( mUsageType== VBO_USAGE_TYPE_STREAM ) usageType = GL_STREAM_DRAW; @@ -304,7 +304,7 @@ void VertexBufferVBO::Update( const Uint32& Types, bool Indices ) { if( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_USE_INDICES ) && Indices ) { glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, mElementHandle ); - glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER, GetIndexCount() * sizeof(Uint32), &mIndexArray[0], usageType ); + glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER, getIndexCount() * sizeof(Uint32), &mIndexArray[0], usageType ); glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, 0 ); } @@ -312,39 +312,39 @@ void VertexBufferVBO::Update( const Uint32& Types, bool Indices ) { mBuffersSet = false; } -void VertexBufferVBO::Reload() { +void VertexBufferVBO::reload() { mCompiled = false; mBuffersSet = false; - Compile(); + compile(); } -void VertexBufferVBO::Unbind() { - if ( GLv_3CP != GLi->Version() ) { +void VertexBufferVBO::unbind() { + if ( GLv_3CP != GLi->version() ) { glBindBufferARB( GL_ARRAY_BUFFER, 0 ); } if ( !mTextured ) { - GLi->Enable( GL_TEXTURE_2D ); - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->enable( GL_TEXTURE_2D ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); } - GLi->ClientActiveTexture( GL_TEXTURE0 ); + GLi->clientActiveTexture( GL_TEXTURE0 ); if( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_POSITION ) ) { - GLi->EnableClientState( GL_VERTEX_ARRAY ); + GLi->enableClientState( GL_VERTEX_ARRAY ); } if( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_COLOR ) ) { - GLi->EnableClientState( GL_COLOR_ARRAY ); + GLi->enableClientState( GL_COLOR_ARRAY ); } } -void VertexBufferVBO::Clear() { +void VertexBufferVBO::clear() { mCompiled = false; mBuffersSet = false; - VertexBuffer::Clear(); + VertexBuffer::clear(); } diff --git a/src/eepp/physics/constraints/dampedspring.cpp b/src/eepp/physics/constraints/dampedspring.cpp index d902dcaab..91b38b096 100644 --- a/src/eepp/physics/constraints/dampedspring.cpp +++ b/src/eepp/physics/constraints/dampedspring.cpp @@ -90,25 +90,25 @@ void DampedSpring::Draw() { cVect a = tovect( cpvadd(body_a->p, cpvrotate(spring->anchr1, body_a->rot)) ); cVect b = tovect( cpvadd(body_b->p, cpvrotate(spring->anchr2, body_b->rot)) ); - GLi->PointSize( mDrawPointSize ); + GLi->pointSize( mDrawPointSize ); BatchRenderer * BR = GlobalBatchRenderer::instance(); - BR->SetTexture( NULL ); - BR->PointsBegin(); - BR->BatchPoint( a.x, a.y ); - BR->BatchPoint( b.x, b.y ); - BR->Draw(); + BR->setTexture( NULL ); + BR->pointsBegin(); + BR->batchPoint( a.x, a.y ); + BR->batchPoint( b.x, b.y ); + BR->draw(); cVect delta = b - a; - GLi->Disable( GL_TEXTURE_2D ); - GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->disable( GL_TEXTURE_2D ); + GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); std::vector tcolors( springVAR_count * 4, ColorA( 0, 255, 0, 255 ) ); - GLi->ColorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast( &tcolors[0] ), springVAR_count * 4 ); - GLi->VertexPointer( 2, GL_FLOAT, 0, springVAR, springVAR_count * sizeof(float) * 2 ); + GLi->colorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast( &tcolors[0] ), springVAR_count * 4 ); + GLi->vertexPointer( 2, GL_FLOAT, 0, springVAR, springVAR_count * sizeof(float) * 2 ); - GLi->PushMatrix(); + GLi->pushMatrix(); float x = a.x; float y = a.y; @@ -122,14 +122,14 @@ void DampedSpring::Draw() { 0.0f , 0.0f , 1.0f, 0.0f, x , y , 0.0f, 1.0f, }; - GLi->MultMatrixf( matrix ); + GLi->multMatrixf( matrix ); - GLi->DrawArrays( GL_LINE_STRIP, 0, springVAR_count ); + GLi->drawArrays( GL_LINE_STRIP, 0, springVAR_count ); - GLi->PopMatrix(); + GLi->popMatrix(); - GLi->Enable( GL_TEXTURE_2D ); - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->enable( GL_TEXTURE_2D ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); #endif } diff --git a/src/eepp/physics/constraints/groovejoint.cpp b/src/eepp/physics/constraints/groovejoint.cpp index 37e8fa7ff..f224af5d2 100644 --- a/src/eepp/physics/constraints/groovejoint.cpp +++ b/src/eepp/physics/constraints/groovejoint.cpp @@ -53,18 +53,18 @@ void GrooveJoint::Draw() { cVect c = tovect( cpvadd(body_b->p, cpvrotate(joint->anchr2, body_b->rot)) ); BatchRenderer * BR = GlobalBatchRenderer::instance(); - cpFloat ps = BR->GetPointSize(); - BR->SetTexture( NULL ); - BR->SetPointSize( mDrawPointSize ); - BR->PointsBegin(); - BR->PointSetColor( ColorA( 128, 255, 128, 255 ) ); - BR->BatchPoint( c.x, c.y ); - BR->Draw(); - BR->LinesBegin(); - BR->LinesSetColor( ColorA( 128, 255, 128, 255 ) ); - BR->BatchLine( a.x, a.y, b.x, b.y ); - BR->Draw(); - BR->SetPointSize( ps ); + cpFloat ps = BR->getPointSize(); + BR->setTexture( NULL ); + BR->setPointSize( mDrawPointSize ); + BR->pointsBegin(); + BR->pointSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->batchPoint( c.x, c.y ); + BR->draw(); + BR->linesBegin(); + BR->linesSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->batchLine( a.x, a.y, b.x, b.y ); + BR->draw(); + BR->setPointSize( ps ); #endif } diff --git a/src/eepp/physics/constraints/pinjoint.cpp b/src/eepp/physics/constraints/pinjoint.cpp index 39ac92abc..d08071102 100644 --- a/src/eepp/physics/constraints/pinjoint.cpp +++ b/src/eepp/physics/constraints/pinjoint.cpp @@ -52,21 +52,21 @@ void PinJoint::Draw() { cVect b = tovect( cpvadd( body_b->p, cpvrotate(joint->anchr2, body_b->rot ) ) ); BatchRenderer * BR = GlobalBatchRenderer::instance(); - cpFloat ps = BR->GetPointSize(); - BR->SetTexture( NULL ); - BR->SetPointSize( mDrawPointSize ); - BR->PointsBegin(); - BR->PointSetColor( ColorA( 128, 255, 128, 255 ) ); - BR->BatchPoint( a.x, a.y ); - BR->BatchPoint( b.x, b.y ); - BR->Draw(); + cpFloat ps = BR->getPointSize(); + BR->setTexture( NULL ); + BR->setPointSize( mDrawPointSize ); + BR->pointsBegin(); + BR->pointSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->batchPoint( a.x, a.y ); + BR->batchPoint( b.x, b.y ); + BR->draw(); - BR->LinesBegin(); - BR->LinesSetColor( ColorA( 128, 255, 128, 255 ) ); - BR->BatchLine( a.x, a.y, b.x, b.y ); - BR->Draw(); + BR->linesBegin(); + BR->linesSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->batchLine( a.x, a.y, b.x, b.y ); + BR->draw(); - BR->SetPointSize( ps ); + BR->setPointSize( ps ); #endif } diff --git a/src/eepp/physics/constraints/pivotjoint.cpp b/src/eepp/physics/constraints/pivotjoint.cpp index 57ffff160..b11914cf0 100644 --- a/src/eepp/physics/constraints/pivotjoint.cpp +++ b/src/eepp/physics/constraints/pivotjoint.cpp @@ -53,15 +53,15 @@ void PivotJoint::Draw() { cVect b = tovect( cpvadd(body_b->p, cpvrotate(joint->anchr2, body_b->rot)) ); BatchRenderer * BR = GlobalBatchRenderer::instance(); - cpFloat ps = BR->GetPointSize(); - BR->SetTexture( NULL ); - BR->SetPointSize( mDrawPointSize ); - BR->PointsBegin(); - BR->PointSetColor( ColorA( 128, 255, 128, 255 ) ); - BR->BatchPoint( a.x, a.y ); - BR->BatchPoint( b.x, b.y ); - BR->Draw(); - BR->SetPointSize( ps ); + cpFloat ps = BR->getPointSize(); + BR->setTexture( NULL ); + BR->setPointSize( mDrawPointSize ); + BR->pointsBegin(); + BR->pointSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->batchPoint( a.x, a.y ); + BR->batchPoint( b.x, b.y ); + BR->draw(); + BR->setPointSize( ps ); #endif } diff --git a/src/eepp/physics/constraints/slidejoint.cpp b/src/eepp/physics/constraints/slidejoint.cpp index 2b2d6d3f4..faccb6914 100644 --- a/src/eepp/physics/constraints/slidejoint.cpp +++ b/src/eepp/physics/constraints/slidejoint.cpp @@ -60,19 +60,19 @@ void SlideJoint::Draw() { cVect b = tovect( cpvadd( body_b->p, cpvrotate( joint->anchr2, body_b->rot ) ) ); BatchRenderer * BR = GlobalBatchRenderer::instance(); - cpFloat ps = BR->GetPointSize(); + cpFloat ps = BR->getPointSize(); - BR->SetTexture( NULL ); - BR->SetPointSize( mDrawPointSize ); - BR->PointsBegin(); - BR->PointSetColor( ColorA( 128, 255, 128, 255 ) ); - BR->BatchPoint( a.x, a.y ); - BR->BatchPoint( b.x, b.y ); - BR->Draw(); - BR->LinesBegin(); - BR->BatchLine( a.x, a.y, b.x, b.y ); - BR->Draw(); - BR->SetPointSize( ps ); + BR->setTexture( NULL ); + BR->setPointSize( mDrawPointSize ); + BR->pointsBegin(); + BR->pointSetColor( ColorA( 128, 255, 128, 255 ) ); + BR->batchPoint( a.x, a.y ); + BR->batchPoint( b.x, b.y ); + BR->draw(); + BR->linesBegin(); + BR->batchLine( a.x, a.y, b.x, b.y ); + BR->draw(); + BR->setPointSize( ps ); #endif } diff --git a/src/eepp/physics/shape.cpp b/src/eepp/physics/shape.cpp index e366f40a4..758d86f72 100644 --- a/src/eepp/physics/shape.cpp +++ b/src/eepp/physics/shape.cpp @@ -169,12 +169,12 @@ ShapeSegment * Shape::GetAsSegment() { void Shape::DrawBB() { #ifdef PHYSICS_RENDERER_ENABLED Primitives P; - P.SetColor( ColorA( 76, 128, 76, 255 ) ); - P.ForceDraw( false ); - P.DrawLine( Line2f( Vector2f( mShape->bb.l, mShape->bb.t ), Vector2f( mShape->bb.r, mShape->bb.t ) ) ); - P.DrawLine( Line2f( Vector2f( mShape->bb.l, mShape->bb.t ), Vector2f( mShape->bb.l, mShape->bb.b ) ) ); - P.DrawLine( Line2f( Vector2f( mShape->bb.l, mShape->bb.b ), Vector2f( mShape->bb.r, mShape->bb.b ) ) ); - P.DrawLine( Line2f( Vector2f( mShape->bb.r, mShape->bb.t ), Vector2f( mShape->bb.r, mShape->bb.b ) ) ); + P.setColor( ColorA( 76, 128, 76, 255 ) ); + P.forceDraw( false ); + P.drawLine( Line2f( Vector2f( mShape->bb.l, mShape->bb.t ), Vector2f( mShape->bb.r, mShape->bb.t ) ) ); + P.drawLine( Line2f( Vector2f( mShape->bb.l, mShape->bb.t ), Vector2f( mShape->bb.l, mShape->bb.b ) ) ); + P.drawLine( Line2f( Vector2f( mShape->bb.l, mShape->bb.b ), Vector2f( mShape->bb.r, mShape->bb.b ) ) ); + P.drawLine( Line2f( Vector2f( mShape->bb.r, mShape->bb.t ), Vector2f( mShape->bb.r, mShape->bb.b ) ) ); #endif } diff --git a/src/eepp/physics/shapecircle.cpp b/src/eepp/physics/shapecircle.cpp index 379f0bf8b..4e6595ca0 100644 --- a/src/eepp/physics/shapecircle.cpp +++ b/src/eepp/physics/shapecircle.cpp @@ -41,9 +41,9 @@ void ShapeCircle::Draw( Space * space ) { Primitives p; cpCircleShape * cs = (cpCircleShape*)mShape; - p.SetColor( ColorForShape( mShape, space->GetSpace() ) ); + p.setColor( ColorForShape( mShape, space->GetSpace() ) ); - p.DrawCircle( Vector2f( cs->CP_PRIVATE(tc).x, cs->CP_PRIVATE(tc).y ), cs->CP_PRIVATE(r) ); + p.drawCircle( Vector2f( cs->CP_PRIVATE(tc).x, cs->CP_PRIVATE(tc).y ), cs->CP_PRIVATE(r) ); #endif } diff --git a/src/eepp/physics/shapecirclesprite.cpp b/src/eepp/physics/shapecirclesprite.cpp index 608082959..5189d60f4 100644 --- a/src/eepp/physics/shapecirclesprite.cpp +++ b/src/eepp/physics/shapecirclesprite.cpp @@ -26,14 +26,14 @@ ShapeCircleSprite::~ShapeCircleSprite() { void ShapeCircleSprite::Draw( Space * space ) { cVect Pos = Body()->Pos(); - mSprite->Position( Pos.x, Pos.y ); - mSprite->Angle( Body()->AngleDeg() ); - mSprite->Draw(); + mSprite->position( Pos.x, Pos.y ); + mSprite->angle( Body()->AngleDeg() ); + mSprite->draw(); } void ShapeCircleSprite::OffsetSet() { - mSprite->Size( Sizef( ShapeCircle::Radius() * 2, ShapeCircle::Radius() * 2 ) ); - mSprite->Offset( Vector2i( -ShapeCircle::Radius() + ShapeCircle::Offset().x, -ShapeCircle::Radius() + ShapeCircle::Offset().y ) ); + mSprite->size( Sizef( ShapeCircle::Radius() * 2, ShapeCircle::Radius() * 2 ) ); + mSprite->offset( Vector2i( -ShapeCircle::Radius() + ShapeCircle::Offset().x, -ShapeCircle::Radius() + ShapeCircle::Offset().y ) ); } Sprite * ShapeCircleSprite::GetSprite() const { diff --git a/src/eepp/physics/shapepoint.cpp b/src/eepp/physics/shapepoint.cpp index 050518fdd..a3a0b0897 100644 --- a/src/eepp/physics/shapepoint.cpp +++ b/src/eepp/physics/shapepoint.cpp @@ -43,17 +43,17 @@ void ShapePoint::Draw( Space * space ) { #ifdef PHYSICS_RENDERER_ENABLED BatchRenderer * BR = GlobalBatchRenderer::instance(); - BR->SetPointSize( mDrawRadius ); + BR->setPointSize( mDrawRadius ); - BR->SetTexture( NULL ); - BR->PointsBegin(); - BR->PointSetColor( ColorForShape( mShape, space->GetSpace() ) ); + BR->setTexture( NULL ); + BR->pointsBegin(); + BR->pointSetColor( ColorForShape( mShape, space->GetSpace() ) ); cpCircleShape * cs = (cpCircleShape*)mShape; - BR->BatchPoint( cs->CP_PRIVATE(tc).x, cs->CP_PRIVATE(tc).y ); + BR->batchPoint( cs->CP_PRIVATE(tc).x, cs->CP_PRIVATE(tc).y ); - BR->DrawOpt(); + BR->drawOpt(); #endif } diff --git a/src/eepp/physics/shapepoly.cpp b/src/eepp/physics/shapepoly.cpp index 5f85d9362..91a76f747 100644 --- a/src/eepp/physics/shapepoly.cpp +++ b/src/eepp/physics/shapepoly.cpp @@ -59,26 +59,26 @@ void ShapePoly::Draw( Space * space ) { BatchRenderer * BR = GlobalBatchRenderer::instance(); - BR->SetTexture( NULL ); + BR->setTexture( NULL ); ColorA Col = ColorForShape( (cpShape *)poly, space->GetSpace() ); if( !poly->CP_PRIVATE(shape).sensor ){ if ( 4 != poly->CP_PRIVATE(numVerts) ) { - BR->PointsBegin(); - BR->PolygonSetColor( Col ); + BR->pointsBegin(); + BR->polygonSetColor( Col ); for ( int i = 0; i < poly->CP_PRIVATE(numVerts); i++ ) { - BR->BatchPolygonByPoint( poly->CP_PRIVATE(tVerts)[i].x, poly->CP_PRIVATE(tVerts)[i].y ); + BR->batchPolygonByPoint( poly->CP_PRIVATE(tVerts)[i].x, poly->CP_PRIVATE(tVerts)[i].y ); } } else { - BR->QuadsBegin(); - BR->QuadsSetColor( Col ); + BR->quadsBegin(); + BR->quadsSetColor( Col ); - BR->BatchQuadFreeEx(poly->CP_PRIVATE(tVerts)[0].x, poly->CP_PRIVATE(tVerts)[0].y, poly->CP_PRIVATE(tVerts)[1].x, poly->CP_PRIVATE(tVerts)[1].y, poly->CP_PRIVATE(tVerts)[2].x, poly->CP_PRIVATE(tVerts)[2].y, poly->CP_PRIVATE(tVerts)[3].x, poly->CP_PRIVATE(tVerts)[3].y ); + BR->batchQuadFreeEx(poly->CP_PRIVATE(tVerts)[0].x, poly->CP_PRIVATE(tVerts)[0].y, poly->CP_PRIVATE(tVerts)[1].x, poly->CP_PRIVATE(tVerts)[1].y, poly->CP_PRIVATE(tVerts)[2].x, poly->CP_PRIVATE(tVerts)[2].y, poly->CP_PRIVATE(tVerts)[3].x, poly->CP_PRIVATE(tVerts)[3].y ); } - BR->DrawOpt(); + BR->drawOpt(); } @@ -93,14 +93,14 @@ void ShapePoly::DrawBorder( Space *space ) { ColorA Col = ColorForShape( (cpShape *)poly, space->GetSpace() ); - BR->LineLoopBegin(); - BR->LineLoopSetColor( Col ); + BR->lineLoopBegin(); + BR->lineLoopSetColor( Col ); for ( int i = 0; i < poly->CP_PRIVATE(numVerts); i++ ) { - BR->BatchLineLoop( poly->CP_PRIVATE(tVerts)[i].x, poly->CP_PRIVATE(tVerts)[i].y ); + BR->batchLineLoop( poly->CP_PRIVATE(tVerts)[i].x, poly->CP_PRIVATE(tVerts)[i].y ); } - BR->Draw(); + BR->draw(); #endif } diff --git a/src/eepp/physics/shapepolysprite.cpp b/src/eepp/physics/shapepolysprite.cpp index f4b312a7d..a4d96b209 100644 --- a/src/eepp/physics/shapepolysprite.cpp +++ b/src/eepp/physics/shapepolysprite.cpp @@ -27,7 +27,7 @@ ShapePolySprite::ShapePolySprite( Physics::Body * body, cpFloat width, cpFloat h mSprite( Sprite ), mSpriteAutoDelete( AutoDeleteSprite ) { - mSprite->Size( Sizef( width, height ) ); + mSprite->size( Sizef( width, height ) ); OffsetSet( cVectNew( width / 2, height / 2 ) ); } @@ -39,14 +39,14 @@ ShapePolySprite::~ShapePolySprite() { void ShapePolySprite::Draw( Space * space ) { cVect Pos = Body()->Pos(); - mSprite->Offset( mOffset ); - mSprite->Position( Pos.x, Pos.y ); - mSprite->Angle( Body()->AngleDeg() ); - mSprite->Draw(); + mSprite->offset( mOffset ); + mSprite->position( Pos.x, Pos.y ); + mSprite->angle( Body()->AngleDeg() ); + mSprite->draw(); } void ShapePolySprite::OffsetSet( cVect center ) { - cVect myCenter = cVectNew( ( mSprite->Size().x / 2 ), ( mSprite->Size().y / 2 ) ); + cVect myCenter = cVectNew( ( mSprite->size().x / 2 ), ( mSprite->size().y / 2 ) ); mOffset = Vector2i( (Int32)( -myCenter.x + ( center.x - myCenter.x ) ) , (Int32)( -myCenter.y + ( center.y - myCenter.y ) ) ); } diff --git a/src/eepp/physics/shapesegment.cpp b/src/eepp/physics/shapesegment.cpp index 09122309e..84caf0dd9 100644 --- a/src/eepp/physics/shapesegment.cpp +++ b/src/eepp/physics/shapesegment.cpp @@ -94,12 +94,12 @@ void ShapeSegment::Draw( Space * space ) { cVect b = tovect( seg->CP_PRIVATE(tb) ); if ( seg->CP_PRIVATE(r) ) { - GLi->Disable( GL_TEXTURE_2D ); - GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->disable( GL_TEXTURE_2D ); + GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); std::vector tcolors( pillVAR_count * 4 ); - GLi->PushMatrix(); + GLi->pushMatrix(); cVect d = b - a; cVect r = d * ( seg->CP_PRIVATE(r) / cpvlength( tocpv( d ) ) ); @@ -111,33 +111,33 @@ void ShapeSegment::Draw( Space * space ) { (float)a.x , (float)a.y, 0.0f, 1.0f, }; - GLi->MultMatrixf( matrix ); + GLi->multMatrixf( matrix ); - GLi->VertexPointer( 3, GL_FLOAT, 0, pillVAR, pillVAR_count * sizeof(float) * 3 ); + GLi->vertexPointer( 3, GL_FLOAT, 0, pillVAR, pillVAR_count * sizeof(float) * 3 ); if( !seg->CP_PRIVATE(shape).sensor ) { ColorA C = ColorForShape( mShape, space->GetSpace() ); tcolors.assign( tcolors.size(), C ); - GLi->ColorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast( &tcolors[0] ), pillVAR_count * 4 ); + GLi->colorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast( &tcolors[0] ), pillVAR_count * 4 ); - GLi->DrawArrays( GL_TRIANGLE_FAN, 0, pillVAR_count ); + GLi->drawArrays( GL_TRIANGLE_FAN, 0, pillVAR_count ); } tcolors.assign( tcolors.size(), ColorA( 102, 102, 102, 255 ) ); - GLi->ColorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast( &tcolors[0] ), pillVAR_count * 4 ); + GLi->colorPointer( 4, GL_UNSIGNED_BYTE, 0, reinterpret_cast( &tcolors[0] ), pillVAR_count * 4 ); - GLi->DrawArrays( GL_LINE_LOOP, 0, pillVAR_count ); + GLi->drawArrays( GL_LINE_LOOP, 0, pillVAR_count ); - GLi->PopMatrix(); + GLi->popMatrix(); - GLi->Enable( GL_TEXTURE_2D ); - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->enable( GL_TEXTURE_2D ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); } else { Primitives p; - p.DrawLine( Line2f( Vector2f( a.x, a.y ), Vector2f( b.x, b.y ) ) ); + p.drawLine( Line2f( Vector2f( a.x, a.y ), Vector2f( b.x, b.y ) ) ); } #endif } diff --git a/src/eepp/physics/space.cpp b/src/eepp/physics/space.cpp index 92d7492b3..66ba04c5d 100644 --- a/src/eepp/physics/space.cpp +++ b/src/eepp/physics/space.cpp @@ -288,14 +288,14 @@ void Space::Draw() { #ifdef PHYSICS_RENDERER_ENABLED BatchRenderer * BR = GlobalBatchRenderer::instance(); - BR->SetBlendMode( ALPHA_NORMAL ); + BR->setBlendMode( ALPHA_NORMAL ); PhysicsManager::DrawSpaceOptions * options = PhysicsManager::instance()->GetDrawOptions(); - cpFloat lw = BR->GetLineWidth(); - cpFloat ps = BR->GetPointSize(); + cpFloat lw = BR->getLineWidth(); + cpFloat ps = BR->getPointSize(); - BR->SetLineWidth( options->LineThickness ); + BR->setLineWidth( options->LineThickness ); if ( options->DrawShapes ) { cpSpatialIndexEach( mSpace->CP_PRIVATE(activeShapes), (cpSpatialIndexIteratorFunc)drawObject, mSpace ); @@ -307,12 +307,12 @@ void Space::Draw() { cpSpatialIndexEach( mSpace->CP_PRIVATE(staticShapes), (cpSpatialIndexIteratorFunc)drawObjectBorder, mSpace ); } - BR->SetLineWidth( lw ); + BR->setLineWidth( lw ); if ( options->DrawBBs ){ cpSpatialIndexEach( mSpace->CP_PRIVATE(activeShapes), (cpSpatialIndexIteratorFunc)drawBB, NULL ); cpSpatialIndexEach( mSpace->CP_PRIVATE(staticShapes), (cpSpatialIndexIteratorFunc)drawBB, NULL ); - BR->Draw(); + BR->draw(); } cpArray * constraints = mSpace->CP_PRIVATE(constraints); @@ -322,25 +322,25 @@ void Space::Draw() { } if ( options->BodyPointSize ) { - BR->SetPointSize( options->BodyPointSize ); - BR->PointsBegin(); - BR->PointSetColor( ColorA( 255, 255, 255, 255 ) ); + BR->setPointSize( options->BodyPointSize ); + BR->pointsBegin(); + BR->pointSetColor( ColorA( 255, 255, 255, 255 ) ); cpArray * bodies = mSpace->CP_PRIVATE(bodies); for( int i=0, count = bodies->num; iarr[i]; - BR->BatchPoint( body->p.x, body->p.y ); + BR->batchPoint( body->p.x, body->p.y ); } - BR->Draw(); + BR->draw(); } if ( options->CollisionPointSize ) { - BR->SetPointSize( options->CollisionPointSize ); - BR->PointsBegin(); - BR->PointSetColor( ColorA( 255, 0, 0, 255 ) ); + BR->setPointSize( options->CollisionPointSize ); + BR->pointsBegin(); + BR->pointSetColor( ColorA( 255, 0, 0, 255 ) ); cpArray * arbiters = mSpace->CP_PRIVATE(arbiters); @@ -349,15 +349,15 @@ void Space::Draw() { for( int i=0; i< arb->CP_PRIVATE(numContacts); i++ ){ cVect v = tovect( arb->CP_PRIVATE(contacts)[i].CP_PRIVATE(p) ); - BR->BatchPoint( v.x, v.y ); + BR->batchPoint( v.x, v.y ); } } - BR->Draw(); + BR->draw(); } - BR->SetLineWidth( lw ); - BR->SetPointSize( ps ); + BR->setLineWidth( lw ); + BR->setPointSize( ps ); #endif } diff --git a/src/eepp/system/log.cpp b/src/eepp/system/log.cpp index e553920e8..9573858b9 100755 --- a/src/eepp/system/log.cpp +++ b/src/eepp/system/log.cpp @@ -190,7 +190,7 @@ void Log::removeLogReader( LogReaderInterface * reader ) { void Log::writeToReaders( std::string& text ) { for ( std::list::iterator it = mReaders.begin(); it != mReaders.end(); it++ ) { - (*it)->WriteLog( text ); + (*it)->writeLog( text ); } } diff --git a/src/eepp/system/platform/posix/threadimpl.cpp b/src/eepp/system/platform/posix/threadimpl.cpp index 0f3376778..477419237 100644 --- a/src/eepp/system/platform/posix/threadimpl.cpp +++ b/src/eepp/system/platform/posix/threadimpl.cpp @@ -42,7 +42,7 @@ void ThreadImpl::terminate() { } } -UintPtr ThreadImpl::id() { +UintPtr ThreadImpl::getId() { return (UintPtr)mThread; } diff --git a/src/eepp/system/platform/posix/threadimpl.hpp b/src/eepp/system/platform/posix/threadimpl.hpp index 700a4e1ad..e479940e9 100644 --- a/src/eepp/system/platform/posix/threadimpl.hpp +++ b/src/eepp/system/platform/posix/threadimpl.hpp @@ -23,7 +23,7 @@ class ThreadImpl { void terminate(); - UintPtr id(); + UintPtr getId(); protected: static void * entryPoint( void* userData ); diff --git a/src/eepp/system/platform/win/threadimpl.cpp b/src/eepp/system/platform/win/threadimpl.cpp index 72b028fb9..43e238dab 100644 --- a/src/eepp/system/platform/win/threadimpl.cpp +++ b/src/eepp/system/platform/win/threadimpl.cpp @@ -39,7 +39,7 @@ void ThreadImpl::terminate() { } } -UintPtr ThreadImpl::id() { +UintPtr ThreadImpl::getId() { return (UintPtr)mThreadId; } diff --git a/src/eepp/system/platform/win/threadimpl.hpp b/src/eepp/system/platform/win/threadimpl.hpp index bcf3f5f3c..f85af772f 100644 --- a/src/eepp/system/platform/win/threadimpl.hpp +++ b/src/eepp/system/platform/win/threadimpl.hpp @@ -28,7 +28,7 @@ class ThreadImpl { void terminate(); - UintPtr id(); + UintPtr getId(); protected: static unsigned int __stdcall entryPoint(void* userData); diff --git a/src/eepp/system/thread.cpp b/src/eepp/system/thread.cpp index 01f8d6308..5816fd79e 100755 --- a/src/eepp/system/thread.cpp +++ b/src/eepp/system/thread.cpp @@ -42,8 +42,8 @@ void Thread::terminate() { } } -Uint32 Thread::Id() { - return mThreadImpl->id(); +Uint32 Thread::getId() { + return mThreadImpl->getId(); } void Thread::run() { diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index eab96a59e..9a96d929f 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -135,9 +135,9 @@ void TextureAtlasEditor::OnResetDestSize( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->Flags() & EE_BUTTON_LMASK ) { - Sizei RealSize = mCurSubTexture->RealSize(); + Sizei RealSize = mCurSubTexture->realSize(); - mCurSubTexture->ResetDestSize(); + mCurSubTexture->resetDestSize(); mSpinDestW->Value( RealSize.width() ); mSpinDestH->Value( RealSize.height() ); @@ -157,7 +157,7 @@ void TextureAtlasEditor::OnCenterOffset( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->Flags() & EE_BUTTON_LMASK ) { - Sizei NSize( -( (Int32)mCurSubTexture->DestSize().x / 2 ), -( (Int32)mCurSubTexture->DestSize().y / 2 ) ); + Sizei NSize( -( (Int32)mCurSubTexture->destSize().x / 2 ), -( (Int32)mCurSubTexture->destSize().y / 2 ) ); mSpinOffX->Value( NSize.x ); mSpinOffY->Value( NSize.y ); @@ -168,7 +168,7 @@ void TextureAtlasEditor::OnHBOffset( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->Flags() & EE_BUTTON_LMASK ) { - Sizei NSize( -( (Int32)mCurSubTexture->DestSize().x / 2 ), -(Int32)mCurSubTexture->DestSize().y ); + Sizei NSize( -( (Int32)mCurSubTexture->destSize().x / 2 ), -(Int32)mCurSubTexture->destSize().y ); mSpinOffX->Value( NSize.x ); mSpinOffY->Value( NSize.y ); @@ -177,25 +177,25 @@ void TextureAtlasEditor::OnHBOffset( const UIEvent * Event ) { void TextureAtlasEditor::OnOffXChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->Offset( Vector2i( (Int32)mSpinOffX->Value(), mCurSubTexture->Offset().y ) ); + mCurSubTexture->offset( Vector2i( (Int32)mSpinOffX->Value(), mCurSubTexture->offset().y ) ); } } void TextureAtlasEditor::OnOffYChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->Offset( Vector2i( mCurSubTexture->Offset().x, (Int32)mSpinOffY->Value() ) ); + mCurSubTexture->offset( Vector2i( mCurSubTexture->offset().x, (Int32)mSpinOffY->Value() ) ); } } void TextureAtlasEditor::OnDestWChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->DestSize( Sizef( (Int32)mSpinDestW->Value(), mCurSubTexture->DestSize().y ) ); + mCurSubTexture->destSize( Sizef( (Int32)mSpinDestW->Value(), mCurSubTexture->destSize().y ) ); } } void TextureAtlasEditor::OnDestHChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->DestSize( Sizef( mCurSubTexture->DestSize().x, (Int32)mSpinDestH->Value() ) ); + mCurSubTexture->destSize( Sizef( mCurSubTexture->destSize().x, (Int32)mSpinDestH->Value() ) ); } } @@ -247,11 +247,11 @@ void TextureAtlasEditor::FileMenuClick( const UIEvent * Event ) { TGDialog->Center(); TGDialog->Show(); } else if ( "Save" == txt ) { - if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->IsLoaded() ) { - mTextureAtlasLoader->UpdateTextureAtlas(); + if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->isLoaded() ) { + mTextureAtlasLoader->updateTextureAtlas(); } } else if ( "Close" == txt ) { - if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->IsLoaded() ) { + if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->isLoaded() ) { UIMessageBox * MsgBox = mTheme->CreateMessageBox( MSGBOX_OKCANCEL, "Do you really want to close the current texture atlas?\nAll changes will be lost." ); MsgBox->AddEventListener( UIEvent::EventMsgBoxConfirmClick, cb::Make1( this, &TextureAtlasEditor::OnTextureAtlasClose ) ); MsgBox->Title( "Close Texture Atlas?" ); @@ -275,29 +275,29 @@ void TextureAtlasEditor::OnTextureAtlasCreate( TexturePacker * TexPacker ) { eeSAFE_DELETE( mTextureAtlasLoader ); - std::string FPath( FileSystem::fileRemoveExtension( mTexturePacker->GetFilepath() + EE_TEXTURE_ATLAS_EXTENSION ) ); + std::string FPath( FileSystem::fileRemoveExtension( mTexturePacker->getFilepath() + EE_TEXTURE_ATLAS_EXTENSION ) ); mTextureAtlasLoader = eeNew( TextureAtlasLoader, ( FPath, true, cb::Make1( this, &TextureAtlasEditor::OnTextureAtlasLoaded ) ) ); } void TextureAtlasEditor::UpdateControls() { - if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->IsLoaded() ) { + if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->isLoaded() ) { FillSubTextureList(); } } void TextureAtlasEditor::FillSubTextureList() { - if ( NULL == mTextureAtlasLoader || NULL == mTextureAtlasLoader->GetTextureAtlas() || !mTextureAtlasLoader->IsLoaded() ) + if ( NULL == mTextureAtlasLoader || NULL == mTextureAtlasLoader->getTextureAtlas() || !mTextureAtlasLoader->isLoaded() ) return; - std::list& Res = mTextureAtlasLoader->GetTextureAtlas()->getResources(); + std::list& Res = mTextureAtlasLoader->getTextureAtlas()->getResources(); mSubTextureList->Clear(); std::vector items; for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { - items.push_back( (*it)->Name() ); + items.push_back( (*it)->getName() ); } if ( items.size() ) { @@ -311,22 +311,22 @@ void TextureAtlasEditor::FillSubTextureList() { } void TextureAtlasEditor::OnSubTextureChange( const UIEvent * Event ) { - if ( NULL != mTextureAtlasLoader && NULL != mTextureAtlasLoader->GetTextureAtlas() ) { - mCurSubTexture = mTextureAtlasLoader->GetTextureAtlas()->getByName( mSubTextureList->GetItemSelectedText() ); + if ( NULL != mTextureAtlasLoader && NULL != mTextureAtlasLoader->getTextureAtlas() ) { + mCurSubTexture = mTextureAtlasLoader->getTextureAtlas()->getByName( mSubTextureList->GetItemSelectedText() ); if ( NULL != mCurSubTexture ) { mSubTextureEditor->SubTexture( mCurSubTexture ); - mSpinOffX->Value( mCurSubTexture->Offset().x ); - mSpinOffY->Value( mCurSubTexture->Offset().y ); - mSpinDestW->Value( mCurSubTexture->DestSize().x ); - mSpinDestH->Value( mCurSubTexture->DestSize().y ); + mSpinOffX->Value( mCurSubTexture->offset().x ); + mSpinOffY->Value( mCurSubTexture->offset().y ); + mSpinDestW->Value( mCurSubTexture->destSize().x ); + mSpinDestH->Value( mCurSubTexture->destSize().y ); } } } void TextureAtlasEditor::Update() { - if ( NULL != mTextureAtlasLoader && !mTextureAtlasLoader->IsLoaded() ) { - mTextureAtlasLoader->Update(); + if ( NULL != mTextureAtlasLoader && !mTextureAtlasLoader->isLoaded() ) { + mTextureAtlasLoader->update(); } } @@ -343,14 +343,14 @@ void TextureAtlasEditor::OpenTextureAtlas( const UIEvent * Event ) { } void TextureAtlasEditor::OnTextureAtlasLoaded( TextureAtlasLoader * TGLoader ) { - if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->IsLoaded() ) { + if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->isLoaded() ) { UpdateControls(); } } void TextureAtlasEditor::SaveTextureAtlas( const UIEvent * Event ) { - if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->IsLoaded() ) { - mTextureAtlasLoader->UpdateTextureAtlas(); + if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->isLoaded() ) { + mTextureAtlasLoader->updateTextureAtlas(); } } diff --git a/src/eepp/ui/tools/textureatlasnew.cpp b/src/eepp/ui/tools/textureatlasnew.cpp index 20ed77f7b..31cfba54a 100644 --- a/src/eepp/ui/tools/textureatlasnew.cpp +++ b/src/eepp/ui/tools/textureatlasnew.cpp @@ -129,9 +129,9 @@ void TextureAtlasNew::TextureAtlasSave( const UIEvent * Event ) { if ( Res1 && Res2 ) { Graphics::TexturePacker * TexturePacker = eeNew( Graphics::TexturePacker, ( w, h, false, b ) ); - TexturePacker->AddTexturesPath( mTGPath->Text() ); + TexturePacker->addTexturesPath( mTGPath->Text() ); - TexturePacker->PackTextures(); + TexturePacker->packTextures(); std::string ext = FileSystem::fileExtension( FPath, true ); @@ -145,7 +145,7 @@ void TextureAtlasNew::TextureAtlasSave( const UIEvent * Event ) { FPath += "." + ext; } - TexturePacker->Save( FPath, static_cast ( mSaveFileType->ListBox()->GetItemSelectedIndex() ) ); + TexturePacker->save( FPath, static_cast ( mSaveFileType->ListBox()->GetItemSelectedIndex() ) ); if ( mNewTGCb.IsSet() ) mNewTGCb( TexturePacker ); diff --git a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp index bc3a1e677..55c5d0480 100644 --- a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp +++ b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp @@ -34,9 +34,9 @@ TextureAtlasSubTextureEditor::~TextureAtlasSubTextureEditor() { void TextureAtlasSubTextureEditor::Draw() { Primitives P; - P.SetColor( ColorA( 255, 0, 0, mAlpha ) ); - P.DrawLine( Line2f( Vector2f( mScreenPos.x, mScreenPos.y + mUICenter.y ), Vector2f( mScreenPos.x + mSize.width(), mScreenPos.y + mUICenter.y ) ) ); - P.DrawLine( Line2f( Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y ), Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y + mSize.height() ) ) ); + P.setColor( ColorA( 255, 0, 0, mAlpha ) ); + P.drawLine( Line2f( Vector2f( mScreenPos.x, mScreenPos.y + mUICenter.y ), Vector2f( mScreenPos.x + mSize.width(), mScreenPos.y + mUICenter.y ) ) ); + P.drawLine( Line2f( Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y ), Vector2f( mScreenPos.x + mUICenter.x, mScreenPos.y + mSize.height() ) ) ); UIComplexControl::Draw(); } @@ -49,10 +49,10 @@ void TextureAtlasSubTextureEditor::Update() { if ( NULL != mGfx->SubTexture() && mDrag->DragEnable() && mDrag->Dragging() && Pos != mDrag->Pos() ) { Vector2i Diff = -( Pos - mDrag->Pos() ); - mGfx->SubTexture()->Offset( Vector2i( mGfx->SubTexture()->Offset().x + Diff.x, mGfx->SubTexture()->Offset().y + Diff.y ) ); + mGfx->SubTexture()->offset( Vector2i( mGfx->SubTexture()->offset().x + Diff.x, mGfx->SubTexture()->offset().y + Diff.y ) ); - mEditor->SpinOffX()->Value( mGfx->SubTexture()->Offset().x ); - mEditor->SpinOffY()->Value( mGfx->SubTexture()->Offset().y ); + mEditor->SpinOffX()->Value( mGfx->SubTexture()->offset().x ); + mEditor->SpinOffY()->Value( mGfx->SubTexture()->offset().y ); } mGfx->Pos( mUICenter ); diff --git a/src/eepp/ui/uicheckbox.cpp b/src/eepp/ui/uicheckbox.cpp index b3cf738b3..bb6a5dc73 100644 --- a/src/eepp/ui/uicheckbox.cpp +++ b/src/eepp/ui/uicheckbox.cpp @@ -56,7 +56,7 @@ void UICheckBox::DoAfterSetTheme() { tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mActiveButton->Size( tSubTexture->RealSize() ); + mActiveButton->Size( tSubTexture->realSize() ); mActiveButton->CenterVertical(); } } @@ -67,7 +67,7 @@ void UICheckBox::DoAfterSetTheme() { tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mInactiveButton->Size( tSubTexture->RealSize() ); + mInactiveButton->Size( tSubTexture->realSize() ); mInactiveButton->CenterVertical(); } } @@ -82,7 +82,7 @@ void UICheckBox::AutoSize() { mActiveButton->CenterVertical(); mInactiveButton->CenterVertical(); - mSize.width( (int)mTextCache->GetTextWidth() + mActiveButton->Size().width() ); + mSize.width( (int)mTextCache->getTextWidth() + mActiveButton->Size().width() ); } } diff --git a/src/eepp/ui/uicombobox.cpp b/src/eepp/ui/uicombobox.cpp index 061397257..dc6ec14e7 100644 --- a/src/eepp/ui/uicombobox.cpp +++ b/src/eepp/ui/uicombobox.cpp @@ -47,7 +47,7 @@ void UIComboBox::CreateButton() { SubTexture * tSubTexture = tComplex->GetSubTextureSide( UISkinState::StateNormal, UISkinComplex::Right ); if ( NULL != tSubTexture ) - btnWidth = tSubTexture->RealSize().width(); + btnWidth = tSubTexture->realSize().width(); } } diff --git a/src/eepp/ui/uicontrol.cpp b/src/eepp/ui/uicontrol.cpp index 42852c1b3..1a2ca810c 100644 --- a/src/eepp/ui/uicontrol.cpp +++ b/src/eepp/ui/uicontrol.cpp @@ -256,18 +256,18 @@ void UIControl::Draw() { if ( UIManager::instance()->HighlightFocus() && UIManager::instance()->FocusControl() == this ) { Primitives P; - P.FillMode( DRAW_LINE ); - P.BlendMode( Blend() ); - P.SetColor( UIManager::instance()->HighlightFocusColor() ); - P.DrawRectangle( GetRectf() ); + P.fillMode( DRAW_LINE ); + P.blendMode( Blend() ); + P.setColor( UIManager::instance()->HighlightFocusColor() ); + P.drawRectangle( GetRectf() ); } if ( UIManager::instance()->HighlightOver() && UIManager::instance()->OverControl() == this ) { Primitives P; - P.FillMode( DRAW_LINE ); - P.BlendMode( Blend() ); - P.SetColor( UIManager::instance()->HighlightOverColor() ); - P.DrawRectangle( GetRectf() ); + P.fillMode( DRAW_LINE ); + P.blendMode( Blend() ); + P.setColor( UIManager::instance()->HighlightOverColor() ); + P.drawRectangle( GetRectf() ); } } } @@ -528,45 +528,45 @@ Rectf UIControl::GetRectf() { void UIControl::BackgroundDraw() { Primitives P; Rectf R = GetRectf(); - P.BlendMode( mBackground->Blend() ); - P.SetColor( mBackground->Color() ); + P.blendMode( mBackground->Blend() ); + P.setColor( mBackground->Color() ); if ( 4 == mBackground->Colors().size() ) { if ( mBackground->Corners() ) { - P.DrawRoundedRectangle( R, mBackground->Colors()[0], mBackground->Colors()[1], mBackground->Colors()[2], mBackground->Colors()[3], mBackground->Corners() ); + P.drawRoundedRectangle( R, mBackground->Colors()[0], mBackground->Colors()[1], mBackground->Colors()[2], mBackground->Colors()[3], mBackground->Corners() ); } else { - P.DrawRectangle( R, mBackground->Colors()[0], mBackground->Colors()[1], mBackground->Colors()[2], mBackground->Colors()[3] ); + P.drawRectangle( R, mBackground->Colors()[0], mBackground->Colors()[1], mBackground->Colors()[2], mBackground->Colors()[3] ); } } else { if ( mBackground->Corners() ) { - P.DrawRoundedRectangle( R, 0.f, Vector2f::One, mBackground->Corners() ); + P.drawRoundedRectangle( R, 0.f, Vector2f::One, mBackground->Corners() ); } else { - P.DrawRectangle( R ); + P.drawRectangle( R ); } } } void UIControl::BorderDraw() { Primitives P; - P.FillMode( DRAW_LINE ); - P.BlendMode( Blend() ); - P.LineWidth( (Float)mBorder->Width() ); - P.SetColor( mBorder->Color() ); + P.fillMode( DRAW_LINE ); + P.blendMode( Blend() ); + P.lineWidth( (Float)mBorder->Width() ); + P.setColor( mBorder->Color() ); //! @TODO: Check why was this +0.1f -0.1f? if ( mFlags & UI_CLIP_ENABLE ) { Rectf R( Vector2f( mScreenPosf.x + 0.1f, mScreenPosf.y + 0.1f ), Sizef( (Float)mSize.width() - 0.1f, (Float)mSize.height() - 0.1f ) ); if ( mBackground->Corners() ) { - P.DrawRoundedRectangle( GetRectf(), 0.f, Vector2f::One, mBackground->Corners() ); + P.drawRoundedRectangle( GetRectf(), 0.f, Vector2f::One, mBackground->Corners() ); } else { - P.DrawRectangle( R ); + P.drawRectangle( R ); } } else { if ( mBackground->Corners() ) { - P.DrawRoundedRectangle( GetRectf(), 0.f, Vector2f::One, mBackground->Corners() ); + P.drawRoundedRectangle( GetRectf(), 0.f, Vector2f::One, mBackground->Corners() ); } else { - P.DrawRectangle( GetRectf() ); + P.drawRectangle( GetRectf() ); } } } @@ -1085,28 +1085,28 @@ Recti UIControl::MakePadding( bool PadLeft, bool PadRight, bool PadTop, bool Pad tSubTexture = tComplex->GetSubTextureSide( UISkinState::StateNormal, UISkinComplex::Left ); if ( NULL != tSubTexture ) - tPadding.Left = tSubTexture->RealSize().width(); + tPadding.Left = tSubTexture->realSize().width(); } if ( PadRight ) { tSubTexture = tComplex->GetSubTextureSide( UISkinState::StateNormal, UISkinComplex::Right ); if ( NULL != tSubTexture ) - tPadding.Right = tSubTexture->RealSize().width(); + tPadding.Right = tSubTexture->realSize().width(); } if ( PadTop ) { tSubTexture = tComplex->GetSubTextureSide( UISkinState::StateNormal, UISkinComplex::Up ); if ( NULL != tSubTexture ) - tPadding.Top = tSubTexture->RealSize().height(); + tPadding.Top = tSubTexture->realSize().height(); } if ( PadBottom ) { tSubTexture = tComplex->GetSubTextureSide( UISkinState::StateNormal, UISkinComplex::Down ); if ( NULL != tSubTexture ) - tPadding.Bottom = tSubTexture->RealSize().height(); + tPadding.Bottom = tSubTexture->realSize().height(); } } } @@ -1141,7 +1141,7 @@ Sizei UIControl::GetSkinSize( UISkin * Skin, const Uint32& State ) { SubTexture * tSubTexture = Skin->GetSubTexture( State ); if ( NULL != tSubTexture ) { - tSize = tSubTexture->RealSize(); + tSize = tSubTexture->realSize(); } if ( Skin->GetType() == UISkin::SkinComplex ) { @@ -1150,25 +1150,25 @@ Sizei UIControl::GetSkinSize( UISkin * Skin, const Uint32& State ) { tSubTexture = SkinC->GetSubTextureSide( State, UISkinComplex::Up ); if ( NULL != tSubTexture ) { - tSize.y += tSubTexture->RealSize().height(); + tSize.y += tSubTexture->realSize().height(); } tSubTexture = SkinC->GetSubTextureSide( State, UISkinComplex::Down ); if ( NULL != tSubTexture ) { - tSize.y += tSubTexture->RealSize().height(); + tSize.y += tSubTexture->realSize().height(); } tSubTexture = SkinC->GetSubTextureSide( State, UISkinComplex::Left ); if ( NULL != tSubTexture ) { - tSize.x += tSubTexture->RealSize().width(); + tSize.x += tSubTexture->realSize().width(); } tSubTexture = SkinC->GetSubTextureSide( State, UISkinComplex::Right ); if ( NULL != tSubTexture ) { - tSize.x += tSubTexture->RealSize().width(); + tSize.x += tSubTexture->realSize().width(); } } } diff --git a/src/eepp/ui/uicontrolanim.cpp b/src/eepp/ui/uicontrolanim.cpp index 561441a23..cdd9b3f60 100644 --- a/src/eepp/ui/uicontrolanim.cpp +++ b/src/eepp/ui/uicontrolanim.cpp @@ -49,18 +49,18 @@ void UIControlAnim::Draw() { if ( UIManager::instance()->HighlightFocus() && UIManager::instance()->FocusControl() == this ) { Primitives P; - P.FillMode( DRAW_LINE ); - P.BlendMode( Blend() ); - P.SetColor( UIManager::instance()->HighlightFocusColor() ); - P.DrawRectangle( GetRectf() ); + P.fillMode( DRAW_LINE ); + P.blendMode( Blend() ); + P.setColor( UIManager::instance()->HighlightFocusColor() ); + P.drawRectangle( GetRectf() ); } if ( UIManager::instance()->HighlightOver() && UIManager::instance()->OverControl() == this ) { Primitives P; - P.FillMode( DRAW_LINE ); - P.BlendMode( Blend() ); - P.SetColor( UIManager::instance()->HighlightOverColor() ); - P.DrawRectangle( GetRectf() ); + P.fillMode( DRAW_LINE ); + P.blendMode( Blend() ); + P.setColor( UIManager::instance()->HighlightOverColor() ); + P.drawRectangle( GetRectf() ); } } } @@ -160,27 +160,27 @@ void UIControlAnim::AlphaChilds( const Float &alpha ) { void UIControlAnim::MatrixSet() { if ( mScale != 1.f || mAngle != 0.f ) { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); - GLi->PushMatrix(); + GLi->pushMatrix(); Vector2f scaleCenter = ScaleCenter(); - GLi->Translatef( scaleCenter.x , scaleCenter.y, 0.f ); - GLi->Scalef( mScale.x, mScale.y, 1.0f ); - GLi->Translatef( -scaleCenter.x, -scaleCenter.y, 0.f ); + GLi->translatef( scaleCenter.x , scaleCenter.y, 0.f ); + GLi->scalef( mScale.x, mScale.y, 1.0f ); + GLi->translatef( -scaleCenter.x, -scaleCenter.y, 0.f ); Vector2f rotationCenter = RotationCenter(); - GLi->Translatef( rotationCenter.x , rotationCenter.y, 0.f ); - GLi->Rotatef( mAngle, 0.0f, 0.0f, 1.0f ); - GLi->Translatef( -rotationCenter.x, -rotationCenter.y, 0.f ); + GLi->translatef( rotationCenter.x , rotationCenter.y, 0.f ); + GLi->rotatef( mAngle, 0.0f, 0.0f, 1.0f ); + GLi->translatef( -rotationCenter.x, -rotationCenter.y, 0.f ); } } void UIControlAnim::MatrixUnset() { if ( mScale != 1.f || mAngle != 0.f ) { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); - GLi->PopMatrix(); + GLi->popMatrix(); } } @@ -348,45 +348,45 @@ Interpolation * UIControlAnim::DisableFadeOut( const Time& Time, const bool& Alp void UIControlAnim::BackgroundDraw() { Primitives P; Rectf R = GetRectf(); - P.BlendMode( mBackground->Blend() ); - P.SetColor( GetColor( mBackground->Color() ) ); + P.blendMode( mBackground->Blend() ); + P.setColor( GetColor( mBackground->Color() ) ); if ( 4 == mBackground->Colors().size() ) { if ( mBackground->Corners() ) { - P.DrawRoundedRectangle( R, GetColor( mBackground->Colors()[0] ), GetColor( mBackground->Colors()[1] ), GetColor( mBackground->Colors()[2] ), GetColor( mBackground->Colors()[3] ), mBackground->Corners() ); + P.drawRoundedRectangle( R, GetColor( mBackground->Colors()[0] ), GetColor( mBackground->Colors()[1] ), GetColor( mBackground->Colors()[2] ), GetColor( mBackground->Colors()[3] ), mBackground->Corners() ); } else { - P.DrawRectangle( R, GetColor( mBackground->Colors()[0] ), GetColor( mBackground->Colors()[1] ), GetColor( mBackground->Colors()[2] ), GetColor( mBackground->Colors()[3] ) ); + P.drawRectangle( R, GetColor( mBackground->Colors()[0] ), GetColor( mBackground->Colors()[1] ), GetColor( mBackground->Colors()[2] ), GetColor( mBackground->Colors()[3] ) ); } } else { if ( mBackground->Corners() ) { - P.DrawRoundedRectangle( R, 0.f, Vector2f::One, mBackground->Corners() ); + P.drawRoundedRectangle( R, 0.f, Vector2f::One, mBackground->Corners() ); } else { - P.DrawRectangle( R ); + P.drawRectangle( R ); } } } void UIControlAnim::BorderDraw() { Primitives P; - P.FillMode( DRAW_LINE ); - P.BlendMode( Blend() ); - P.LineWidth( (Float)mBorder->Width() ); - P.SetColor( GetColor( mBorder->Color() ) ); + P.fillMode( DRAW_LINE ); + P.blendMode( Blend() ); + P.lineWidth( (Float)mBorder->Width() ); + P.setColor( GetColor( mBorder->Color() ) ); //! @TODO: Check why was this +0.1f -0.1f? if ( mFlags & UI_CLIP_ENABLE ) { Rectf R( Vector2f( mScreenPosf.x + 0.1f, mScreenPosf.y + 0.1f ), Sizef( (Float)mSize.width() - 0.1f, (Float)mSize.height() - 0.1f ) ); if ( mBackground->Corners() ) { - P.DrawRoundedRectangle( GetRectf(), 0.f, Vector2f::One, mBackground->Corners() ); + P.drawRoundedRectangle( GetRectf(), 0.f, Vector2f::One, mBackground->Corners() ); } else { - P.DrawRectangle( R ); + P.drawRectangle( R ); } } else { if ( mBackground->Corners() ) { - P.DrawRoundedRectangle( GetRectf(), 0.f, Vector2f::One, mBackground->Corners() ); + P.drawRoundedRectangle( GetRectf(), 0.f, Vector2f::One, mBackground->Corners() ); } else { - P.DrawRectangle( GetRectf() ); + P.drawRectangle( GetRectf() ); } } } diff --git a/src/eepp/ui/uigfx.cpp b/src/eepp/ui/uigfx.cpp index a4fd0a1b3..aae62474c 100644 --- a/src/eepp/ui/uigfx.cpp +++ b/src/eepp/ui/uigfx.cpp @@ -11,7 +11,7 @@ UIGfx::UIGfx( const UIGfx::CreateParams& Params ) : mAlignOffset(0,0) { if ( NULL != mSubTexture && ( ( Flags() & UI_AUTO_SIZE ) || ( Params.Size.x == -1 && Params.Size.y == -1 ) ) ) - Size( mSubTexture->Size() ); + Size( mSubTexture->size() ); mColor.Alpha = (Uint8)mAlpha; @@ -39,7 +39,7 @@ void UIGfx::SubTexture( Graphics::SubTexture * subTexture ) { void UIGfx::AutoSize() { if ( mFlags & UI_AUTO_SIZE ) { if ( NULL != mSubTexture ) { - Size( mSubTexture->Size() ); + Size( mSubTexture->size() ); } else { Size( Sizei( 0, 0 ) ); } @@ -51,19 +51,19 @@ void UIGfx::Draw() { if ( mVisible ) { if ( NULL != mSubTexture && 0.f != mAlpha ) { - Sizef oDestSize = mSubTexture->DestSize(); - Vector2i oOff = mSubTexture->Offset(); + Sizef oDestSize = mSubTexture->destSize(); + Vector2i oOff = mSubTexture->offset(); if ( mFlags & UI_FIT_TO_CONTROL ) { - mSubTexture->Offset( Vector2i( 0, 0 ) ); - mSubTexture->DestSize( Vector2f( mSize.x, mSize.y ) ); + mSubTexture->offset( Vector2i( 0, 0 ) ); + mSubTexture->destSize( Vector2f( mSize.x, mSize.y ) ); DrawSubTexture(); - mSubTexture->DestSize( oDestSize ); - mSubTexture->Offset( oOff ); + mSubTexture->destSize( oDestSize ); + mSubTexture->offset( oOff ); } else if ( mFlags & UI_AUTO_FIT ) { - mSubTexture->Offset( Vector2i( 0, 0 ) ); + mSubTexture->offset( Vector2i( 0, 0 ) ); Float Scale1 = mSize.x / oDestSize.x; Float Scale2 = mSize.y / oDestSize.y; @@ -72,20 +72,20 @@ void UIGfx::Draw() { if ( Scale2 < Scale1 ) Scale1 = Scale2; - mSubTexture->DestSize( Sizef( oDestSize.x * Scale1, oDestSize.y * Scale1 ) ); + mSubTexture->destSize( Sizef( oDestSize.x * Scale1, oDestSize.y * Scale1 ) ); AutoAlign(); DrawSubTexture(); - mSubTexture->DestSize( oDestSize ); + mSubTexture->destSize( oDestSize ); AutoAlign(); } else { DrawSubTexture(); } - mSubTexture->Offset( oOff ); + mSubTexture->offset( oOff ); } else { AutoAlign(); @@ -96,7 +96,7 @@ void UIGfx::Draw() { } void UIGfx::DrawSubTexture() { - mSubTexture->Draw( (Float)mScreenPos.x + mAlignOffset.x, (Float)mScreenPos.y + mAlignOffset.y, mColor, 0.f, Vector2f::One, Blend(), mRender ); + mSubTexture->draw( (Float)mScreenPos.x + mAlignOffset.x, (Float)mScreenPos.y + mAlignOffset.y, mColor, 0.f, Vector2f::One, Blend(), mRender ); } void UIGfx::Alpha( const Float& alpha ) { @@ -130,17 +130,17 @@ void UIGfx::AutoAlign() { return; if ( HAlignGet( mFlags ) == UI_HALIGN_CENTER ) { - mAlignOffset.x = mSize.width() / 2 - mSubTexture->DestSize().x / 2; + mAlignOffset.x = mSize.width() / 2 - mSubTexture->destSize().x / 2; } else if ( FontHAlignGet( mFlags ) == UI_HALIGN_RIGHT ) { - mAlignOffset.x = mSize.width() - mSubTexture->DestSize().x; + mAlignOffset.x = mSize.width() - mSubTexture->destSize().x; } else { mAlignOffset.x = 0; } if ( VAlignGet( mFlags ) == UI_VALIGN_CENTER ) { - mAlignOffset.y = mSize.height() / 2 - mSubTexture->DestSize().y / 2; + mAlignOffset.y = mSize.height() / 2 - mSubTexture->destSize().y / 2; } else if ( FontVAlignGet( mFlags ) == UI_VALIGN_BOTTOM ) { - mAlignOffset.y = mSize.height() - mSubTexture->DestSize().y; + mAlignOffset.y = mSize.height() - mSubTexture->destSize().y; } else { mAlignOffset.y = 0; } diff --git a/src/eepp/ui/uilistbox.cpp b/src/eepp/ui/uilistbox.cpp index e281e2e39..36178de30 100644 --- a/src/eepp/ui/uilistbox.cpp +++ b/src/eepp/ui/uilistbox.cpp @@ -152,7 +152,7 @@ Uint32 UIListBox::AddListBoxItem( const String& Text ) { mItems.push_back( NULL ); if ( NULL != mFont ) { - Uint32 twidth = mFont->GetTextWidth( Text ); + Uint32 twidth = mFont->getTextWidth( Text ); if ( twidth > mMaxTextWidth ) { mMaxTextWidth = twidth; @@ -305,13 +305,13 @@ void UIListBox::SetRowHeight() { Uint32 FontSize = 12; if ( NULL != UIThemeManager::instance()->DefaultFont() ) - FontSize = UIThemeManager::instance()->DefaultFont()->GetFontHeight(); + FontSize = UIThemeManager::instance()->DefaultFont()->getFontHeight(); if ( NULL != mSkinState && NULL != mSkinState->GetSkin() && NULL != mSkinState->GetSkin()->Theme() && NULL != mSkinState->GetSkin()->Theme()->Font() ) - FontSize = mSkinState->GetSkin()->Theme()->Font()->GetFontHeight(); + FontSize = mSkinState->GetSkin()->Theme()->Font()->getFontHeight(); if ( NULL != mFont ) - FontSize = mFont->GetFontHeight(); + FontSize = mFont->getFontHeight(); mRowHeight = (Uint32)( FontSize + 4 ); } @@ -332,7 +332,7 @@ void UIListBox::FindMaxWidth() { if ( NULL != mItems[i] ) width = (Int32)mItems[i]->GetTextWidth(); else - width = mFont->GetTextWidth( mTexts[i] ); + width = mFont->getTextWidth( mTexts[i] ); if ( width > (Int32)mMaxTextWidth ) mMaxTextWidth = (Uint32)width; diff --git a/src/eepp/ui/uimanager.cpp b/src/eepp/ui/uimanager.cpp index 441d09234..c05dfb714 100644 --- a/src/eepp/ui/uimanager.cpp +++ b/src/eepp/ui/uimanager.cpp @@ -256,9 +256,9 @@ UIControl * UIManager::DownControl() const { } void UIManager::Draw() { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); mControl->InternalDraw(); - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); } UIWindow * UIManager::MainControl() const { diff --git a/src/eepp/ui/uimenu.cpp b/src/eepp/ui/uimenu.cpp index f4fb7dcf6..b0d61c8d0 100644 --- a/src/eepp/ui/uimenu.cpp +++ b/src/eepp/ui/uimenu.cpp @@ -357,7 +357,7 @@ Uint32 UIMenu::OnMessage( const UIMessage * Msg ) { void UIMenu::OnSizeChange() { if ( NULL != mFont && ( ( mFlags & UI_AUTO_SIZE ) || 0 == mRowHeight ) ) { - mRowHeight = mFont->GetFontHeight() + 8; + mRowHeight = mFont->getFontHeight() + 8; } if ( 0 != mMinWidth && mSize.width() < (Int32)mMinWidth ) { diff --git a/src/eepp/ui/uiprogressbar.cpp b/src/eepp/ui/uiprogressbar.cpp index fe73bc94a..eb459e29c 100644 --- a/src/eepp/ui/uiprogressbar.cpp +++ b/src/eepp/ui/uiprogressbar.cpp @@ -42,12 +42,12 @@ void UIProgressBar::Draw() { UIControlAnim::Draw(); if ( NULL != mParallax && 0.f != mAlpha ) { - ColorA C( mParallax->Color() ); + ColorA C( mParallax->color() ); C.Alpha = (Uint8)mAlpha; - mParallax->Color( C ); - mParallax->Position( Vector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ) ); - mParallax->Draw(); + mParallax->color( C ); + mParallax->position( Vector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ) ); + mParallax->draw(); } } @@ -69,7 +69,7 @@ void UIProgressBar::SetTheme( UITheme * Theme ) { Float Height = (Float)GetSkinSize().height(); if ( !mVerticalExpand ) - Height = (Float)tSubTexture->RealSize().height(); + Height = (Float)tSubTexture->realSize().height(); if ( Height > mSize.height() ) Height = mSize.height(); @@ -91,13 +91,13 @@ void UIProgressBar::OnSizeChange() { if ( NULL != mParallax ) { Float Height = (Float)mSize.height(); - if ( !mVerticalExpand && mParallax->SubTexture() ) - Height = (Float)mParallax->SubTexture()->RealSize().height(); + if ( !mVerticalExpand && mParallax->subTexture() ) + Height = (Float)mParallax->subTexture()->realSize().height(); if ( Height > mSize.height() ) Height = mSize.height(); - mParallax->Size( Sizef( ( ( mSize.width() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ) ); + mParallax->size( Sizef( ( ( mSize.width() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ) ); } UpdateTextBox(); @@ -129,7 +129,7 @@ void UIProgressBar::MovementSpeed( const Vector2f& Speed ) { mSpeed = Speed; if ( NULL != mParallax ) - mParallax->Speed( mSpeed ); + mParallax->speed( mSpeed ); } const Vector2f& UIProgressBar::MovementSpeed() const { diff --git a/src/eepp/ui/uiradiobutton.cpp b/src/eepp/ui/uiradiobutton.cpp index c4eed22d7..48818585a 100644 --- a/src/eepp/ui/uiradiobutton.cpp +++ b/src/eepp/ui/uiradiobutton.cpp @@ -56,7 +56,7 @@ void UIRadioButton::SetTheme( UITheme * Theme ) { tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mActiveButton->Size( tSubTexture->RealSize() ); + mActiveButton->Size( tSubTexture->realSize() ); mActiveButton->CenterVertical(); } } @@ -67,7 +67,7 @@ void UIRadioButton::SetTheme( UITheme * Theme ) { tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mInactiveButton->Size( tSubTexture->RealSize() ); + mInactiveButton->Size( tSubTexture->realSize() ); mInactiveButton->CenterVertical(); } } @@ -82,7 +82,7 @@ void UIRadioButton::AutoSize() { mActiveButton->CenterVertical(); mInactiveButton->CenterVertical(); - mSize.width( (int)mTextCache->GetTextWidth() + mActiveButton->Size().width() ); + mSize.width( (int)mTextCache->getTextWidth() + mActiveButton->Size().width() ); } } diff --git a/src/eepp/ui/uiscrollbar.cpp b/src/eepp/ui/uiscrollbar.cpp index 02f24f3ae..409140778 100644 --- a/src/eepp/ui/uiscrollbar.cpp +++ b/src/eepp/ui/uiscrollbar.cpp @@ -79,7 +79,7 @@ void UIScrollBar::SetTheme( UITheme * Theme ) { tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mBtnUp->Size( tSubTexture->RealSize() ); + mBtnUp->Size( tSubTexture->realSize() ); } } @@ -89,7 +89,7 @@ void UIScrollBar::SetTheme( UITheme * Theme ) { tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mBtnDown->Size( tSubTexture->RealSize() ); + mBtnDown->Size( tSubTexture->realSize() ); } } @@ -101,12 +101,12 @@ void UIScrollBar::SetTheme( UITheme * Theme ) { if ( NULL != tSubTexture ) { if ( mSlider->IsVertical() ) { - mSlider->Size( tSubTexture->RealSize().width() , mSize.height() ); - Size( tSubTexture->RealSize().width() , mSize.height() ); + mSlider->Size( tSubTexture->realSize().width() , mSize.height() ); + Size( tSubTexture->realSize().width() , mSize.height() ); mMinControlSize.x = mSize.width(); } else { - mSlider->Size( mSize.width(), tSubTexture->RealSize().height() ); - Size( mSize.width(), tSubTexture->RealSize().height() ); + mSlider->Size( mSize.width(), tSubTexture->realSize().height() ); + Size( mSize.width(), tSubTexture->realSize().height() ); mMinControlSize.y = mSize.height(); } } diff --git a/src/eepp/ui/uiseparator.cpp b/src/eepp/ui/uiseparator.cpp index f5042edb4..5cb3100b7 100644 --- a/src/eepp/ui/uiseparator.cpp +++ b/src/eepp/ui/uiseparator.cpp @@ -24,7 +24,7 @@ void UISeparator::SetTheme( UITheme * Theme ) { UIControl::SetThemeControl( Theme, "separator" ); if ( NULL != mSkinState && NULL != mSkinState->GetSkin() && NULL != mSkinState->GetSkin()->GetSubTexture( UISkinState::StateNormal ) ) { - Size( mSize.width(), mSkinState->GetSkin()->GetSubTexture( UISkinState::StateNormal )->RealSize().height() ); + Size( mSize.width(), mSkinState->GetSkin()->GetSubTexture( UISkinState::StateNormal )->realSize().height() ); } } diff --git a/src/eepp/ui/uiskin.cpp b/src/eepp/ui/uiskin.cpp index 48b18bdf1..e1a67f86c 100644 --- a/src/eepp/ui/uiskin.cpp +++ b/src/eepp/ui/uiskin.cpp @@ -48,16 +48,16 @@ const ColorA& UISkin::GetColor( const Uint32& State ) const { return mColor[ State ]; } -const std::string& UISkin::Name() const { +const std::string& UISkin::getName() const { return mName; } -void UISkin::Name( const std::string& name ) { +void UISkin::setName( const std::string& name ) { mName = name; mNameHash = String::hash( mName ); } -const Uint32& UISkin::Id() const { +const Uint32& UISkin::getId() const { return mNameHash; } diff --git a/src/eepp/ui/uiskincomplex.cpp b/src/eepp/ui/uiskincomplex.cpp index 331812ea3..707d7bfc0 100644 --- a/src/eepp/ui/uiskincomplex.cpp +++ b/src/eepp/ui/uiskincomplex.cpp @@ -41,9 +41,9 @@ void UISkinComplex::Draw( const Float& X, const Float& Y, const Float& Width, co Sizei uls; if ( NULL != tSubTexture ) { - uls = tSubTexture->RealSize(); + uls = tSubTexture->realSize(); - tSubTexture->Draw( X, Y, mTempColor ); + tSubTexture->draw( X, Y, mTempColor ); } tSubTexture = mSubTexture[ State ][ DownLeft ]; @@ -51,9 +51,9 @@ void UISkinComplex::Draw( const Float& X, const Float& Y, const Float& Width, co Sizei dls; if ( NULL != tSubTexture ) { - dls = tSubTexture->RealSize(); + dls = tSubTexture->realSize(); - tSubTexture->Draw( X, Y + Height - dls.height(), mTempColor ); + tSubTexture->draw( X, Y + Height - dls.height(), mTempColor ); } tSubTexture = mSubTexture[ State ][ UpRight ]; @@ -61,9 +61,9 @@ void UISkinComplex::Draw( const Float& X, const Float& Y, const Float& Width, co Sizei urs; if ( NULL != tSubTexture ) { - urs = tSubTexture->RealSize(); + urs = tSubTexture->realSize(); - tSubTexture->Draw( X + Width - urs.width(), Y, mTempColor ); + tSubTexture->draw( X + Width - urs.width(), Y, mTempColor ); } tSubTexture = mSubTexture[ State ][ DownRight ]; @@ -71,74 +71,74 @@ void UISkinComplex::Draw( const Float& X, const Float& Y, const Float& Width, co Sizei drs; if ( NULL != tSubTexture ) { - drs = tSubTexture->RealSize(); + drs = tSubTexture->realSize(); - tSubTexture->Draw( X + Width - drs.width(), Y + Height - drs.height(), mTempColor ); + tSubTexture->draw( X + Width - drs.width(), Y + Height - drs.height(), mTempColor ); } tSubTexture = mSubTexture[ State ][ Left ]; if ( NULL != tSubTexture ) { - tSubTexture->DestSize( Sizef( tSubTexture->DestSize().x, Height - uls.height() - dls.height() ) ); + tSubTexture->destSize( Sizef( tSubTexture->destSize().x, Height - uls.height() - dls.height() ) ); - tSubTexture->Draw( X, Y + uls.height(), mTempColor ); + tSubTexture->draw( X, Y + uls.height(), mTempColor ); - tSubTexture->ResetDestSize(); + tSubTexture->resetDestSize(); if ( uls.width() == 0 ) - uls.x = tSubTexture->RealSize().width(); + uls.x = tSubTexture->realSize().width(); } tSubTexture = mSubTexture[ State ][ Up ]; if ( NULL != tSubTexture ) { - tSubTexture->DestSize( Sizef( Width - uls.width() - urs.width(), tSubTexture->DestSize().y ) ); + tSubTexture->destSize( Sizef( Width - uls.width() - urs.width(), tSubTexture->destSize().y ) ); - tSubTexture->Draw( X + uls.width(), Y, mTempColor ); + tSubTexture->draw( X + uls.width(), Y, mTempColor ); - tSubTexture->ResetDestSize(); + tSubTexture->resetDestSize(); if ( urs.height() == 0 ) - urs.y = tSubTexture->RealSize().height(); + urs.y = tSubTexture->realSize().height(); if ( uls.height() == 0 ) - uls.y = tSubTexture->RealSize().height(); + uls.y = tSubTexture->realSize().height(); } tSubTexture = mSubTexture[ State ][ Right ]; if ( NULL != tSubTexture ) { if ( urs.width() == 0 ) - urs.x = tSubTexture->RealSize().width(); + urs.x = tSubTexture->realSize().width(); - tSubTexture->DestSize( Sizef( tSubTexture->DestSize().x, Height - urs.height() - drs.height() ) ); + tSubTexture->destSize( Sizef( tSubTexture->destSize().x, Height - urs.height() - drs.height() ) ); - tSubTexture->Draw( X + Width - tSubTexture->RealSize().width(), Y + urs.height(), mTempColor ); + tSubTexture->draw( X + Width - tSubTexture->realSize().width(), Y + urs.height(), mTempColor ); - tSubTexture->ResetDestSize(); + tSubTexture->resetDestSize(); } tSubTexture = mSubTexture[ State ][ Down ]; if ( NULL != tSubTexture ) { - tSubTexture->DestSize( Sizef( Width - dls.width() - drs.width(), tSubTexture->DestSize().y ) ); + tSubTexture->destSize( Sizef( Width - dls.width() - drs.width(), tSubTexture->destSize().y ) ); - tSubTexture->Draw( X + dls.width(), Y + Height - tSubTexture->RealSize().height(), mTempColor ); + tSubTexture->draw( X + dls.width(), Y + Height - tSubTexture->realSize().height(), mTempColor ); - tSubTexture->ResetDestSize(); + tSubTexture->resetDestSize(); if ( dls.height() == 0 && drs.height() == 0 ) - dls.height( tSubTexture->RealSize().height() ); + dls.height( tSubTexture->realSize().height() ); } tSubTexture = mSubTexture[ State ][ Center ]; if ( NULL != tSubTexture ) { - tSubTexture->DestSize( Sizef( Width - uls.width() - urs.width(), Height - uls.height() - dls.height() ) ); + tSubTexture->destSize( Sizef( Width - uls.width() - urs.width(), Height - uls.height() - dls.height() ) ); - tSubTexture->Draw( X + uls.width(), Y + uls.height(), mTempColor ); + tSubTexture->draw( X + uls.width(), Y + uls.height(), mTempColor ); - tSubTexture->ResetDestSize(); + tSubTexture->resetDestSize(); } } @@ -147,7 +147,7 @@ void UISkinComplex::SetSkin( const Uint32& State ) { for ( Uint32 Side = 0; Side < SideCount; Side++ ) { - SubTexture * SubTexture = TextureAtlasManager::instance()->GetSubTextureByName( std::string( mName + "_" + UISkin::GetSkinStateName( State ) + "_" + SideSuffix[ Side ] ) ); + SubTexture * SubTexture = TextureAtlasManager::instance()->getSubTextureByName( std::string( mName + "_" + UISkin::GetSkinStateName( State ) + "_" + SideSuffix[ Side ] ) ); if ( NULL != SubTexture ) mSubTexture[ State ][ Side ] = SubTexture; diff --git a/src/eepp/ui/uiskinsimple.cpp b/src/eepp/ui/uiskinsimple.cpp index f255614e7..56cbbed2f 100644 --- a/src/eepp/ui/uiskinsimple.cpp +++ b/src/eepp/ui/uiskinsimple.cpp @@ -23,15 +23,15 @@ void UISkinSimple::Draw( const Float& X, const Float& Y, const Float& Width, con mTempColor = mColor[ State ]; if ( NULL != tSubTexture ) { - tSubTexture->DestSize( Sizef( Width, Height ) ); + tSubTexture->destSize( Sizef( Width, Height ) ); if ( mTempColor.Alpha != Alpha ) { mTempColor.Alpha = (Uint8)( (Float)mTempColor.Alpha * ( (Float)Alpha / 255.f ) ); } - tSubTexture->Draw( X, Y, mTempColor ); + tSubTexture->draw( X, Y, mTempColor ); - tSubTexture->ResetDestSize(); + tSubTexture->resetDestSize(); } } @@ -40,7 +40,7 @@ void UISkinSimple::SetSkin( const Uint32& State ) { std::string Name( mName + "_" + UISkin::GetSkinStateName( State ) ); - mSubTexture[ State ] = TextureAtlasManager::instance()->GetSubTextureByName( Name ); + mSubTexture[ State ] = TextureAtlasManager::instance()->getSubTextureByName( Name ); } SubTexture * UISkinSimple::GetSubTexture( const Uint32& State ) const { diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index eb2c62c41..f0f40945f 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -92,7 +92,7 @@ void UISlider::AdjustChilds() { tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mSlider->Size( tSubTexture->RealSize() ); + mSlider->Size( tSubTexture->realSize() ); if ( !mVertical ) mSlider->CenterVertical(); @@ -113,7 +113,7 @@ void UISlider::AdjustChilds() { if ( mExpandBackground ) Height = mSize.height(); else - Height = tSubTexture->RealSize().height(); + Height = tSubTexture->realSize().height(); if ( mAllowHalfSliderOut ) mBackSlider->Size( Sizei( mSize.width() - mSlider->Size().width(), Height ) ); @@ -125,7 +125,7 @@ void UISlider::AdjustChilds() { if ( mExpandBackground ) Width = mSize.width(); else - Width = tSubTexture->RealSize().width(); + Width = tSubTexture->realSize().width(); if ( mAllowHalfSliderOut ) mBackSlider->Size( Sizei( Width, mSize.height() - mSlider->Size().height() ) ); diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index 7c9f795b6..05d5753b3 100644 --- a/src/eepp/ui/uispinbox.cpp +++ b/src/eepp/ui/uispinbox.cpp @@ -77,7 +77,7 @@ void UISpinBox::SetTheme( UITheme * Theme ) { tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mPushUp->Size( tSubTexture->RealSize() ); + mPushUp->Size( tSubTexture->realSize() ); } } @@ -87,7 +87,7 @@ void UISpinBox::SetTheme( UITheme * Theme ) { tSubTexture = tSkin->GetSubTexture( UISkinState::StateNormal ); if ( NULL != tSubTexture ) { - mPushDown->Size( tSubTexture->RealSize() ); + mPushDown->Size( tSubTexture->realSize() ); } } diff --git a/src/eepp/ui/uisprite.cpp b/src/eepp/ui/uisprite.cpp index 32e14944b..dc911392e 100644 --- a/src/eepp/ui/uisprite.cpp +++ b/src/eepp/ui/uisprite.cpp @@ -14,8 +14,8 @@ UISprite::UISprite( const UISprite::CreateParams& Params ) : mControlFlags |= UI_CTRL_FLAG_FREE_USE; if ( ( Flags() & UI_AUTO_SIZE ) || ( Params.Size.x == -1 && Params.Size.y == -1 ) ) { - if ( NULL != mSprite && NULL != mSprite->GetCurrentSubTexture() ) { - Size( mSprite->GetCurrentSubTexture()->Size() ); + if ( NULL != mSprite && NULL != mSprite->getCurrentSubTexture() ) { + Size( mSprite->getCurrentSubTexture()->size() ); } } } @@ -52,17 +52,17 @@ void UISprite::Draw() { if ( mVisible ) { if ( NULL != mSprite && 0.f != mAlpha ) { CheckSubTextureUpdate(); - mSprite->Position( (Float)( mScreenPos.x + mAlignOffset.x ), (Float)( mScreenPos.y + mAlignOffset.y ) ); - mSprite->Draw( Blend(), mRender ); + mSprite->position( (Float)( mScreenPos.x + mAlignOffset.x ), (Float)( mScreenPos.y + mAlignOffset.y ) ); + mSprite->draw( Blend(), mRender ); } } } void UISprite::CheckSubTextureUpdate() { - if ( NULL != mSprite && NULL != mSprite->GetCurrentSubTexture() && mSprite->GetCurrentSubTexture() != mSubTextureLast ) { + if ( NULL != mSprite && NULL != mSprite->getCurrentSubTexture() && mSprite->getCurrentSubTexture() != mSubTextureLast ) { UpdateSize(); AutoAlign(); - mSubTextureLast = mSprite->GetCurrentSubTexture(); + mSubTextureLast = mSprite->getCurrentSubTexture(); } } @@ -70,7 +70,7 @@ void UISprite::Alpha( const Float& alpha ) { UIControlAnim::Alpha( alpha ); if ( NULL != mSprite ) - mSprite->Alpha( alpha ); + mSprite->alpha( alpha ); } Graphics::Sprite * UISprite::Sprite() const { @@ -79,14 +79,14 @@ Graphics::Sprite * UISprite::Sprite() const { ColorA UISprite::Color() const { if ( NULL != mSprite ) - return mSprite->Color(); + return mSprite->color(); return ColorA(); } void UISprite::Color( const ColorA& color ) { if ( NULL != mSprite ) - mSprite->Color( color ); + mSprite->color( color ); Alpha( color.a() ); } @@ -102,30 +102,30 @@ void UISprite::RenderMode( const EE_RENDER_MODE& render ) { void UISprite::UpdateSize() { if ( Flags() & UI_AUTO_SIZE ) { if ( NULL != mSprite ) { - if ( NULL != mSprite->GetCurrentSubTexture() && mSprite->GetCurrentSubTexture()->Size() != mSize ) - Size( mSprite->GetCurrentSubTexture()->Size() ); + if ( NULL != mSprite->getCurrentSubTexture() && mSprite->getCurrentSubTexture()->size() != mSize ) + Size( mSprite->getCurrentSubTexture()->size() ); } } } void UISprite::AutoAlign() { - if ( NULL == mSprite || NULL == mSprite->GetCurrentSubTexture() ) + if ( NULL == mSprite || NULL == mSprite->getCurrentSubTexture() ) return; - SubTexture * tSubTexture = mSprite->GetCurrentSubTexture(); + SubTexture * tSubTexture = mSprite->getCurrentSubTexture(); if ( HAlignGet( mFlags ) == UI_HALIGN_CENTER ) { - mAlignOffset.x = mSize.width() / 2 - tSubTexture->Size().width() / 2; + mAlignOffset.x = mSize.width() / 2 - tSubTexture->size().width() / 2; } else if ( FontHAlignGet( mFlags ) == UI_HALIGN_RIGHT ) { - mAlignOffset.x = mSize.width() - tSubTexture->Size().width(); + mAlignOffset.x = mSize.width() - tSubTexture->size().width(); } else { mAlignOffset.x = 0; } if ( VAlignGet( mFlags ) == UI_VALIGN_CENTER ) { - mAlignOffset.y = mSize.height() / 2 - tSubTexture->Size().height() / 2; + mAlignOffset.y = mSize.height() / 2 - tSubTexture->size().height() / 2; } else if ( FontVAlignGet( mFlags ) == UI_VALIGN_BOTTOM ) { - mAlignOffset.y = mSize.height() - tSubTexture->Size().height(); + mAlignOffset.y = mSize.height() - tSubTexture->size().height(); } else { mAlignOffset.y = 0; } diff --git a/src/eepp/ui/uitabwidget.cpp b/src/eepp/ui/uitabwidget.cpp index 47df6479e..b6e9059f2 100644 --- a/src/eepp/ui/uitabwidget.cpp +++ b/src/eepp/ui/uitabwidget.cpp @@ -93,8 +93,8 @@ void UITabWidget::SeContainerSize() { void UITabWidget::Draw() { if ( mDrawLineBelowTabs ) { - bool smooth = GLi->IsLineSmooth(); - if ( smooth ) GLi->LineSmooth( false ); + bool smooth = GLi->isLineSmooth(); + if ( smooth ) GLi->lineSmooth( false ); Primitives P; Vector2i p1( mPos.x, mPos.y + mTabContainer->Size().height() + mLineBewowTabsYOffset ); @@ -103,9 +103,9 @@ void UITabWidget::Draw() { ControlToScreen( p1 ); ControlToScreen( p2 ); - P.LineWidth( 1 ); - P.SetColor( mLineBelowTabsColor ); - P.DrawLine( Line2f( Vector2f( p1.x, p1.y ), Vector2f( p2.x, p2.y ) ) ); + P.lineWidth( 1 ); + P.setColor( mLineBelowTabsColor ); + P.drawLine( Line2f( Vector2f( p1.x, p1.y ), Vector2f( p2.x, p2.y ) ) ); Vector2i p3( mPos.x + mTabContainer->Pos().x + mTabContainer->Size().width(), mPos.y + mTabContainer->Size().height() + mLineBewowTabsYOffset ); Vector2i p4( mPos.x + mSize.width(), p3.y ); @@ -113,9 +113,9 @@ void UITabWidget::Draw() { ControlToScreen( p3 ); ControlToScreen( p4 ); - P.DrawLine( Line2f( Vector2f( p3.x, p3.y ), Vector2f( p4.x, p4.y ) ) ); + P.drawLine( Line2f( Vector2f( p3.x, p3.y ), Vector2f( p4.x, p4.y ) ) ); - if ( smooth ) GLi->LineSmooth( true ); + if ( smooth ) GLi->lineSmooth( true ); } } diff --git a/src/eepp/ui/uitextbox.cpp b/src/eepp/ui/uitextbox.cpp index d3b0e4611..5784b1536 100644 --- a/src/eepp/ui/uitextbox.cpp +++ b/src/eepp/ui/uitextbox.cpp @@ -18,13 +18,13 @@ UITextBox::UITextBox( const UITextBox::CreateParams& Params ) : mSelCurEnd( -1 ) { mTextCache = eeNew( TextCache, () ); - mTextCache->Font( Params.Font ); - mTextCache->Color( mFontColor ); - mTextCache->ShadowColor( mFontShadowColor ); + mTextCache->font( Params.Font ); + mTextCache->color( mFontColor ); + mTextCache->shadowColor( mFontShadowColor ); if ( NULL == Params.Font ) { if ( NULL != UIThemeManager::instance()->DefaultFont() ) - mTextCache->Font( UIThemeManager::instance()->DefaultFont() ); + mTextCache->font( UIThemeManager::instance()->DefaultFont() ); else eePRINTL( "UITextBox::UITextBox : Created a UI TextBox without a defined font." ); } @@ -50,7 +50,7 @@ void UITextBox::Draw() { DrawSelection(); - if ( mTextCache->GetTextWidth() ) { + if ( mTextCache->getTextWidth() ) { if ( mFlags & UI_CLIP_ENABLE ) { UIManager::instance()->ClipEnable( mScreenPos.x + mPadding.Left, @@ -60,8 +60,8 @@ void UITextBox::Draw() { ); } - mTextCache->Flags( Flags() ); - mTextCache->Draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, Blend() ); + mTextCache->flags( Flags() ); + mTextCache->draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, Blend() ); if ( mFlags & UI_CLIP_ENABLE ) { UIManager::instance()->ClipDisable(); @@ -71,12 +71,12 @@ void UITextBox::Draw() { } Graphics::Font * UITextBox::Font() const { - return mTextCache->Font(); + return mTextCache->font(); } void UITextBox::Font( Graphics::Font * font ) { - if ( mTextCache->Font() != font ) { - mTextCache->Font( font ); + if ( mTextCache->font() != font ) { + mTextCache->font( font ); AutoShrink(); AutoSize(); AutoAlign(); @@ -88,15 +88,15 @@ const String& UITextBox::Text() { if ( mFlags & UI_AUTO_SHRINK_TEXT ) return mString; - return mTextCache->Text(); + return mTextCache->text(); } void UITextBox::Text( const String& text ) { if ( mFlags & UI_AUTO_SHRINK_TEXT ) { mString = text; - mTextCache->Text( mString ); + mTextCache->text( mString ); } else { - mTextCache->Text( text ); + mTextCache->text( text ); } AutoShrink(); @@ -111,7 +111,7 @@ const ColorA& UITextBox::Color() const { void UITextBox::Color( const ColorA& color ) { mFontColor = color; - mTextCache->Color( color ); + mTextCache->color( color ); Alpha( color.a() ); } @@ -122,7 +122,7 @@ const ColorA& UITextBox::ShadowColor() const { void UITextBox::ShadowColor( const ColorA& color ) { mFontShadowColor = color; - mTextCache->ShadowColor( mFontColor ); + mTextCache->shadowColor( mFontColor ); } const ColorA& UITextBox::SelectionBackColor() const { @@ -138,7 +138,7 @@ void UITextBox::Alpha( const Float& alpha ) { mFontColor.Alpha = (Uint8)alpha; mFontShadowColor.Alpha = (Uint8)alpha; - mTextCache->Alpha( mFontColor.Alpha ); + mTextCache->alpha( mFontColor.Alpha ); } void UITextBox::AutoShrink() { @@ -149,26 +149,26 @@ void UITextBox::AutoShrink() { void UITextBox::ShrinkText( const Uint32& MaxWidth ) { if ( mFlags & UI_AUTO_SHRINK_TEXT ) { - mTextCache->Text( mString ); + mTextCache->text( mString ); } - mTextCache->Font()->ShrinkText( mTextCache->Text(), MaxWidth ); + mTextCache->font()->shrinkText( mTextCache->text(), MaxWidth ); } void UITextBox::AutoSize() { if ( mFlags & UI_AUTO_SIZE ) { - mSize.width( (int)mTextCache->GetTextWidth() ); - mSize.height( (int)mTextCache->GetTextHeight() ); + mSize.width( (int)mTextCache->getTextWidth() ); + mSize.height( (int)mTextCache->getTextHeight() ); } } void UITextBox::AutoAlign() { switch ( FontHAlignGet( Flags() ) ) { case UI_HALIGN_CENTER: - mAlignOffset.x = (Float)( (Int32)( mSize.x - mTextCache->GetTextWidth() ) / 2 ); + mAlignOffset.x = (Float)( (Int32)( mSize.x - mTextCache->getTextWidth() ) / 2 ); break; case UI_HALIGN_RIGHT: - mAlignOffset.x = ( (Float)mSize.x - (Float)mTextCache->GetTextWidth() ); + mAlignOffset.x = ( (Float)mSize.x - (Float)mTextCache->getTextWidth() ); break; case UI_HALIGN_LEFT: mAlignOffset.x = 0.f; @@ -177,10 +177,10 @@ void UITextBox::AutoAlign() { switch ( FontVAlignGet( Flags() ) ) { case UI_VALIGN_CENTER: - mAlignOffset.y = (Float)( ( (Int32)( mSize.y - mTextCache->GetTextHeight() ) ) / 2 ) - 1; + mAlignOffset.y = (Float)( ( (Int32)( mSize.y - mTextCache->getTextHeight() ) ) / 2 ) - 1; break; case UI_VALIGN_BOTTOM: - mAlignOffset.y = ( (Float)mSize.y - (Float)mTextCache->GetTextHeight() ); + mAlignOffset.y = ( (Float)mSize.y - (Float)mTextCache->getTextHeight() ); break; case UI_VALIGN_TOP: mAlignOffset.y = 0.f; @@ -202,7 +202,7 @@ void UITextBox::OnSizeChange() { UIControlAnim::OnSizeChange(); - mTextCache->Cache(); + mTextCache->cache(); } void UITextBox::OnTextChanged() { @@ -224,8 +224,8 @@ const Recti& UITextBox::Padding() const { void UITextBox::SetTheme( UITheme * Theme ) { UIControlAnim::SetTheme( Theme ); - if ( NULL == mTextCache->Font() && NULL != Theme->Font() ) { - mTextCache->Font( Theme->Font() ); + if ( NULL == mTextCache->font() && NULL != Theme->Font() ) { + mTextCache->font( Theme->Font() ); } } @@ -234,15 +234,15 @@ TextCache * UITextBox::GetTextCache() { } Float UITextBox::GetTextWidth() { - return mTextCache->GetTextWidth(); + return mTextCache->getTextWidth(); } Float UITextBox::GetTextHeight() { - return mTextCache->GetTextHeight(); + return mTextCache->getTextHeight(); } const int& UITextBox::GetNumLines() const { - return mTextCache->GetNumLines(); + return mTextCache->getNumLines(); } const Vector2f& UITextBox::AlignOffset() const { @@ -254,12 +254,12 @@ Uint32 UITextBox::OnMouseDoubleClick( const Vector2i& Pos, const Uint32 Flags ) Vector2i controlPos( Pos ); WorldToControl( controlPos ); - Int32 curPos = mTextCache->Font()->FindClosestCursorPosFromPoint( mTextCache->Text(), controlPos ); + Int32 curPos = mTextCache->font()->findClosestCursorPosFromPoint( mTextCache->text(), controlPos ); if ( -1 != curPos ) { Int32 tSelCurInit, tSelCurEnd; - mTextCache->Font()->SelectSubStringFromCursor( mTextCache->Text(), curPos, tSelCurInit, tSelCurEnd ); + mTextCache->font()->selectSubStringFromCursor( mTextCache->text(), curPos, tSelCurInit, tSelCurEnd ); SelCurInit( tSelCurInit ); SelCurEnd( tSelCurEnd ); @@ -289,7 +289,7 @@ Uint32 UITextBox::OnMouseDown( const Vector2i& Pos, const Uint32 Flags ) { Vector2i controlPos( Pos ); WorldToControl( controlPos ); - Int32 curPos = mTextCache->Font()->FindClosestCursorPosFromPoint( mTextCache->Text(), controlPos ); + Int32 curPos = mTextCache->font()->findClosestCursorPosFromPoint( mTextCache->text(), controlPos ); if ( -1 != curPos ) { if ( -1 == SelCurInit() || !( mControlFlags & UI_CTRL_FLAG_SELECTING ) ) { @@ -311,7 +311,7 @@ void UITextBox::DrawSelection() { Int32 init = eemin( SelCurInit(), SelCurEnd() ); Int32 end = eemax( SelCurInit(), SelCurEnd() ); - if ( init < 0 && end > (Int32)mTextCache->Text().size() ) { + if ( init < 0 && end > (Int32)mTextCache->text().size() ) { return; } @@ -319,22 +319,22 @@ void UITextBox::DrawSelection() { Vector2i initPos, endPos; Primitives P; - P.SetColor( mFontSelectionBackColor ); + P.setColor( mFontSelectionBackColor ); do { - initPos = mTextCache->Font()->GetCursorPos( mTextCache->Text(), init ); - lastEnd = mTextCache->Text().find_first_of( '\n', init ); + initPos = mTextCache->font()->getCursorPos( mTextCache->text(), init ); + lastEnd = mTextCache->text().find_first_of( '\n', init ); if ( lastEnd < end && -1 != lastEnd ) { - endPos = mTextCache->Font()->GetCursorPos( mTextCache->Text(), lastEnd ); + endPos = mTextCache->font()->getCursorPos( mTextCache->text(), lastEnd ); init = lastEnd + 1; } else { - endPos = mTextCache->Font()->GetCursorPos( mTextCache->Text(), end ); + endPos = mTextCache->font()->getCursorPos( mTextCache->text(), end ); lastEnd = end; } - P.DrawRectangle( Rectf( mScreenPos.x + initPos.x + mAlignOffset.x + mPadding.Left, - mScreenPos.y + initPos.y - mTextCache->Font()->GetFontHeight() + mAlignOffset.y + mPadding.Top, + P.drawRectangle( Rectf( mScreenPos.x + initPos.x + mAlignOffset.x + mPadding.Left, + mScreenPos.y + initPos.y - mTextCache->font()->getFontHeight() + mAlignOffset.y + mPadding.Top, mScreenPos.x + endPos.x + mAlignOffset.x + mPadding.Left, mScreenPos.y + endPos.y + mAlignOffset.y + mPadding.Top ) ); diff --git a/src/eepp/ui/uitextedit.cpp b/src/eepp/ui/uitextedit.cpp index 5470b254d..a1ac627ef 100644 --- a/src/eepp/ui/uitextedit.cpp +++ b/src/eepp/ui/uitextedit.cpp @@ -341,7 +341,7 @@ void UITextEdit::FixScrollToCursor() { Uint32 NLPos = 0; Uint32 LineNum = mTextInput->GetInputTextBuffer()->getCurPosLinePos( NLPos ); - mTextInput->GetTextCache()->Font()->SetText( + mTextInput->GetTextCache()->font()->setText( mTextInput->GetInputTextBuffer()->buffer().substr( NLPos, mTextInput->GetInputTextBuffer()->curPos() - NLPos ) @@ -349,8 +349,8 @@ void UITextEdit::FixScrollToCursor() { mSkipValueChange = true; - Float tW = mTextInput->GetTextCache()->Font()->GetTextWidth(); - Float tH = (Float)(LineNum + 1) * (Float)mTextInput->GetTextCache()->Font()->GetFontHeight(); + Float tW = mTextInput->GetTextCache()->font()->getTextWidth(); + Float tH = (Float)(LineNum + 1) * (Float)mTextInput->GetTextCache()->font()->getFontHeight(); if ( tW > Width ) { mTextInput->Pos( mPadding.Left + Width - tW, mTextInput->Pos().y ); diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index e2ea4be84..65f55efea 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -78,13 +78,13 @@ void UITextInput::DrawWaitingCursor() { mWaitCursorTime += UIManager::instance()->Elapsed().asMilliseconds(); if ( mShowingWait ) { - bool disableSmooth = mShowingWait && GLi->IsLineSmooth(); + bool disableSmooth = mShowingWait && GLi->isLineSmooth(); if ( disableSmooth ) - GLi->LineSmooth( false ); + GLi->lineSmooth( false ); Primitives P; - P.SetColor( mFontColor ); + P.setColor( mFontColor ); Float CurPosX = mScreenPos.x + mAlignOffset.x + mCurPos.x + 1 + mPadding.Left; Float CurPosY = mScreenPos.y + mAlignOffset.y + mCurPos.y + mPadding.Top; @@ -92,10 +92,10 @@ void UITextInput::DrawWaitingCursor() { if ( CurPosX > (Float)mScreenPos.x + (Float)mSize.x ) CurPosX = (Float)mScreenPos.x + (Float)mSize.x; - P.DrawLine( Line2f( Vector2f( CurPosX, CurPosY ), Vector2f( CurPosX, CurPosY + mTextCache->Font()->GetFontHeight() ) ) ); + P.drawLine( Line2f( Vector2f( CurPosX, CurPosY ), Vector2f( CurPosX, CurPosY + mTextCache->font()->getFontHeight() ) ) ); if ( disableSmooth ) - GLi->LineSmooth( true ); + GLi->lineSmooth( true ); } if ( mWaitCursorTime >= 500.f ) { @@ -151,13 +151,13 @@ void UITextInput::AlignFix() { Uint32 NLPos = 0; Uint32 LineNum = mTextBuffer.getCurPosLinePos( NLPos ); - mTextCache->Font()->SetText( mTextBuffer.buffer().substr( NLPos, mTextBuffer.curPos() - NLPos ) ); + mTextCache->font()->setText( mTextBuffer.buffer().substr( NLPos, mTextBuffer.curPos() - NLPos ) ); - Float tW = mTextCache->Font()->GetTextWidth(); + Float tW = mTextCache->font()->getTextWidth(); Float tX = mAlignOffset.x + tW; mCurPos.x = tW; - mCurPos.y = (Float)LineNum * (Float)mTextCache->Font()->GetFontHeight(); + mCurPos.y = (Float)LineNum * (Float)mTextCache->font()->getFontHeight(); if ( !mTextBuffer.supportNewLine() ) { if ( tX < 0.f ) @@ -215,11 +215,11 @@ const String& UITextInput::Text() { } void UITextInput::ShrinkText( const Uint32& MaxWidth ) { - mTextCache->Text( mTextBuffer.buffer() ); + mTextCache->text( mTextBuffer.buffer() ); UITextBox::ShrinkText( MaxWidth ); - mTextBuffer.buffer( mTextCache->Text() ); + mTextBuffer.buffer( mTextCache->text() ); AlignFix(); } @@ -232,7 +232,7 @@ Uint32 UITextInput::OnMouseClick( const Vector2i& Pos, const Uint32 Flags ) { Vector2i controlPos( Pos ); WorldToControl( controlPos ); - Int32 curPos = mTextCache->Font()->FindClosestCursorPosFromPoint( mTextCache->Text(), controlPos ); + Int32 curPos = mTextCache->font()->findClosestCursorPosFromPoint( mTextCache->text(), controlPos ); if ( -1 != curPos ) { mTextBuffer.curPos( curPos ); diff --git a/src/eepp/ui/uitextinputpassword.cpp b/src/eepp/ui/uitextinputpassword.cpp index 8fe484315..bf605a823 100644 --- a/src/eepp/ui/uitextinputpassword.cpp +++ b/src/eepp/ui/uitextinputpassword.cpp @@ -10,13 +10,13 @@ UITextInputPassword::UITextInputPassword( const UITextInput::CreateParams& Param UITextInput( Params ) { mPassCache = eeNew( TextCache, () ); - mPassCache->Font( Params.Font ); - mPassCache->Color( mFontColor ); - mPassCache->ShadowColor( mFontShadowColor ); + mPassCache->font( Params.Font ); + mPassCache->color( mFontColor ); + mPassCache->shadowColor( mFontShadowColor ); if ( NULL == Params.Font ) { if ( NULL != UIThemeManager::instance()->DefaultFont() ) - mPassCache->Font( UIThemeManager::instance()->DefaultFont() ); + mPassCache->font( UIThemeManager::instance()->DefaultFont() ); else eePRINTL( "UITextInputPassword::UITextInputPassword : Created a UI TextInputPassword without a defined font." ); } @@ -28,7 +28,7 @@ void UITextInputPassword::Draw() { if ( mVisible && 0.f != mAlpha ) { UIControlAnim::Draw(); - if ( mPassCache->GetTextWidth() ) { + if ( mPassCache->getTextWidth() ) { if ( mFlags & UI_CLIP_ENABLE ) { UIManager::instance()->ClipEnable( mScreenPos.x + mPadding.Left, @@ -38,8 +38,8 @@ void UITextInputPassword::Draw() { ); } - mPassCache->Flags( Flags() ); - mPassCache->Draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, Blend() ); + mPassCache->flags( Flags() ); + mPassCache->draw( (Float)mScreenPos.x + mAlignOffset.x + (Float)mPadding.Left, (Float)mScreenPos.y + mAlignOffset.y + (Float)mPadding.Top, Vector2f::One, 0.f, Blend() ); if ( mFlags & UI_CLIP_ENABLE ) { UIManager::instance()->ClipDisable(); @@ -61,13 +61,13 @@ void UITextInputPassword::AlignFix() { for ( size_t i = 0; i < curStr.size(); i++ ) pasStr += '*'; - mPassCache->Font()->SetText( pasStr ); + mPassCache->font()->setText( pasStr ); - Float tW = mPassCache->Font()->GetTextWidth(); + Float tW = mPassCache->font()->getTextWidth(); Float tX = mAlignOffset.x + tW; mCurPos.x = tW; - mCurPos.y = (Float)LineNum * (Float)mPassCache->Font()->GetFontHeight(); + mCurPos.y = (Float)LineNum * (Float)mPassCache->font()->getFontHeight(); if ( !mTextBuffer.supportNewLine() ) { if ( tX < 0.f ) @@ -81,10 +81,10 @@ void UITextInputPassword::AlignFix() { void UITextInputPassword::AutoAlign() { switch ( FontHAlignGet( Flags() ) ) { case UI_HALIGN_CENTER: - mAlignOffset.x = (Float)( (Int32)( mSize.x - mPassCache->GetTextWidth() ) / 2 ); + mAlignOffset.x = (Float)( (Int32)( mSize.x - mPassCache->getTextWidth() ) / 2 ); break; case UI_HALIGN_RIGHT: - mAlignOffset.x = ( (Float)mSize.x - (Float)mPassCache->GetTextWidth() ); + mAlignOffset.x = ( (Float)mSize.x - (Float)mPassCache->getTextWidth() ); break; case UI_HALIGN_LEFT: mAlignOffset.x = 0.f; @@ -93,10 +93,10 @@ void UITextInputPassword::AutoAlign() { switch ( FontVAlignGet( Flags() ) ) { case UI_VALIGN_CENTER: - mAlignOffset.y = (Float)( ( (Int32)( mSize.y - mPassCache->GetTextHeight() ) ) / 2 ) - 1; + mAlignOffset.y = (Float)( ( (Int32)( mSize.y - mPassCache->getTextHeight() ) ) / 2 ) - 1; break; case UI_VALIGN_BOTTOM: - mAlignOffset.y = ( (Float)mSize.y - (Float)mPassCache->GetTextHeight() ); + mAlignOffset.y = ( (Float)mSize.y - (Float)mPassCache->getTextHeight() ); break; case UI_VALIGN_TOP: mAlignOffset.y = 0.f; @@ -105,11 +105,11 @@ void UITextInputPassword::AutoAlign() { } void UITextInputPassword::UpdateText() { - UpdatePass( mTextCache->Text() ); + UpdatePass( mTextCache->text() ); } void UITextInputPassword::UpdatePass( const String& pass ) { - mPassCache->Text().clear(); + mPassCache->text().clear(); String newTxt; @@ -117,7 +117,7 @@ void UITextInputPassword::UpdatePass( const String& pass ) { newTxt += '*'; } - mPassCache->Text( newTxt ); + mPassCache->text( newTxt ); } void UITextInputPassword::Text( const String& text ) { diff --git a/src/eepp/ui/uitheme.cpp b/src/eepp/ui/uitheme.cpp index 9535b1cfe..058c88703 100644 --- a/src/eepp/ui/uitheme.cpp +++ b/src/eepp/ui/uitheme.cpp @@ -126,8 +126,8 @@ UITheme * UITheme::LoadFromTextureAtlas( UITheme * tTheme, Graphics::TextureAtla eeASSERT( NULL != tTheme && NULL != TextureAtlas ); /** Themes use nearest filter by default, force the filter to the textures. */ - for ( Uint32 tC = 0; tC < TextureAtlas->GetTexturesCount(); tC++ ) { - TextureAtlas->GetTexture( tC )->Filter( TEX_FILTER_NEAREST ); + for ( Uint32 tC = 0; tC < TextureAtlas->getTexturesCount(); tC++ ) { + TextureAtlas->getTexture( tC )->filter( TEX_FILTER_NEAREST ); } Clock TE; @@ -209,7 +209,7 @@ UITheme * UITheme::LoadFromPath( UITheme * tTheme, const std::string& Path, cons Element = RPath + ElemName + "." + ImgExt; if ( FileSystem::fileExists( Element ) ) { - tSG->add( eeNew( SubTexture, ( TextureFactory::instance()->Load( Element ), ElemName ) ) ); + tSG->add( eeNew( SubTexture, ( TextureFactory::instance()->load( Element ), ElemName ) ) ); } } @@ -292,7 +292,7 @@ bool UITheme::SearchFilesOfElement( Graphics::TextureAtlas * SG, const std::stri ElemFullPath = ElemPath + "." + ImgExt; if ( FileSystem::fileExists( ElemFullPath ) ) { - SG->add( eeNew( SubTexture, ( TextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); + SG->add( eeNew( SubTexture, ( TextureFactory::instance()->load( ElemFullPath ), ElemName ) ) ); IsComplex = 1; Found = true; @@ -309,7 +309,7 @@ bool UITheme::SearchFilesOfElement( Graphics::TextureAtlas * SG, const std::stri ElemFullPath = ElemPath + "." + ImgExt; if ( FileSystem::fileExists( ElemFullPath ) ) { - SG->add( eeNew( SubTexture, ( TextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); + SG->add( eeNew( SubTexture, ( TextureFactory::instance()->load( ElemFullPath ), ElemName ) ) ); Found = true; } @@ -338,16 +338,16 @@ UITheme::~UITheme() { } -const std::string& UITheme::Name() const { +const std::string& UITheme::getName() const { return mName; } -void UITheme::Name( const std::string& name ) { +void UITheme::setName( const std::string& name ) { mName = name; mNameHash = String::hash( mName ); } -const Uint32& UITheme::Id() const { +const Uint32& UITheme::getId() const { return mNameHash; } diff --git a/src/eepp/ui/uitooltip.cpp b/src/eepp/ui/uitooltip.cpp index 57a5f88da..c879aa933 100644 --- a/src/eepp/ui/uitooltip.cpp +++ b/src/eepp/ui/uitooltip.cpp @@ -15,13 +15,13 @@ UITooltip::UITooltip( UITooltip::CreateParams& Params, UIControl * TooltipOf ) : mTooltipOf( TooltipOf ) { mTextCache = eeNew( TextCache, () ); - mTextCache->Font( Params.Font ); - mTextCache->Color( mFontColor ); - mTextCache->ShadowColor( mFontShadowColor ); + mTextCache->font( Params.Font ); + mTextCache->color( mFontColor ); + mTextCache->shadowColor( mFontShadowColor ); if ( NULL == Params.Font ) { if ( NULL != UIThemeManager::instance()->DefaultFont() ) - mTextCache->Font( UIThemeManager::instance()->DefaultFont() ); + mTextCache->font( UIThemeManager::instance()->DefaultFont() ); else eePRINTL( "UITooltip::UITextBox : Created a UI TextBox without a defined font." ); } @@ -55,8 +55,8 @@ void UITooltip::SetTheme( UITheme * Theme ) { AutoPadding(); - if ( NULL == mTextCache->Font() && NULL != Theme->Font() ) { - mTextCache->Font( Theme->Font() ); + if ( NULL == mTextCache->font() && NULL != Theme->Font() ) { + mTextCache->font( Theme->Font() ); } } @@ -92,20 +92,20 @@ void UITooltip::Draw() { if ( mVisible && 0.f != mAlpha ) { UIControlAnim::Draw(); - if ( mTextCache->GetTextWidth() ) { - mTextCache->Flags( Flags() ); - mTextCache->Draw( (Float)mScreenPos.x + mAlignOffset.x, (Float)mScreenPos.y + mAlignOffset.y, Vector2f::One, 0.f, Blend() ); + if ( mTextCache->getTextWidth() ) { + mTextCache->flags( Flags() ); + mTextCache->draw( (Float)mScreenPos.x + mAlignOffset.x, (Float)mScreenPos.y + mAlignOffset.y, Vector2f::One, 0.f, Blend() ); } } } Graphics::Font * UITooltip::Font() const { - return mTextCache->Font(); + return mTextCache->font(); } void UITooltip::Font( Graphics::Font * font ) { - if ( mTextCache->Font() != font ) { - mTextCache->Font( font ); + if ( mTextCache->font() != font ) { + mTextCache->font( font ); AutoPadding(); AutoSize(); AutoAlign(); @@ -114,11 +114,11 @@ void UITooltip::Font( Graphics::Font * font ) { } const String& UITooltip::Text() { - return mTextCache->Text(); + return mTextCache->text(); } void UITooltip::Text( const String& text ) { - mTextCache->Text( text ); + mTextCache->text( text ); AutoPadding(); AutoSize(); AutoAlign(); @@ -141,7 +141,7 @@ const ColorA& UITooltip::ShadowColor() const { void UITooltip::ShadowColor( const ColorA& color ) { mFontShadowColor = color; Alpha( color.a() ); - mTextCache->ShadowColor( mFontColor ); + mTextCache->shadowColor( mFontColor ); } void UITooltip::Alpha( const Float& alpha ) { @@ -149,13 +149,13 @@ void UITooltip::Alpha( const Float& alpha ) { mFontColor.Alpha = (Uint8)alpha; mFontShadowColor.Alpha = (Uint8)alpha; - mTextCache->Color( mFontColor ); + mTextCache->color( mFontColor ); } void UITooltip::AutoSize() { if ( mFlags & UI_AUTO_SIZE ) { - mSize.width( (int)mTextCache->GetTextWidth() + mPadding.Left + mPadding.Right ); - mSize.height( (int)mTextCache->GetTextHeight() + mPadding.Top + mPadding.Bottom ); + mSize.width( (int)mTextCache->getTextWidth() + mPadding.Left + mPadding.Right ); + mSize.height( (int)mTextCache->getTextHeight() + mPadding.Top + mPadding.Bottom ); } } @@ -165,10 +165,10 @@ void UITooltip::AutoAlign() { switch ( FontHAlignGet( Flags() ) ) { case UI_HALIGN_CENTER: - mAlignOffset.x = mPadding.Left + (Float)( (Int32)( Width - mTextCache->GetTextWidth() ) / 2 ); + mAlignOffset.x = mPadding.Left + (Float)( (Int32)( Width - mTextCache->getTextWidth() ) / 2 ); break; case UI_HALIGN_RIGHT: - mAlignOffset.x = ( (Float)Width - (Float)mTextCache->GetTextWidth() ) - mPadding.Right; + mAlignOffset.x = ( (Float)Width - (Float)mTextCache->getTextWidth() ) - mPadding.Right; break; case UI_HALIGN_LEFT: mAlignOffset.x = mPadding.Left; @@ -177,10 +177,10 @@ void UITooltip::AutoAlign() { switch ( FontVAlignGet( Flags() ) ) { case UI_VALIGN_CENTER: - mAlignOffset.y = mPadding.Top + (Float)( ( (Int32)( Height - mTextCache->GetTextHeight() ) ) / 2 ); + mAlignOffset.y = mPadding.Top + (Float)( ( (Int32)( Height - mTextCache->getTextHeight() ) ) / 2 ); break; case UI_VALIGN_BOTTOM: - mAlignOffset.y = ( (Float)Height - (Float)mTextCache->GetTextHeight() ) - mPadding.Bottom; + mAlignOffset.y = ( (Float)Height - (Float)mTextCache->getTextHeight() ) - mPadding.Bottom; break; case UI_VALIGN_TOP: mAlignOffset.y = mPadding.Top; @@ -195,7 +195,7 @@ void UITooltip::OnSizeChange() { UIControlAnim::OnSizeChange(); - mTextCache->Cache(); + mTextCache->cache(); } void UITooltip::OnTextChanged() { @@ -219,15 +219,15 @@ TextCache * UITooltip::GetTextCache() { } Float UITooltip::GetTextWidth() { - return mTextCache->GetTextWidth(); + return mTextCache->getTextWidth(); } Float UITooltip::GetTextHeight() { - return mTextCache->GetTextHeight(); + return mTextCache->getTextHeight(); } const int& UITooltip::GetNumLines() const { - return mTextCache->GetNumLines(); + return mTextCache->getNumLines(); } const Vector2f& UITooltip::AlignOffset() const { diff --git a/src/eepp/ui/uiwindow.cpp b/src/eepp/ui/uiwindow.cpp index 77cbe4762..b7165228e 100644 --- a/src/eepp/ui/uiwindow.cpp +++ b/src/eepp/ui/uiwindow.cpp @@ -654,7 +654,7 @@ void UIWindow::Draw() { if ( mWinFlags & UI_WIN_DRAW_SHADOW ) { Primitives P; - P.ForceDraw( false ); + P.forceDraw( false ); ColorA BeginC( 0, 0, 0, 25 * ( Alpha() / (Float)255 ) ); ColorA EndC( 0, 0, 0, 0 ); @@ -662,25 +662,25 @@ void UIWindow::Draw() { Vector2i ShadowPos = mScreenPos + Vector2i( 0, 16 ); - P.DrawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y ), Sizef( mSize.width(), mSize.height() ) ), BeginC, BeginC, BeginC, BeginC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y ), Sizef( mSize.width(), mSize.height() ) ), BeginC, BeginC, BeginC, BeginC ); - P.DrawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y - SSize ), Sizef( mSize.width(), SSize ) ), EndC, BeginC, BeginC, EndC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y - SSize ), Sizef( mSize.width(), SSize ) ), EndC, BeginC, BeginC, EndC ); - P.DrawRectangle( Rectf( Vector2f( ShadowPos.x - SSize, ShadowPos.y ), Sizef( SSize, mSize.height() ) ), EndC, EndC, BeginC, BeginC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x - SSize, ShadowPos.y ), Sizef( SSize, mSize.height() ) ), EndC, EndC, BeginC, BeginC ); - P.DrawRectangle( Rectf( Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y ), Sizef( SSize, mSize.height() ) ), BeginC, BeginC, EndC, EndC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y ), Sizef( SSize, mSize.height() ) ), BeginC, BeginC, EndC, EndC ); - P.DrawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() ), Sizef( mSize.width(), SSize ) ), BeginC, EndC, EndC, BeginC ); + P.drawRectangle( Rectf( Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() ), Sizef( mSize.width(), SSize ) ), BeginC, EndC, EndC, BeginC ); - P.DrawTriangle( Triangle2f( Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y ), Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y - SSize ), Vector2f( ShadowPos.x + mSize.width() + SSize, ShadowPos.y ) ), BeginC, EndC, EndC ); + P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y ), Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y - SSize ), Vector2f( ShadowPos.x + mSize.width() + SSize, ShadowPos.y ) ), BeginC, EndC, EndC ); - P.DrawTriangle( Triangle2f( Vector2f( ShadowPos.x, ShadowPos.y ), Vector2f( ShadowPos.x, ShadowPos.y - SSize ), Vector2f( ShadowPos.x - SSize, ShadowPos.y ) ), BeginC, EndC, EndC ); + P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x, ShadowPos.y ), Vector2f( ShadowPos.x, ShadowPos.y - SSize ), Vector2f( ShadowPos.x - SSize, ShadowPos.y ) ), BeginC, EndC, EndC ); - P.DrawTriangle( Triangle2f( Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y + mSize.height() + SSize ), Vector2f( ShadowPos.x + mSize.width() + SSize, ShadowPos.y + mSize.height() ) ), BeginC, EndC, EndC ); + P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x + mSize.width(), ShadowPos.y + mSize.height() + SSize ), Vector2f( ShadowPos.x + mSize.width() + SSize, ShadowPos.y + mSize.height() ) ), BeginC, EndC, EndC ); - P.DrawTriangle( Triangle2f( Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x - SSize, ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() + SSize ) ), BeginC, EndC, EndC ); + P.drawTriangle( Triangle2f( Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x - SSize, ShadowPos.y + mSize.height() ), Vector2f( ShadowPos.x, ShadowPos.y + mSize.height() + SSize ) ), BeginC, EndC, EndC ); - P.ForceDraw( true ); + P.forceDraw( true ); } } diff --git a/src/eepp/ui/uiwinmenu.cpp b/src/eepp/ui/uiwinmenu.cpp index c43602e96..84a760054 100644 --- a/src/eepp/ui/uiwinmenu.cpp +++ b/src/eepp/ui/uiwinmenu.cpp @@ -78,7 +78,7 @@ void UIWinMenu::SetTheme( UITheme * Theme ) { } if ( 0 == mMenuHeight && NULL != GetSkin() && NULL != GetSkin()->GetSubTexture( UISkinState::StateNormal ) ) { - mMenuHeight = GetSkin()->GetSubTexture( UISkinState::StateNormal )->Size().height(); + mMenuHeight = GetSkin()->GetSubTexture( UISkinState::StateNormal )->size().height(); Size( Parent()->Size().width(), mMenuHeight ); @@ -126,7 +126,7 @@ void UIWinMenu::RefreshButtons() { SubTexture * subTexture = GetSkin()->GetSubTexture( UISkinState::StateNormal ); if ( NULL != subTexture ) { - h = subTexture->Size().height(); + h = subTexture->size().height(); if ( mButtons.begin() != mButtons.end() ) { UISelectButton * tbut = mButtons.begin()->first; @@ -135,7 +135,7 @@ void UIWinMenu::RefreshButtons() { SubTexture * tSubTexture2 = tbut->GetSkin()->GetSubTexture( UISkinState::StateSelected ); if ( NULL != tSubTexture2 ) { - th = tSubTexture2->Size().height(); + th = tSubTexture2->size().height(); switch ( VAlignGet( Flags() ) ) { case UI_VALIGN_CENTER: diff --git a/src/eepp/window/backend/SDL/backendsdl.cpp b/src/eepp/window/backend/SDL/backendsdl.cpp deleted file mode 100644 index 619d7aab1..000000000 --- a/src/eepp/window/backend/SDL/backendsdl.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#include - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -WindowBackendSDL::WindowBackendSDL() : - WindowBackend() -{ -} - -WindowBackendSDL::~WindowBackendSDL() -{ - SDL_Quit(); -} - -}}}} - -#endif diff --git a/src/eepp/window/backend/SDL/backendsdl.hpp b/src/eepp/window/backend/SDL/backendsdl.hpp deleted file mode 100644 index 2c8f94fd9..000000000 --- a/src/eepp/window/backend/SDL/backendsdl.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef EE_WINDOWCBACKENDSDL_HPP -#define EE_WINDOWCBACKENDSDL_HPP - -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#include - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -class EE_API WindowBackendSDL : public WindowBackend { - public: - WindowBackendSDL(); - - ~WindowBackendSDL(); -}; - -}}}} - -#endif - -#endif diff --git a/src/eepp/window/backend/SDL/base.hpp b/src/eepp/window/backend/SDL/base.hpp deleted file mode 100644 index 82b054175..000000000 --- a/src/eepp/window/backend/SDL/base.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef EE_WINDOWBACKEND_BASE_SDL12_HPP -#define EE_WINDOWBACKEND_BASE_SDL12_HPP - -#include - -#ifdef EE_BACKEND_SDL_ACTIVE - - #if defined( EE_SDL_VERSION_1_2 ) - #ifndef EE_BACKEND_SDL_1_2 - #define EE_BACKEND_SDL_1_2 - #endif - #endif - -#endif - -#endif diff --git a/src/eepp/window/backend/SDL/clipboardsdl.cpp b/src/eepp/window/backend/SDL/clipboardsdl.cpp deleted file mode 100644 index df17da7f7..000000000 --- a/src/eepp/window/backend/SDL/clipboardsdl.cpp +++ /dev/null @@ -1,369 +0,0 @@ -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#if defined( EE_X11_PLATFORM ) - #include - #include -#endif - -#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - #if !defined( EE_COMPILER_MSVC ) - #include - #else - #include - #endif -#endif - -#include -#include -#include - -#if !defined( EE_COMPILER_MSVC ) -#include -#else -#include -#endif - -#if EE_PLATFORM == EE_PLATFORM_WIN - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN - #endif - #ifndef NOMINMAX - #define NOMINMAX - #endif - #include -#endif - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -#define T(A, B, C, D) (int)((A<<24)|(B<<16)|(C<<8)|(D<<0)) -#define FORMAT_PREFIX "EE_scrap_0x" - -#if defined( EE_X11_PLATFORM ) - -static void * CurrentHandler = NULL; - -static int clipboard_filter( const SDL_Event *event ) { - /* Post all non-window manager specific events */ - if ( event->type != SDL_SYSWMEVENT ) { - return 1; - } - - Display * curDisplay = (Display *)CurrentHandler; - - /* Handle window-manager specific clipboard events */ - switch ( event->syswm.msg->event.xevent.type ) { - /* Copy the selection from XA_CUT_BUFFER0 to the requested property */ - case SelectionRequest: - { - XSelectionRequestEvent *req; - XEvent sevent; - int seln_format; - unsigned long nbytes; - unsigned long overflow; - unsigned char *seln_data; - - req = &event->syswm.msg->event.xevent.xselectionrequest; - sevent.xselection.type = SelectionNotify; - sevent.xselection.display = req->display; - sevent.xselection.selection = req->selection; - sevent.xselection.target = None; - sevent.xselection.property = None; - sevent.xselection.requestor = req->requestor; - sevent.xselection.time = req->time; - - if ( XGetWindowProperty(curDisplay, DefaultRootWindow(curDisplay), XA_CUT_BUFFER0, 0, INT_MAX/4, False, req->target, &sevent.xselection.target, &seln_format, &nbytes, &overflow, &seln_data) == Success ) { - if ( sevent.xselection.target == req->target ) { - if ( sevent.xselection.target == XA_STRING ) { - if ( seln_data[nbytes-1] == '\0' ) - --nbytes; - } - - XChangeProperty(curDisplay, req->requestor, req->property, sevent.xselection.target, seln_format, PropModeReplace, seln_data, nbytes); - sevent.xselection.property = req->property; - } - - XFree(seln_data); - } - - XSendEvent(curDisplay,req->requestor, False, 0, &sevent); - XSync(curDisplay, False); - } - - break; - } - - /* Post the event for X11 clipboard reading above */ - return 1; -} -#endif - -ClipboardSDL::ClipboardSDL( EE::Window::Window * window ) : - Clipboard( window ), - mInfo( NULL ) -{ -} - -ClipboardSDL::~ClipboardSDL() { -} - -void ClipboardSDL::init() { - #if defined( EE_X11_PLATFORM ) - /// Enable the special window hook events - SDL_EventState( SDL_SYSWMEVENT, SDL_ENABLE ); - SDL_SetEventFilter( clipboard_filter ); - - CurrentHandler = (void*)mWindow->getWindowHandler(); - #endif - - #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - mInfo = reinterpret_cast ( mWindow )->mWMinfo; - #endif -} - -#if defined( EE_X11_PLATFORM ) -#ifdef X_HAVE_UTF8_STRING -#define TEXT_FORMAT XInternAtom(display, "UTF8_STRING", False) -#else -#define TEXT_FORMAT XA_STRING -#endif -#endif - -void ClipboardSDL::setText( const std::string& Text ) { - #if defined( EE_X11_PLATFORM ) - eeWindowHandle display = mInfo->info.x11.display; - X11Window window = mInfo->info.x11.wmwindow; - Atom format = TEXT_FORMAT; - - XChangeProperty( display, DefaultRootWindow( display ), XA_CUT_BUFFER0, format, 8, PropModeReplace, (const unsigned char *)Text.c_str(), Text.size() ); - - if ( XGetSelectionOwner( display, XA_PRIMARY ) != window ) { - XSetSelectionOwner( display, XA_PRIMARY, window, CurrentTime ); - } - #elif EE_PLATFORM == EE_PLATFORM_WIN - /** @TODO: Implement */ - #endif -} - -int ClipboardSDL::clipboard_convert_scrap( int type, char *dst, char *src, int srclen ) { - int dstlen; - - dstlen = 0; - switch (type) { - case T('T', 'E', 'X', 'T'): - if ( srclen == 0 ) - srclen = (int)strlen(src); - - if ( dst ) { - while ( --srclen >= 0 ) { - #if EE_PLATFORM == EE_PLATFORM_WIN - if ( *src == '\r' ) - /* drop extraneous '\r' */; - else - #endif - if ( *src == '\n' ) { - *dst++ = '\r'; - ++dstlen; - } else { - *dst++ = *src; - ++dstlen; - } - ++src; - } - *dst = '\0'; - ++dstlen; - } else { - while ( --srclen >= 0 ) { - #if EE_PLATFORM == EE_PLATFORM_WIN - if ( *src == '\r' ) - /* drop unspected '\r' */; - else - #endif - ++dstlen; - ++src; - } - ++dstlen; - } - break; - default: - dstlen = *(int *)src; - if ( dst ) { - if ( srclen == 0 ) - memcpy(dst, src+sizeof(int), dstlen); - else - memcpy(dst, src+sizeof(int), srclen-sizeof(int)); - } - break; - } - return dstlen; -} - -eeScrapType ClipboardSDL::clipboard_convert_format( int type ) { - switch (type) { - case T('T', 'E', 'X', 'T'): - #if defined( EE_X11_PLATFORM ) - return XA_STRING; - #elif EE_PLATFORM == EE_PLATFORM_WIN - return CF_TEXT; - #endif - default: { - char format[ sizeof(FORMAT_PREFIX)+8+1 ]; - String::strFormat(format, sizeof(FORMAT_PREFIX)+8+1, "%s%08lx", FORMAT_PREFIX, (unsigned long)type); - - #if defined( EE_X11_PLATFORM ) - return XInternAtom( mInfo->info.x11.display, format, False ); - #elif EE_PLATFORM == EE_PLATFORM_WIN - #ifdef UNICODE - return RegisterClipboardFormat( reinterpret_cast( format ) ); - #else - return RegisterClipboardFormat( reinterpret_cast( format ) ); - #endif - #endif - } - } - - return 0; -} - -void ClipboardSDL::clipboard_get_scrap( int type, int *dstlen, char **dst ) { - eeScrapType format; - *dstlen = 0; - format = clipboard_convert_format( type ); - -#if defined( EE_X11_PLATFORM ) - X11Window owner; - Atom selection; - Atom seln_type; - int seln_format; - unsigned long nbytes; - unsigned long overflow; - char *src; - - mInfo->info.x11.lock_func(); - owner = XGetSelectionOwner( mInfo->info.x11.display , XA_PRIMARY); - mInfo->info.x11.unlock_func(); - - if ( ( owner == None ) || ( owner == mInfo->info.x11.wmwindow ) ) { - owner = DefaultRootWindow( mInfo->info.x11.display ); - selection = XA_CUT_BUFFER0; - } else { - int selection_response = 0; - SDL_Event event; - - owner = mInfo->info.x11.wmwindow; - mInfo->info.x11.lock_func(); - - selection = XInternAtom( mInfo->info.x11.display, "SELECTION", False); - XConvertSelection( mInfo->info.x11.display, XA_PRIMARY, format, selection, owner, CurrentTime); - - mInfo->info.x11.unlock_func(); - - while ( ! selection_response ) { - SDL_WaitEvent(&event); - if ( event.type == SDL_SYSWMEVENT ) { - XEvent xevent = event.syswm.msg->event.xevent; - if ( (xevent.type == SelectionNotify) && (xevent.xselection.requestor == owner) ) - selection_response = 1; - } - } - } - - mInfo->info.x11.lock_func(); - if ( XGetWindowProperty( mInfo->info.x11.display, owner, selection, 0, INT_MAX/4, False, format, &seln_type, &seln_format, &nbytes, &overflow, (unsigned char **)&src ) == Success ) { - if ( seln_type == format ) { - *dstlen = clipboard_convert_scrap(type, NULL, src, nbytes); - *dst = (char *)eeMalloc( *dstlen ); - - if ( *dst == NULL ) - *dstlen = 0; - else - clipboard_convert_scrap(type, *dst, src, nbytes); - } - XFree(src); - } - mInfo->info.x11.unlock_func(); -#elif EE_PLATFORM == EE_PLATFORM_WIN - if ( IsClipboardFormatAvailable(format) && OpenClipboard( mInfo->window ) ) { - HANDLE hMem; - char *src; - hMem = GetClipboardData(format); - if ( hMem != NULL ) { - src = (char *)GlobalLock(hMem); - *dstlen = clipboard_convert_scrap(type, NULL, src, 0); - *dst = (char *)eeMalloc( *dstlen ); - if ( *dst == NULL ) - *dstlen = 0; - else - clipboard_convert_scrap(type, *dst, src, 0); - GlobalUnlock(hMem); - } - CloseClipboard(); - } -#endif -} - -std::string ClipboardSDL::getText() { - std::string tStr; - - #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - char *scrap = NULL; - int scraplen; - - clipboard_get_scrap( T('T','E','X','T'), &scraplen, &scrap ); - - if ( scraplen != 0 && strcmp( scrap, "SDL-\r-scrap") ) { - char *cp; - int i; - - for ( cp = scrap, i = 0; i < scraplen; ++cp, ++i ) { - if ( *cp == '\r' ) - *cp = '\n'; - } - - tStr.assign( scrap, scraplen-1 ); - } - - eeSAFE_DELETE_ARRAY( scrap ); - #else - #warning ClipboardSDL::GetClipboardText() not implemented on this platform. - #endif - - return tStr; -} - -String ClipboardSDL::getWideText() { - String tStr; - - #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - char * scrap = NULL; - int scraplen; - - clipboard_get_scrap( T('T','E','X','T'), &scraplen, &scrap ); - - if ( scraplen != 0 && strcmp( scrap, "SDL-\r-scrap" ) ) { - tStr.resize( scraplen-1, ' ' ); - - char *cp; - int i; - - for ( cp = scrap, i = 0; i < scraplen; ++cp, ++i ) { - if ( *cp == '\r' ) - *cp = '\n'; - - unsigned char y = *cp; // convert the nevative values to positives - tStr[i] = y; - } - } - - eeSAFE_DELETE_ARRAY( scrap ); - #else - #warning ClipboardSDL::GetWideText() not implemented on this platform. - #endif - - return tStr; -} - -}}}} - -#endif diff --git a/src/eepp/window/backend/SDL/clipboardsdl.hpp b/src/eepp/window/backend/SDL/clipboardsdl.hpp deleted file mode 100644 index 2e3252edf..000000000 --- a/src/eepp/window/backend/SDL/clipboardsdl.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef EE_WINDOWCCLIPBOARDSDL_HPP -#define EE_WINDOWCCLIPBOARDSDL_HPP - -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#include - -struct SDL_SysWMinfo; - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -#if EE_PLATFORM == EE_PLATFORM_WIN - typedef unsigned int eeScrapType; -#elif defined( EE_X11_PLATFORM ) - typedef unsigned long eeScrapType; -#elif EE_PLATFORM == EE_PLATFORM_MACOSX - typedef unsigned int eeScrapType; -#else - typedef unsigned int eeScrapType; -#endif - -class EE_API ClipboardSDL : public Clipboard { - public: - virtual ~ClipboardSDL(); - - std::string getText(); - - String getWideText(); - - void setText( const std::string& Text ); - protected: - friend class WindowSDL; - - ClipboardSDL( EE::Window::Window * window ); - - void init(); - - #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - SDL_SysWMinfo * mInfo; - #else - void * mInfo; - #endif - - eeScrapType clipboard_convert_format( int type ); - - int clipboard_convert_scrap(int type, char *dst, char *src, int srclen); - - void clipboard_get_scrap(int type, int *dstlen, char **dst); -}; - -}}}} - -#endif - -#endif diff --git a/src/eepp/window/backend/SDL/cursormanagersdl.cpp b/src/eepp/window/backend/SDL/cursormanagersdl.cpp deleted file mode 100644 index bfd929f7e..000000000 --- a/src/eepp/window/backend/SDL/cursormanagersdl.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#include - -#if !defined( EE_COMPILER_MSVC ) -#include -#else -#include -#endif - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -CursorManagerSDL::CursorManagerSDL( EE::Window::Window * window ) : - CursorManager( window ) -{ -} - -Cursor * CursorManagerSDL::create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { - #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - return mWindow->getPlatform()->createMouseCursor( tex, hotspot, name ); - #else - return eeNew( CursorSDL, ( tex, hotspot, name, mWindow ) ); - #endif -} - -Cursor * CursorManagerSDL::create( Image * img, const Vector2i& hotspot, const std::string& name ) { - #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - return mWindow->getPlatform()->createMouseCursor( img, hotspot, name ); - #else - return eeNew( CursorSDL, ( img, hotspot, name, mWindow ) ); - #endif -} - -Cursor * CursorManagerSDL::create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { - #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN - return mWindow->getPlatform()->createMouseCursor( path, hotspot, name ); - #else - return eeNew( CursorSDL, ( path, hotspot, name, mWindow ) ); - #endif -} - -void CursorManagerSDL::set( Cursor * cursor ) { - mWindow->getPlatform()->setMouseCursor( cursor ); -} - -void CursorManagerSDL::set( EE_SYSTEM_CURSOR syscurid ) { - mWindow->getPlatform()->setSystemMouseCursor( syscurid ); -} - -void CursorManagerSDL::show() { - visible( true ); -} - -void CursorManagerSDL::hide() { - visible( false ); -} - -void CursorManagerSDL::visible( bool visible ) { - if ( visible ) { - SDL_ShowCursor( SDL_ENABLE ); - - mWindow->getPlatform()->showMouseCursor(); - - mVisible = true; - } else { - SDL_ShowCursor( SDL_DISABLE ); - - mWindow->getPlatform()->hideMouseCursor(); - - mVisible = false; - } -} - -void CursorManagerSDL::remove( Cursor * cursor, bool Delete ) { - CursorManager::remove( cursor, Delete ); -} - -void CursorManagerSDL::reload() { - if ( mVisible ) { - show(); - - mWindow->getPlatform()->restoreCursor(); - } else { - hide(); - } -} - -}}}} - -#endif diff --git a/src/eepp/window/backend/SDL/cursormanagersdl.hpp b/src/eepp/window/backend/SDL/cursormanagersdl.hpp deleted file mode 100644 index 815e18c20..000000000 --- a/src/eepp/window/backend/SDL/cursormanagersdl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef EE_WINDOWCCURSORMANAGERSDL_HPP -#define EE_WINDOWCCURSORMANAGERSDL_HPP - -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -using namespace EE::Window; - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -class CursorManagerSDL : public CursorManager { - public: - CursorManagerSDL( EE::Window::Window * window ); - - Cursor * create( Texture * tex, const Vector2i& hotspot, const std::string& name ); - - Cursor * create( Image * img, const Vector2i& hotspot, const std::string& name ); - - Cursor * create( const std::string& path, const Vector2i& hotspot, const std::string& name ); - - void set( Cursor * cursor ); - - void set( EE_SYSTEM_CURSOR syscurid ); - - void show(); - - void hide(); - - void visible( bool visible ); - - void remove( Cursor * cursor, bool Delete = false ); - - void reload(); -}; - -}}}} - -#endif - -#endif diff --git a/src/eepp/window/backend/SDL/cursorsdl.cpp b/src/eepp/window/backend/SDL/cursorsdl.cpp deleted file mode 100644 index a0c7b5aa9..000000000 --- a/src/eepp/window/backend/SDL/cursorsdl.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include - -#ifdef EE_BACKEND_SDL_1_2 - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -CursorSDL::CursorSDL( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : - Cursor( tex, hotspot, name, window ) -{ -} - -CursorSDL::CursorSDL( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : - Cursor( img, hotspot, name, window ) -{ -} - -CursorSDL::CursorSDL( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : - Cursor( path, hotspot, name, window ) -{ -} - -void CursorSDL::create() { -} - -}}}} - -#endif diff --git a/src/eepp/window/backend/SDL/cursorsdl.hpp b/src/eepp/window/backend/SDL/cursorsdl.hpp deleted file mode 100644 index 0f76e89a6..000000000 --- a/src/eepp/window/backend/SDL/cursorsdl.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef EE_WINDOWCCURSORSDL_HPP -#define EE_WINDOWCCURSORSDL_HPP - -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -using namespace EE::Window; - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -class CursorSDL : public Cursor { - protected: - friend class CursorManagerSDL; - - CursorSDL( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - - CursorSDL( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - - CursorSDL( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - - void create(); -}; - -}}}} - -#endif - -#endif diff --git a/src/eepp/window/backend/SDL/inputsdl.cpp b/src/eepp/window/backend/SDL/inputsdl.cpp deleted file mode 100644 index c9e3af8a6..000000000 --- a/src/eepp/window/backend/SDL/inputsdl.cpp +++ /dev/null @@ -1,244 +0,0 @@ -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - #if !defined( EE_COMPILER_MSVC ) - #include - #else - #include - #endif -#endif - -#include - -#if !defined( EE_COMPILER_MSVC ) -#include -#else -#include -#endif - -#if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN -#ifndef SDL_NUMEVENTS -#define SDL_NUMEVENTS SDL_LASTEVENT -#endif -#endif - -#include -#include -#include - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -InputSDL::InputSDL( EE::Window::Window * window ) : - Input( window, eeNew( JoystickManagerSDL, () ) ) -{ - #if defined( EE_X11_PLATFORM ) - mMouseSpeed = 1.75f; - #endif -} - -InputSDL::~InputSDL() { -} - -void InputSDL::update() { - SDL_Event SDLEvent; - InputEvent EEEvent; - - cleanStates(); - - while ( SDL_PollEvent( &SDLEvent ) ) { - switch( SDLEvent.type ) { - case SDL_ACTIVEEVENT: - { - EEEvent.Type = InputEvent::Active; - EEEvent.active.gain = SDLEvent.active.gain; - EEEvent.active.state = SDLEvent.active.state; - break; - } - case SDL_KEYDOWN: - { - if ( String::isCharacter( SDLEvent.key.keysym.unicode ) && KEY_TAB != SDLEvent.key.keysym.unicode ) { - EEEvent.Type = InputEvent::TextInput; - EEEvent.text.timestamp = Sys::getTicks(); - EEEvent.text.text = SDLEvent.key.keysym.unicode; - - processEvent( &EEEvent ); - } - - EEEvent.Type = InputEvent::KeyDown; - EEEvent.key.state = SDLEvent.key.state; - #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN - EEEvent.key.which = SDLEvent.key.which; - #endif - EEEvent.key.keysym.sym = SDLEvent.key.keysym.sym; - EEEvent.key.keysym.mod = SDLEvent.key.keysym.mod; - EEEvent.key.keysym.unicode = SDLEvent.key.keysym.unicode; - break; - } - case SDL_KEYUP: - { - EEEvent.Type = InputEvent::KeyUp; - EEEvent.key.state = SDLEvent.key.state; - #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN - EEEvent.key.which = SDLEvent.key.which; - #endif - EEEvent.key.keysym.sym = SDLEvent.key.keysym.sym; - EEEvent.key.keysym.mod = SDLEvent.key.keysym.mod; - EEEvent.key.keysym.unicode = SDLEvent.key.keysym.unicode; - break; - } - case SDL_MOUSEMOTION: - { - EEEvent.Type = InputEvent::MouseMotion; - #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN - EEEvent.motion.which = SDLEvent.motion.which; - #endif - EEEvent.motion.state = SDLEvent.motion.state; - EEEvent.motion.x = SDLEvent.motion.x; - EEEvent.motion.y = SDLEvent.motion.y; - EEEvent.motion.xrel = SDLEvent.motion.xrel; - EEEvent.motion.yrel = SDLEvent.motion.yrel; - break; - } - case SDL_MOUSEBUTTONDOWN: - { - EEEvent.Type = InputEvent::MouseButtonDown; - EEEvent.button.button = SDLEvent.button.button; - #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN - EEEvent.button.which = SDLEvent.button.which; - #endif - EEEvent.button.state = SDLEvent.button.state; - EEEvent.button.x = SDLEvent.button.x; - EEEvent.button.y = SDLEvent.button.y; - break; - } - case SDL_MOUSEBUTTONUP: - { - EEEvent.Type = InputEvent::MouseButtonUp; - EEEvent.button.button = SDLEvent.button.button; - #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN - EEEvent.button.which = SDLEvent.button.which; - #endif - EEEvent.button.state = SDLEvent.button.state; - EEEvent.button.x = SDLEvent.button.x; - EEEvent.button.y = SDLEvent.button.y; - break; - } - case SDL_JOYAXISMOTION: - { - EEEvent.Type = InputEvent::JoyAxisMotion; - EEEvent.jaxis.which = SDLEvent.jaxis.which; - EEEvent.jaxis.axis = SDLEvent.jaxis.axis; - EEEvent.jaxis.value = SDLEvent.jaxis.value; - break; - } - case SDL_JOYBALLMOTION: - { - EEEvent.Type = InputEvent::JoyBallMotion; - EEEvent.jball.which = SDLEvent.jball.which; - EEEvent.jball.ball = SDLEvent.jball.ball; - EEEvent.jball.xrel = SDLEvent.jball.xrel; - EEEvent.jball.yrel = SDLEvent.jball.yrel; - break; - } - case SDL_JOYHATMOTION: - { - EEEvent.Type = InputEvent::JoyHatMotion; - EEEvent.jhat.which = SDLEvent.jhat.which; - EEEvent.jhat.value = SDLEvent.jhat.value; - EEEvent.jhat.hat = SDLEvent.jhat.hat; - break; - } - case SDL_JOYBUTTONDOWN: - { - EEEvent.Type = InputEvent::JoyButtonDown; - EEEvent.jbutton.which = SDLEvent.jbutton.which; - EEEvent.jbutton.state = SDLEvent.jbutton.state; - EEEvent.jbutton.button = SDLEvent.jbutton.button; - break; - } - case SDL_JOYBUTTONUP: - { - EEEvent.Type = InputEvent::JoyButtonUp; - EEEvent.jbutton.which = SDLEvent.jbutton.which; - EEEvent.jbutton.state = SDLEvent.jbutton.state; - EEEvent.jbutton.button = SDLEvent.jbutton.button; - break; - } - case SDL_QUIT: - { - EEEvent.Type = InputEvent::Quit; - EEEvent.quit.type = EEEvent.Type; - break; - } - case SDL_SYSWMEVENT: - { - EEEvent.Type = InputEvent::SysWM; - EEEvent.syswm.msg = (InputEvent::SysWMmsg*)SDLEvent.syswm.msg; - break; - } - case SDL_VIDEORESIZE: - { - EEEvent.Type = InputEvent::VideoResize; - EEEvent.resize.w = SDLEvent.resize.w; - EEEvent.resize.h = SDLEvent.resize.h; - break; - } - case SDL_VIDEOEXPOSE: - { - EEEvent.Type = InputEvent::VideoExpose; - EEEvent.expose.type = EEEvent.Type; - break; - } - default: - { - if ( SDLEvent.type >= SDL_USEREVENT && SDLEvent.type < SDL_NUMEVENTS ) { - EEEvent.Type = InputEvent::EventUser + SDLEvent.type - SDL_USEREVENT; - EEEvent.user.type = EEEvent.Type; - EEEvent.user.code = SDLEvent.user.code; - EEEvent.user.data1 = SDLEvent.user.data1; - EEEvent.user.data2 = SDLEvent.user.data2; - } else { - EEEvent.Type = InputEvent::NoEvent; - } - } - } - - if ( InputEvent::NoEvent != EEEvent.Type ) { - processEvent( &EEEvent ); - } - } -} - -bool InputSDL::grabInput() { - return ( SDL_WM_GrabInput( SDL_GRAB_QUERY ) == SDL_GRAB_ON ) ? true : false; -} - -void InputSDL::grabInput( const bool& Grab ) { - if ( Grab ) - SDL_WM_GrabInput(SDL_GRAB_ON); - else - SDL_WM_GrabInput(SDL_GRAB_OFF); -} - -void InputSDL::injectMousePos( const Uint16& x, const Uint16& y ) { - SDL_WarpMouse( x, y ); -} - -void InputSDL::init() { - Vector2if mTempMouse; - SDL_GetMouseState( &mTempMouse.x, &mTempMouse.y ); - mMousePos.x = (int)mTempMouse.x; - mMousePos.y = (int)mTempMouse.y; - - SDL_EnableUNICODE(1); - - SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); - - mJoystickManager->open(); -} - -}}}} - -#endif diff --git a/src/eepp/window/backend/SDL/inputsdl.hpp b/src/eepp/window/backend/SDL/inputsdl.hpp deleted file mode 100644 index 95ff6dc14..000000000 --- a/src/eepp/window/backend/SDL/inputsdl.hpp +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef EE_WINDOWCINPUTSDL_HPP -#define EE_WINDOWCINPUTSDL_HPP - -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#include - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -class EE_API InputSDL : public Input { - public: - virtual ~InputSDL(); - - void update(); - - bool grabInput(); - - void grabInput( const bool& Grab ); - - void injectMousePos( const Uint16& x, const Uint16& y ); - protected: - friend class WindowSDL; - - InputSDL( EE::Window::Window * window ); - - virtual void init(); -}; - -}}}} - -#endif - -#endif diff --git a/src/eepp/window/backend/SDL/joystickmanagersdl.cpp b/src/eepp/window/backend/SDL/joystickmanagersdl.cpp deleted file mode 100644 index 9952c1db9..000000000 --- a/src/eepp/window/backend/SDL/joystickmanagersdl.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#if !defined( EE_COMPILER_MSVC ) -#include -#else -#include -#endif - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -JoystickManagerSDL::JoystickManagerSDL() : - JoystickManager() -{ -} - -JoystickManagerSDL::~JoystickManagerSDL() { -} - -void JoystickManagerSDL::update() { - if ( mInit ) { - SDL_JoystickUpdate(); - - for ( Uint32 i = 0; i < mCount; i++ ) - if ( NULL != mJoysticks[i] ) - mJoysticks[i]->update(); - } -} - -void JoystickManagerSDL::open() { - int error = SDL_InitSubSystem( SDL_INIT_JOYSTICK ); - - if ( !error ) { - mCount = SDL_NumJoysticks(); - - for ( Uint32 i = 0; i < mCount; i++ ) - create(i); - - mInit = true; - } -} - -void JoystickManagerSDL::close() { - if ( SDL_WasInit( SDL_INIT_JOYSTICK ) ) { - SDL_QuitSubSystem( SDL_INIT_JOYSTICK ); - - mInit = false; - } -} - -void JoystickManagerSDL::create( const Uint32& index ) { - if ( NULL != mJoysticks[ index ] ) - mJoysticks[ index ]->reOpen(); - else - mJoysticks[ index ] = eeNew( JoystickSDL, ( index ) ); -} - -}}}} - -#endif diff --git a/src/eepp/window/backend/SDL/joystickmanagersdl.hpp b/src/eepp/window/backend/SDL/joystickmanagersdl.hpp deleted file mode 100644 index 79ad9b9c3..000000000 --- a/src/eepp/window/backend/SDL/joystickmanagersdl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef EE_WINDOWCJOYSTICKMANAGERSDL_HPP -#define EE_WINDOWCJOYSTICKMANAGERSDL_HPP - -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#include - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -class EE_API JoystickManagerSDL : public JoystickManager { - public: - JoystickManagerSDL(); - - virtual ~JoystickManagerSDL(); - - void update(); - - void close(); - - void open(); - protected: - void create( const Uint32& index ); -}; - -}}}} - -#endif - -#endif diff --git a/src/eepp/window/backend/SDL/joysticksdl.cpp b/src/eepp/window/backend/SDL/joysticksdl.cpp deleted file mode 100644 index fa7a8af42..000000000 --- a/src/eepp/window/backend/SDL/joysticksdl.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include - -#ifdef EE_BACKEND_SDL_1_2 - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -JoystickSDL::JoystickSDL( const Uint32& index ) : - Joystick( index ), - mJoystick( NULL ) -{ - open(); -} - -JoystickSDL::~JoystickSDL() { - close(); -} - -void JoystickSDL::open() { - mJoystick = SDL_JoystickOpen( mIndex ); - - if ( NULL != mJoystick ) { - mName = SDL_JoystickName( mIndex ); - mHats = SDL_JoystickNumHats( mJoystick ); - mButtons = SDL_JoystickNumButtons( mJoystick ); - mAxes = SDL_JoystickNumAxes( mJoystick ); - mBalls = SDL_JoystickNumBalls( mJoystick ); - - mButtonDown = mButtonDownLast = mButtonUp = 0; - - if ( mButtons > 32 ) - mButtons = 32; - } -} - -void JoystickSDL::close() { - if( SDL_JoystickOpened( mIndex ) ) - SDL_JoystickClose( mJoystick ); - - mJoystick = NULL; - mName = ""; - mHats = mButtons = mAxes = mBalls = 0; -} - -void JoystickSDL::update() { - if ( NULL != mJoystick ) { - clearStates(); - - for ( Int32 i = 0; i < mButtons; i++ ) { - updateButton( i, 0 != SDL_JoystickGetButton( mJoystick, i ) ); - } - - } -} - -Uint8 JoystickSDL::getHat( const Int32& index ) { - if ( index >= 0 && index < mHats ) - return SDL_JoystickGetHat( mJoystick, index ); - - return HAT_CENTERED; -} - -Float JoystickSDL::getAxis( const Int32& axis ) { - if ( axis >= 0 && axis < mAxes ) { - return (Float)SDL_JoystickGetAxis( mJoystick, axis ) / 32768.f; - } - - return 0; -} - -Vector2i JoystickSDL::getBallMotion( const Int32& ball ) { - Vector2i v; - - if ( ball >= 0 && ball < mBalls ) - SDL_JoystickGetBall( mJoystick, ball, &v.x, &v.y ); - - return v; -} - - -bool JoystickSDL::isPlugged() const { - return NULL != mJoystick; -} - - -}}}} - -#endif diff --git a/src/eepp/window/backend/SDL/joysticksdl.hpp b/src/eepp/window/backend/SDL/joysticksdl.hpp deleted file mode 100644 index d7e05e7d2..000000000 --- a/src/eepp/window/backend/SDL/joysticksdl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef EE_WINDOWCJOYSTICKSDL_HPP -#define EE_WINDOWCJOYSTICKSDL_HPP - -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#include -#if !defined( EE_COMPILER_MSVC ) -#include -#else -#include -#endif - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -class EE_API JoystickSDL : public Joystick { - public: - JoystickSDL( const Uint32& index ); - - virtual ~JoystickSDL(); - - void close(); - - void open(); - - void update(); - - Uint8 getHat( const Int32& index ); - - Float getAxis( const Int32& axis ); - - Vector2i getBallMotion( const Int32& ball ); - - bool isPlugged() const; - protected: - SDL_Joystick * mJoystick; -}; - -}}}} - -#endif - -#endif diff --git a/src/eepp/window/backend/SDL/windowsdl.cpp b/src/eepp/window/backend/SDL/windowsdl.cpp deleted file mode 100644 index 8b7721475..000000000 --- a/src/eepp/window/backend/SDL/windowsdl.cpp +++ /dev/null @@ -1,407 +0,0 @@ -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - #if !defined( EE_COMPILER_MSVC ) - #include - #else - #include - #endif -#endif - -#include - -#if !defined( EE_COMPILER_MSVC ) -#include -#else -#include -#endif - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -WindowSDL::WindowSDL( WindowSettings Settings, ContextSettings Context ) : - Window( Settings, Context, eeNew( ClipboardSDL, ( this ) ), eeNew( InputSDL, ( this ) ), eeNew( CursorManagerSDL, ( this ) ) ), - mSurface( NULL ) -#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - , - mWMinfo( eeNew( SDL_SysWMinfo, () ) ) -#endif -{ - create( Settings, Context ); -} - -WindowSDL::~WindowSDL() { -#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - eeSAFE_DELETE( mWMinfo ); -#endif -} - -bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { - if ( mWindow.Created ) - return false; - - mWindow.WindowConfig = Settings; - mWindow.ContextConfig = Context; - - if ( SDL_Init( SDL_INIT_VIDEO ) != 0 ) { - eePRINTL( "Unable to initialize SDL: %s", SDL_GetError() ); - - logFailureInit( "WindowSDL", getVersion() ); - - return false; - } - - if ( "" != mWindow.WindowConfig.Icon ) { - mWindow.Created = true; - icon( mWindow.WindowConfig.Icon ); - mWindow.Created = false; - } - - const SDL_VideoInfo * videoInfo = SDL_GetVideoInfo(); - - mWindow.DesktopResolution = Sizei( videoInfo->current_w, videoInfo->current_h ); - - if ( mWindow.WindowConfig.Style & WindowStyle::UseDesktopResolution ) { - mWindow.WindowConfig.Width = mWindow.DesktopResolution.width(); - mWindow.WindowConfig.Height = mWindow.DesktopResolution.height(); - } - - mWindow.Flags = SDL_OPENGL | SDL_HWPALETTE; - - if ( mWindow.WindowConfig.Style & WindowStyle::Resize ) { - mWindow.Flags |= SDL_RESIZABLE; - } - - if ( mWindow.WindowConfig.Style & WindowStyle::NoBorder ) { - mWindow.Flags |= SDL_NOFRAME; - } - - setGLConfig(); - - Uint32 mTmpFlags = mWindow.Flags; - - if ( mWindow.WindowConfig.Style & WindowStyle::Fullscreen ) { - mTmpFlags |= SDL_FULLSCREEN; - } - - if ( SDL_VideoModeOK( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, mWindow.WindowConfig.BitsPerPixel, mTmpFlags ) ) { - mSurface = SDL_SetVideoMode( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, mWindow.WindowConfig.BitsPerPixel, mTmpFlags ); - } else { - eePRINTL( "Video Mode Unsopported for this videocard: " ); - - logFailureInit( "WindowSDL", getVersion() ); - - return false; - } - - mWindow.WindowSize = Sizei( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height ); - - if ( NULL == mSurface ) { - eePRINTL( "Unable to set video mode: %s", SDL_GetError() ); - - logFailureInit( "WindowSDL", getVersion() ); - - return false; - } - - if ( mWindow.WindowConfig.BitsPerPixel == 16 ) { - SDL_GL_SetAttribute( SDL_GL_RED_SIZE , 4 ); - SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE , 4 ); - SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE , 4 ); - SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE , 4 ); - } else { - SDL_GL_SetAttribute( SDL_GL_RED_SIZE , 8); - SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE , 8 ); - SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE , 8 ); - SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE , 8 ); - } - - if ( NULL == cGL::existsSingleton() ) { - cGL::createSingleton( mWindow.ContextConfig.Version ); - cGL::instance()->Init(); - } - - createPlatform(); - - getMainContext(); - - caption( mWindow.WindowConfig.Caption ); - - createView(); - - setup2D(); - - mWindow.Created = true; - - logSuccessfulInit( getVersion() ); - - /// Init the clipboard after the window creation - reinterpret_cast ( mClipboard )->init(); - - /// Init the input after the window creation - reinterpret_cast ( mInput )->init(); - - mCursorManager->set( SYS_CURSOR_ARROW ); - - return true; -} - -std::string WindowSDL::getVersion() { -#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - SDL_version ver = mWMinfo->version; - - return String::strFormated( "SDL %d.%d.%d", ver.major, ver.minor, ver.patch ); -#else - return String::strFormated( "SDL %d.%d.%d", SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL ); -#endif -} - -void WindowSDL::createPlatform() { - eeSAFE_DELETE( mPlatform ); -#if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - SDL_VERSION( &mWMinfo->version ); - - SDL_GetWMInfo ( mWMinfo ); -#endif - -#if defined( EE_X11_PLATFORM ) - mPlatform = eeNew( Platform::X11Impl, ( this, mWMinfo->info.x11.display, mWMinfo->info.x11.wmwindow, mWMinfo->info.x11.window, mWMinfo->info.x11.lock_func, mWMinfo->info.x11.unlock_func ) ); -#elif EE_PLATFORM == EE_PLATFORM_WIN - mPlatform = eeNew( Platform::WinImpl, ( this, GetWindowHandler() ) ); -#elif EE_PLATFORM == EE_PLATFORM_MACOSX - mPlatform = eeNew( Platform::OSXImpl, ( this ) ); -#else - Window::CreatePlatform(); -#endif -} - -void WindowSDL::setGLConfig() { - SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE , mWindow.ContextConfig.DepthBufferSize ); // Depth - SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, ( mWindow.ContextConfig.DoubleBuffering ? 1 : 0 ) ); // Double Buffering - SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, mWindow.ContextConfig.StencilBufferSize ); - - #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN - SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, ( mWindow.ContextConfig.VSync ? 1 : 0 ) ); // VSync - #endif -} - -void WindowSDL::toggleFullscreen() { - bool WasMaximized = mWindow.Maximized; - - if ( isWindowed() ) { - size( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, !isWindowed() ); - } else { - size( mWindow.WindowSize.width(), mWindow.WindowSize.height(), !isWindowed() ); - } - - if ( WasMaximized ) { - maximize(); - } - - getCursorManager()->reload(); -} - -void WindowSDL::caption( const std::string& Caption ) { - mWindow.WindowConfig.Caption = Caption; - - SDL_WM_SetCaption( Caption.c_str(), NULL ); -} - -bool WindowSDL::icon( const std::string& Path ) { - int x, y, c; - - if ( !mWindow.Created ) { - if ( stbi_info( Path.c_str(), &x, &y, &c ) ) { - mWindow.WindowConfig.Icon = Path; - - return true; - } - - return false; - } - - Image Img( Path ); - - if ( NULL != Img.GetPixelsPtr() ) { - const Uint8 * Ptr = Img.GetPixelsPtr(); - x = Img.Width(); - y = Img.Height(); - c = Img.Channels(); - - if ( ( x % 8 ) == 0 && ( y % 8 ) == 0 ) { - Uint32 rmask, gmask, bmask, amask; - #if SDL_BYTEORDER == SDL_BIG_ENDIAN - rmask = 0xff000000; - gmask = 0x00ff0000; - bmask = 0x0000ff00; - amask = 0x000000ff; - #else - rmask = 0x000000ff; - gmask = 0x0000ff00; - bmask = 0x00ff0000; - amask = 0xff000000; - #endif - SDL_Surface * TempGlyphSheet = SDL_CreateRGBSurface( SDL_SWSURFACE, x, y, c * 8, rmask, gmask, bmask, amask ); - - SDL_LockSurface( TempGlyphSheet ); - - Uint32 ssize = TempGlyphSheet->w * TempGlyphSheet->h * c; - - for ( Uint32 i=0; i < ssize; i++ ) { - ( static_cast( TempGlyphSheet->pixels ) )[i+0] = (Ptr)[i]; - } - - SDL_UnlockSurface( TempGlyphSheet ); - - SDL_WM_SetIcon( TempGlyphSheet, NULL ); - - SDL_FreeSurface( TempGlyphSheet ); - - return true; - } - } - - return false; -} - -bool WindowSDL::active() { - return 0 != ( SDL_GetAppState() & SDL_APPINPUTFOCUS ); -} - -bool WindowSDL::visible() { - return 0 != ( SDL_GetAppState() & SDL_APPACTIVE ); -} - -void WindowSDL::size( Uint32 Width, Uint32 Height, bool Windowed ) { - if ( ( !Width || !Height ) ) { - Width = mWindow.DesktopResolution.width(); - Height = mWindow.DesktopResolution.height(); - } - - if ( this->isWindowed() == Windowed && Width == mWindow.WindowConfig.Width && Height == mWindow.WindowConfig.Height ) - return; - - eePRINTL( "Switching from %s to %s. Width: %d Height %d.", this->isWindowed() ? "windowed" : "fullscreen", Windowed ? "windowed" : "fullscreen", Width, Height ); - - #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX - #if EE_PLATFORM == EE_PLATFORM_WIN - bool Reload = this->Windowed() != Windowed; - #else - bool Reload = true; - #endif - - if ( Reload ) - Graphics::TextureFactory::instance()->GrabTextures(); - #endif - - Uint32 oldWidth = mWindow.WindowConfig.Width; - Uint32 oldHeight = mWindow.WindowConfig.Height; - - mWindow.WindowConfig.Width = Width; - mWindow.WindowConfig.Height = Height; - - if ( Windowed ) { - mWindow.WindowSize = Sizei( Width, Height ); - } else { - mWindow.WindowSize = Sizei( oldWidth, oldHeight ); - } - - if ( this->isWindowed() && !Windowed ) { - mWinPos = position(); - } - - setGLConfig(); - - if ( Windowed ) { - mSurface = SDL_SetVideoMode( Width, Height, mWindow.WindowConfig.BitsPerPixel, mWindow.Flags ); - } else { - mSurface = SDL_SetVideoMode( Width, Height, mWindow.WindowConfig.BitsPerPixel, mWindow.Flags | SDL_FULLSCREEN ); - } - - #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX - if ( Reload ) { - cGL::instance()->Init(); - - Graphics::TextureFactory::instance()->UngrabTextures(); // Reload all textures - Graphics::ShaderProgramManager::instance()->Reload(); // Reload all shaders - Graphics::Private::FrameBufferManager::instance()->Reload(); // Reload all frame buffers - Graphics::Private::VertexBufferManager::instance()->Reload(); // Reload all vertex buffers - GetMainContext(); // Recover the context - CreatePlatform(); - } - #endif - - if ( !this->isWindowed() && Windowed ) { - position( mWinPos.x, mWinPos.y ); - } - - BitOp::setBitFlagValue( &mWindow.WindowConfig.Style, WindowStyle::Fullscreen, !Windowed ); - - mDefaultView.setView( 0, 0, Width, Height ); - - setup2D(); - - mCursorManager->reload(); - - sendVideoResizeCb(); - - if ( NULL == mSurface ) { - mWindow.Created = false; - } -} - -void WindowSDL::swapBuffers() { - SDL_GL_SwapBuffers(); -} - -std::vector WindowSDL::getDisplayModes() const { - SDL_Rect **modes = SDL_ListModes( NULL, SDL_OPENGL | SDL_HWPALETTE | SDL_HWACCEL | SDL_FULLSCREEN ); - - if(modes == (SDL_Rect **)0) - eePRINTL("No VideoMode Found"); - - std::vector result; - if( modes != (SDL_Rect **)-1 ) - for(unsigned int i = 0; modes[i]; ++i) - result.push_back( DisplayMode(modes[i]->w, modes[i]->h,60,0) ); - - return result; -} - -void WindowSDL::setGamma( Float Red, Float Green, Float Blue ) { - eeclamp( &Red , 0.1f, 10.0f ); - eeclamp( &Green , 0.1f, 10.0f ); - eeclamp( &Blue , 0.1f, 10.0f ); - SDL_SetGamma( Red, Green, Blue ); -} - -eeWindowHandle WindowSDL::getWindowHandler() { -#if EE_PLATFORM == EE_PLATFORM_WIN - return mWMinfo->window; -#elif defined( EE_X11_PLATFORM ) - return mWMinfo->info.x11.display; -#elif EE_PLATFORM == EE_PLATFORM_MACOSX - return mWMinfo->info.x11.display; -#else - return 0; -#endif -} - -}}}} - -#endif diff --git a/src/eepp/window/backend/SDL/windowsdl.hpp b/src/eepp/window/backend/SDL/windowsdl.hpp deleted file mode 100644 index 0854fcd37..000000000 --- a/src/eepp/window/backend/SDL/windowsdl.hpp +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef EE_WINDOWCWINDOWSDL_HPP -#define EE_WINDOWCWINDOWSDL_HPP - -#include -#include - -#ifdef EE_BACKEND_SDL_1_2 - -#include - -struct SDL_Surface; -struct SDL_SysWMinfo; - -namespace EE { namespace Window { namespace Backend { namespace SDL { - -class EE_API WindowSDL : public Window { - public: - WindowSDL( WindowSettings Settings, ContextSettings Context ); - - virtual ~WindowSDL(); - - bool create( WindowSettings Settings, ContextSettings Context ); - - void toggleFullscreen(); - - void caption( const std::string& caption ); - - bool icon( const std::string& Path ); - - bool active(); - - bool visible(); - - void size( Uint32 Width, Uint32 Height, bool Windowed ); - - std::vector getDisplayModes() const; - - void setGamma( Float Red, Float Green, Float Blue ); - - eeWindowHandle getWindowHandler(); - protected: - friend class ClipboardSDL; - - SDL_Surface * mSurface; - - #if EE_PLATFORM == EE_PLATFORM_WIN || EE_PLATFORM == EE_PLATFORM_MACOSX || defined( EE_X11_PLATFORM ) - SDL_SysWMinfo * mWMinfo; - #endif - - Vector2i mWinPos; - - void createPlatform(); - - void swapBuffers(); - - void setGLConfig(); - - std::string getVersion(); -}; - -}}}} - -#endif - -#endif diff --git a/src/eepp/window/backend/SDL2/cursorsdl2.cpp b/src/eepp/window/backend/SDL2/cursorsdl2.cpp index 30abfc79c..d83e0ee0f 100644 --- a/src/eepp/window/backend/SDL2/cursorsdl2.cpp +++ b/src/eepp/window/backend/SDL2/cursorsdl2.cpp @@ -46,13 +46,13 @@ void CursorSDL::create() { bmask = 0x00ff0000; amask = 0xff000000; #endif - SDL_Surface * TempGlyphSheet = SDL_CreateRGBSurface( SDL_SWSURFACE, mImage->Width(), mImage->Height(), mImage->Channels() * 8, rmask, gmask, bmask, amask ); + SDL_Surface * TempGlyphSheet = SDL_CreateRGBSurface( SDL_SWSURFACE, mImage->width(), mImage->height(), mImage->channels() * 8, rmask, gmask, bmask, amask ); SDL_LockSurface( TempGlyphSheet ); - Uint32 ssize = TempGlyphSheet->w * TempGlyphSheet->h * mImage->Channels(); + Uint32 ssize = TempGlyphSheet->w * TempGlyphSheet->h * mImage->channels(); - Uint8 * Ptr = mImage->GetPixels(); + Uint8 * Ptr = mImage->getPixels(); for ( Uint32 i=0; i < ssize; i++ ) { ( static_cast( TempGlyphSheet->pixels ) )[i] = Ptr[i]; diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 866271808..3488ee67c 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -229,7 +229,7 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { if ( NULL == cGL::existsSingleton() ) { cGL::createSingleton( mWindow.ContextConfig.Version ); - cGL::instance()->Init(); + cGL::instance()->init(); } createPlatform(); @@ -504,11 +504,11 @@ bool WindowSDL::icon( const std::string& Path ) { Image Img( Path ); - if ( NULL != Img.GetPixelsPtr() ) { - const Uint8 * Ptr = Img.GetPixelsPtr(); - x = Img.Width(); - y = Img.Height(); - c = Img.Channels(); + if ( NULL != Img.getPixelsPtr() ) { + const Uint8 * Ptr = Img.getPixelsPtr(); + x = Img.width(); + y = Img.height(); + c = Img.channels(); if ( ( x % 8 ) == 0 && ( y % 8 ) == 0 ) { Uint32 rmask, gmask, bmask, amask; diff --git a/src/eepp/window/backend/SFML/clipboardsfml.cpp b/src/eepp/window/backend/SFML/clipboardsfml.cpp index 76f757ce3..b49bd2c69 100644 --- a/src/eepp/window/backend/SFML/clipboardsfml.cpp +++ b/src/eepp/window/backend/SFML/clipboardsfml.cpp @@ -13,17 +13,17 @@ ClipboardSFML::ClipboardSFML( EE::Window::Window * window ) : ClipboardSFML::~ClipboardSFML() { } -void ClipboardSFML::Init() { +void ClipboardSFML::init() { } -void ClipboardSFML::SetText( const std::string& Text ) { +void ClipboardSFML::setText( const std::string& Text ) { } -std::string ClipboardSFML::GetText() { +std::string ClipboardSFML::getText() { return std::string(); } -String ClipboardSFML::GetWideText() { +String ClipboardSFML::getWideText() { return String(); } diff --git a/src/eepp/window/backend/SFML/clipboardsfml.hpp b/src/eepp/window/backend/SFML/clipboardsfml.hpp index 63f460de1..7dc70d3af 100644 --- a/src/eepp/window/backend/SFML/clipboardsfml.hpp +++ b/src/eepp/window/backend/SFML/clipboardsfml.hpp @@ -12,17 +12,17 @@ class EE_API ClipboardSFML : public Clipboard { public: virtual ~ClipboardSFML(); - std::string GetText(); + std::string getText(); - String GetWideText(); + String getWideText(); - void SetText( const std::string& Text ); + void setText( const std::string& Text ); protected: friend class WindowSFML; ClipboardSFML( EE::Window::Window * window ); - void Init(); + void init(); }; }}}} diff --git a/src/eepp/window/backend/SFML/cursormanagersfml.cpp b/src/eepp/window/backend/SFML/cursormanagersfml.cpp index db5544e48..39eab4a8f 100644 --- a/src/eepp/window/backend/SFML/cursormanagersfml.cpp +++ b/src/eepp/window/backend/SFML/cursormanagersfml.cpp @@ -17,7 +17,7 @@ CursorManagerSFML::CursorManagerSFML( EE::Window::Window * window ) : { } -Cursor * CursorManagerSFML::Create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSFML::create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN return mWindow->getPlatform()->createMouseCursor( tex, hotspot, name ); #else @@ -25,7 +25,7 @@ Cursor * CursorManagerSFML::Create( Texture * tex, const Vector2i& hotspot, cons #endif } -Cursor * CursorManagerSFML::Create( Image * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSFML::create( Image * img, const Vector2i& hotspot, const std::string& name ) { #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN return mWindow->getPlatform()->createMouseCursor( img, hotspot, name ); #else @@ -33,7 +33,7 @@ Cursor * CursorManagerSFML::Create( Image * img, const Vector2i& hotspot, const #endif } -Cursor * CursorManagerSFML::Create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSFML::create( const std::string& path, const Vector2i& hotspot, const std::string& name ) { #if defined( EE_X11_PLATFORM ) || EE_PLATFORM == EE_PLATFORM_WIN return mWindow->getPlatform()->createMouseCursor( path, hotspot, name ); #else @@ -41,31 +41,31 @@ Cursor * CursorManagerSFML::Create( const std::string& path, const Vector2i& hot #endif } -void CursorManagerSFML::Set( Cursor * cursor ) { +void CursorManagerSFML::set( Cursor * cursor ) { mWindow->getPlatform()->setMouseCursor( cursor ); } -void CursorManagerSFML::Set( EE_SYSTEM_CURSOR syscurid ) { +void CursorManagerSFML::set( EE_SYSTEM_CURSOR syscurid ) { mWindow->getPlatform()->setSystemMouseCursor( syscurid ); } -void CursorManagerSFML::Show() { - Visible( true ); +void CursorManagerSFML::show() { + visible( true ); } -void CursorManagerSFML::Hide() { - Visible( false ); +void CursorManagerSFML::hide() { + visible( false ); } -void CursorManagerSFML::Visible( bool visible ) { +void CursorManagerSFML::visible( bool visible ) { if ( visible ) { - reinterpret_cast(mWindow)->GetSFMLWindow()->setMouseCursorVisible( true ); + reinterpret_cast(mWindow)->getSFMLWindow()->setMouseCursorVisible( true ); mWindow->getPlatform()->showMouseCursor(); mVisible = true; } else { - reinterpret_cast(mWindow)->GetSFMLWindow()->setMouseCursorVisible( false ); + reinterpret_cast(mWindow)->getSFMLWindow()->setMouseCursorVisible( false ); mWindow->getPlatform()->hideMouseCursor(); @@ -73,17 +73,17 @@ void CursorManagerSFML::Visible( bool visible ) { } } -void CursorManagerSFML::Remove( Cursor * cursor, bool Delete ) { - CursorManager::Remove( cursor, Delete ); +void CursorManagerSFML::remove( Cursor * cursor, bool Delete ) { + CursorManager::remove( cursor, Delete ); } -void CursorManagerSFML::Reload() { +void CursorManagerSFML::reload() { if ( mVisible ) { - Show(); + show(); mWindow->getPlatform()->restoreCursor(); } else { - Hide(); + hide(); } } diff --git a/src/eepp/window/backend/SFML/cursormanagersfml.hpp b/src/eepp/window/backend/SFML/cursormanagersfml.hpp index ce3e18ec9..a154d4a95 100644 --- a/src/eepp/window/backend/SFML/cursormanagersfml.hpp +++ b/src/eepp/window/backend/SFML/cursormanagersfml.hpp @@ -13,25 +13,25 @@ class CursorManagerSFML : public CursorManager { public: CursorManagerSFML( EE::Window::Window * window ); - Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * create( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( Image * img, const Vector2i& hotspot, const std::string& name ); + Cursor * create( Image * img, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( const std::string& path, const Vector2i& hotspot, const std::string& name ); + Cursor * create( const std::string& path, const Vector2i& hotspot, const std::string& name ); - void Set( Cursor * cursor ); + void set( Cursor * cursor ); - void Set( EE_SYSTEM_CURSOR syscurid ); + void set( EE_SYSTEM_CURSOR syscurid ); - void Show(); + void show(); - void Hide(); + void hide(); - void Visible( bool visible ); + void visible( bool visible ); - void Remove( Cursor * cursor, bool Delete = false ); + void remove( Cursor * cursor, bool Delete = false ); - void Reload(); + void reload(); }; }}}} diff --git a/src/eepp/window/backend/SFML/inputsfml.cpp b/src/eepp/window/backend/SFML/inputsfml.cpp index 08b231ccb..783aa9a99 100644 --- a/src/eepp/window/backend/SFML/inputsfml.cpp +++ b/src/eepp/window/backend/SFML/inputsfml.cpp @@ -20,14 +20,14 @@ InputSFML::InputSFML( EE::Window::Window * window ) : InputSFML::~InputSFML() { } -void InputSFML::Update() { +void InputSFML::update() { sf::Event event; InputEvent EEEvent; WindowSFML * win = reinterpret_cast( mWindow ); - sf::Window * window = win->GetSFMLWindow(); + sf::Window * window = win->getSFMLWindow(); - CleanStates(); + cleanStates(); while ( window->pollEvent(event) ) { @@ -50,7 +50,7 @@ void InputSFML::Update() { case sf::Event::MouseButtonPressed: { EEEvent.Type = InputEvent::MouseButtonDown; - EEEvent.button.button = GetButton( event.mouseButton.button ); + EEEvent.button.button = getButton( event.mouseButton.button ); EEEvent.button.x = event.mouseButton.x; EEEvent.button.y = event.mouseButton.y; break; @@ -58,7 +58,7 @@ void InputSFML::Update() { case sf::Event::MouseButtonReleased: { EEEvent.Type = InputEvent::MouseButtonUp; - EEEvent.button.button = GetButton( event.mouseButton.button ); + EEEvent.button.button = getButton( event.mouseButton.button ); EEEvent.button.x = event.mouseButton.x; EEEvent.button.y = event.mouseButton.y; break; @@ -66,7 +66,7 @@ void InputSFML::Update() { case sf::Event::MouseMoved: { EEEvent.Type = InputEvent::MouseMotion; - Vector2i mp( win->GetInput()->GetMousePos() ); + Vector2i mp( win->getInput()->getMousePos() ); EEEvent.motion.xrel = mp.x - event.mouseMove.x; EEEvent.motion.yrel = mp.y - event.mouseMove.y; EEEvent.motion.x = event.mouseMove.x; @@ -90,7 +90,7 @@ void InputSFML::Update() { EEEvent.Type = InputEvent::MouseButtonDown; EEEvent.button.state = 1; - ProcessEvent( &EEEvent ); + processEvent( &EEEvent ); EEEvent.Type = InputEvent::MouseButtonUp; EEEvent.button.state = 0; @@ -105,7 +105,7 @@ void InputSFML::Update() { ) { EEEvent.Type = InputEvent::KeyDown; EEEvent.key.keysym.sym = KeyCodesTable[ event.key.code ]; - EEEvent.key.keysym.mod = SetMod( event.key ); + EEEvent.key.keysym.mod = setMod( event.key ); EEEvent.key.keysym.unicode = 0; } else { EEEvent.Type = InputEvent::NoEvent; @@ -117,7 +117,7 @@ void InputSFML::Update() { { EEEvent.Type = InputEvent::KeyUp; EEEvent.key.keysym.sym = KeyCodesTable[ event.key.code ]; - EEEvent.key.keysym.mod = SetMod( event.key ); + EEEvent.key.keysym.mod = setMod( event.key ); EEEvent.key.keysym.unicode = 0; break; } @@ -125,10 +125,10 @@ void InputSFML::Update() { { if ( KEY_TAB != event.text.unicode ) { EEEvent.Type = InputEvent::TextInput; - EEEvent.text.timestamp = Sys::GetTicks(); + EEEvent.text.timestamp = Sys::getTicks(); EEEvent.text.text = event.text.unicode; - ProcessEvent( &EEEvent ); + processEvent( &EEEvent ); } EEEvent.Type = InputEvent::KeyDown; @@ -158,7 +158,7 @@ void InputSFML::Update() { { EEEvent.Type = InputEvent::NoEvent; - win->VideoResize( event.size.width, event.size.height ); + win->videoResize( event.size.width, event.size.height ); break; } @@ -184,31 +184,31 @@ void InputSFML::Update() { } if ( InputEvent::NoEvent != EEEvent.Type ) { - ProcessEvent( &EEEvent ); + processEvent( &EEEvent ); } - } + } } -bool InputSFML::GrabInput() { +bool InputSFML::grabInput() { return false; } -void InputSFML::GrabInput( const bool& Grab ) { +void InputSFML::grabInput( const bool& Grab ) { } -void InputSFML::InjectMousePos( const Uint16& x, const Uint16& y ) { +void InputSFML::injectMousePos( const Uint16& x, const Uint16& y ) { WindowSFML * win = reinterpret_cast( mWindow ); - sf::Window * window = win->GetSFMLWindow(); + sf::Window * window = win->getSFMLWindow(); sf::Mouse::setPosition( sf::Vector2i( x, y ), *window ); } -void InputSFML::Init() { - InitializeTables(); +void InputSFML::init() { + initializeTables(); - mJoystickManager->Open(); + mJoystickManager->open(); } -Uint32 InputSFML::GetButton( const Uint32& sfmlBut ) { +Uint32 InputSFML::getButton( const Uint32& sfmlBut ) { switch ( sfmlBut ) { case sf::Mouse::Left: return EE_BUTTON_LEFT; case sf::Mouse::Right: return EE_BUTTON_RIGHT; @@ -220,7 +220,7 @@ Uint32 InputSFML::GetButton( const Uint32& sfmlBut ) { return EE_BUTTON_LEFT; } -Uint32 InputSFML::SetMod( sf::Event::KeyEvent& key ) { +Uint32 InputSFML::setMod( sf::Event::KeyEvent& key ) { Uint32 Ret = 0; if ( key.shift ) Ret |= KEYMOD_SHIFT; @@ -231,7 +231,7 @@ Uint32 InputSFML::SetMod( sf::Event::KeyEvent& key ) { return Ret; } -void InputSFML::InitializeTables() { +void InputSFML::initializeTables() { if ( KeyCodesTableInit ) return; diff --git a/src/eepp/window/backend/SFML/inputsfml.hpp b/src/eepp/window/backend/SFML/inputsfml.hpp index 6bebd002b..ee16e7a4e 100644 --- a/src/eepp/window/backend/SFML/inputsfml.hpp +++ b/src/eepp/window/backend/SFML/inputsfml.hpp @@ -15,13 +15,13 @@ class EE_API InputSFML : public Input { public: virtual ~InputSFML(); - void Update(); + void update(); - bool GrabInput(); + bool grabInput(); - void GrabInput( const bool& Grab ); + void grabInput( const bool& Grab ); - void InjectMousePos( const Uint16& x, const Uint16& y ); + void injectMousePos( const Uint16& x, const Uint16& y ); protected: friend class WindowSFML; @@ -29,13 +29,13 @@ class EE_API InputSFML : public Input { InputSFML( EE::Window::Window * window ); - virtual void Init(); + virtual void init(); - Uint32 GetButton( const Uint32& sfmlBut ); + Uint32 getButton( const Uint32& sfmlBut ); - Uint32 SetMod( sf::Event::KeyEvent& key ); + Uint32 setMod( sf::Event::KeyEvent& key ); - void InitializeTables(); + void initializeTables(); }; }}}} diff --git a/src/eepp/window/backend/SFML/joystickmanagersfml.cpp b/src/eepp/window/backend/SFML/joystickmanagersfml.cpp index 86c67eb85..5aeb05bd0 100644 --- a/src/eepp/window/backend/SFML/joystickmanagersfml.cpp +++ b/src/eepp/window/backend/SFML/joystickmanagersfml.cpp @@ -18,25 +18,25 @@ JoystickManagerSFML::JoystickManagerSFML() : JoystickManagerSFML::~JoystickManagerSFML() { } -void JoystickManagerSFML::Update() { +void JoystickManagerSFML::update() { } -void JoystickManagerSFML::Open() { +void JoystickManagerSFML::open() { mCount = sf::Joystick::Count; for ( unsigned int i = 0; i < mCount; i++ ) - Create(i); + create(i); mInit = true; } -void JoystickManagerSFML::Close() { +void JoystickManagerSFML::close() { mInit = false; } -void JoystickManagerSFML::Create( const Uint32& index ) { +void JoystickManagerSFML::create( const Uint32& index ) { if ( NULL != mJoysticks[ index ] ) - mJoysticks[ index ]->ReOpen(); + mJoysticks[ index ]->reOpen(); else mJoysticks[ index ] = eeNew( JoystickSFML, ( index ) ); } diff --git a/src/eepp/window/backend/SFML/joystickmanagersfml.hpp b/src/eepp/window/backend/SFML/joystickmanagersfml.hpp index 4bae5286a..4c4ea093a 100644 --- a/src/eepp/window/backend/SFML/joystickmanagersfml.hpp +++ b/src/eepp/window/backend/SFML/joystickmanagersfml.hpp @@ -13,13 +13,13 @@ class EE_API JoystickManagerSFML : public JoystickManager { virtual ~JoystickManagerSFML(); - void Update(); + void update(); - void Close(); + void close(); - void Open(); + void open(); protected: - void Create( const Uint32& index ); + void create( const Uint32& index ); }; }}}} diff --git a/src/eepp/window/backend/SFML/joysticksfml.cpp b/src/eepp/window/backend/SFML/joysticksfml.cpp index 6e41415f9..67884db56 100644 --- a/src/eepp/window/backend/SFML/joysticksfml.cpp +++ b/src/eepp/window/backend/SFML/joysticksfml.cpp @@ -13,13 +13,13 @@ JoystickSFML::JoystickSFML( const Uint32& index ) : Joystick( index ), mHat( HAT_CENTERED ) { - Open(); + open(); } JoystickSFML::~JoystickSFML() { } -void JoystickSFML::Open() { +void JoystickSFML::open() { mName = "Joystick " + String::toStr( mIndex ); mHats = 0; mButtons = eemin( sf::Joystick::getButtonCount( mIndex ), (unsigned int)32 ); @@ -29,20 +29,20 @@ void JoystickSFML::Open() { mButtonDown = mButtonDownLast = mButtonUp = 0; } -void JoystickSFML::Close() { +void JoystickSFML::close() { } -void JoystickSFML::Update() { - ClearStates(); +void JoystickSFML::update() { + clearStates(); for ( Int32 i = 0; i < mButtons; i++ ) { - UpdateButton( i, sf::Joystick::isButtonPressed( mIndex, i ) ); + updateButton( i, sf::Joystick::isButtonPressed( mIndex, i ) ); } - CalcHat(); + calcHat(); } -void JoystickSFML::CalcHat() { +void JoystickSFML::calcHat() { Float hatX = sf::Joystick::getAxisPosition( mIndex, sf::Joystick::PovX ); Float hatY = sf::Joystick::getAxisPosition( mIndex, sf::Joystick::PovY ); @@ -55,11 +55,11 @@ void JoystickSFML::CalcHat() { else if ( hatY > 0 ) mHat |= HAT_DOWN; } -Uint8 JoystickSFML::GetHat( const Int32& index ) { +Uint8 JoystickSFML::getHat( const Int32& index ) { return mHat; } -Float JoystickSFML::GetAxis( const Int32& axis ) { +Float JoystickSFML::getAxis( const Int32& axis ) { sf::Joystick::Axis raxis = sf::Joystick::X; switch ( axis ) @@ -73,11 +73,11 @@ Float JoystickSFML::GetAxis( const Int32& axis ) { return sf::Joystick::getAxisPosition( mIndex, raxis ) * 0.01; } -Vector2i JoystickSFML::GetBallMotion( const Int32& ball ) { +Vector2i JoystickSFML::getBallMotion( const Int32& ball ) { return Vector2i(); } -bool JoystickSFML::Plugged() const { +bool JoystickSFML::isPlugged() const { return sf::Joystick::isConnected( mIndex ); } diff --git a/src/eepp/window/backend/SFML/joysticksfml.hpp b/src/eepp/window/backend/SFML/joysticksfml.hpp index 751385d33..a982e4cd6 100644 --- a/src/eepp/window/backend/SFML/joysticksfml.hpp +++ b/src/eepp/window/backend/SFML/joysticksfml.hpp @@ -13,21 +13,21 @@ class EE_API JoystickSFML : public Joystick { virtual ~JoystickSFML(); - void Close(); + void close(); - void Open(); + void open(); - void Update(); + void update(); - Uint8 GetHat( const Int32& index ); + Uint8 getHat( const Int32& index ); - Float GetAxis( const Int32& axis ); + Float getAxis( const Int32& axis ); - Vector2i GetBallMotion( const Int32& ball ); + Vector2i getBallMotion( const Int32& ball ); - bool Plugged() const; + bool isPlugged() const; protected: - void CalcHat(); + void calcHat(); Uint8 mHat; }; diff --git a/src/eepp/window/backend/SFML/windowsfml.cpp b/src/eepp/window/backend/SFML/windowsfml.cpp index 52d13e4c1..d8c193b50 100644 --- a/src/eepp/window/backend/SFML/windowsfml.cpp +++ b/src/eepp/window/backend/SFML/windowsfml.cpp @@ -30,13 +30,13 @@ WindowSFML::WindowSFML( WindowSettings Settings, ContextSettings Context ) : mWinHandler( 0 ), mVisible( false ) { - Create( Settings, Context ); + create( Settings, Context ); } WindowSFML::~WindowSFML() { } -bool WindowSFML::Create( WindowSettings Settings, ContextSettings Context ) { +bool WindowSFML::create( WindowSettings Settings, ContextSettings Context ) { if ( mWindow.Created ) return false; @@ -70,45 +70,45 @@ bool WindowSFML::Create( WindowSettings Settings, ContextSettings Context ) { if ( NULL == cGL::existsSingleton() ) { cGL::createSingleton( mWindow.ContextConfig.Version ); - cGL::instance()->Init(); + cGL::instance()->init(); } - CreatePlatform(); + createPlatform(); - GetMainContext(); + getMainContext(); - CreateView(); + createView(); - Setup2D(); + setup2D(); mWindow.Created = true; mVisible = true; if ( "" != mWindow.WindowConfig.Icon ) { - Icon( mWindow.WindowConfig.Icon ); + icon( mWindow.WindowConfig.Icon ); } /// Init the clipboard after the window creation - reinterpret_cast ( mClipboard )->Init(); + reinterpret_cast ( mClipboard )->init(); /// Init the input after the window creation - reinterpret_cast ( mInput )->Init(); + reinterpret_cast ( mInput )->init(); - LogSuccessfulInit( GetVersion() ); + logSuccessfulInit( getVersion() ); return true; } -std::string WindowSFML::GetVersion() { +std::string WindowSFML::getVersion() { return std::string( "SFML 2" ); } -void WindowSFML::CreatePlatform() { +void WindowSFML::createPlatform() { #if defined( EE_X11_PLATFORM ) - if ( 0 != GetWindowHandler() ) { - mPlatform = eeNew( Platform::X11Impl, ( this, GetWindowHandler(), mSFMLWindow.getSystemHandle(), mSFMLWindow.getSystemHandle(), NULL, NULL ) ); + if ( 0 != getWindowHandler() ) { + mPlatform = eeNew( Platform::X11Impl, ( this, getWindowHandler(), mSFMLWindow.getSystemHandle(), mSFMLWindow.getSystemHandle(), NULL, NULL ) ); } else { - Window::CreatePlatform(); + Window::createPlatform(); } #elif EE_PLATFORM == EE_PLATFORM_WIN mPlatform = eeNew( Platform::WinImpl, ( this, GetWindowHandler() ) ); @@ -119,59 +119,59 @@ void WindowSFML::CreatePlatform() { #endif } -void WindowSFML::ToggleFullscreen() { +void WindowSFML::toggleFullscreen() { } -void WindowSFML::Caption( const std::string& Caption ) { +void WindowSFML::caption( const std::string& Caption ) { mWindow.WindowConfig.Caption = Caption; mSFMLWindow.setTitle( Caption ); } -bool WindowSFML::Icon( const std::string& Path ) { +bool WindowSFML::icon( const std::string& Path ) { mWindow.WindowConfig.Icon = Path; Image Img( Path ); - mSFMLWindow.setIcon( Img.Width(), Img.Height(), Img.GetPixelsPtr() ); + mSFMLWindow.setIcon( Img.width(), Img.height(), Img.getPixelsPtr() ); return true; } -void WindowSFML::Hide() { +void WindowSFML::hide() { mSFMLWindow.setVisible( false ); mVisible = false; } -void WindowSFML::Show() { +void WindowSFML::show() { mSFMLWindow.setVisible( true ); mVisible = true; } -void WindowSFML::Position( Int16 Left, Int16 Top ) { +void WindowSFML::position( Int16 Left, Int16 Top ) { mSFMLWindow.setPosition( sf::Vector2i( Left, Top ) ); } -bool WindowSFML::Active() { +bool WindowSFML::active() { return reinterpret_cast ( mInput )->mWinActive; } -bool WindowSFML::Visible() { +bool WindowSFML::visible() { return mVisible; } -Vector2i WindowSFML::Position() { +Vector2i WindowSFML::position() { sf::Vector2i v( mSFMLWindow.getPosition() ); return Vector2i( v.x, v.y ); } -void WindowSFML::Size( Uint32 Width, Uint32 Height, bool Windowed ) { +void WindowSFML::size( Uint32 Width, Uint32 Height, bool Windowed ) { if ( ( !Width || !Height ) ) { - Width = mWindow.DesktopResolution.Width(); - Height = mWindow.DesktopResolution.Height(); + Width = mWindow.DesktopResolution.width(); + Height = mWindow.DesktopResolution.height(); } - if ( this->Windowed() == Windowed && Width == mWindow.WindowConfig.Width && Height == mWindow.WindowConfig.Height ) + if ( this->isWindowed() == Windowed && Width == mWindow.WindowConfig.Width && Height == mWindow.WindowConfig.Height ) return; sf::Vector2u v( Width, Height ); @@ -179,24 +179,24 @@ void WindowSFML::Size( Uint32 Width, Uint32 Height, bool Windowed ) { mSFMLWindow.setSize( v ); } -void WindowSFML::VideoResize( Uint32 Width, Uint32 Height ) { +void WindowSFML::videoResize( Uint32 Width, Uint32 Height ) { mWindow.WindowConfig.Width = Width; mWindow.WindowConfig.Height = Height; - mDefaultView.SetView( 0, 0, Width, Height ); + mDefaultView.setView( 0, 0, Width, Height ); - Setup2D(); + setup2D(); - mCursorManager->Reload(); + mCursorManager->reload(); - SendVideoResizeCb(); + sendVideoResizeCb(); } -void WindowSFML::SwapBuffers() { +void WindowSFML::swapBuffers() { mSFMLWindow.display(); } -std::vector WindowSFML::GetDisplayModes() const { +std::vector WindowSFML::getDisplayModes() const { std::vector result; std::vector modes = sf::VideoMode::getFullscreenModes(); @@ -204,23 +204,23 @@ std::vector WindowSFML::GetDisplayModes() const { for (std::size_t i = 0; i < modes.size(); ++i) { sf::VideoMode mode = modes[i]; - result.push_back( DisplayMode( mode.width, mode.height, 60, x ) ); + result.push_back( DisplayMode( mode.width, mode.height, 60, 0 ) ); } return result; } -void WindowSFML::SetGamma( Float Red, Float Green, Float Blue ) { +void WindowSFML::setGamma( Float Red, Float Green, Float Blue ) { } -eeWindowContex WindowSFML::GetContext() const { +eeWindowContex WindowSFML::getContext() const { return 0; } -void WindowSFML::GetMainContext() { +void WindowSFML::getMainContext() { } -eeWindowHandle WindowSFML::GetWindowHandler() { +eeWindowHandle WindowSFML::getWindowHandler() { #if defined( EE_X11_PLATFORM ) if ( 0 == mWinHandler ) { #ifdef EE_SUPPORT_EXCEPTIONS @@ -244,10 +244,10 @@ eeWindowHandle WindowSFML::GetWindowHandler() { #endif } -void WindowSFML::SetDefaultContext() { +void WindowSFML::setDefaultContext() { } -sf::Window * WindowSFML::GetSFMLWindow() { +sf::Window * WindowSFML::getSFMLWindow() { return &mSFMLWindow; } diff --git a/src/eepp/window/backend/SFML/windowsfml.hpp b/src/eepp/window/backend/SFML/windowsfml.hpp index 3f554d6b6..8c96bd4f2 100644 --- a/src/eepp/window/backend/SFML/windowsfml.hpp +++ b/src/eepp/window/backend/SFML/windowsfml.hpp @@ -18,39 +18,39 @@ class EE_API WindowSFML : public Window { virtual ~WindowSFML(); - bool Create( WindowSettings Settings, ContextSettings Context ); + bool create( WindowSettings Settings, ContextSettings Context ); - void ToggleFullscreen(); + void toggleFullscreen(); - void Caption( const std::string& Caption ); + void caption( const std::string& caption ); - bool Icon( const std::string& Path ); + bool icon( const std::string& Path ); - void Hide(); + void hide(); - void Show(); + void show(); - void Position( Int16 Left, Int16 Top ); + void position( Int16 Left, Int16 Top ); - bool Active(); + bool active(); - bool Visible(); + bool visible(); - Vector2i Position(); + Vector2i position(); - void Size( Uint32 Width, Uint32 Height, bool Windowed ); + void size( Uint32 Width, Uint32 Height, bool Windowed ); - std::vector GetDisplayModes() const; + std::vector getDisplayModes() const; - void SetGamma( Float Red, Float Green, Float Blue ); + void setGamma( Float Red, Float Green, Float Blue ); - eeWindowContex GetContext() const; + eeWindowContex getContext() const; - eeWindowHandle GetWindowHandler(); + eeWindowHandle getWindowHandler(); - void SetDefaultContext(); + void setDefaultContext(); - sf::Window * GetSFMLWindow(); + sf::Window * getSFMLWindow(); protected: friend class ClipboardSFML; friend class InputSFML; @@ -61,15 +61,15 @@ class EE_API WindowSFML : public Window { bool mVisible; - void CreatePlatform(); + void createPlatform(); - void SwapBuffers(); + void swapBuffers(); - void GetMainContext(); + void getMainContext(); - std::string GetVersion(); + std::string getVersion(); - void VideoResize( Uint32 Width, Uint32 Height ); + void videoResize( Uint32 Width, Uint32 Height ); }; }}}} diff --git a/src/eepp/window/cursor.cpp b/src/eepp/window/cursor.cpp index e6ff3cdab..aeea1523e 100644 --- a/src/eepp/window/cursor.cpp +++ b/src/eepp/window/cursor.cpp @@ -9,10 +9,10 @@ Cursor::Cursor( Texture * tex, const Vector2i& hotspot, const std::string& name, mHotSpot( hotspot ), mWindow( window ) { - if ( NULL != tex && tex->Lock() ) { - mImage = eeNew( Graphics::Image, ( tex->GetPixelsPtr(), tex->Width(), tex->Height(), tex->Channels() ) ); + if ( NULL != tex && tex->lock() ) { + mImage = eeNew( Graphics::Image, ( tex->getPixelsPtr(), tex->width(), tex->height(), tex->channels() ) ); - tex->Unlock(); + tex->unlock(); } else { eePRINTL( "Cursor::Cursor: Error creating cursor from Texture." ); } @@ -25,8 +25,8 @@ Cursor::Cursor( Graphics::Image * img, const Vector2i& hotspot, const std::strin mHotSpot( hotspot ), mWindow( window ) { - if ( img->MemSize() ) { - mImage = eeNew( Graphics::Image, ( img->GetPixelsPtr(), img->Width(), img->Height(), img->Channels() ) ); + if ( img->memSize() ) { + mImage = eeNew( Graphics::Image, ( img->getPixelsPtr(), img->width(), img->height(), img->channels() ) ); } else { eePRINTL( "Cursor::Cursor: Error creating cursor from Image." ); } @@ -41,7 +41,7 @@ Cursor::Cursor( const std::string& path, const Vector2i& hotspot, const std::str { mImage = eeNew( Graphics::Image, ( path ) ); - if ( NULL == mImage->GetPixels() ) { + if ( NULL == mImage->getPixels() ) { eePRINTL( "Cursor::Cursor: Error creating cursor from path." ); } } diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index c82400268..7577d78b4 100755 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -14,21 +14,17 @@ #include #include #include -#include #include #include #include -#define BACKEND_SDL 1 -#define BACKEND_SDL2 2 -#define BACKEND_SFML 3 +#define BACKEND_SDL2 1 +#define BACKEND_SFML 2 #ifndef DEFAULT_BACKEND #if defined( EE_BACKEND_SDL2 ) #define DEFAULT_BACKEND BACKEND_SDL2 -#elif defined( EE_BACKEND_SDL_1_2 ) -#define DEFAULT_BACKEND BACKEND_SDL #elif defined( EE_BACKEND_SFML_ACTIVE ) #define DEFAULT_BACKEND BACKEND_SFML #endif @@ -94,14 +90,6 @@ void Engine::destroy() { mWindow = NULL; } -Backend::WindowBackend * Engine::createSDLBackend( const WindowSettings &Settings ) { -#if defined( EE_SDL_VERSION_1_2 ) - return eeNew( Backend::SDL::WindowBackendSDL, () ); -#else - return NULL; -#endif -} - Backend::WindowBackend * Engine::createSDL2Backend( const WindowSettings &Settings ) { #if defined( EE_SDL_VERSION_2 ) return eeNew( Backend::SDL2::WindowBackendSDL2, () ); @@ -118,18 +106,6 @@ Backend::WindowBackend * Engine::createSFMLBackend( const WindowSettings &Settin #endif } -EE::Window::Window * Engine::createSDLWindow( const WindowSettings& Settings, const ContextSettings& Context ) { -#if defined( EE_SDL_VERSION_1_2 ) - if ( NULL == mBackend ) { - mBackend = createSDLBackend( Settings ); - } - - return eeNew( Backend::SDL::WindowSDL, ( Settings, Context ) ); -#else - return NULL; -#endif -} - EE::Window::Window * Engine::createSDL2Window( const WindowSettings& Settings, const ContextSettings& Context ) { #if defined( EE_SDL_VERSION_2 ) if ( NULL == mBackend ) { @@ -146,7 +122,7 @@ EE::Window::Window * Engine::createSFMLWindow( const WindowSettings& Settings, c #if defined( EE_BACKEND_SFML_ACTIVE ) if ( NULL == mBackend ) { - mBackend = CreateSFMLBackend( Settings ); + mBackend = createSFMLBackend( Settings ); } return eeNew( Backend::SFML::WindowSFML, ( Settings, Context ) ); @@ -156,12 +132,10 @@ EE::Window::Window * Engine::createSFMLWindow( const WindowSettings& Settings, c } EE::Window::Window * Engine::createDefaultWindow( const WindowSettings& Settings, const ContextSettings& Context ) { -#if DEFAULT_BACKEND == BACKEND_SDL - return createSDLWindow( Settings, Context ); -#elif DEFAULT_BACKEND == BACKEND_SDL2 +#if DEFAULT_BACKEND == BACKEND_SDL2 return createSDL2Window( Settings, Context ); #elif DEFAULT_BACKEND == BACKEND_SFML - return CreateSFMLWindow( Settings, Context ); + return createSFMLWindow( Settings, Context ); #endif } @@ -175,7 +149,6 @@ EE::Window::Window * Engine::createWindow( WindowSettings Settings, ContextSetti } switch ( Settings.Backend ) { - case WindowBackend::SDL: window = createSDLWindow( Settings, Context ); break; case WindowBackend::SDL2: window = createSDL2Window( Settings, Context ); break; case WindowBackend::SFML: window = createSFMLWindow( Settings, Context ); break; case WindowBackend::Default: @@ -259,9 +232,7 @@ const Uint32& Engine::getHeight() const { } Uint32 Engine::getDefaultBackend() const { -#if DEFAULT_BACKEND == BACKEND_SDL - return WindowBackend::SDL; -#elif DEFAULT_BACKEND == BACKEND_SDL2 +#if DEFAULT_BACKEND == BACKEND_SDL2 return WindowBackend::SDL2; #elif DEFAULT_BACKEND == BACKEND_SFML return WindowBackend::SFML; @@ -285,7 +256,6 @@ WindowSettings Engine::createWindowSettings( IniFile * ini, std::string iniKeyNa String::toLowerInPlace( Backend ); if ( "sdl2" == Backend ) WinBackend = WindowBackend::SDL2; - else if ( "sdl" == Backend ) WinBackend = WindowBackend::SDL; else if ( "sfml" == Backend ) WinBackend = WindowBackend::SFML; Uint32 Style = WindowStyle::Titlebar; @@ -301,13 +271,6 @@ WindowSettings Engine::createWindowSettings( IniFile * ini, std::string iniKeyNa WindowSettings WinSettings( Width, Height, Caption, Style, WinBackend, BitColor, Icon ); - #if EE_PLATFORM == EE_PLATFORM_IOS - //! @TODO: Check if SDL2 default win settings are being forced ( it wasn't working fine some time ago ) - WinSettings.Width = 960; - WinSettings.Height = 640; - WinSettings.Style = WindowStyle::NoBorder; - #endif - return WinSettings; } diff --git a/src/eepp/window/platform/x11/cursorx11.cpp b/src/eepp/window/platform/x11/cursorx11.cpp index be4587292..e4dfa9228 100644 --- a/src/eepp/window/platform/x11/cursorx11.cpp +++ b/src/eepp/window/platform/x11/cursorx11.cpp @@ -42,21 +42,21 @@ CursorX11::~CursorX11() { } void CursorX11::create() { - if ( NULL == mImage || 0 == mImage->MemSize() ) + if ( NULL == mImage || 0 == mImage->memSize() ) return; XcursorImage * image; unsigned int c, ix, iy; - image = XcursorImageCreate( mImage->Width(), mImage->Height() ); + image = XcursorImageCreate( mImage->width(), mImage->height() ); if ( image == None ) return; c = 0; - for ( iy = 0; iy < mImage->Height(); iy++ ) { - for ( ix = 0; ix < mImage->Width(); ix++ ) { - ColorA C = mImage->GetPixel( ix, iy ); + for ( iy = 0; iy < mImage->height(); iy++ ) { + for ( ix = 0; ix < mImage->width(); ix++ ) { + ColorA C = mImage->getPixel( ix, iy ); image->pixels[c++] = ( C.a() << 24 ) | ( C.r() << 16 ) | ( C.g() <<8 ) | ( C.b() ); } diff --git a/src/eepp/window/window.cpp b/src/eepp/window/window.cpp index 594938a73..9a7267c5b 100644 --- a/src/eepp/window/window.cpp +++ b/src/eepp/window/window.cpp @@ -91,17 +91,17 @@ bool Window::isResizeable() const { } void Window::set2DProjection( const Uint32& Width, const Uint32& Height ) { - GLi->MatrixMode( GL_PROJECTION ); - GLi->LoadIdentity(); + GLi->matrixMode( GL_PROJECTION ); + GLi->loadIdentity(); - GLi->Ortho( 0.0f, Width, Height, 0.0f, -1000.0f, 1000.0f ); + GLi->ortho( 0.0f, Width, Height, 0.0f, -1000.0f, 1000.0f ); - GLi->MatrixMode( GL_MODELVIEW ); - GLi->LoadIdentity(); + GLi->matrixMode( GL_MODELVIEW ); + GLi->loadIdentity(); } void Window::setViewport( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height, const bool& UpdateProjectionMatrix ) { - GLi->Viewport( x, getHeight() - ( y + Height ), Width, Height ); + GLi->viewport( x, getHeight() - ( y + Height ), Width, Height ); if ( UpdateProjectionMatrix ) { set2DProjection( Width, Height ); @@ -129,18 +129,18 @@ void Window::createView() { } void Window::setup2D( const bool& KeepView ) { - GLi->PixelStorei( GL_UNPACK_ALIGNMENT, 1 ); - GLi->PixelStorei( GL_PACK_ALIGNMENT, 1 ); + GLi->pixelStorei( GL_UNPACK_ALIGNMENT, 1 ); + GLi->pixelStorei( GL_PACK_ALIGNMENT, 1 ); backColor( mWindow.BackgroundColor ); - GLi->LineSmooth(); + GLi->lineSmooth(); - GLi->Enable ( GL_TEXTURE_2D ); // Enable Textures - GLi->Disable( GL_DEPTH_TEST ); + GLi->enable ( GL_TEXTURE_2D ); // Enable Textures + GLi->disable( GL_DEPTH_TEST ); - if ( GLv_2 == GLi->Version() || GLv_ES1 == GLi->Version() ) { - GLi->Disable( GL_LIGHTING ); + if ( GLv_2 == GLi->version() || GLv_ES1 == GLi->version() ) { + GLi->disable( GL_LIGHTING ); } if ( !KeepView ) { @@ -151,17 +151,17 @@ void Window::setup2D( const bool& KeepView ) { BlendMode::SetMode( ALPHA_NORMAL, true ); - if ( GLv_3 != GLi->Version() ) { + if ( GLv_3 != GLi->version() ) { #if !defined( EE_GLES2 ) || defined( EE_GLES_BOTH ) - GLi->TexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); - GLi->TexEnvi( GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE ); + GLi->texEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); + GLi->texEnvi( GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE ); #endif } - if ( GLv_2 == GLi->Version() || GLv_ES1 == GLi->Version() ) { - GLi->EnableClientState( GL_VERTEX_ARRAY ); - GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); - GLi->EnableClientState( GL_COLOR_ARRAY ); + if ( GLv_2 == GLi->version() || GLv_ES1 == GLi->version() ) { + GLi->enableClientState( GL_VERTEX_ARRAY ); + GLi->enableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->enableClientState( GL_COLOR_ARRAY ); } } @@ -171,7 +171,7 @@ const WindowInfo * Window::getWindowInfo() const { void Window::backColor( const RGB& Color ) { mWindow.BackgroundColor = Color; - GLi->ClearColor( static_cast( mWindow.BackgroundColor.r() ) / 255.0f, static_cast( mWindow.BackgroundColor.g() ) / 255.0f, static_cast( mWindow.BackgroundColor.b() ) / 255.0f, 255.0f ); + GLi->clearColor( static_cast( mWindow.BackgroundColor.r() ) / 255.0f, static_cast( mWindow.BackgroundColor.g() ) / 255.0f, static_cast( mWindow.BackgroundColor.b() ) / 255.0f, 255.0f ); } const RGB& Window::backColor() const { @@ -179,7 +179,7 @@ const RGB& Window::backColor() const { } bool Window::takeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); bool CreateNewFile = false; std::string File, Ext; @@ -203,7 +203,7 @@ bool Window::takeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) if ( !FileSystem::isDirectory( filepath ) ) FileSystem::makeDir( filepath ); - Ext = "." + Image::SaveTypeToExtension( Format ); + Ext = "." + Image::saveTypeToExtension( Format ); while ( !find && FileNum < 10000 ) { TmpPath = String::strFormated( "%s%05d%s", filepath.c_str(), FileNum, Ext.c_str() ); @@ -303,11 +303,11 @@ void Window::viewCheckUpdate() { } void Window::clear() { - GLi->Clear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); + GLi->clear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ); } void Window::display( bool clear ) { - GlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->draw(); if ( mCurrentView->needUpdate() ) setView( *mCurrentView ); @@ -327,24 +327,24 @@ void Window::display( bool clear ) { } void Window::clipEnable( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height ) { - GlobalBatchRenderer::instance()->Draw(); - GLi->Scissor( x, getHeight() - ( y + Height ), Width, Height ); - GLi->Enable( GL_SCISSOR_TEST ); + GlobalBatchRenderer::instance()->draw(); + GLi->scissor( x, getHeight() - ( y + Height ), Width, Height ); + GLi->enable( GL_SCISSOR_TEST ); } void Window::clipDisable() { - GlobalBatchRenderer::instance()->Draw(); - GLi->Disable( GL_SCISSOR_TEST ); + GlobalBatchRenderer::instance()->draw(); + GLi->disable( GL_SCISSOR_TEST ); } void Window::clipPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { - GlobalBatchRenderer::instance()->Draw(); - GLi->Clip2DPlaneEnable( x, y, Width, Height ); + GlobalBatchRenderer::instance()->draw(); + GLi->clip2DPlaneEnable( x, y, Width, Height ); } void Window::clipPlaneDisable() { - GlobalBatchRenderer::instance()->Draw(); - GLi->Clip2DPlaneDisable(); + GlobalBatchRenderer::instance()->draw(); + GLi->clip2DPlaneDisable(); } Clipboard * Window::getClipboard() const { @@ -385,13 +385,13 @@ void Window::logSuccessfulInit(const std::string& BackendName , const std::strin "\n\tProcess Path: " + ( !ProcessPath.empty() ? ProcessPath : Sys::getProcessPath() ) + "\n\tDisk Free Space: " + String::toStr( FileSystem::sizeToString( Sys::getDiskFreeSpace( Sys::getProcessPath() ) ) ) + "\n\tWindow/Input Backend: " + BackendName + - "\n\tGL Backend: " + GLi->VersionStr() + - "\n\tGL Vendor: " + GLi->GetVendor() + - "\n\tGL Renderer: " + GLi->GetRenderer() + - "\n\tGL Version: " + GLi->GetVersion() + - "\n\tGL Shading Language Version: " + GLi->GetShadingLanguageVersion() + + "\n\tGL Backend: " + GLi->versionStr() + + "\n\tGL Vendor: " + GLi->getVendor() + + "\n\tGL Renderer: " + GLi->getRenderer() + + "\n\tGL Version: " + GLi->getVersion() + + "\n\tGL Shading Language Version: " + GLi->getShadingLanguageVersion() + "\n\tResolution: " + String::toStr( getWidth() ) + "x" + String::toStr( getHeight() ) + - "\n\tGL extensions supported:\n\t\t" + GLi->GetExtensions() + "\n\tGL extensions supported:\n\t\t" + GLi->getExtensions() ); #ifndef EE_SILENT diff --git a/src/examples/empty_window/empty_window.cpp b/src/examples/empty_window/empty_window.cpp index a2db988c9..cee33e92d 100644 --- a/src/examples/empty_window/empty_window.cpp +++ b/src/examples/empty_window/empty_window.cpp @@ -19,7 +19,7 @@ void MainLoop() Primitives p; // Change the color - p.SetColor( ColorA( 0, 255, 0, 150 ) ); + p.setColor( ColorA( 0, 255, 0, 150 ) ); // Update the input win->getInput()->update(); @@ -45,19 +45,19 @@ void MainLoop() Vector2f winCenter( win->getWidth() * 0.5f, win->getHeight() * 0.5f ); - GLi->Enable(GL_STENCIL_TEST); - GLi->StencilMask(0xFF); - GLi->StencilFunc(GL_NEVER, 1, 0xFF); - GLi->StencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); + GLi->enable(GL_STENCIL_TEST); + GLi->stencilMask(0xFF); + GLi->stencilFunc(GL_NEVER, 1, 0xFF); + GLi->stencilOp(GL_REPLACE, GL_KEEP, GL_KEEP); - p.DrawCircle( winCenter, 150, 40 ); + p.drawCircle( winCenter, 150, 40 ); - GLi->StencilFunc(GL_EQUAL, 0, 0xFF); + GLi->stencilFunc(GL_EQUAL, 0, 0xFF); // Draw a circle - p.DrawArc( winCenter, 200, 40, circ, circ2 ); + p.drawArc( winCenter, 200, 40, circ, circ2 ); - GLi->Disable(GL_STENCIL_TEST); + GLi->disable(GL_STENCIL_TEST); /* GLi->Enable(GL_STENCIL_TEST); @@ -95,7 +95,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Set window background color win->backColor( RGB( 50, 50, 50 ) ); - GLi->PolygonMode( ); + GLi->polygonMode( ); // Set the MainLoop function and run it // This is the application loop, it will loop until the window is closed. diff --git a/src/examples/external_shader/external_shader.cpp b/src/examples/external_shader/external_shader.cpp index 6ab06feaf..b0fc1f127 100644 --- a/src/examples/external_shader/external_shader.cpp +++ b/src/examples/external_shader/external_shader.cpp @@ -50,40 +50,40 @@ void videoResize( EE::Window::Window * w ) { }; /// Load the our default projection - GLi->MatrixMode( GL_PROJECTION ); - GLi->LoadMatrixf( perspectiveMatrix ); - GLi->MatrixMode( GL_MODELVIEW ); + GLi->matrixMode( GL_PROJECTION ); + GLi->loadMatrixf( perspectiveMatrix ); + GLi->matrixMode( GL_MODELVIEW ); /// eepp enables some client states by default, and textures by default - GLi->Disable( GL_TEXTURE_2D ); - GLi->DisableClientState( GL_TEXTURE_COORD_ARRAY ); + GLi->disable( GL_TEXTURE_2D ); + GLi->disableClientState( GL_TEXTURE_COORD_ARRAY ); /// GL_VERTEX_ARRAY and GL_COLOR_ARRAY are needed, so we keep them enabled - GLi->EnableClientState( GL_VERTEX_ARRAY ); - GLi->EnableClientState( GL_COLOR_ARRAY ); + GLi->enableClientState( GL_VERTEX_ARRAY ); + GLi->enableClientState( GL_COLOR_ARRAY ); /// Reset the default blend func ( by default eepp use ALPHA_NORMAL ) BlendMode::SetMode( ALPHA_BLENDONE ); /// Set the line width - GlobalBatchRenderer::instance()->SetLineWidth( 2 ); + GlobalBatchRenderer::instance()->setLineWidth( 2 ); if ( ShadersSupported ) { /// Rebind the Shader - shaderProgram->Bind(); + shaderProgram->bind(); /// If you want to use the programmable-pipeline renderer you'll need to set up the projection and modelview matrix manually. /// Or if you want to use another name to the projection matrix or the modelview matrix ( eepp programmable-pipeline use /// dgl_ProjectionMatrix and dgl_ModelViewMatrix by default. - if ( GLv_2 == GLi->Version() ) { - shaderProgram->SetUniformMatrix( "dgl_ProjectionMatrix", perspectiveMatrix ); + if ( GLv_2 == GLi->version() ) { + shaderProgram->setUniformMatrix( "dgl_ProjectionMatrix", perspectiveMatrix ); /// Get the identity matrix and set it to the modelview matrix float modelMatrix[16]; - GLi->LoadIdentity(); - GLi->GetCurrentMatrix( GL_MODELVIEW_MATRIX, modelMatrix ); + GLi->loadIdentity(); + GLi->getCurrentMatrix( GL_MODELVIEW_MATRIX, modelMatrix ); - shaderProgram->SetUniformMatrix( "dgl_ModelViewMatrix", modelMatrix ); + shaderProgram->setUniformMatrix( "dgl_ModelViewMatrix", modelMatrix ); } } } @@ -186,13 +186,13 @@ void MainLoop() /// VertexPointer assigns values by default to the attribute "dgl_Vertex" /// TextureCoordPointer to "dgl_MultiTexCoord0" - GLi->VertexPointer( 3, GL_FLOAT, sizeof(Vector3ff), reinterpret_cast ( &vertices[0] ), ParticlesNum * sizeof(float) * 3 ); + GLi->vertexPointer( 3, GL_FLOAT, sizeof(Vector3ff), reinterpret_cast ( &vertices[0] ), ParticlesNum * sizeof(float) * 3 ); /// ColorPointer to "dgl_FrontColor" - GLi->ColorPointer( 4, GL_FP, sizeof(ColorAf), reinterpret_cast ( &colors[0] ), ParticlesNum * sizeof(Float) * 4 ); + GLi->colorPointer( 4, GL_FP, sizeof(ColorAf), reinterpret_cast ( &colors[0] ), ParticlesNum * sizeof(Float) * 4 ); /// Draw the lines - GLi->DrawArrays( DM_LINES, 0, ParticlesNum ); + GLi->drawArrays( DM_LINES, 0, ParticlesNum ); /// Stop the simulation if the window is not visible while ( !win->visible() ) { @@ -210,14 +210,14 @@ EE_MAIN_FUNC int main (int argc, char * argv []) if ( win->created() ) { /// This will work without shaders too - ShadersSupported = GLi->ShadersSupported(); + ShadersSupported = GLi->shadersSupported(); imp = win->getInput(); /// We really don't need shaders for this, but the purpose of the example is to show how to work with external shaders if ( ShadersSupported ) { /// Disable the automatic shader conversion from fixed-pipeline to programmable-pipeline - Shader::Ensure( false ); + Shader::ensure( false ); std::string fs( "#ifdef GL_ES\n\ precision highp float;\n\ @@ -240,7 +240,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) /// Since fixed-pipeline OpenGL use gl_FrontColor for glColorPointer, we need to replace the color attribute /// This is all to show how it works, in a real world scenario, you will choose to work fixed-pipeline or programmable-pipeline. - if ( GLi->Version() == GLv_2 ) { + if ( GLi->version() == GLv_2 ) { String::replaceAll( fs, "gl_FragColor = dgl_Color", "gl_FragColor = gl_FrontColor" ); } diff --git a/src/examples/fonts/fonts.cpp b/src/examples/fonts/fonts.cpp index fc142174a..01df92d39 100644 --- a/src/examples/fonts/fonts.cpp +++ b/src/examples/fonts/fonts.cpp @@ -25,21 +25,21 @@ void MainLoop() Float YPos = 32; // Draw the text on screen - TTF->Draw( win->getWidth() * 0.5f - TTF->GetTextWidth() * 0.5f, YPos ); + TTF->draw( win->getWidth() * 0.5f - TTF->getTextWidth() * 0.5f, YPos ); - TTFO->Draw( win->getWidth() * 0.5f - TTFO->GetTextWidth() * 0.5f, ( YPos += TTF->GetTextHeight() + 24 ) ); + TTFO->draw( win->getWidth() * 0.5f - TTFO->getTextWidth() * 0.5f, ( YPos += TTF->getTextHeight() + 24 ) ); - TTF2->Draw( win->getWidth() * 0.5f - TTF2->GetTextWidth() * 0.5f, ( YPos += TTF->GetTextHeight() + 24 ) ); + TTF2->draw( win->getWidth() * 0.5f - TTF2->getTextWidth() * 0.5f, ( YPos += TTF->getTextHeight() + 24 ) ); - TexF->Draw( win->getWidth() * 0.5f - TexF->GetTextWidth() * 0.5f, ( YPos += TTF2->GetTextHeight() + 24 ) ); + TexF->draw( win->getWidth() * 0.5f - TexF->getTextWidth() * 0.5f, ( YPos += TTF2->getTextHeight() + 24 ) ); - TexF2->Draw( win->getWidth() * 0.5f - TexF2->GetTextWidth() * 0.5f, ( YPos += TexF->GetTextHeight() + 24 ) ); + TexF2->draw( win->getWidth() * 0.5f - TexF2->getTextWidth() * 0.5f, ( YPos += TexF->getTextHeight() + 24 ) ); // Draw the cached text - TxtCache->Draw( 48, ( YPos += TexF2->GetTextHeight() + 24 ) ); + TxtCache->draw( 48, ( YPos += TexF2->getTextHeight() + 24 ) ); // Text rotated and scaled - TTF->Draw( win->getWidth() * 0.5f - TTF->GetTextWidth() * 0.5f, 512, FONT_DRAW_LEFT, Vector2f( 0.75f, 0.75f ), 12.5f ); + TTF->draw( win->getWidth() * 0.5f - TTF->getTextWidth() * 0.5f, 512, FONT_DRAW_LEFT, Vector2f( 0.75f, 0.75f ), 12.5f ); // Draw frame win->display(); @@ -66,61 +66,61 @@ EE_MAIN_FUNC int main (int argc, char * argv []) TexF2 = TextureFont::New( "conchars" ); // Load the TTF font - TTF->Load( AppPath + "assets/fonts/DejaVuSansMono.ttf", 18, TTF_STYLE_NORMAL, 128, RGB(255,255,255), 3, RGB(0,0,0), true ); + TTF->load( AppPath + "assets/fonts/DejaVuSansMono.ttf", 18, TTF_STYLE_NORMAL, 128, RGB(255,255,255), 3, RGB(0,0,0), true ); // Change the default method to use for outlining the font glyphs TTFFont::OutlineMethod = TTFFont::OutlineFreetype; // Create the exact same font than before but using the new outlining method - TTFO->Load( AppPath + "assets/fonts/DejaVuSansMono.ttf", 18, TTF_STYLE_NORMAL, 128, RGB(255,255,255), 3, RGB(0,0,0), true ); + TTFO->load( AppPath + "assets/fonts/DejaVuSansMono.ttf", 18, TTF_STYLE_NORMAL, 128, RGB(255,255,255), 3, RGB(0,0,0), true ); - TTF2->Load( AppPath + "assets/fonts/DejaVuSansMono.ttf", 24, TTF_STYLE_NORMAL, 128, RGB(255,255,255), 0, RGB(0,0,0), true ); + TTF2->load( AppPath + "assets/fonts/DejaVuSansMono.ttf", 24, TTF_STYLE_NORMAL, 128, RGB(255,255,255), 0, RGB(0,0,0), true ); // Save the TTF font so then it can be loaded as a TextureFont - TTF->Save( AppPath + "assets/temp/DejaVuSansMono.png", AppPath + "assets/temp/DejaVuSansMono.fnt" ); + TTF->save( AppPath + "assets/temp/DejaVuSansMono.png", AppPath + "assets/temp/DejaVuSansMono.fnt" ); // Load the texture font, previusly generated from a True Type Font // First load the texture - Uint32 TexFid = TextureFactory::instance()->Load( AppPath + "assets/fonts/ProggySquareSZ.png" ); - TexF->Load( TexFid, AppPath + "assets/fonts/ProggySquareSZ.dat" ); + Uint32 TexFid = TextureFactory::instance()->load( AppPath + "assets/fonts/ProggySquareSZ.png" ); + TexF->load( TexFid, AppPath + "assets/fonts/ProggySquareSZ.dat" ); // Load a monospaced texture font from image ( using the texture loader to set the color key ) TextureLoader TexLoader( AppPath + "assets/fonts/conchars.png" ); - TexLoader.SetColorKey( RGB(0,0,0) ); + TexLoader.setColorKey( RGB(0,0,0) ); TexLoader.load();; - TexF2->Load( TexLoader.Id(), 32 ); + TexF2->load( TexLoader.getId(), 32 ); // Set a text to render - TTF->SetText( "Lorem ipsum dolor sit amet, consectetur adipisicing elit." ); - TTFO->SetText( TTF->GetText() ); - TTF2->SetText( TTF->GetText() ); - TexF->SetText( TTF->GetText() ); - TexF2->SetText( TTF->GetText() ); + TTF->setText( "Lorem ipsum dolor sit amet, consectetur adipisicing elit." ); + TTFO->setText( TTF->getText() ); + TTF2->setText( TTF->getText() ); + TexF->setText( TTF->getText() ); + TexF2->setText( TTF->getText() ); // Set the font color - TTF2->Color( RGB(0,0,0) ); - TexF->Color( RGB(0,0,0) ); + TTF2->color( RGB(0,0,0) ); + TexF->color( RGB(0,0,0) ); // Create a new text string String Txt( "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." ); // Make the text fit the screen width ( wrap the text ) - TTF2->ShrinkText( Txt, win->getWidth() - 96 ); + TTF2->shrinkText( Txt, win->getWidth() - 96 ); // Create a new text cache to draw on screen // The cached text will TxtCache = eeNew( TextCache, ( TTF2, Txt, ColorA(0,0,0,255) ) ); // Set the text cache to be centered - TxtCache->Flags( FONT_DRAW_CENTER ); + TxtCache->flags( FONT_DRAW_CENTER ); // Set the font color to a substring of the text // To be able to set the color of the font, create the font as white // Create a gradient - size_t size = TxtCache->Text().size(); + size_t size = TxtCache->text().size(); for ( size_t i = 0; i < size; i++ ) { - TxtCache->Color( ColorA(255*i/size,0,0,255), i, i+1 ); + TxtCache->color( ColorA(255*i/size,0,0,255), i, i+1 ); } // Application loop diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index 317649f8d..2790b4f22 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -21,20 +21,20 @@ void spriteCallback( Uint32 Event, Sprite * Sprite, void * UserData ) { // Sprite Animation entered the first frame? if ( Event == Sprite::SPRITE_EVENT_FIRST_FRAME ) { // Fire a user Event - Sprite->FireEvent( USER_SPRITE_EVENT ); + Sprite->fireEvent( USER_SPRITE_EVENT ); } else if ( Event == USER_SPRITE_EVENT ) { // Create an interpolation to change the angle of the sprite Interpolation * RotationInterpolation = reinterpret_cast( UserData ); RotationInterpolation->clearWaypoints(); - RotationInterpolation->addWaypoint( Sprite->Angle() ); - RotationInterpolation->addWaypoint( Sprite->Angle() + 45.f ); + RotationInterpolation->addWaypoint( Sprite->angle() ); + RotationInterpolation->addWaypoint( Sprite->angle() + 45.f ); RotationInterpolation->setTotalTime( Milliseconds( 500 ) ); RotationInterpolation->type( Ease::BounceOut ); // Set the easing effect used for the interpolation RotationInterpolation->start(); // Scale the sprite - if ( Sprite->Scale().x < 3 ) { - Sprite->Scale( Sprite->Scale() + 0.25f ); + if ( Sprite->scale().x < 3 ) { + Sprite->scale( Sprite->scale() + 0.25f ); } } } @@ -56,7 +56,7 @@ void MainLoop() // Check if the D key was pressed if ( win->getInput()->isKeyUp( KEY_D ) ) { // Reverse the Rock animation - Rock->ReverseAnim( !Rock->ReverseAnim() ); + Rock->reverseAnim( !Rock->reverseAnim() ); } // Update the angle interpolation @@ -64,25 +64,25 @@ void MainLoop() RockAngle.update( win->elapsed() ); // Set the Planet and Rock angle from the interpolation - Planet->Angle( PlanetAngle.getPos() ); - Rock->Angle( RockAngle.getPos() ); + Planet->angle( PlanetAngle.getPos() ); + Rock->angle( RockAngle.getPos() ); // Draw the static planet sprite - Planet->Draw(); + Planet->draw(); // Draw the animated Rock sprite - Rock->Draw(); + Rock->draw(); // Draw the blindy animation - Blindy->Draw(); + Blindy->draw(); // Draw the Rock Axis-Aligned Bounding Box - P.SetColor( ColorA( 255, 255, 255, 255 ) ); - P.DrawRectangle( Rock->GetAABB() ); + P.setColor( ColorA( 255, 255, 255, 255 ) ); + P.drawRectangle( Rock->getAABB() ); // Draw the Rock Quad - P.SetColor( ColorA( 255, 0, 0, 255 ) ); - P.DrawQuad( Rock->GetQuad() ); + P.setColor( ColorA( 255, 0, 0, 255 ) ); + P.drawQuad( Rock->getQuad() ); // Draw frame win->display(); @@ -99,8 +99,8 @@ EE_MAIN_FUNC int main (int argc, char * argv []) std::string AppPath = Sys::getProcessPath(); // Load the rock texture - Uint32 PlanetId = TextureFactory::instance()->Load( AppPath + "assets/sprites/7.png" ); - Uint32 RockId = TextureFactory::instance()->Load( AppPath + "assets/sprites/5.png" ); + Uint32 PlanetId = TextureFactory::instance()->load( AppPath + "assets/sprites/7.png" ); + Uint32 RockId = TextureFactory::instance()->load( AppPath + "assets/sprites/5.png" ); // Load a previously generated texture atlas that contains the SubTextures needed to load an animated sprite TextureAtlasLoader Blindies( AppPath + "assets/atlases/bnb.eta" ); @@ -112,7 +112,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) for ( Int32 my = 0; my < 4; my++ ) { for( Int32 mx = 0; mx < 8; mx++ ) { // DestSize as 0,0 will use the SubTexture size - Rock->AddFrame( RockId, Sizef( 0, 0 ), Vector2i( 0, 0 ), Recti( mx * 64, my * 64, mx * 64 + 64, my * 64 + 64 ) ); + Rock->addFrame( RockId, Sizef( 0, 0 ), Vector2i( 0, 0 ), Recti( mx * 64, my * 64, mx * 64 + 64, my * 64 + 64 ) ); } } @@ -128,25 +128,25 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Set the sprite animation speed, set in Frames per Second // Sprites are auto-animated by default. - Rock->AnimSpeed( 32 ); + Rock->animSpeed( 32 ); // Set the render mode of the sprite - Blindy->RenderMode( RN_MIRROR ); + Blindy->renderMode( RN_MIRROR ); // Set the Blend Mode of the sprite - Blindy->BlendMode( ALPHA_BLENDONE ); + Blindy->blendMode( ALPHA_BLENDONE ); // Set the primitive fill mode - P.FillMode( DRAW_LINE ); + P.fillMode( DRAW_LINE ); // Set the sprites position to the screen center Vector2i ScreenCenter( Engine::instance()->getWidth() / 2, Engine::instance()->getHeight() / 2 ); - Planet->Position( ScreenCenter.x - Planet->GetAABB().size().width() / 2, ScreenCenter.y - Planet->GetAABB().size().height() / 2 ); + Planet->position( ScreenCenter.x - Planet->getAABB().size().width() / 2, ScreenCenter.y - Planet->getAABB().size().height() / 2 ); - Rock->Position( ScreenCenter.x - Rock->GetAABB().size().width() / 2, ScreenCenter.y - Rock->GetAABB().size().height() / 2 ); + Rock->position( ScreenCenter.x - Rock->getAABB().size().width() / 2, ScreenCenter.y - Rock->getAABB().size().height() / 2 ); - Blindy->Position( ScreenCenter.x - Blindy->GetAABB().size().width() / 2, ScreenCenter.y - Blindy->GetAABB().size().height() / 2 ); + Blindy->position( ScreenCenter.x - Blindy->getAABB().size().width() / 2, ScreenCenter.y - Blindy->getAABB().size().height() / 2 ); // Set the planet angle interpolation PlanetAngle.addWaypoint( 0 ); @@ -156,7 +156,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) PlanetAngle.start(); // Create a Event callback for the rock sprite - Rock->SetEventsCallback( cb::Make3( &spriteCallback ), &RockAngle ); + Rock->setEventsCallback( cb::Make3( &spriteCallback ), &RockAngle ); // Application loop win->runMainLoop( &MainLoop ); diff --git a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp index 5bfbe9d6d..b9a5efb5b 100644 --- a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +++ b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp @@ -29,29 +29,29 @@ void MainLoop() } // Bind the Frame Buffer, everything rendered from here will be rendered in the frame buffer - FBO->Bind(); + FBO->bind(); { // Bind the buffered data ( activate the buffer ) - VBO->Bind(); + VBO->bind(); // Draw the buffered data - VBO->Draw(); + VBO->draw(); // Unbind the buffered data - VBO->Unbind(); + VBO->unbind(); // Same as above - VBO2->Bind(); - VBO2->Draw(); - VBO2->Unbind(); + VBO2->bind(); + VBO2->draw(); + VBO2->unbind(); } // Unbind the frame buffer. Stops rendering to the frame buffer - FBO->Unbind(); + FBO->unbind(); // Draw the frame buffer many times for ( int y = 0; y < 5; y++ ) { for ( int x = 0; x < 5; x++ ) { - FBO->GetTexture()->Draw( x * 200, y * 200, -ang, Vector2f::One, ColorA(255,255,255,100) ); + FBO->getTexture()->draw( x * 200, y * 200, -ang, Vector2f::One, ColorA(255,255,255,100) ); } } @@ -59,9 +59,9 @@ void MainLoop() Float HHeight = win->getHeight() * 0.5f; // The batch can be rotated, scale and moved - Batch->BatchRotation( ang ); - Batch->BatchScale( scale ); - Batch->BatchCenter( Vector2f( HWidth, HHeight ) ); + Batch->batchRotation( ang ); + Batch->batchScale( scale ); + Batch->batchCenter( Vector2f( HWidth, HHeight ) ); // Create a quad to render Float aX = HWidth - 256.f; @@ -75,7 +75,7 @@ void MainLoop() TmpQuad.rotate( ang, Vector2f( aX + 16.f, aY + 16.f ) ); // Begin drawing quads - Batch->QuadsBegin(); + Batch->quadsBegin(); // Add some quads to the batch renderer for ( Uint32 z = 0; z < 16; z++ ) { @@ -84,13 +84,13 @@ void MainLoop() Float tmpy = (Float)y * 32.f; // Add the quad to the batch - Batch->QuadsSetColor( ColorA( z * 16, 255, 255, 150 ) ); - Batch->BatchQuadFree( TmpQuad[0].x + tmpx, TmpQuad[0].y + tmpy, TmpQuad[1].x + tmpx, TmpQuad[1].y + tmpy, TmpQuad[2].x + tmpx, TmpQuad[2].y + tmpy, TmpQuad[3].x + tmpx, TmpQuad[3].y + tmpy ); + Batch->quadsSetColor( ColorA( z * 16, 255, 255, 150 ) ); + Batch->batchQuadFree( TmpQuad[0].x + tmpx, TmpQuad[0].y + tmpy, TmpQuad[1].x + tmpx, TmpQuad[1].y + tmpy, TmpQuad[2].x + tmpx, TmpQuad[2].y + tmpy, TmpQuad[3].x + tmpx, TmpQuad[3].y + tmpy ); } } // Draw the batched quads - Batch->Draw(); + Batch->draw(); // Add the rotation angle ang+=win->elapsed().asMilliseconds() * 0.1f; @@ -130,20 +130,20 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Add the vertex and vertex colors to the Vertex Buffer if ( NULL != VBO && NULL != VBO2 ) { for ( Uint32 i = 0; i < Poly.size(); i++ ) { - VBO->AddVertex( Poly[i] ); - VBO->AddColor( ColorA( 100 + i, 255 - i, 150 + i, 100 ) ); + VBO->addVertex( Poly[i] ); + VBO->addColor( ColorA( 100 + i, 255 - i, 150 + i, 100 ) ); } Poly.rotate( 90, Poly.toAABB().center() ); for ( Uint32 i = 0; i < Poly.size(); i++ ) { - VBO2->AddVertex( Poly[i] ); - VBO2->AddColor( ColorA( 100 + i, 255 - i, 150 + i, 100 ) ); + VBO2->addVertex( Poly[i] ); + VBO2->addColor( ColorA( 100 + i, 255 - i, 150 + i, 100 ) ); } // Compile the Vertex Buffer, this uploads the data to the GPU - VBO->Compile(); - VBO2->Compile(); + VBO->compile(); + VBO2->compile(); } // Create a new frame buffer. It will use Framebuffer Objects if available, otherwise it will try to fallback to PBuffers. diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index f2f9f8090..b26b521f3 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -64,7 +64,7 @@ void EETest::Init() { mWindow->pushResizeCallback( cb::Make1( this, &EETest::OnWindowResize ) ); TF = TextureFactory::instance(); - TF->Allocate(40); + TF->allocate(40); Log = Log::instance(); KM = mWindow->getInput(); @@ -111,13 +111,13 @@ void EETest::Init() { WP.setTotalTime( Milliseconds( 5000 ) ); WP.start(); - Batch.AllocVertexs( 2048 ); - Batch.SetBlendMode( ALPHA_BLENDONE ); + Batch.allocVertexs( 2048 ); + Batch.setBlendMode( ALPHA_BLENDONE ); mFBO = FrameBuffer::New( 256, 256, false ); if ( NULL != mFBO ) - mFBO->ClearColor( ColorAf( 0, 0, 0, 0.5f ) ); + mFBO->clearColor( ColorAf( 0, 0, 0, 0.5f ) ); Polygon2f Poly = Polygon2f::createRoundedRectangle( 0, 0, 256, 50 ); @@ -125,11 +125,11 @@ void EETest::Init() { if ( NULL != mVBO ) { for ( Uint32 i = 0; i < Poly.size(); i++ ) { - mVBO->AddVertex( Poly[i] ); - mVBO->AddColor( ColorA( 100 + i, 255 - i, 150 + i, 200 ) ); + mVBO->addVertex( Poly[i] ); + mVBO->addColor( ColorA( 100 + i, 255 - i, 150 + i, 200 ) ); } - mVBO->Compile(); + mVBO->compile(); } PhysicsCreate(); @@ -155,12 +155,12 @@ void EETest::CreateUIThemeTextureAtlas() { if ( !FileSystem::fileExists( tgpath + EE_TEXTURE_ATLAS_EXTENSION ) ) { TexturePacker tp( 256, 256, true, 2 ); - tp.AddTexturesPath( Path ); - tp.PackTextures(); - tp.Save( tgpath + ".png", SAVE_TYPE_PNG ); + tp.addTexturesPath( Path ); + tp.packTextures(); + tp.save( tgpath + ".png", SAVE_TYPE_PNG ); } else { TextureAtlasLoader tgl; - tgl.UpdateTextureAtlas( tgpath + EE_TEXTURE_ATLAS_EXTENSION, Path ); + tgl.updateTextureAtlas( tgpath + EE_TEXTURE_ATLAS_EXTENSION, Path ); } } @@ -168,7 +168,7 @@ void EETest::LoadFonts() { mFTE.restart(); TextureLoader * tl = eeNew( TextureLoader, ( MyPath + "fonts/conchars.png" ) ); - tl->SetColorKey( RGB(0,0,0) ); + tl->setColorKey( RGB(0,0,0) ); mFontLoader.add( eeNew( TextureFontLoader, ( "conchars", tl, (unsigned int)32 ) ) ); mFontLoader.add( eeNew( TextureFontLoader, ( "ProggySquareSZ", eeNew( TextureLoader, ( MyPath + "fonts/ProggySquareSZ.png" ) ), MyPath + "fonts/ProggySquareSZ.dat" ) ) ); @@ -189,23 +189,23 @@ void EETest::OnFontLoaded( ResourceLoader * ObjLoaded ) { eeASSERT( TTF != NULL ); eeASSERT( TTFB != NULL ); - Con.Create( FF, true ); - Con.IgnoreCharOnPrompt( 186 ); // 'º' + Con.create( FF, true ); + Con.ignoreCharOnPrompt( 186 ); // 'º' mBuda = String::fromUtf8( "El mono ve el pez en el agua y sufre. Piensa que su mundo es el único que existe, el mejor, el real. Sufre porque es bueno y tiene compasión, lo ve y piensa: \"Pobre se está ahogando no puede respirar\". Y lo saca, lo saca y se queda tranquilo, por fin lo salvé. Pero el pez se retuerce de dolor y muere. Por eso te mostré el sueño, es imposible meter el mar en tu cabeza, que es un balde." ); CreateUI(); - mEEText.Create( TTFB, "Entropia Engine++\nCTRL + Number to change Demo Screen\nRight click to see the PopUp Menu" ); - mFBOText.Create( TTFB, "This is a VBO\nInside of a FBO" ); - mFBOText.Color( ColorA(255,255,0,255), mFBOText.Text().find( "VBO" ), mFBOText.Text().find( "VBO" ) + 2 ); - mFBOText.Color( ColorA(255,255,0,255), mFBOText.Text().find( "FBO" ), mFBOText.Text().find( "FBO" ) + 2 ); + mEEText.create( TTFB, "Entropia Engine++\nCTRL + Number to change Demo Screen\nRight click to see the PopUp Menu" ); + mFBOText.create( TTFB, "This is a VBO\nInside of a FBO" ); + mFBOText.color( ColorA(255,255,0,255), mFBOText.text().find( "VBO" ), mFBOText.text().find( "VBO" ) + 2 ); + mFBOText.color( ColorA(255,255,0,255), mFBOText.text().find( "FBO" ), mFBOText.text().find( "FBO" ) + 2 ); - mInfoText.Create( FF, "", ColorA(255,255,255,150) ); + mInfoText.create( FF, "", ColorA(255,255,255,150) ); } void EETest::CreateShaders() { - mUseShaders = mUseShaders && GLi->ShadersSupported(); + mUseShaders = mUseShaders && GLi->shadersSupported(); mShaderProgram = NULL; @@ -558,7 +558,7 @@ void EETest::CreateUI() { #ifdef EE_PLATFORM_TOUCH TextureAtlas * SG = GlobalTextureAtlas::instance(); - Texture * butTex = TF->GetTexture( TF->Load( MyPath + "sprites/button-te_normal.png" ) ); + Texture * butTex = TF->getTexture( TF->Load( MyPath + "sprites/button-te_normal.png" ) ); SG->Add( butTex->Id(), "button-te_normal" ); SG->Add( TF->Load( MyPath + "sprites/button-te_mdown.png" ), "button-te_mdown" ); @@ -678,10 +678,10 @@ void EETest::ItemClick( const UIEvent * Event ) { } else if ( "Show Screen 6" == txt ) { SetScreen( 5 ); } else if ( "Show Console" == txt ) { - Con.Toggle(); - InBuf.active( !Con.Active() ); + Con.toggle(); + InBuf.active( !Con.active() ); - if ( Con.Active() ) { + if ( Con.active() ) { mWindow->startTextInput(); } else { mWindow->stopTextInput(); @@ -797,10 +797,10 @@ void EETest::CmdSetPartsNum ( const std::vector < String >& params ) { bool Res = String::fromString( tInt, params[1] ); if ( Res && ( tInt >= 0 && tInt <= 100000 ) ) { - PS[2].Create( PSE_WormHole, tInt, TN[5], Vector2f( mWindow->getWidth() * 0.5f, mWindow->getHeight() * 0.5f ), 32, true ); - Con.PushText( "Wormhole Particles Number Changed to: " + String::toStr(tInt) ); + PS[2].create( PSE_WormHole, tInt, TN[5], Vector2f( mWindow->getWidth() * 0.5f, mWindow->getHeight() * 0.5f ), 32, true ); + Con.pushText( "Wormhole Particles Number Changed to: " + String::toStr(tInt) ); } else - Con.PushText( "Valid parameters are between 0 and 100000 (0 = no limit)." ); + Con.pushText( "Valid parameters are between 0 and 100000 (0 = no limit)." ); } } @@ -842,8 +842,8 @@ void EETest::LoadTextures() { TNP.resize(12); for ( i = 0; i <= 6; i++ ) { - TN[i] = TF->Load( MyPath + "sprites/" + String::toStr(i+1) + ".png", (i+1) == 7 ? true : false, ( (i+1) == 4 ) ? CLAMP_REPEAT : CLAMP_TO_EDGE ); - TNP[i] = TF->GetTexture( TN[i] ); + TN[i] = TF->load( MyPath + "sprites/" + String::toStr(i+1) + ".png", (i+1) == 7 ? true : false, ( (i+1) == 4 ) ? CLAMP_REPEAT : CLAMP_TO_EDGE ); + TNP[i] = TF->getTexture( TN[i] ); } Tiles.resize(10); @@ -856,15 +856,15 @@ void EETest::LoadTextures() { Tiles[i] = SG->getByName( String::toStr( i+1 ) ); } - Tiles[6] = SG->add( TF->Load( MyPath + "sprites/objects/1.png" ), "7" ); + Tiles[6] = SG->add( TF->load( MyPath + "sprites/objects/1.png" ), "7" ); #ifdef EE_GLES Image tImg( MyPath + "sprites/objects/2.png", 4 ); tImg.CreateMaskFromColor( ColorA(0,0,0,255), 0 ); - Tiles[7] = SG->Add( TF->LoadFromPixels( tImg.GetPixelsPtr(), tImg.Width(), tImg.Height(), tImg.Channels() ), "8" ); + Tiles[7] = SG->Add( TF->loadFromPixels( tImg.GetPixelsPtr(), tImg.Width(), tImg.Height(), tImg.Channels() ), "8" ); #else - Tiles[7] = SG->add( TF->Load( MyPath + "sprites/objects/2.png" ), "8" ); - Tiles[7]->GetTexture()->CreateMaskFromColor( ColorA(0,0,0,255), 0 ); + Tiles[7] = SG->add( TF->load( MyPath + "sprites/objects/2.png" ), "8" ); + Tiles[7]->getTexture()->createMaskFromColor( ColorA(0,0,0,255), 0 ); #endif } @@ -872,39 +872,39 @@ void EETest::LoadTextures() { for ( Int32 my = 0; my < 4; my++ ) for( Int32 mx = 0; mx < 8; mx++ ) - SP.AddFrame( TN[4], Sizef( 0, 0 ), Vector2i( 0, 0 ), Recti( mx * 64, my * 64, mx * 64 + 64, my * 64 + 64 ) ); + SP.addFrame( TN[4], Sizef( 0, 0 ), Vector2i( 0, 0 ), Recti( mx * 64, my * 64, mx * 64 + 64, my * 64 + 64 ) ); - PS[0].SetCallbackReset( cb::Make2( this, &EETest::ParticlesCallback ) ); - PS[0].Create( PSE_Callback, 500, TN[5], Vector2f( 0, 0 ), 16, true ); - PS[1].Create( PSE_Heal, 250, TN[5], Vector2f( mWindow->getWidth() * 0.5f, mWindow->getHeight() * 0.5f ), 16, true ); - PS[2].Create( PSE_WormHole, PartsNum, TN[5], Vector2f( mWindow->getWidth() * 0.5f, mWindow->getHeight() * 0.5f ), 32, true ); - PS[3].Create( PSE_Fire, 350, TN[5], Vector2f( -50.f, -50.f ), 32, true ); - PS[4].Create( PSE_Fire, 350, TN[5], Vector2f( -50.f, -50.f ), 32, true ); + PS[0].setCallbackReset( cb::Make2( this, &EETest::ParticlesCallback ) ); + PS[0].create( PSE_Callback, 500, TN[5], Vector2f( 0, 0 ), 16, true ); + PS[1].create( PSE_Heal, 250, TN[5], Vector2f( mWindow->getWidth() * 0.5f, mWindow->getHeight() * 0.5f ), 16, true ); + PS[2].create( PSE_WormHole, PartsNum, TN[5], Vector2f( mWindow->getWidth() * 0.5f, mWindow->getHeight() * 0.5f ), 32, true ); + PS[3].create( PSE_Fire, 350, TN[5], Vector2f( -50.f, -50.f ), 32, true ); + PS[4].create( PSE_Fire, 350, TN[5], Vector2f( -50.f, -50.f ), 32, true ); - Con.AddCommand( "setparticlesnum", cb::Make1( this, &EETest::CmdSetPartsNum ) ); + Con.addCommand( "setparticlesnum", cb::Make1( this, &EETest::CmdSetPartsNum ) ); Texture * Tex = TNP[2]; - if ( NULL != Tex && Tex->Lock() ) { - w = (int)Tex->Width(); - h = (int)Tex->Height(); + if ( NULL != Tex && Tex->lock() ) { + w = (int)Tex->width(); + h = (int)Tex->height(); for ( y = 0; y < h; y++) { for ( x = 0; x < w; x++) { - ColorA C = Tex->GetPixel(x, y); + ColorA C = Tex->getPixel(x, y); if ( C.r() > 200 && C.g() > 200 && C.b() > 200 ) - Tex->SetPixel(x, y, ColorA( Math::randi(0, 255), Math::randi(0, 255), Math::randi(0, 255), C.a() ) ); + Tex->setPixel(x, y, ColorA( Math::randi(0, 255), Math::randi(0, 255), Math::randi(0, 255), C.a() ) ); else - Tex->SetPixel(x, y, ColorA( Math::randi(200, 255), Math::randi(200, 255), Math::randi(200, 255), C.a() ) ); + Tex->setPixel(x, y, ColorA( Math::randi(200, 255), Math::randi(200, 255), Math::randi(200, 255), C.a() ) ); } } - Tex->Unlock(false, true); + Tex->unlock(false, true); } - Cursor[0] = TF->Load( MyPath + "cursors/cursor.tga" ); - CursorP[0] = TF->GetTexture( Cursor[0] ); + Cursor[0] = TF->load( MyPath + "cursors/cursor.tga" ); + CursorP[0] = TF->getTexture( Cursor[0] ); CursorManager * CurMan = mWindow->getCursorManager(); CurMan->visible( false ); @@ -913,17 +913,17 @@ void EETest::LoadTextures() { CurMan->setGlobalCursor( EE_CURSOR_ARROW, CurMan->add( CurMan->create( CursorP[0], Vector2i( 1, 1 ), "cursor_special" ) ) ); CurMan->set( EE_CURSOR_ARROW ); - CL1.AddFrame( TN[2] ); - CL1.Position( 500, 400 ); - CL1.Scale( 0.5f ); + CL1.addFrame( TN[2] ); + CL1.position( 500, 400 ); + CL1.scale( 0.5f ); - CL2.AddFrame(TN[0], Sizef(96, 96) ); - CL2.Color( ColorA( 255, 255, 255, 255 ) ); + CL2.addFrame(TN[0], Sizef(96, 96) ); + CL2.color( ColorA( 255, 255, 255, 255 ) ); mTGL = eeNew( TextureAtlasLoader, ( MyPath + "atlases/bnb" + EE_TEXTURE_ATLAS_EXTENSION ) ); - mBlindy.AddFramesByPattern( "rn" ); - mBlindy.Position( 320.f, 0.f ); + mBlindy.addFramesByPattern( "rn" ); + mBlindy.position( 320.f, 0.f ); mBoxSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->add( eeNew( SubTexture, ( TN[3], "ilmare" ) ) ) ) ); mCircleSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->add( eeNew( SubTexture, ( TN[1], "thecircle" ) ) ) ) ); @@ -955,7 +955,7 @@ void EETest::UpdateParticles() { PSElapsed = cElapsed.elapsed(); for ( Uint8 i = 0; i < PS.size(); i++ ) - PS[i].Update( PSElapsed ); + PS[i].update( PSElapsed ); } } @@ -966,23 +966,23 @@ void EETest::Screen1() { void EETest::Screen2() { if ( mResLoad.isLoaded() ) { - Texture * TexLoaded = TF->GetByName( "1.jpg" ); + Texture * TexLoaded = TF->getByName( "1.jpg" ); if ( NULL != TexLoaded ) - TexLoaded->Draw( 0, 0 ); + TexLoaded->draw( 0, 0 ); } if ( KM->mouseLeftPressed() ) - TNP[3]->DrawEx( 0.f, 0.f, (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ); + TNP[3]->drawEx( 0.f, 0.f, (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ); - Batch.SetTexture( TNP[2] ); - Batch.QuadsBegin(); - Batch.QuadsSetColor( ColorA(150,150,150,100) ); - Batch.QuadsSetSubset( 0.0f, 0.0f, 0.5f, 0.5f ); + Batch.setTexture( TNP[2] ); + Batch.quadsBegin(); + Batch.quadsSetColor( ColorA(150,150,150,100) ); + Batch.quadsSetSubset( 0.0f, 0.0f, 0.5f, 0.5f ); - Batch.BatchRotation( ang ); - Batch.BatchScale( scale ); - Batch.BatchCenter( Vector2f( HWidth, HHeight ) ); + Batch.batchRotation( ang ); + Batch.batchScale( scale ); + Batch.batchCenter( Vector2f( HWidth, HHeight ) ); Float aX = HWidth - 256.f; Float aY = HHeight - 256.f; @@ -999,18 +999,18 @@ void EETest::Screen2() { Float tmpx = (Float)z * 32.f; Float tmpy = (Float)y * 32.f; - Batch.BatchQuadFree( TmpQuad[0].x + tmpx, TmpQuad[0].y + tmpy, TmpQuad[1].x + tmpx, TmpQuad[1].y + tmpy, TmpQuad[2].x + tmpx, TmpQuad[2].y + tmpy, TmpQuad[3].x + tmpx, TmpQuad[3].y + tmpy ); + Batch.batchQuadFree( TmpQuad[0].x + tmpx, TmpQuad[0].y + tmpy, TmpQuad[1].x + tmpx, TmpQuad[1].y + tmpy, TmpQuad[2].x + tmpx, TmpQuad[2].y + tmpy, TmpQuad[3].x + tmpx, TmpQuad[3].y + tmpy ); } } - Batch.Draw(); + Batch.draw(); - Batch.BatchRotation( 0.0f ); - Batch.BatchScale( 1.0f ); - Batch.BatchCenter( Vector2f( 0, 0 ) ); + Batch.batchRotation( 0.0f ); + Batch.batchScale( 1.0f ); + Batch.batchCenter( Vector2f( 0, 0 ) ); - Float PlanetX = HWidth - TNP[6]->Width() * 0.5f; - Float PlanetY = HHeight - TNP[6]->Height() * 0.5f; + Float PlanetX = HWidth - TNP[6]->width() * 0.5f; + Float PlanetY = HHeight - TNP[6]->height() * 0.5f; ang+=et.asMilliseconds() * 0.1f; ang = (ang>=360) ? 0 : ang; @@ -1026,19 +1026,19 @@ void EETest::Screen2() { if ( mUseShaders ) { mBlurFactor = ( 1.5f * 0.01f ) - ( scale * 0.01f ); - mShaderProgram->Bind(); - mShaderProgram->SetUniform( "blurfactor" , (float)mBlurFactor ); + mShaderProgram->bind(); + mShaderProgram->setUniform( "blurfactor" , (float)mBlurFactor ); } - TNP[6]->DrawFast( PlanetX, PlanetY, ang, Vector2f(scale,scale)); + TNP[6]->drawFast( PlanetX, PlanetY, ang, Vector2f(scale,scale)); if ( mUseShaders ) - mShaderProgram->Unbind(); + mShaderProgram->unbind(); - TNP[3]->Draw( HWidth - 128, HHeight, 0, Vector2f::One, ColorA(255,255,255,150), ALPHA_NORMAL, RN_ISOMETRIC); - TNP[3]->Draw( HWidth - 128, HHeight - 128, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRIC); - TNP[3]->Draw( HWidth - 128, HHeight, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICAL); - TNP[3]->Draw( HWidth, HHeight, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICALNEGATIVE); + TNP[3]->draw( HWidth - 128, HHeight, 0, Vector2f::One, ColorA(255,255,255,150), ALPHA_NORMAL, RN_ISOMETRIC); + TNP[3]->draw( HWidth - 128, HHeight - 128, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRIC); + TNP[3]->draw( HWidth - 128, HHeight, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICAL); + TNP[3]->draw( HWidth, HHeight, 0, Vector2f::One, ColorA(255,255,255,50), ALPHA_NORMAL, RN_ISOMETRICVERTICALNEGATIVE); alpha = (!aside) ? alpha+et.asMilliseconds() * 0.1f : alpha-et.asMilliseconds() * 0.1f; if (alpha>=255) { @@ -1050,38 +1050,38 @@ void EETest::Screen2() { } ColorA Col(255,255,255,(int)alpha); - TNP[1]->DrawEx( (Float)mWindow->getWidth() - 128.f, (Float)mWindow->getHeight() - 128.f, 128.f, 128.f, ang, Vector2f::One, Col, Col, Col, Col, ALPHA_BLENDONE, RN_FLIPMIRROR); + TNP[1]->drawEx( (Float)mWindow->getWidth() - 128.f, (Float)mWindow->getHeight() - 128.f, 128.f, 128.f, ang, Vector2f::One, Col, Col, Col, Col, ALPHA_BLENDONE, RN_FLIPMIRROR); - SP.Position( alpha, alpha ); - SP.Draw(); + SP.position( alpha, alpha ); + SP.draw(); #ifndef EE_GLES - CL1.RenderMode( RN_ISOMETRIC ); + CL1.renderMode( RN_ISOMETRIC ); - if ( CL1.GetAABB().intersectCircle( Mousef, 80.f ) ) - CL1.Color( ColorA(255, 0, 0, 200) ); + if ( CL1.getAABB().intersectCircle( Mousef, 80.f ) ) + CL1.color( ColorA(255, 0, 0, 200) ); else - CL1.Color( ColorA(255, 255, 255, 200) ); + CL1.color( ColorA(255, 255, 255, 200) ); - if ( Polygon2f::intersectQuad2( CL1.GetQuad() , CL2.GetQuad() ) ) { - CL1.Color( ColorA(0, 255, 0, 255) ); - CL2.Color( ColorA(0, 255, 0, 255) ); + if ( Polygon2f::intersectQuad2( CL1.getQuad() , CL2.getQuad() ) ) { + CL1.color( ColorA(0, 255, 0, 255) ); + CL2.color( ColorA(0, 255, 0, 255) ); } else - CL2.Color( ColorA(255, 255, 255, 255) ); + CL2.color( ColorA(255, 255, 255, 255) ); - CL1.Angle(ang); - CL1.Scale(scale * 0.5f); + CL1.angle(ang); + CL1.scale(scale * 0.5f); - CL2.Position( (Float)Mousef.x - 64.f, (Float)Mousef.y + 128.f ); - CL2.Angle(-ang); + CL2.position( (Float)Mousef.x - 64.f, (Float)Mousef.y + 128.f ); + CL2.angle(-ang); - CL1.Draw(); - CL2.Draw(); + CL1.draw(); + CL2.draw(); - PR.FillMode( DRAW_LINE ); - PR.DrawRectangle( CL1.GetAABB() ); + PR.fillMode( DRAW_LINE ); + PR.drawRectangle( CL1.getAABB() ); - PR.DrawQuad( CL1.GetQuad() ); + PR.drawQuad( CL1.getQuad() ); #endif Ang = Ang + mWindow->elapsed().asMilliseconds() * 0.1f; @@ -1090,7 +1090,7 @@ void EETest::Screen2() { if ( ShowParticles ) Particles(); - PR.SetColor( ColorA(0, 255, 0, 50) ); + PR.setColor( ColorA(0, 255, 0, 50) ); Line2f Line( Vector2f(0.f, 0.f), Vector2f( (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ) ); Line2f Line2( Vector2f(Mousef.x - 80.f, Mousef.y - 80.f), Vector2f(Mousef.x + 80.f, Mousef.y + 80.f) ); @@ -1108,29 +1108,29 @@ void EETest::Screen2() { iL2 = false; if (iL1 && iL2) - PR.SetColor( ColorA(255, 0, 0, 255) ); + PR.setColor( ColorA(255, 0, 0, 255) ); else if (iL1) - PR.SetColor( ColorA(0, 0, 255, 255) ); + PR.setColor( ColorA(0, 0, 255, 255) ); else if (iL2) - PR.SetColor( ColorA(255, 255, 0, 255) ); + PR.setColor( ColorA(255, 255, 0, 255) ); - PR.FillMode( DRAW_LINE ); - PR.DrawCircle( Vector2f( Mousef.x, Mousef.y ), 80.f, (Uint32)(Ang/3) ); - PR.DrawTriangle( Triangle2f( Vector2f( Mousef.x, Mousef.y - 10.f ), Vector2f( Mousef.x - 10.f, Mousef.y + 10.f ), Vector2f( Mousef.x + 10.f, Mousef.y + 10.f ) ) ); - PR.DrawLine( Line2f( Vector2f(Mousef.x - 80.f, Mousef.y - 80.f), Vector2f(Mousef.x + 80.f, Mousef.y + 80.f) ) ); - PR.DrawLine( Line2f( Vector2f(Mousef.x - 80.f, Mousef.y + 80.f), Vector2f(Mousef.x + 80.f, Mousef.y - 80.f) ) ); - PR.DrawLine( Line2f( Vector2f((Float)mWindow->getWidth(), 0.f), Vector2f( 0.f, (Float)mWindow->getHeight() ) ) ); - PR.FillMode( DRAW_FILL ); - PR.DrawQuad( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), ColorA(220, 240, 0, 125), ColorA(100, 0, 240, 125), ColorA(250, 50, 25, 125), ColorA(50, 150, 150, 125) ); - PR.FillMode( DRAW_LINE ); - PR.DrawRectangle( Rectf( Vector2f( Mousef.x - 80.f, Mousef.y - 80.f ), Sizef( 160.f, 160.f ) ), 45.f ); - PR.DrawLine( Line2f( Vector2f(0.f, 0.f), Vector2f( (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ) ) ); + PR.fillMode( DRAW_LINE ); + PR.drawCircle( Vector2f( Mousef.x, Mousef.y ), 80.f, (Uint32)(Ang/3) ); + PR.drawTriangle( Triangle2f( Vector2f( Mousef.x, Mousef.y - 10.f ), Vector2f( Mousef.x - 10.f, Mousef.y + 10.f ), Vector2f( Mousef.x + 10.f, Mousef.y + 10.f ) ) ); + PR.drawLine( Line2f( Vector2f(Mousef.x - 80.f, Mousef.y - 80.f), Vector2f(Mousef.x + 80.f, Mousef.y + 80.f) ) ); + PR.drawLine( Line2f( Vector2f(Mousef.x - 80.f, Mousef.y + 80.f), Vector2f(Mousef.x + 80.f, Mousef.y - 80.f) ) ); + PR.drawLine( Line2f( Vector2f((Float)mWindow->getWidth(), 0.f), Vector2f( 0.f, (Float)mWindow->getHeight() ) ) ); + PR.fillMode( DRAW_FILL ); + PR.drawQuad( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), ColorA(220, 240, 0, 125), ColorA(100, 0, 240, 125), ColorA(250, 50, 25, 125), ColorA(50, 150, 150, 125) ); + PR.fillMode( DRAW_LINE ); + PR.drawRectangle( Rectf( Vector2f( Mousef.x - 80.f, Mousef.y - 80.f ), Sizef( 160.f, 160.f ) ), 45.f ); + PR.drawLine( Line2f( Vector2f(0.f, 0.f), Vector2f( (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ) ) ); - TNP[3]->DrawQuadEx( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), Vector2f(), ang, Vector2f(scale,scale), ColorA(220, 240, 0, 125), ColorA(100, 0, 240, 125), ColorA(250, 50, 25, 125), ColorA(50, 150, 150, 125) ); + TNP[3]->drawQuadEx( Quad2f( Vector2f(0.f, 0.f), Vector2f(0.f, 100.f), Vector2f(150.f, 150.f), Vector2f(200.f, 150.f) ), Vector2f(), ang, Vector2f(scale,scale), ColorA(220, 240, 0, 125), ColorA(100, 0, 240, 125), ColorA(250, 50, 25, 125), ColorA(50, 150, 150, 125) ); WP.update( et ); - PR.SetColor( ColorA(0, 255, 0, 255) ); - PR.DrawPoint( WP.getPos(), 10.f ); + PR.setColor( ColorA(0, 255, 0, 255) ); + PR.drawPoint( WP.getPos(), 10.f ); } void EETest::Screen3() { @@ -1143,38 +1143,38 @@ void EETest::Screen3() { } AnimVal = (!AnimSide) ? AnimVal+et.asMilliseconds() * 0.1f : AnimVal-et.asMilliseconds() * 0.1f; - Batch.SetTexture( TNP[3] ); - Batch.LineLoopBegin(); + Batch.setTexture( TNP[3] ); + Batch.lineLoopBegin(); for ( Float j = 0; j < 360; j++ ) { - Batch.BatchLineLoop( HWidth + 350 * Math::sinAng(j), HHeight + 350 * Math::cosAng(j), HWidth + AnimVal * Math::sinAng(j+1), HHeight + AnimVal * Math::cosAng(j+1) ); + Batch.batchLineLoop( HWidth + 350 * Math::sinAng(j), HHeight + 350 * Math::cosAng(j), HWidth + AnimVal * Math::sinAng(j+1), HHeight + AnimVal * Math::cosAng(j+1) ); } - Batch.Draw(); + Batch.draw(); } void EETest::Screen4() { if ( NULL != mFBO ) { - mFBO->Bind(); - mFBO->Clear(); + mFBO->bind(); + mFBO->clear(); } if ( NULL != mVBO ) { - mBlindy.Position( 128-16, 128-16 ); - mBlindy.Draw(); + mBlindy.position( 128-16, 128-16 ); + mBlindy.draw(); - mVBO->Bind(); - mVBO->Draw(); - mVBO->Unbind(); + mVBO->bind(); + mVBO->draw(); + mVBO->unbind(); - mFBOText.Flags( FONT_DRAW_CENTER ); - mFBOText.Draw( 128.f - (Float)(Int32)( mFBOText.GetTextWidth() * 0.5f ), 25.f - (Float)(Int32)( mFBOText.GetTextHeight() * 0.5f ) ); + mFBOText.flags( FONT_DRAW_CENTER ); + mFBOText.draw( 128.f - (Float)(Int32)( mFBOText.getTextWidth() * 0.5f ), 25.f - (Float)(Int32)( mFBOText.getTextHeight() * 0.5f ) ); } if ( NULL != mFBO ) { - mFBO->Unbind(); + mFBO->unbind(); - if ( NULL != mFBO->GetTexture() ) { - mFBO->GetTexture()->Draw( (Float)mWindow->getWidth() * 0.5f - (Float)mFBO->GetWidth() * 0.5f, (Float)mWindow->getHeight() * 0.5f - (Float)mFBO->GetHeight() * 0.5f, Ang ); - GlobalBatchRenderer::instance()->Draw(); + if ( NULL != mFBO->getTexture() ) { + mFBO->getTexture()->draw( (Float)mWindow->getWidth() * 0.5f - (Float)mFBO->getWidth() * 0.5f, (Float)mWindow->getHeight() * 0.5f - (Float)mFBO->getHeight() * 0.5f, Ang ); + GlobalBatchRenderer::instance()->draw(); } } } @@ -1195,7 +1195,7 @@ void EETest::Render() { et.asMilliseconds(), (Int32)Mouse.x, (Int32)Mouse.y, - FileSystem::sizeToString( TF->MemorySize() ).c_str(), + FileSystem::sizeToString( TF->memorySize() ).c_str(), FileSystem::sizeToString( (Uint32)MemoryManager::getTotalMemoryUsage() ).c_str(), FileSystem::sizeToString( (Uint32)MemoryManager::getPeakMemoryUsage() ).c_str() ); @@ -1209,7 +1209,7 @@ void EETest::Render() { ); #endif - mInfoText.Text( mInfo ); + mInfoText.text( mInfo ); } if ( !MultiViewportMode ) { @@ -1239,50 +1239,50 @@ void EETest::Render() { ColorA ColRR2( 100, 100, 100, 220 ); ColorA ColRR3( 100, 100, 100, 220 ); - mEEText.Flags( FONT_DRAW_CENTER ); + mEEText.flags( FONT_DRAW_CENTER ); - PR.SetColor( ColorA(150, 150, 150, 220) ); - PR.FillMode( DRAW_FILL ); - PR.DrawRectangle( + PR.setColor( ColorA(150, 150, 150, 220) ); + PR.fillMode( DRAW_FILL ); + PR.drawRectangle( Rectf( Vector2f( 0.f, - (Float)mWindow->getHeight() - mEEText.GetTextHeight() + (Float)mWindow->getHeight() - mEEText.getTextHeight() ), Vector2f( - mEEText.GetTextWidth(), - mEEText.GetTextHeight() + mEEText.getTextWidth(), + mEEText.getTextHeight() ) ), ColRR1, ColRR2, ColRR3, ColRR4 ); - mEEText.Draw( 0.f, (Float)mWindow->getHeight() - mEEText.GetTextHeight() ); + mEEText.draw( 0.f, (Float)mWindow->getHeight() - mEEText.getTextHeight() ); - mInfoText.Draw( 6.f, 6.f ); + mInfoText.draw( 6.f, 6.f ); if ( InBuf.active() ) { Uint32 NLPos = 0; Uint32 LineNum = InBuf.getCurPosLinePos( NLPos ); if ( InBuf.curPos() == (int)InBuf.buffer().size() && !LineNum ) { - FF2->Draw( "_", 6.f + FF2->GetTextWidth(), 180.f ); + FF2->draw( "_", 6.f + FF2->getTextWidth(), 180.f ); } else { - FF2->SetText( InBuf.buffer().substr( NLPos, InBuf.curPos() - NLPos ) ); - FF2->Draw( "_", 6.f + FF2->GetTextWidth(), 180.f + (Float)LineNum * (Float)FF2->GetFontHeight() ); + FF2->setText( InBuf.buffer().substr( NLPos, InBuf.curPos() - NLPos ) ); + FF2->draw( "_", 6.f + FF2->getTextWidth(), 180.f + (Float)LineNum * (Float)FF2->getFontHeight() ); } - FF2->SetText( "FPS: " + String::toStr( mWindow->FPS() ) ); - FF2->Draw( mWindow->getWidth() - FF2->GetTextWidth() - 15, 0 ); + FF2->setText( "FPS: " + String::toStr( mWindow->FPS() ) ); + FF2->draw( mWindow->getWidth() - FF2->getTextWidth() - 15, 0 ); - FF2->SetText( InBuf.buffer() ); - FF2->Draw( 6, 180, FONT_DRAW_SHADOW ); + FF2->setText( InBuf.buffer() ); + FF2->draw( 6, 180, FONT_DRAW_SHADOW ); } UIManager::instance()->Draw(); UIManager::instance()->Update(); - Con.Draw(); + Con.draw(); } void EETest::Input() { @@ -1293,7 +1293,7 @@ void EETest::Input() { Mousef = Vector2f( (Float)Mouse.x, (Float)Mouse.y ); if ( KM->isKeyUp( KEY_F1 ) ) - Graphics::ShaderProgramManager::instance()->Reload(); + Graphics::ShaderProgramManager::instance()->reload(); if ( !mWindow->visible() ) { mWasMinimized = true; @@ -1329,13 +1329,13 @@ void EETest::Input() { if ( KM->altPressed() && KM->isKeyUp( KEY_C ) ) mWindow->center(); - if ( KM->altPressed() && KM->isKeyUp( KEY_M ) && !Con.Active() ) { + if ( KM->altPressed() && KM->isKeyUp( KEY_M ) && !Con.active() ) { if ( !mWindow->isMaximized() ) mWindow->maximize(); } if ( KM->isKeyUp(KEY_F4) ) - TF->ReloadAllTextures(); + TF->reloadAllTextures(); if ( KM->altPressed() && KM->isKeyUp( KEY_RETURN ) ) { if ( mWindow->isWindowed() ) { @@ -1358,8 +1358,8 @@ void EETest::Input() { KM->grabInput( !KM->grabInput() ); if ( KM->isKeyUp( KEY_F3 ) || KM->isKeyUp( KEY_WORLD_26 ) || KM->isKeyUp( KEY_BACKSLASH ) ) { - Con.Toggle(); - InBuf.active( !Con.Active() ); + Con.toggle(); + InBuf.active( !Con.active() ); } if ( KM->isKeyUp(KEY_1) && KM->controlPressed() ) @@ -1474,13 +1474,13 @@ void EETest::Input() { break; case 2: if ( KM->isKeyUp(KEY_S) ) - SP.SetRepeations(1); + SP.setRepetitions(1); if ( KM->isKeyUp(KEY_A) ) - SP.SetRepeations(-1); + SP.setRepetitions(-1); if ( KM->isKeyUp(KEY_D) ) - SP.ReverseAnim( !SP.ReverseAnim() ); + SP.reverseAnim( !SP.reverseAnim() ); if ( KM->mouseRightPressed() ) DrawBack = true; @@ -1536,27 +1536,27 @@ void EETest::Process() { void EETest::ParticlesCallback( Particle * P, ParticleSystem * Me ) { Float x, y, radio; - Vector2f MePos( Me->Position() ); + Vector2f MePos( Me->position() ); - radio = (Math::randf(1.f, 1.2f) + sin( 20.0f / P->Id() )) * 24; - x = MePos.x + radio * cos( (Float)P->Id() ); - y = MePos.y + radio * sin( (Float)P->Id() ); - P->Reset(x, y, Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f)); + radio = (Math::randf(1.f, 1.2f) + sin( 20.0f / P->id() )) * 24; + x = MePos.x + radio * cos( (Float)P->id() ); + y = MePos.y + radio * sin( (Float)P->id() ); + P->reset(x, y, Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f), Math::randf(-10.f, 10.f)); P->Color( ColorAf(1.f, 0.6f, 0.3f, 1.f), 0.02f + Math::randf() * 0.3f ); } void EETest::Particles() { - PS[0].Position( Mousef ); + PS[0].position( Mousef ); if ( DrawBack ) - PS[1].Position( Mousef ); + PS[1].position( Mousef ); - PS[2].Position( HWidth, HHeight ); - PS[3].Position( Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) ); - PS[4].Position( -Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), -Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) ); + PS[2].position( HWidth, HHeight ); + PS[3].position( Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) ); + PS[4].position( -Math::cosAng(Ang) * 220.f + HWidth + Math::randf(0.f, 10.f), -Math::sinAng(Ang) * 220.f + HHeight + Math::randf(0.f, 10.f) ); for ( Uint32 i = 0; i < PS.size(); i++ ) - PS[i].Draw(); + PS[i].draw(); } #define GRABABLE_MASK_BIT (1<<31)