From 0c7385a3c896118e1fffe3ef3344f1824a5c500a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Sun, 22 Jun 2014 20:29:23 -0300 Subject: [PATCH] Graphics module refactored. --- include/eepp/audio/soundloader.hpp | 8 +- include/eepp/gaming/cgameobjectobject.hpp | 2 +- include/eepp/gaming/cgameobjectsprite.hpp | 12 +- include/eepp/gaming/cgameobjectsubtexture.hpp | 14 +- .../eepp/gaming/cgameobjectsubtextureex.hpp | 6 +- include/eepp/gaming/cgameobjectvirtual.hpp | 6 +- include/eepp/gaming/cmap.hpp | 6 +- include/eepp/gaming/mapeditor/cmapeditor.hpp | 2 +- include/eepp/graphics.hpp | 70 +++--- .../{cbatchrenderer.hpp => batchrenderer.hpp} | 18 +- .../graphics/{cconsole.hpp => console.hpp} | 20 +- include/eepp/graphics/{cfont.hpp => font.hpp} | 14 +- .../{cfontmanager.hpp => fontmanager.hpp} | 12 +- .../{cframebuffer.hpp => framebuffer.hpp} | 14 +- ...chrenderer.hpp => globalbatchrenderer.hpp} | 10 +- ...extureatlas.hpp => globaltextureatlas.hpp} | 10 +- .../eepp/graphics/{cimage.hpp => image.hpp} | 38 ++-- .../graphics/{cparticle.hpp => particle.hpp} | 6 +- ...cparticlesystem.hpp => particlesystem.hpp} | 14 +- include/eepp/graphics/pixelperfect.hpp | 12 +- .../{cprimitives.hpp => primitives.hpp} | 6 +- .../graphics/renderer/{cgl.hpp => gl.hpp} | 20 +- .../{crenderergl.hpp => renderergl.hpp} | 8 +- .../{crenderergl3.hpp => renderergl3.hpp} | 18 +- .../{crenderergl3cp.hpp => renderergl3cp.hpp} | 18 +- .../{crenderergles2.hpp => renderergles2.hpp} | 18 +- ...cscrollparallax.hpp => scrollparallax.hpp} | 20 +- .../eepp/graphics/{cshader.hpp => shader.hpp} | 20 +- .../{cshaderprogram.hpp => shaderprogram.hpp} | 38 ++-- ...ammanager.hpp => shaderprogrammanager.hpp} | 10 +- .../eepp/graphics/{csprite.hpp => sprite.hpp} | 48 ++-- .../{csubtexture.hpp => subtexture.hpp} | 26 +-- .../{ctextcache.hpp => textcache.hpp} | 20 +- .../graphics/{ctexture.hpp => texture.hpp} | 20 +- .../{ctextureatlas.hpp => textureatlas.hpp} | 26 +-- ...atlasloader.hpp => textureatlasloader.hpp} | 30 +-- ...lasmanager.hpp => textureatlasmanager.hpp} | 28 +-- ...ctexturefactory.hpp => texturefactory.hpp} | 24 +- .../{ctexturefont.hpp => texturefont.hpp} | 30 +-- ...refontloader.hpp => texturefontloader.hpp} | 36 +-- .../{ctextureloader.hpp => textureloader.hpp} | 18 +- .../{ctexturepacker.hpp => texturepacker.hpp} | 42 ++-- .../graphics/{cttffont.hpp => ttffont.hpp} | 16 +- .../{cttffontloader.hpp => ttffontloader.hpp} | 18 +- .../{cvertexbuffer.hpp => vertexbuffer.hpp} | 12 +- ...ertexbufferogl.hpp => vertexbufferogl.hpp} | 10 +- ...ertexbuffervbo.hpp => vertexbuffervbo.hpp} | 10 +- include/eepp/physics/cshapecirclesprite.hpp | 10 +- include/eepp/physics/cshapepolysprite.hpp | 14 +- include/eepp/system/objectloader.hpp | 10 +- include/eepp/system/packmanager.hpp | 2 +- include/eepp/ui/cuidefaulttheme.hpp | 2 +- include/eepp/ui/cuigfx.hpp | 18 +- include/eepp/ui/cuilistbox.hpp | 22 +- include/eepp/ui/cuimenu.hpp | 32 +-- include/eepp/ui/cuiprogressbar.hpp | 4 +- include/eepp/ui/cuipushbutton.hpp | 20 +- include/eepp/ui/cuiskin.hpp | 4 +- include/eepp/ui/cuiskincomplex.hpp | 6 +- include/eepp/ui/cuiskinsimple.hpp | 4 +- include/eepp/ui/cuisprite.hpp | 18 +- include/eepp/ui/cuitabwidget.hpp | 20 +- include/eepp/ui/cuitextbox.hpp | 16 +- include/eepp/ui/cuitextinputpassword.hpp | 4 +- include/eepp/ui/cuitheme.hpp | 38 ++-- include/eepp/ui/cuithememanager.hpp | 6 +- include/eepp/ui/cuitooltip.hpp | 18 +- include/eepp/ui/cuiwinmenu.hpp | 30 +-- include/eepp/ui/tools/ctextureatlaseditor.hpp | 30 +-- include/eepp/window/cursor.hpp | 12 +- include/eepp/window/cursormanager.hpp | 8 +- include/eepp/window/engine.hpp | 2 +- include/eepp/window/inputtextbuffer.hpp | 2 +- include/eepp/window/platformimpl.hpp | 8 +- projects/linux/ee.creator.user | 4 +- projects/linux/ee.files | 172 +++++++------- src/eepp/gaming/cgameobjectobject.cpp | 4 +- src/eepp/gaming/cgameobjectpolygon.cpp | 4 +- src/eepp/gaming/cgameobjectpolyline.cpp | 4 +- src/eepp/gaming/cgameobjectsprite.cpp | 20 +- src/eepp/gaming/cgameobjectsubtexture.cpp | 10 +- src/eepp/gaming/cgameobjectsubtextureex.cpp | 2 +- src/eepp/gaming/cgameobjectvirtual.cpp | 6 +- src/eepp/gaming/cmap.cpp | 40 ++-- src/eepp/gaming/cobjectlayer.cpp | 12 +- src/eepp/gaming/ctilelayer.cpp | 12 +- src/eepp/gaming/mapeditor/cmapeditor.cpp | 38 ++-- src/eepp/gaming/mapeditor/cuimap.hpp | 4 +- .../{cbatchrenderer.cpp => batchrenderer.cpp} | 132 +++++------ src/eepp/graphics/blendmode.cpp | 2 +- src/eepp/graphics/cfontmanager.cpp | 18 -- src/eepp/graphics/cframebuffermanager.cpp | 22 -- src/eepp/graphics/cglobalbatchrenderer.cpp | 14 -- src/eepp/graphics/cglobaltextureatlas.cpp | 16 -- .../graphics/{cconsole.cpp => console.cpp} | 134 +++++------ src/eepp/graphics/cshaderprogrammanager.cpp | 22 -- src/eepp/graphics/ctextureatlas.cpp | 72 ------ src/eepp/graphics/cvertexbuffermanager.cpp | 22 -- src/eepp/graphics/{cfont.cpp => font.cpp} | 84 +++---- src/eepp/graphics/fontmanager.cpp | 18 ++ .../{cframebuffer.cpp => framebuffer.cpp} | 44 ++-- ...cframebufferfbo.cpp => framebufferfbo.cpp} | 42 ++-- ...cframebufferfbo.hpp => framebufferfbo.hpp} | 12 +- src/eepp/graphics/framebuffermanager.cpp | 22 ++ ...ffermanager.hpp => framebuffermanager.hpp} | 10 +- src/eepp/graphics/globalbatchrenderer.cpp | 14 ++ src/eepp/graphics/globaltextureatlas.cpp | 16 ++ src/eepp/graphics/{cimage.cpp => image.cpp} | 108 ++++----- .../graphics/{cparticle.cpp => particle.cpp} | 12 +- ...cparticlesystem.cpp => particlesystem.cpp} | 94 ++++---- src/eepp/graphics/pixelperfect.cpp | 4 +- .../{cprimitives.cpp => primitives.cpp} | 60 ++--- .../graphics/renderer/{cgl.cpp => gl.cpp} | 44 ++-- .../{crenderergl.cpp => renderergl.cpp} | 68 +++--- .../{crenderergl3.cpp => renderergl3.cpp} | 100 ++++----- .../{crenderergl3cp.cpp => renderergl3cp.cpp} | 104 ++++----- .../{crenderergles2.cpp => renderergles2.cpp} | 114 +++++----- ...cscrollparallax.cpp => scrollparallax.cpp} | 32 +-- src/eepp/graphics/{cshader.cpp => shader.cpp} | 82 +++---- .../{cshaderprogram.cpp => shaderprogram.cpp} | 132 +++++------ src/eepp/graphics/shaderprogrammanager.cpp | 22 ++ src/eepp/graphics/{csprite.cpp => sprite.cpp} | 210 +++++++++--------- .../{csubtexture.cpp => subtexture.cpp} | 98 ++++---- .../{ctextcache.cpp => textcache.cpp} | 68 +++--- .../graphics/{ctexture.cpp => texture.cpp} | 146 ++++++------ src/eepp/graphics/textureatlas.cpp | 72 ++++++ ...atlasloader.cpp => textureatlasloader.cpp} | 86 +++---- ...lasmanager.cpp => textureatlasmanager.cpp} | 66 +++--- ...ctexturefactory.cpp => texturefactory.cpp} | 98 ++++---- .../{ctexturefont.cpp => texturefont.cpp} | 36 +-- ...refontloader.cpp => texturefontloader.cpp} | 48 ++-- .../{ctextureloader.cpp => textureloader.cpp} | 66 +++--- .../{ctexturepacker.cpp => texturepacker.cpp} | 162 +++++++------- ...repackernode.cpp => texturepackernode.cpp} | 14 +- ...repackernode.hpp => texturepackernode.hpp} | 14 +- ...turepackertex.cpp => texturepackertex.cpp} | 12 +- ...turepackertex.hpp => texturepackertex.hpp} | 13 +- .../{ctexturesaver.cpp => texturesaver.cpp} | 8 +- .../{ctexturesaver.hpp => texturesaver.hpp} | 6 +- .../graphics/{cttffont.cpp => ttffont.cpp} | 54 ++--- .../{cttffontloader.cpp => ttffontloader.cpp} | 46 ++-- .../{cvertexbuffer.cpp => vertexbuffer.cpp} | 60 ++--- src/eepp/graphics/vertexbuffermanager.cpp | 22 ++ ...fermanager.hpp => vertexbuffermanager.hpp} | 10 +- ...ertexbufferogl.cpp => vertexbufferogl.cpp} | 24 +- ...ertexbuffervbo.cpp => vertexbuffervbo.cpp} | 34 +-- .../physics/constraints/cdampedspring.cpp | 6 +- src/eepp/physics/constraints/cgroovejoint.cpp | 4 +- src/eepp/physics/constraints/cpinjoint.cpp | 4 +- src/eepp/physics/constraints/cpivotjoint.cpp | 4 +- src/eepp/physics/constraints/cslidejoint.cpp | 4 +- src/eepp/physics/cshape.cpp | 4 +- src/eepp/physics/cshapecircle.cpp | 6 +- src/eepp/physics/cshapecirclesprite.cpp | 8 +- src/eepp/physics/cshapepoint.cpp | 6 +- src/eepp/physics/cshapepoly.cpp | 6 +- src/eepp/physics/cshapepolysprite.cpp | 12 +- src/eepp/physics/cshapesegment.cpp | 6 +- src/eepp/physics/cspace.cpp | 4 +- src/eepp/ui/cuicheckbox.cpp | 6 +- src/eepp/ui/cuicombobox.cpp | 4 +- src/eepp/ui/cuicommondialog.cpp | 2 +- src/eepp/ui/cuicontrol.cpp | 18 +- src/eepp/ui/cuicontrolanim.cpp | 18 +- src/eepp/ui/cuidefaulttheme.cpp | 2 +- src/eepp/ui/cuigfx.cpp | 6 +- src/eepp/ui/cuilistbox.cpp | 6 +- src/eepp/ui/cuimanager.cpp | 6 +- src/eepp/ui/cuimenu.cpp | 12 +- src/eepp/ui/cuimessagebox.cpp | 4 +- src/eepp/ui/cuiprogressbar.cpp | 4 +- src/eepp/ui/cuipushbutton.cpp | 2 +- src/eepp/ui/cuiradiobutton.cpp | 6 +- src/eepp/ui/cuiscrollbar.cpp | 4 +- src/eepp/ui/cuiseparator.cpp | 2 +- src/eepp/ui/cuiskin.cpp | 2 +- src/eepp/ui/cuiskincomplex.cpp | 12 +- src/eepp/ui/cuiskinsimple.cpp | 10 +- src/eepp/ui/cuislider.cpp | 4 +- src/eepp/ui/cuispinbox.cpp | 4 +- src/eepp/ui/cuisprite.cpp | 16 +- src/eepp/ui/cuitabwidget.cpp | 12 +- src/eepp/ui/cuitextbox.cpp | 16 +- src/eepp/ui/cuitextedit.cpp | 4 +- src/eepp/ui/cuitextinput.cpp | 10 +- src/eepp/ui/cuitextinputpassword.cpp | 8 +- src/eepp/ui/cuitheme.cpp | 50 ++--- src/eepp/ui/cuithememanager.cpp | 4 +- src/eepp/ui/cuitooltip.cpp | 10 +- src/eepp/ui/cuiwindow.cpp | 4 +- src/eepp/ui/cuiwinmenu.cpp | 8 +- src/eepp/ui/tools/ctextureatlaseditor.cpp | 88 ++++---- src/eepp/ui/tools/ctextureatlasnew.cpp | 32 +-- src/eepp/ui/tools/ctextureatlasnew.hpp | 10 +- .../tools/ctextureatlassubtextureeditor.cpp | 22 +- .../tools/ctextureatlassubtextureeditor.hpp | 16 +- .../window/backend/SDL/cursormanagersdl.cpp | 4 +- .../window/backend/SDL/cursormanagersdl.hpp | 4 +- src/eepp/window/backend/SDL/cursorsdl.cpp | 4 +- src/eepp/window/backend/SDL/cursorsdl.hpp | 4 +- src/eepp/window/backend/SDL/windowsdl.cpp | 24 +- .../window/backend/SDL2/cursormanagersdl2.cpp | 4 +- .../window/backend/SDL2/cursormanagersdl2.hpp | 4 +- src/eepp/window/backend/SDL2/cursorsdl2.cpp | 4 +- src/eepp/window/backend/SDL2/cursorsdl2.hpp | 4 +- src/eepp/window/backend/SDL2/windowsdl2.cpp | 14 +- .../window/backend/SFML/cursormanagersfml.cpp | 4 +- .../window/backend/SFML/cursormanagersfml.hpp | 4 +- src/eepp/window/backend/SFML/cursorsfml.cpp | 4 +- src/eepp/window/backend/SFML/cursorsfml.hpp | 4 +- src/eepp/window/backend/SFML/windowsfml.cpp | 4 +- .../window/backend/null/cursormanagernull.cpp | 4 +- .../window/backend/null/cursormanagernull.hpp | 4 +- src/eepp/window/backend/null/cursornull.cpp | 4 +- src/eepp/window/backend/null/cursornull.hpp | 4 +- src/eepp/window/cursor.cpp | 16 +- src/eepp/window/engine.cpp | 32 +-- src/eepp/window/platform/null/nullimpl.cpp | 4 +- src/eepp/window/platform/null/nullimpl.hpp | 4 +- src/eepp/window/platform/osx/osximpl.cpp | 4 +- src/eepp/window/platform/osx/osximpl.hpp | 4 +- src/eepp/window/platform/win/cursorwin.cpp | 12 +- src/eepp/window/platform/win/cursorwin.hpp | 6 +- src/eepp/window/platform/win/winimpl.cpp | 4 +- src/eepp/window/platform/win/winimpl.hpp | 4 +- src/eepp/window/platform/x11/cursorx11.cpp | 4 +- src/eepp/window/platform/x11/cursorx11.hpp | 4 +- src/eepp/window/platform/x11/x11impl.cpp | 4 +- src/eepp/window/platform/x11/x11impl.hpp | 4 +- src/eepp/window/window.cpp | 20 +- src/examples/empty_window/empty_window.cpp | 2 +- .../external_shader/external_shader.cpp | 14 +- src/examples/fonts/fonts.cpp | 32 +-- src/examples/sprites/sprites.cpp | 28 +-- src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp | 16 +- src/test/eetest.cpp | 62 +++--- src/test/eetest.hpp | 52 ++--- 237 files changed, 2849 insertions(+), 2848 deletions(-) rename include/eepp/graphics/{cbatchrenderer.hpp => batchrenderer.hpp} (97%) rename include/eepp/graphics/{cconsole.hpp => console.hpp} (92%) rename include/eepp/graphics/{cfont.hpp => font.hpp} (92%) rename include/eepp/graphics/{cfontmanager.hpp => fontmanager.hpp} (66%) rename include/eepp/graphics/{cframebuffer.hpp => framebuffer.hpp} (88%) rename include/eepp/graphics/{cglobalbatchrenderer.hpp => globalbatchrenderer.hpp} (58%) rename include/eepp/graphics/{cglobaltextureatlas.hpp => globaltextureatlas.hpp} (64%) rename include/eepp/graphics/{cimage.hpp => image.hpp} (83%) rename include/eepp/graphics/{cparticle.hpp => particle.hpp} (96%) rename include/eepp/graphics/{cparticlesystem.hpp => particlesystem.hpp} (94%) rename include/eepp/graphics/{cprimitives.hpp => primitives.hpp} (98%) rename include/eepp/graphics/renderer/{cgl.hpp => gl.hpp} (95%) rename include/eepp/graphics/renderer/{crenderergl.hpp => renderergl.hpp} (95%) rename include/eepp/graphics/renderer/{crenderergl3.hpp => renderergl3.hpp} (91%) rename include/eepp/graphics/renderer/{crenderergl3cp.hpp => renderergl3cp.hpp} (91%) rename include/eepp/graphics/renderer/{crenderergles2.hpp => renderergles2.hpp} (91%) rename include/eepp/graphics/{cscrollparallax.hpp => scrollparallax.hpp} (77%) rename include/eepp/graphics/{cshader.hpp => shader.hpp} (83%) rename include/eepp/graphics/{cshaderprogram.hpp => shaderprogram.hpp} (72%) rename include/eepp/graphics/{cshaderprogrammanager.hpp => shaderprogrammanager.hpp} (66%) rename include/eepp/graphics/{csprite.hpp => sprite.hpp} (90%) rename include/eepp/graphics/{csubtexture.hpp => subtexture.hpp} (89%) rename include/eepp/graphics/{ctextcache.hpp => textcache.hpp} (84%) rename include/eepp/graphics/{ctexture.hpp => texture.hpp} (93%) rename include/eepp/graphics/{ctextureatlas.hpp => textureatlas.hpp} (78%) rename include/eepp/graphics/{ctextureatlasloader.hpp => textureatlasloader.hpp} (85%) rename include/eepp/graphics/{ctextureatlasmanager.hpp => textureatlasmanager.hpp} (67%) rename include/eepp/graphics/{ctexturefactory.hpp => texturefactory.hpp} (95%) rename include/eepp/graphics/{ctexturefont.hpp => texturefont.hpp} (71%) rename include/eepp/graphics/{ctexturefontloader.hpp => texturefontloader.hpp} (73%) rename include/eepp/graphics/{ctextureloader.hpp => textureloader.hpp} (76%) rename include/eepp/graphics/{ctexturepacker.hpp => texturepacker.hpp} (84%) rename include/eepp/graphics/{cttffont.hpp => ttffont.hpp} (92%) rename include/eepp/graphics/{cttffontloader.hpp => ttffontloader.hpp} (74%) rename include/eepp/graphics/{cvertexbuffer.hpp => vertexbuffer.hpp} (89%) rename include/eepp/graphics/{cvertexbufferogl.hpp => vertexbufferogl.hpp} (54%) rename include/eepp/graphics/{cvertexbuffervbo.hpp => vertexbuffervbo.hpp} (63%) rename src/eepp/graphics/{cbatchrenderer.cpp => batchrenderer.cpp} (76%) delete mode 100644 src/eepp/graphics/cfontmanager.cpp delete mode 100644 src/eepp/graphics/cframebuffermanager.cpp delete mode 100755 src/eepp/graphics/cglobalbatchrenderer.cpp delete mode 100644 src/eepp/graphics/cglobaltextureatlas.cpp rename src/eepp/graphics/{cconsole.cpp => console.cpp} (81%) delete mode 100644 src/eepp/graphics/cshaderprogrammanager.cpp delete mode 100644 src/eepp/graphics/ctextureatlas.cpp delete mode 100644 src/eepp/graphics/cvertexbuffermanager.cpp rename src/eepp/graphics/{cfont.cpp => font.cpp} (84%) create mode 100644 src/eepp/graphics/fontmanager.cpp rename src/eepp/graphics/{cframebuffer.cpp => framebuffer.cpp} (55%) rename src/eepp/graphics/{cframebufferfbo.cpp => framebufferfbo.cpp} (70%) rename src/eepp/graphics/{cframebufferfbo.hpp => framebufferfbo.hpp} (62%) create mode 100644 src/eepp/graphics/framebuffermanager.cpp rename src/eepp/graphics/{cframebuffermanager.hpp => framebuffermanager.hpp} (51%) create mode 100755 src/eepp/graphics/globalbatchrenderer.cpp create mode 100644 src/eepp/graphics/globaltextureatlas.cpp rename src/eepp/graphics/{cimage.cpp => image.cpp} (82%) rename src/eepp/graphics/{cparticle.cpp => particle.cpp} (60%) rename src/eepp/graphics/{cparticlesystem.cpp => particlesystem.cpp} (79%) rename src/eepp/graphics/{cprimitives.cpp => primitives.cpp} (80%) rename src/eepp/graphics/renderer/{cgl.cpp => gl.cpp} (94%) rename src/eepp/graphics/renderer/{crenderergl.cpp => renderergl.cpp} (80%) rename src/eepp/graphics/renderer/{crenderergl3.cpp => renderergl3.cpp} (79%) rename src/eepp/graphics/renderer/{crenderergl3cp.cpp => renderergl3cp.cpp} (82%) rename src/eepp/graphics/renderer/{crenderergles2.cpp => renderergles2.cpp} (79%) rename src/eepp/graphics/{cscrollparallax.cpp => scrollparallax.cpp} (74%) rename src/eepp/graphics/{cshader.cpp => shader.cpp} (75%) rename src/eepp/graphics/{cshaderprogram.cpp => shaderprogram.cpp} (56%) create mode 100644 src/eepp/graphics/shaderprogrammanager.cpp rename src/eepp/graphics/{csprite.cpp => sprite.cpp} (70%) rename src/eepp/graphics/{csubtexture.cpp => subtexture.cpp} (68%) rename src/eepp/graphics/{ctextcache.cpp => textcache.cpp} (66%) rename src/eepp/graphics/{ctexture.cpp => texture.cpp} (75%) create mode 100644 src/eepp/graphics/textureatlas.cpp rename src/eepp/graphics/{ctextureatlasloader.cpp => textureatlasloader.cpp} (77%) rename src/eepp/graphics/{ctextureatlasmanager.cpp => textureatlasmanager.cpp} (69%) rename src/eepp/graphics/{ctexturefactory.cpp => texturefactory.cpp} (54%) rename src/eepp/graphics/{ctexturefont.cpp => texturefont.cpp} (79%) rename src/eepp/graphics/{ctexturefontloader.cpp => texturefontloader.cpp} (55%) rename src/eepp/graphics/{ctextureloader.cpp => textureloader.cpp} (89%) rename src/eepp/graphics/{ctexturepacker.cpp => texturepacker.cpp} (76%) rename src/eepp/graphics/{ctexturepackernode.cpp => texturepackernode.cpp} (77%) rename src/eepp/graphics/{ctexturepackernode.hpp => texturepackernode.hpp} (72%) rename src/eepp/graphics/{ctexturepackertex.cpp => texturepackertex.cpp} (72%) rename src/eepp/graphics/{ctexturepackertex.hpp => texturepackertex.hpp} (90%) rename src/eepp/graphics/{ctexturesaver.cpp => texturesaver.cpp} (69%) rename src/eepp/graphics/{ctexturesaver.hpp => texturesaver.hpp} (67%) rename src/eepp/graphics/{cttffont.cpp => ttffont.cpp} (81%) rename src/eepp/graphics/{cttffontloader.cpp => ttffontloader.cpp} (53%) rename src/eepp/graphics/{cvertexbuffer.cpp => vertexbuffer.cpp} (55%) create mode 100644 src/eepp/graphics/vertexbuffermanager.cpp rename src/eepp/graphics/{cvertexbuffermanager.hpp => vertexbuffermanager.hpp} (51%) rename src/eepp/graphics/{cvertexbufferogl.cpp => vertexbufferogl.cpp} (80%) rename src/eepp/graphics/{cvertexbuffervbo.cpp => vertexbuffervbo.cpp} (91%) diff --git a/include/eepp/audio/soundloader.hpp b/include/eepp/audio/soundloader.hpp index 65286b795..65b1e11f4 100644 --- a/include/eepp/audio/soundloader.hpp +++ b/include/eepp/audio/soundloader.hpp @@ -61,7 +61,7 @@ template tSoundLoader::tSoundLoader( tSoundManager * SndMngr, const T& id, const std::string& filepath -) : ObjectLoader( ObjectLoader::SoundLoader ), +) : ObjectLoader( ObjectLoader::SoundLoaderType ), mLoadType(SND_LT_PATH), mSndMngr(SndMngr), mId(id), @@ -74,7 +74,7 @@ tSoundLoader::tSoundLoader( tSoundManager * SndMngr, const T& id, const char * Data, std::size_t SizeInBytes -) : ObjectLoader( ObjectLoader::SoundLoader ), +) : ObjectLoader( ObjectLoader::SoundLoaderType ), mLoadType(SND_LT_MEM), mSndMngr(SndMngr), mId(id), @@ -90,7 +90,7 @@ tSoundLoader::tSoundLoader( tSoundManager * SndMngr, std::size_t SamplesCount, unsigned int ChannelCount, unsigned int SampleRate -) : ObjectLoader( ObjectLoader::SoundLoader ), +) : ObjectLoader( ObjectLoader::SoundLoaderType ), mLoadType(SND_LT_SAMPLES), mSndMngr(SndMngr), mId(id), @@ -105,7 +105,7 @@ template tSoundLoader::tSoundLoader( tSoundManager * SndMngr, const T& id, Pack* Pack, const std::string& FilePackPath -) : ObjectLoader( ObjectLoader::SoundLoader ), +) : ObjectLoader( ObjectLoader::SoundLoaderType ), mLoadType(SND_LT_PACK), mSndMngr(SndMngr), mId(id), diff --git a/include/eepp/gaming/cgameobjectobject.hpp b/include/eepp/gaming/cgameobjectobject.hpp index 28be80eca..e1844a2d1 100644 --- a/include/eepp/gaming/cgameobjectobject.hpp +++ b/include/eepp/gaming/cgameobjectobject.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { diff --git a/include/eepp/gaming/cgameobjectsprite.hpp b/include/eepp/gaming/cgameobjectsprite.hpp index 0828cf818..abe129dec 100644 --- a/include/eepp/gaming/cgameobjectsprite.hpp +++ b/include/eepp/gaming/cgameobjectsprite.hpp @@ -5,14 +5,14 @@ #include namespace EE { namespace Graphics { -class cSprite; +class Sprite; }} namespace EE { namespace Gaming { class EE_API cGameObjectSprite : public cGameObject { public: - cGameObjectSprite( const Uint32& Flags, cLayer * Layer, cSprite * Sprite = NULL ); + cGameObjectSprite( const Uint32& Flags, cLayer * Layer, Graphics::Sprite * Sprite = NULL ); virtual ~cGameObjectSprite(); @@ -28,9 +28,9 @@ class EE_API cGameObjectSprite : public cGameObject { virtual Sizei Size(); - cSprite * Sprite() const; + Graphics::Sprite * Sprite() const; - void Sprite( cSprite * sprite ); + void Sprite( Graphics::Sprite * sprite ); virtual Uint32 Type() const; @@ -42,8 +42,8 @@ class EE_API cGameObjectSprite : public cGameObject { virtual void DataId( Uint32 Id ); protected: - cSprite * mSprite; - Vector2i mTilePos; + Graphics::Sprite * mSprite; + Vector2i mTilePos; }; }} diff --git a/include/eepp/gaming/cgameobjectsubtexture.hpp b/include/eepp/gaming/cgameobjectsubtexture.hpp index 348b26976..cd85892df 100644 --- a/include/eepp/gaming/cgameobjectsubtexture.hpp +++ b/include/eepp/gaming/cgameobjectsubtexture.hpp @@ -4,14 +4,14 @@ #include #include -#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { class EE_API cGameObjectSubTexture : public cGameObject { public: - cGameObjectSubTexture( const Uint32& Flags, cLayer * Layer, cSubTexture * SubTexture = NULL, const Vector2f& Pos = Vector2f() ); + cGameObjectSubTexture( const Uint32& Flags, cLayer * Layer, Graphics::SubTexture * SubTexture = NULL, const Vector2f& Pos = Vector2f() ); virtual ~cGameObjectSubTexture(); @@ -27,9 +27,9 @@ class EE_API cGameObjectSubTexture : public cGameObject { virtual Sizei Size(); - cSubTexture * SubTexture() const; + Graphics::SubTexture * SubTexture() const; - void SubTexture( cSubTexture * subTexture ); + void SubTexture( Graphics::SubTexture * subTexture ); virtual Uint32 Type() const; @@ -39,9 +39,9 @@ class EE_API cGameObjectSubTexture : public cGameObject { virtual void DataId( Uint32 Id ); protected: - cSubTexture * mSubTexture; - Vector2f mPos; - Vector2i mTilePos; + Graphics::SubTexture * mSubTexture; + Vector2f mPos; + Vector2i mTilePos; }; }} diff --git a/include/eepp/gaming/cgameobjectsubtextureex.hpp b/include/eepp/gaming/cgameobjectsubtextureex.hpp index 61361562b..34396670f 100644 --- a/include/eepp/gaming/cgameobjectsubtextureex.hpp +++ b/include/eepp/gaming/cgameobjectsubtextureex.hpp @@ -8,7 +8,7 @@ namespace EE { namespace Gaming { class EE_API cGameObjectSubTextureEx : public cGameObjectSubTexture { public: - cGameObjectSubTextureEx( const Uint32& Flags, cLayer * Layer, cSubTexture * SubTexture = NULL, const Vector2f& Pos = Vector2f(), EE_BLEND_MODE Blend = ALPHA_NORMAL, EE_RENDER_MODE Render = RN_NORMAL, Float Angle = 0.f, Vector2f Scale = Vector2f::One, ColorA Color = ColorA() ); + cGameObjectSubTextureEx( const Uint32& Flags, cLayer * Layer, Graphics::SubTexture * SubTexture = NULL, const Vector2f& Pos = Vector2f(), EE_BLEND_MODE Blend = ALPHA_NORMAL, EE_RENDER_MODE Render = RN_NORMAL, Float Angle = 0.f, Vector2f Scale = Vector2f::One, ColorA Color = ColorA() ); virtual ~cGameObjectSubTextureEx(); @@ -20,11 +20,11 @@ class EE_API cGameObjectSubTextureEx : public cGameObjectSubTexture { virtual void FlagSet( const Uint32& Flag ); protected: - EE_BLEND_MODE mBlend; + EE_BLEND_MODE mBlend; EE_RENDER_MODE mRender; Float mAngle; Vector2f mScale; - ColorA mColor; + ColorA mColor; ColorA * mVertexColors; }; diff --git a/include/eepp/gaming/cgameobjectvirtual.hpp b/include/eepp/gaming/cgameobjectvirtual.hpp index a7f6c7b71..6baa6fd7c 100644 --- a/include/eepp/gaming/cgameobjectvirtual.hpp +++ b/include/eepp/gaming/cgameobjectvirtual.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { @@ -14,7 +14,7 @@ class EE_API cGameObjectVirtual : public cGameObject { public: cGameObjectVirtual( Uint32 DataId, cLayer * Layer, const Uint32& Flags = GObjFlags::GAMEOBJECT_STATIC, Uint32 RealType = GAMEOBJECT_TYPE_VIRTUAL, const Vector2f& Pos = Vector2f() ); - cGameObjectVirtual( cSubTexture * SubTexture, cLayer * Layer, const Uint32& Flags = GObjFlags::GAMEOBJECT_STATIC, Uint32 RealType = GAMEOBJECT_TYPE_VIRTUAL, const Vector2f& Pos = Vector2f() ); + cGameObjectVirtual( SubTexture * SubTexture, cLayer * Layer, const Uint32& Flags = GObjFlags::GAMEOBJECT_STATIC, Uint32 RealType = GAMEOBJECT_TYPE_VIRTUAL, const Vector2f& Pos = Vector2f() ); virtual ~cGameObjectVirtual(); @@ -42,7 +42,7 @@ class EE_API cGameObjectVirtual : public cGameObject { Uint32 mDataId; Vector2f mPos; cLayer * mLayer; - cSubTexture * mSubTexture; + SubTexture * mSubTexture; }; }} diff --git a/include/eepp/gaming/cmap.hpp b/include/eepp/gaming/cmap.hpp index 4565bc807..1f36587de 100644 --- a/include/eepp/gaming/cmap.hpp +++ b/include/eepp/gaming/cmap.hpp @@ -14,7 +14,7 @@ #include using namespace EE::Window; -#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { @@ -187,7 +187,7 @@ class EE_API cMap { void SetUpdateCallback( MapUpdateCb Cb ); - cTexture * GetBlankTileTexture(); + Texture * GetBlankTileTexture(); bool IsTileBlocked( const Vector2i& TilePos ); @@ -266,7 +266,7 @@ class EE_API cMap { PropertiesMap mProperties; GOTypesList mObjTypes; CreateGOCb mCreateGOCb; - cTexture * mTileTex; + Texture * mTileTex; eeAABB mScreenAABB; cLightManager * mLightManager; MapDrawCb mDrawCb; diff --git a/include/eepp/gaming/mapeditor/cmapeditor.hpp b/include/eepp/gaming/mapeditor/cmapeditor.hpp index 3f51ce5af..b9e39cf05 100644 --- a/include/eepp/gaming/mapeditor/cmapeditor.hpp +++ b/include/eepp/gaming/mapeditor/cmapeditor.hpp @@ -38,7 +38,7 @@ class EE_API cMapEditor { cUIControl * mWinContainer; cUIListBox * mSubTextureList; cUIGfx * mGfxPreview; - cTextureAtlas * mCurSG; + TextureAtlas * mCurSG; cUIScrollBar * mMapHScroll; cUIScrollBar * mMapVScroll; cUIDropDownList * mGOTypeList; diff --git a/include/eepp/graphics.hpp b/include/eepp/graphics.hpp index 964510b6d..beedb248a 100644 --- a/include/eepp/graphics.hpp +++ b/include/eepp/graphics.hpp @@ -1,43 +1,43 @@ #ifndef EEPP_GRAPHICS_HPP #define EEPP_GRAPHICS_HPP -#include +#include #include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/include/eepp/graphics/cbatchrenderer.hpp b/include/eepp/graphics/batchrenderer.hpp similarity index 97% rename from include/eepp/graphics/cbatchrenderer.hpp rename to include/eepp/graphics/batchrenderer.hpp index f38dfd048..2263d97f9 100755 --- a/include/eepp/graphics/cbatchrenderer.hpp +++ b/include/eepp/graphics/batchrenderer.hpp @@ -18,24 +18,24 @@ struct eeVertex { ColorA color; }; -class cTextureFactory; -class cTexture; +class TextureFactory; +class Texture; /** @brief A batch rendering class. */ -class EE_API cBatchRenderer { +class EE_API BatchRenderer { public: - cBatchRenderer(); + BatchRenderer(); - virtual ~cBatchRenderer(); + virtual ~BatchRenderer(); /** Construct with a defined number of vertexs preallocated */ - cBatchRenderer( const unsigned int& Prealloc ); + BatchRenderer( const unsigned int& Prealloc ); /** Allocate space for vertexs */ 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 cTexture * Tex ); + void SetTexture( const Texture * Tex ); /** Set the predefined blending function to use on the batch */ void SetBlendMode( const EE_BLEND_MODE& Blend ); @@ -216,8 +216,8 @@ class EE_API cBatchRenderer { eeVertex * mTVertex; unsigned int mNumVertex; - const cTexture * mTexture; - cTextureFactory * mTF; + const Texture * mTexture; + TextureFactory * mTF; EE_BLEND_MODE mBlend; eeTexCoord mTexCoord[4]; diff --git a/include/eepp/graphics/cconsole.hpp b/include/eepp/graphics/console.hpp similarity index 92% rename from include/eepp/graphics/cconsole.hpp rename to include/eepp/graphics/console.hpp index 321604088..921ab12f1 100755 --- a/include/eepp/graphics/cconsole.hpp +++ b/include/eepp/graphics/console.hpp @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include #include namespace EE { namespace Window { class Window; class InputTextBuffer; class InputEvent; } } @@ -13,18 +13,18 @@ using namespace EE::Window; namespace EE { namespace Graphics { -class EE_API cConsole : protected LogReaderInterface { +class EE_API Console : protected LogReaderInterface { public: //! The Console Callback return a vector of parameters ( String ) typedef cb::Callback1& > ConsoleCallback; /** Instances the console but doesn't create it, you must call Create to initialize the console. */ - cConsole( EE::Window::Window * window = NULL ); + Console( EE::Window::Window * window = NULL ); /** Creates the console */ - cConsole( cFont* 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 ); - ~cConsole(); + ~Console(); /** Set the Console Height when it's Minimized ( Not Maximized ) */ void ConsoleMinimizedHeight( const Float& MinHeight ) { mHeightMin = MinHeight; if (mVisible && !mExpand) mCurHeight = mHeightMin; } @@ -87,13 +87,13 @@ class EE_API cConsole : protected LogReaderInterface { const Time& FadeSpeed() const { return mFadeSpeed; } /** @brief Creates the new console - * @param Font The cFont pointer to class + * @param Font The Font pointer to class * @param MakeDefaultCommands Register the default commands provided by the class? * @param AttachToLog Attach the console to the Log instance * @param MaxLogLines Maximun number of lines stored on the console * @param TextureId Background texture id ( 0 for no texture ) */ - void Create( cFont* 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 ); @@ -152,9 +152,9 @@ class EE_API cConsole : protected LogReaderInterface { InputTextBuffer * mTBuf; - cFont * mFont; + Font * mFont; - cPrimitives mPri; + Primitives mPri; Uint32 mTexId; typedef struct { diff --git a/include/eepp/graphics/cfont.hpp b/include/eepp/graphics/font.hpp similarity index 92% rename from include/eepp/graphics/cfont.hpp rename to include/eepp/graphics/font.hpp index c9d10617b..102d9c783 100755 --- a/include/eepp/graphics/cfont.hpp +++ b/include/eepp/graphics/font.hpp @@ -3,15 +3,15 @@ #include #include -#include -#include +#include +#include namespace EE { namespace Graphics { /** @brief Font interface class. */ -class EE_API cFont { +class EE_API Font { public: - virtual ~cFont(); + virtual ~Font(); /** Set a text to render * @param Text The Text @@ -93,7 +93,7 @@ class EE_API cFont { * @param Angle The angle of the string rendered * @param Effect Set the Blend Mode ( default ALPHA_NORMAL ) */ - void Draw( cTextCache& 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 @@ -147,9 +147,9 @@ class EE_API cFont { std::vector mGlyphs; std::vector mTexCoords; - cTextCache mTextCache; + TextCache mTextCache; - cFont( const Uint32& Type, const std::string& Name ); + Font( const Uint32& Type, const std::string& Name ); void CacheWidth(); }; diff --git a/include/eepp/graphics/cfontmanager.hpp b/include/eepp/graphics/fontmanager.hpp similarity index 66% rename from include/eepp/graphics/cfontmanager.hpp rename to include/eepp/graphics/fontmanager.hpp index 2036823ce..a65b61517 100644 --- a/include/eepp/graphics/cfontmanager.hpp +++ b/include/eepp/graphics/fontmanager.hpp @@ -2,23 +2,23 @@ #define EE_GRAPHICSCFONTMANAGER_HPP #include -#include +#include namespace EE { namespace Graphics { /** @brief The Font Manager is a singleton class that manages all the instance of fonts instanciated. And releases the font instances automatically. So the user doesn't need to release any font instance. */ -class EE_API cFontManager : public ResourceManager { - SINGLETON_DECLARE_HEADERS(cFontManager) +class EE_API FontManager : public ResourceManager { + SINGLETON_DECLARE_HEADERS(FontManager) public: - virtual ~cFontManager(); + virtual ~FontManager(); /** @brief Adds a new font to the manager */ - cFont * Add( cFont * Font ); + Graphics::Font * Add( Graphics::Font * Font ); protected: - cFontManager(); + FontManager(); }; }} diff --git a/include/eepp/graphics/cframebuffer.hpp b/include/eepp/graphics/framebuffer.hpp similarity index 88% rename from include/eepp/graphics/cframebuffer.hpp rename to include/eepp/graphics/framebuffer.hpp index fedf0dc5d..02c667dba 100644 --- a/include/eepp/graphics/cframebuffer.hpp +++ b/include/eepp/graphics/framebuffer.hpp @@ -2,7 +2,7 @@ #define EE_GRAPHICSCFRAMEBUFFER_HPP #include -#include +#include #include namespace EE { namespace Window { class Window; } } @@ -12,7 +12,7 @@ using namespace EE::Window; namespace EE { namespace Graphics { /** @brief A frame buffer allows rendering to a off-sreen 2D texture */ -class EE_API cFrameBuffer { +class EE_API FrameBuffer { public: /** @brief Creates a new instance of a frame buffer ** @param Width The frame buffer width @@ -20,9 +20,9 @@ class EE_API cFrameBuffer { ** @param DepthBuffer Indicates if a depth buffer is used ** @param window In case that the application is using more than one window, the user can indicate which one to use ( by default uses the current active window ) */ - static cFrameBuffer * New( const Uint32& Width, const Uint32& Height, bool DepthBuffer = false, EE::Window::Window * window = NULL ); + static FrameBuffer * New( const Uint32& Width, const Uint32& Height, bool DepthBuffer = false, EE::Window::Window * window = NULL ); - virtual ~cFrameBuffer(); + virtual ~FrameBuffer(); /** @brief Enables the off-screen rendering. ** From this moment any rendered primitive will be rendered to the frame buffer. @@ -45,7 +45,7 @@ class EE_API cFrameBuffer { ** The frame buffer must be unbinded before any rendering is done outside the frame buffer. ** For example MyFrameBufferPtr->GetTexture()->Draw(0,0); */ - cTexture * GetTexture() const; + Texture * GetTexture() const; /** @brief Sets the frame buffer clear color. */ void ClearColor( ColorAf Color ); @@ -66,12 +66,12 @@ class EE_API cFrameBuffer { Int32 mWidth; Int32 mHeight; bool mHasDepthBuffer; - cTexture * mTexture; + Texture * mTexture; ColorAf mClearColor; View mPrevView; float mProjMat[16]; - cFrameBuffer( EE::Window::Window * window ); + FrameBuffer( EE::Window::Window * window ); virtual bool Create( const Uint32& Width, const Uint32& Height ) = 0; diff --git a/include/eepp/graphics/cglobalbatchrenderer.hpp b/include/eepp/graphics/globalbatchrenderer.hpp similarity index 58% rename from include/eepp/graphics/cglobalbatchrenderer.hpp rename to include/eepp/graphics/globalbatchrenderer.hpp index 41d51b1aa..31a218aa6 100755 --- a/include/eepp/graphics/cglobalbatchrenderer.hpp +++ b/include/eepp/graphics/globalbatchrenderer.hpp @@ -2,18 +2,18 @@ #define EE_GAMINGCGLOBALBATCHRENDERER_H #include -#include +#include namespace EE { namespace Graphics { /** @brief The global Batch Renderer class. This class will be used by the engine for the rendering. */ -class EE_API cGlobalBatchRenderer : public cBatchRenderer { - SINGLETON_DECLARE_HEADERS(cGlobalBatchRenderer) +class EE_API GlobalBatchRenderer : public BatchRenderer { + SINGLETON_DECLARE_HEADERS(GlobalBatchRenderer) public: - ~cGlobalBatchRenderer(); + ~GlobalBatchRenderer(); protected: - cGlobalBatchRenderer(); + GlobalBatchRenderer(); }; }} diff --git a/include/eepp/graphics/cglobaltextureatlas.hpp b/include/eepp/graphics/globaltextureatlas.hpp similarity index 64% rename from include/eepp/graphics/cglobaltextureatlas.hpp rename to include/eepp/graphics/globaltextureatlas.hpp index 2e72032d1..817556e94 100644 --- a/include/eepp/graphics/cglobaltextureatlas.hpp +++ b/include/eepp/graphics/globaltextureatlas.hpp @@ -2,20 +2,20 @@ #define EE_GRAPHICSCGLOBALTEXTUREATLAS_HPP #include -#include +#include namespace EE { namespace Graphics { /** @brief Any SubTexture that doesn't belong to an specific TextureAtlas ( a real texture atlas texture ), goes here. This is useful to auto release the SubTextures. */ -class EE_API cGlobalTextureAtlas : public cTextureAtlas { - SINGLETON_DECLARE_HEADERS(cGlobalTextureAtlas) +class EE_API GlobalTextureAtlas : public TextureAtlas { + SINGLETON_DECLARE_HEADERS(GlobalTextureAtlas) public: - ~cGlobalTextureAtlas(); + ~GlobalTextureAtlas(); protected: - cGlobalTextureAtlas(); + GlobalTextureAtlas(); }; }} diff --git a/include/eepp/graphics/cimage.hpp b/include/eepp/graphics/image.hpp similarity index 83% rename from include/eepp/graphics/cimage.hpp rename to include/eepp/graphics/image.hpp index 02d7a178a..112f59256 100644 --- a/include/eepp/graphics/cimage.hpp +++ b/include/eepp/graphics/image.hpp @@ -19,7 +19,7 @@ class Pack; namespace EE { namespace Graphics { /** @brief A simple image class to manipulate them. */ -class EE_API cImage { +class EE_API Image { public: /** @return The current Jpeg save quality */ static Uint32 JpegQuality(); @@ -52,34 +52,34 @@ class EE_API cImage { /** @return The last failure image loading/info reason */ static std::string GetLastFailureReason(); - cImage(); + Image(); /** Copy a image data to create the new image */ - cImage( cImage * image ); + Image( Graphics::Image * image ); /** Use an existing image ( and appropriates the data passed ) */ - cImage( 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 */ - cImage( 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 */ - cImage( 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. * @param forceChannels Number of channels to use for the image, default 0 means that it use the default image channels. */ - cImage( std::string Path, const unsigned int& forceChannels = 0 ); + Image( std::string Path, const unsigned int& forceChannels = 0 ); /** Load an image from pack * @param Pack The pack file to use to load the image. * @param FilePackPath The path of the file inside the pack file. * @param forceChannels Number of channels to use for the image, default 0 means that it use the default image channels. */ - cImage( Pack * Pack, std::string FilePackPath, const unsigned int& forceChannels = 0 ); + Image( Pack * Pack, std::string FilePackPath, const unsigned int& forceChannels = 0 ); - virtual ~cImage(); + 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 ); @@ -142,7 +142,7 @@ class EE_API cImage { virtual void FillWithColor( const ColorA& Color ); /** Copy the image to this image data, starting from the position x,y */ - virtual void CopyImage( cImage * 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 ); @@ -154,32 +154,32 @@ class EE_API cImage { virtual void Flip(); /** Create a thumnail of the image */ - cImage * 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 */ - cImage * Crop( Recti rect ); + Graphics::Image * Crop( Recti rect ); - /** Set as true if you dont want to free the image data in the cImage destruction ( false as default ). */ + /** Set as true if you dont want to free the image data in the Image destruction ( false as default ). */ 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( cImage * 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 */ - cImage * Copy(); + Graphics::Image * Copy(); /** Overload the assigment operator to ensure the image copy */ - cImage& operator =(const cImage& right); + Graphics::Image& operator =(const Image& right); protected: static Uint32 sJpegQuality; Uint8 * mPixels; - unsigned int mWidth; - unsigned int mHeight; - unsigned int mChannels; + unsigned int mWidth; + unsigned int mHeight; + unsigned int mChannels; Uint32 mSize; bool mAvoidFree; bool mLoadedFromStbi; diff --git a/include/eepp/graphics/cparticle.hpp b/include/eepp/graphics/particle.hpp similarity index 96% rename from include/eepp/graphics/cparticle.hpp rename to include/eepp/graphics/particle.hpp index 01409438e..0b85835d1 100755 --- a/include/eepp/graphics/cparticle.hpp +++ b/include/eepp/graphics/particle.hpp @@ -7,10 +7,10 @@ namespace EE { namespace Graphics { /** @brief A simple particle class used by the particle system. ** Probably not useful for the end user. */ -class EE_API cParticle{ +class EE_API Particle{ public: - cParticle(); - ~cParticle(); + Particle(); + ~Particle(); void Color(ColorAf Color, Float AlphaDecay); ColorAf Color() const { return mColor; } diff --git a/include/eepp/graphics/cparticlesystem.hpp b/include/eepp/graphics/particlesystem.hpp similarity index 94% rename from include/eepp/graphics/cparticlesystem.hpp rename to include/eepp/graphics/particlesystem.hpp index 733e1f2af..26402790f 100755 --- a/include/eepp/graphics/cparticlesystem.hpp +++ b/include/eepp/graphics/particlesystem.hpp @@ -2,7 +2,7 @@ #define EECPARTICLESYSTEM_H #include -#include +#include namespace EE { namespace Graphics { @@ -31,13 +31,13 @@ enum EE_PARTICLE_EFFECT { }; /** @brief Basic but powerfull Particle System */ -class EE_API cParticleSystem { +class EE_API ParticleSystem { public: - typedef cb::Callback2 ParticleCallback; + typedef cb::Callback2 ParticleCallback; - cParticleSystem(); + ParticleSystem(); - virtual ~cParticleSystem(); + virtual ~ParticleSystem(); /** Creates the new effect * @param Effect Number of the effect. @@ -151,7 +151,7 @@ class EE_API cParticleSystem { /** Set The Acceleration of the effect */ void Acceleration( const Vector2f& acc ); private: - cParticle * mParticle; + Particle * mParticle; Uint32 mPCount; Uint32 mTexId; Uint32 mPLeft; @@ -180,7 +180,7 @@ class EE_API cParticleSystem { void Begin(); - virtual void Reset( cParticle * P ); + virtual void Reset( Particle * P ); ParticleCallback mPC; }; diff --git a/include/eepp/graphics/pixelperfect.hpp b/include/eepp/graphics/pixelperfect.hpp index 8d47dfe2f..b4caecd44 100644 --- a/include/eepp/graphics/pixelperfect.hpp +++ b/include/eepp/graphics/pixelperfect.hpp @@ -1,7 +1,7 @@ #ifndef EE_GRAPHICS_PIXELPERFECT_H #define EE_GRAPHICS_PIXELPERFECT_H -#include +#include namespace EE { namespace Graphics { @@ -12,12 +12,12 @@ namespace EE { namespace Graphics { * @param Tex2 Second Texture Id * @param x2 Screen X axis position for the second texture * @param y2 Screen Y axis position for the second texture -* @param Tex1_SrcRECT The sector of the texture from TexId_1 that you are rendering, the sector you want to collide ( on cSprite the SprSrcRECT ) -* @param Tex2_SrcRECT The sector of the texture from TexId_2 that you are rendering, the sector you want to collide ( on cSprite the SprSrcRECT ) +* @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 ) +* @param Tex2_SrcRECT The sector of the texture from TexId_2 that you are rendering, the sector you want to collide ( on Sprite the SprSrcRECT ) * @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( cTexture * Tex1, const unsigned int& x1, const unsigned int& y1, cTexture * 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 @@ -25,10 +25,10 @@ bool EE_API PixelPerfectCollide( cTexture * Tex1, const unsigned int& x1, const * @param y1 Screen Y axis position for the first texture * @param x2 Screen X axis position for the point on screen * @param y2 Screen Y axis position for the point on screen -* @param Tex1_SrcRECT The sector of the texture from TexId_1 that you are rendering, the sector you want to collide ( on cSprite the SprSrcRECT ) +* @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( cTexture * 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/cprimitives.hpp b/include/eepp/graphics/primitives.hpp similarity index 98% rename from include/eepp/graphics/cprimitives.hpp rename to include/eepp/graphics/primitives.hpp index e92ddef44..0b31abe6a 100755 --- a/include/eepp/graphics/cprimitives.hpp +++ b/include/eepp/graphics/primitives.hpp @@ -7,11 +7,11 @@ namespace EE { namespace Graphics { /** @brief Basic primitives rendering class */ -class EE_API cPrimitives { +class EE_API Primitives { public: - cPrimitives(); + Primitives(); - ~cPrimitives(); + ~Primitives(); /** Draw a point on the screen * @param p The coordinates diff --git a/include/eepp/graphics/renderer/cgl.hpp b/include/eepp/graphics/renderer/gl.hpp similarity index 95% rename from include/eepp/graphics/renderer/cgl.hpp rename to include/eepp/graphics/renderer/gl.hpp index dbc33b539..2eac558dd 100644 --- a/include/eepp/graphics/renderer/cgl.hpp +++ b/include/eepp/graphics/renderer/gl.hpp @@ -2,7 +2,7 @@ #define EE_GRAPHICS_CGL_HPP #include -#include +#include #include namespace EE { namespace Graphics { @@ -11,10 +11,10 @@ namespace EE { namespace Graphics { #define EE_MAX_PLANES 6 #endif -class cRendererGL; -class cRendererGL3; -class cRendererGL3CP; -class cRendererGLES2; +class RendererGL; +class RendererGL3; +class RendererGL3CP; +class RendererGLES2; /** @brief This class is an abstraction of some OpenGL functionality. * eepp have 3 different rendering pipelines: OpenGL 2, OpenGL 3 and OpenGL ES 2. This abstraction is to encapsulate this pipelines. @@ -112,13 +112,13 @@ class EE_API cGL { void PixelStorei (unsigned int pname, int param); - cRendererGL * GetRendererGL(); + RendererGL * GetRendererGL(); - cRendererGL3 * GetRendererGL3(); + RendererGL3 * GetRendererGL3(); - cRendererGL3CP * GetRendererGL3CP(); + RendererGL3CP * GetRendererGL3CP(); - cRendererGLES2 * GetRendererGLES2(); + RendererGLES2 * GetRendererGLES2(); virtual void PointSize( float size ) = 0; @@ -164,7 +164,7 @@ class EE_API cGL { virtual void TexCoordPointer ( int size, unsigned int type, int stride, const void *pointer, unsigned int allocate ) = 0; - virtual void SetShader( cShaderProgram * Shader ); + virtual void SetShader( ShaderProgram * Shader ); virtual void Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) = 0; diff --git a/include/eepp/graphics/renderer/crenderergl.hpp b/include/eepp/graphics/renderer/renderergl.hpp similarity index 95% rename from include/eepp/graphics/renderer/crenderergl.hpp rename to include/eepp/graphics/renderer/renderergl.hpp index 18ba32aed..46ae8e347 100644 --- a/include/eepp/graphics/renderer/crenderergl.hpp +++ b/include/eepp/graphics/renderer/renderergl.hpp @@ -1,18 +1,18 @@ #ifndef EE_GRAPHICS_CRENDERERGL_HPP #define EE_GRAPHICS_CRENDERERGL_HPP -#include +#include namespace EE { namespace Graphics { //! Avoid compilling the fixed pipeline renderer for GLES2, because it's not supported. #if !defined( EE_GLES2 ) || defined( EE_GLES_BOTH ) -class EE_API cRendererGL : public cGL { +class EE_API RendererGL : public cGL { public: - cRendererGL(); + RendererGL(); - ~cRendererGL(); + ~RendererGL(); EEGL_version Version(); diff --git a/include/eepp/graphics/renderer/crenderergl3.hpp b/include/eepp/graphics/renderer/renderergl3.hpp similarity index 91% rename from include/eepp/graphics/renderer/crenderergl3.hpp rename to include/eepp/graphics/renderer/renderergl3.hpp index 0eb62c26a..c98a2bfc6 100644 --- a/include/eepp/graphics/renderer/crenderergl3.hpp +++ b/include/eepp/graphics/renderer/renderergl3.hpp @@ -1,7 +1,7 @@ #ifndef EE_GRAPHICS_CRENDERERGL3_HPP #define EE_GRAPHICS_CRENDERERGL3_HPP -#include +#include #ifdef EE_GL3_ENABLED @@ -16,11 +16,11 @@ namespace Private { class cMatrixStack; } -class EE_API cRendererGL3 : public cGL { +class EE_API RendererGL3 : public cGL { public: - cRendererGL3(); + RendererGL3(); - ~cRendererGL3(); + ~RendererGL3(); EEGL_version Version(); @@ -70,7 +70,7 @@ class EE_API cRendererGL3 : public cGL { unsigned int BaseShaderId(); - void SetShader( cShaderProgram * Shader ); + void SetShader( ShaderProgram * Shader ); void SetShader( const EEGL3_SHADERS& Shader ); @@ -106,13 +106,13 @@ class EE_API cRendererGL3 : public cGL { int mProjectionMatrix_id; // cpu-side hook to shader uniform int mModelViewMatrix_id; // cpu-side hook to shader uniform unsigned int mCurrentMode; - cShaderProgram * mShaders[ EEGL3_SHADERS_COUNT ]; - cShaderProgram * mCurShader; + ShaderProgram * mShaders[ EEGL3_SHADERS_COUNT ]; + ShaderProgram * mCurShader; int mAttribsLoc[ EEGL_ARRAY_STATES_COUNT ]; int mAttribsLocStates[ EEGL_ARRAY_STATES_COUNT ]; int mPlanes[ EE_MAX_PLANES ]; int mPlanesStates[ EE_MAX_PLANES ]; - cShaderProgram * mShaderPrev; + ShaderProgram * mShaderPrev; Int32 mTexActive; int mTexActiveLoc; int mPointSpriteLoc; @@ -128,7 +128,7 @@ class EE_API cRendererGL3 : public cGL { void PlaneStateCheck( bool tryEnable ); - void ReloadShader( cShaderProgram * Shader ); + void ReloadShader( ShaderProgram * Shader ); }; }} diff --git a/include/eepp/graphics/renderer/crenderergl3cp.hpp b/include/eepp/graphics/renderer/renderergl3cp.hpp similarity index 91% rename from include/eepp/graphics/renderer/crenderergl3cp.hpp rename to include/eepp/graphics/renderer/renderergl3cp.hpp index c974f6e38..8a1947f91 100644 --- a/include/eepp/graphics/renderer/crenderergl3cp.hpp +++ b/include/eepp/graphics/renderer/renderergl3cp.hpp @@ -1,7 +1,7 @@ #ifndef EE_GRAPHICS_CRENDERERGL3CP_HPP #define EE_GRAPHICS_CRENDERERGL3CP_HPP -#include +#include #ifdef EE_GL3_ENABLED @@ -16,11 +16,11 @@ namespace Private { class cMatrixStack; } -class EE_API cRendererGL3CP : public cGL { +class EE_API RendererGL3CP : public cGL { public: - cRendererGL3CP(); + RendererGL3CP(); - ~cRendererGL3CP(); + ~RendererGL3CP(); EEGL_version Version(); @@ -70,7 +70,7 @@ class EE_API cRendererGL3CP : public cGL { unsigned int BaseShaderId(); - void SetShader( cShaderProgram * Shader ); + void SetShader( ShaderProgram * Shader ); void SetShader( const EEGL3CP_SHADERS& Shader ); @@ -108,15 +108,15 @@ class EE_API cRendererGL3CP : public cGL { int mProjectionMatrix_id; // cpu-side hook to shader uniform int mModelViewMatrix_id; // cpu-side hook to shader uniform unsigned int mCurrentMode; - cShaderProgram * mShaders[ EEGL3CP_SHADERS_COUNT ]; - cShaderProgram * mCurShader; + ShaderProgram * mShaders[ EEGL3CP_SHADERS_COUNT ]; + ShaderProgram * mCurShader; unsigned int mVAO; unsigned int mVBO[ 8 ]; int mAttribsLoc[ EEGL_ARRAY_STATES_COUNT ]; int mAttribsLocStates[ EEGL_ARRAY_STATES_COUNT ]; int mPlanes[ EE_MAX_PLANES ]; int mPlanesStates[ EE_MAX_PLANES ]; - cShaderProgram * mShaderPrev; + ShaderProgram * mShaderPrev; Int32 mTexActive; int mTexActiveLoc; int mPointSpriteLoc; @@ -135,7 +135,7 @@ class EE_API cRendererGL3CP : public cGL { void PlaneStateCheck( bool tryEnable ); - void ReloadShader( cShaderProgram * Shader ); + void ReloadShader( ShaderProgram * Shader ); void AllocateBuffers( const Uint32& size ); }; diff --git a/include/eepp/graphics/renderer/crenderergles2.hpp b/include/eepp/graphics/renderer/renderergles2.hpp similarity index 91% rename from include/eepp/graphics/renderer/crenderergles2.hpp rename to include/eepp/graphics/renderer/renderergles2.hpp index 2801bb4ce..aaa4b25bc 100644 --- a/include/eepp/graphics/renderer/crenderergles2.hpp +++ b/include/eepp/graphics/renderer/renderergles2.hpp @@ -1,7 +1,7 @@ #ifndef EE_GRAPHICS_CRENDERERGLES2_HPP #define EE_GRAPHICS_CRENDERERGLES2_HPP -#include +#include #ifdef EE_GL3_ENABLED @@ -19,11 +19,11 @@ namespace Private { class cMatrixStack; } -class EE_API cRendererGLES2 : public cGL { +class EE_API RendererGLES2 : public cGL { public: - cRendererGLES2(); + RendererGLES2(); - ~cRendererGLES2(); + ~RendererGLES2(); EEGL_version Version(); @@ -73,7 +73,7 @@ class EE_API cRendererGLES2 : public cGL { unsigned int BaseShaderId(); - void SetShader( cShaderProgram * Shader ); + void SetShader( ShaderProgram * Shader ); void SetShader( const EEGLES2_SHADERS& Shader ); @@ -109,13 +109,13 @@ class EE_API cRendererGLES2 : public cGL { int mProjectionMatrix_id; // cpu-side hook to shader uniform int mModelViewMatrix_id; // cpu-side hook to shader uniform unsigned int mCurrentMode; - cShaderProgram * mShaders[ EEGLES2_SHADERS_COUNT ]; - cShaderProgram * mCurShader; + ShaderProgram * mShaders[ EEGLES2_SHADERS_COUNT ]; + ShaderProgram * mCurShader; int mAttribsLoc[ EEGL_ARRAY_STATES_COUNT ]; int mAttribsLocStates[ EEGL_ARRAY_STATES_COUNT ]; int mPlanes[ EE_MAX_PLANES ]; int mPlanesStates[ EE_MAX_PLANES ]; - cShaderProgram * mShaderPrev; + ShaderProgram * mShaderPrev; Int32 mTexActive; int mTexActiveLoc; int mClippingEnabledLoc; @@ -133,7 +133,7 @@ class EE_API cRendererGLES2 : public cGL { void PlaneStateCheck( bool tryEnable ); - void ReloadShader( cShaderProgram * Shader ); + void ReloadShader( ShaderProgram * Shader ); void CheckLocalShader(); }; diff --git a/include/eepp/graphics/cscrollparallax.hpp b/include/eepp/graphics/scrollparallax.hpp similarity index 77% rename from include/eepp/graphics/cscrollparallax.hpp rename to include/eepp/graphics/scrollparallax.hpp index f8637c30c..b297859ec 100755 --- a/include/eepp/graphics/cscrollparallax.hpp +++ b/include/eepp/graphics/scrollparallax.hpp @@ -2,19 +2,19 @@ #define EE_GRAPHICSCSCROLLPARALLAX_H #include -#include -#include +#include +#include namespace EE { namespace Graphics { /** @brief The scroll parallax renders a SubTexture to the screen from a position and a size specified. If the size is bigger than the SubTexture, the SubTexture is rendered as a repeated SubTexture until it covers all the size of the parallax, adding movement to more than one Scroll Parallax will generate the ilusion of depth. ** More info in wikipedia: http://en.wikipedia.org/wiki/Parallax_scrolling */ -class EE_API cScrollParallax { +class EE_API ScrollParallax { public: - cScrollParallax(); + ScrollParallax(); - ~cScrollParallax(); + ~ScrollParallax(); /** Constructor that create's the Scroll Parallax * @param SubTexture The SubTexture to Draw @@ -23,7 +23,7 @@ class EE_API cScrollParallax { * @param Speed Speed of movement ( in Pixels Per Second ) * @param Color The Texture Color * @param Blend The Blend Mode ( default ALPHA_NORMAL ) */ - cScrollParallax( cSubTexture * 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,7 +34,7 @@ class EE_API cScrollParallax { * @param Blend The Blend Mode ( default ALPHA_NORMAL ) * @return True if success */ - bool Create( cSubTexture * 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; } @@ -66,10 +66,10 @@ class EE_API cScrollParallax { const Vector2f& Position() const; /** @return The SubTexture used for the parallax.*/ - cSubTexture * SubTexture() const; + Graphics::SubTexture * SubTexture() const; /** Set Change the SubTexture used for the parallax. */ - void SubTexture( cSubTexture * subTexture ); + void SubTexture( Graphics::SubTexture * subTexture ); /** Set the parallax speed movement. */ void Speed( const Vector2f& speed ); @@ -77,7 +77,7 @@ class EE_API cScrollParallax { /** @return The parallax movement speed. */ const Vector2f& Speed() const; private: - cSubTexture * mSubTexture; + Graphics::SubTexture * mSubTexture; EE_BLEND_MODE mBlend; ColorA mColor; Vector2f mInitPos; diff --git a/include/eepp/graphics/cshader.hpp b/include/eepp/graphics/shader.hpp similarity index 83% rename from include/eepp/graphics/cshader.hpp rename to include/eepp/graphics/shader.hpp index 3516c5ea7..be7046f2c 100644 --- a/include/eepp/graphics/cshader.hpp +++ b/include/eepp/graphics/shader.hpp @@ -6,7 +6,7 @@ namespace EE { namespace Graphics { /** @brief The basic shader class. */ -class EE_API cShader { +class EE_API Shader { public: /** Activates/Deactivates shader convertion from fixed pipeline to programmable pipeline ( activated by default ) */ static void Ensure( bool ensure ); @@ -15,21 +15,21 @@ class EE_API cShader { static bool Ensure(); /** Constructor with type of shader, next you'll need to set the source and compile it. */ - cShader( const Uint32& Type ); + Shader( const Uint32& Type ); /** Create a type of shader and load the shader from a file, and compile it. */ - cShader( const Uint32& Type, const std::string& Filename ); + Shader( const Uint32& Type, const std::string& Filename ); /** Create a type of shader from memory, and compile it. */ - cShader( const Uint32& Type, const char * Data, const Uint32& DataSize ); + Shader( const Uint32& Type, const char * Data, const Uint32& DataSize ); /** Create a type of shader loaded from a pack file */ - cShader( const Uint32& Type, Pack * Pack, const std::string& Filename ); + Shader( const Uint32& Type, Pack * Pack, const std::string& Filename ); /** Create a type of shader from memory, and compile it. */ - cShader( const Uint32& Type, const char ** Data, const Uint32& NumLines ); + Shader( const Uint32& Type, const char ** Data, const Uint32& NumLines ); - virtual ~cShader(); + virtual ~Shader(); /** Set the shader source */ void SetSource( const std::string& Source ); @@ -64,7 +64,7 @@ class EE_API cShader { /** Reloads the Shader. */ void Reload(); protected: - friend class cRendererGL3; + friend class RendererGL3; static bool sEnsure; Uint32 mGLId; Uint32 mType; @@ -82,7 +82,7 @@ class EE_API cShader { }; /** @brief Prebuild Vertex Shader class */ -class EE_API cVertexShader : public cShader { +class EE_API cVertexShader : public Shader { public: cVertexShader(); cVertexShader( const std::string& Filename ); @@ -92,7 +92,7 @@ class EE_API cVertexShader : public cShader { }; /** @brief Prebuild Fragment Shader class */ -class EE_API cFragmentShader : public cShader { +class EE_API cFragmentShader : public Shader { public: cFragmentShader(); cFragmentShader( const std::string& Filename ); diff --git a/include/eepp/graphics/cshaderprogram.hpp b/include/eepp/graphics/shaderprogram.hpp similarity index 72% rename from include/eepp/graphics/cshaderprogram.hpp rename to include/eepp/graphics/shaderprogram.hpp index d16ad333c..7ed284d09 100644 --- a/include/eepp/graphics/cshaderprogram.hpp +++ b/include/eepp/graphics/shaderprogram.hpp @@ -2,7 +2,7 @@ #define EE_GRAPHICSCSHADERPROGRAM_H #include -#include +#include namespace EE { namespace Graphics { @@ -10,35 +10,35 @@ namespace EE { namespace Graphics { @short Program is a GPU-executed program that is ready to be used for manipulating geometry and colors. * ShaderProgram can encapsulate vertex and fragment shaders or just one of them. If only either vertex or fragment shader is used, then traditional fixed-function pipeline is used for the other stage. */ -class EE_API cShaderProgram { +class EE_API ShaderProgram { public: /** Creates an empty shader program */ - static cShaderProgram * New( const std::string& name = "" ); + static ShaderProgram * New( const std::string& name = "" ); /** Creates a program shader with a vector of shaders and link them. */ - static cShaderProgram * New( const std::vector& Shaders, const std::string& name = "" ); + static ShaderProgram * New( const std::vector& Shaders, const std::string& name = "" ); /** Creates a VertexShader from file and a Fragment Shader from file, and link them. */ - static cShaderProgram * 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& name = "" ); /** Creates a VertexShader from memory and a Fragment Shader from memory, and link them. */ - static cShaderProgram * 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& name = "" ); /** Creates the vertex shader and fragment shader from two files inside a pack */ - static cShaderProgram * 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& name = "" ); /** Creates the vertex and fragment shader from an array of strings */ - static cShaderProgram * 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& name = "" ); - typedef cb::Callback1 ShaderProgramReloadCb; + typedef cb::Callback1 ShaderProgramReloadCb; - virtual ~cShaderProgram(); + virtual ~ShaderProgram(); /** Add a new shader */ - void AddShader( cShader* 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(); @@ -139,7 +139,7 @@ class EE_API cShaderProgram { bool mValid; std::string mLinkLog; - std::vector mShaders; + std::vector mShaders; std::map mUniformLocations; std::map mAttributeLocations; @@ -152,22 +152,22 @@ class EE_API cShaderProgram { void RemoveFromManager(); /** Creates an empty shader program */ - cShaderProgram( const std::string& name = "" ); + ShaderProgram( const std::string& name = "" ); /** Construct a program shader with a vector of shaders and link them. */ - cShaderProgram( const std::vector& Shaders, const std::string& name = "" ); + ShaderProgram( const std::vector& Shaders, const std::string& name = "" ); /** Constructor that creates a VertexShader from file and a Fragment Shader from file, and link them. */ - cShaderProgram( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& name = "" ); + ShaderProgram( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& name = "" ); /** Constructor that creates a VertexShader from memory and a Fragment Shader from memory, and link them. */ - cShaderProgram( 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& name = "" ); /** Constructor that creates the vertex shader and fragment shader from two files inside a pack */ - cShaderProgram( 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& name = "" ); /** Constructor that creates the vertex and fragment shader from an array of strings */ - cShaderProgram( 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& name = "" ); }; }} diff --git a/include/eepp/graphics/cshaderprogrammanager.hpp b/include/eepp/graphics/shaderprogrammanager.hpp similarity index 66% rename from include/eepp/graphics/cshaderprogrammanager.hpp rename to include/eepp/graphics/shaderprogrammanager.hpp index c466ece63..b689f1310 100644 --- a/include/eepp/graphics/cshaderprogrammanager.hpp +++ b/include/eepp/graphics/shaderprogrammanager.hpp @@ -2,21 +2,21 @@ #define EE_GRAPHICSSHADERPROGRAMANAGER_HPP #include -#include +#include namespace EE { namespace Graphics { /** @brief The Shader Program Manager is a singleton class that manages all the instances of Shader Programs instanciated. Releases the Shader Program instances automatically. So the user doesn't need to release any Shader Program instance. */ -class EE_API cShaderProgramManager : public ResourceManager { - SINGLETON_DECLARE_HEADERS(cShaderProgramManager) +class EE_API ShaderProgramManager : public ResourceManager { + SINGLETON_DECLARE_HEADERS(ShaderProgramManager) public: - virtual ~cShaderProgramManager(); + virtual ~ShaderProgramManager(); void Reload(); protected: - cShaderProgramManager(); + ShaderProgramManager(); }; }} diff --git a/include/eepp/graphics/csprite.hpp b/include/eepp/graphics/sprite.hpp similarity index 90% rename from include/eepp/graphics/csprite.hpp rename to include/eepp/graphics/sprite.hpp index e9bb785e6..83b39ce70 100755 --- a/include/eepp/graphics/csprite.hpp +++ b/include/eepp/graphics/sprite.hpp @@ -2,17 +2,17 @@ #define EE_GRAPHICSCSPRITE_HPP #include -#include -#include -#include +#include +#include +#include namespace EE { namespace Graphics { /** @brief A Sprite controller class, can hold and control sprites animations. */ -class EE_API cSprite { +class EE_API Sprite { public: /// Event ID - Sprite - User Data - typedef cb::Callback3< void, Uint32, cSprite *, void * > SpriteCallback; + typedef cb::Callback3< void, Uint32, Sprite *, void * > SpriteCallback; /** @brief SpriteEvents The events that can be reported by the Sprite */ enum SpriteEvents { @@ -23,7 +23,7 @@ class EE_API cSprite { }; /** Instanciate an empty sprite */ - cSprite(); + Sprite(); /** Creates an animated Sprite from a animation name. It will 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 ). @@ -31,13 +31,13 @@ class EE_API cSprite { * @param extension Extension of the sub texture name ( if have one, otherwise is empty ) * @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. - * @see cTextureAtlasManager::GetSubTexturesByPattern + * @see TextureAtlasManager::GetSubTexturesByPattern */ - cSprite( const std::string& name, const std::string& extension = "", cTextureAtlas * SearchInTextureAtlas = NULL ); + Sprite( const std::string& name, const std::string& extension = "", TextureAtlas * SearchInTextureAtlas = NULL ); /** Creates a Sprite from a SubTexture ** @param SubTexture The subtexture to use */ - cSprite( cSubTexture * SubTexture ); + Sprite( SubTexture * SubTexture ); /** Creates a Sprite instance that holds a new SubTexture from a texture already loaded. * @param TexId The texture Id used to create the SubTexture @@ -45,11 +45,11 @@ class EE_API cSprite { * @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 */ - cSprite( 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 ~cSprite(); + virtual ~Sprite(); - cSprite& operator =( const cSprite& Other ); + Sprite& operator =( const Sprite& Other ); /** Set the x axis position */ void X( const Float& X ); @@ -198,7 +198,7 @@ class EE_API cSprite { * @param SubTexture The sprite SubTexture * @return True if success */ - bool CreateStatic( cSubTexture * SubTexture ); + bool CreateStatic( SubTexture * SubTexture ); /** Creates an static sprite (no animation). It creates a new SubTexture. * @param TexId The internal Texture Id @@ -227,17 +227,17 @@ class EE_API cSprite { * @param SubTexture The SubTexture used in the frame * @return The frame position or 0 if fails */ - unsigned int AddFrame( cSubTexture * 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 cTextureAtlasManager::GetSubTexturesByPattern */ - bool AddFramesByPattern( const std::string& name, const std::string& extension = "", cTextureAtlas * SearchInTextureAtlas = NULL ); + /** @see TextureAtlasManager::GetSubTexturesByPattern */ + bool AddFramesByPattern( const std::string& name, const std::string& extension = "", TextureAtlas * SearchInTextureAtlas = NULL ); - bool AddFramesByPatternId( const Uint32& SubTextureId, const std::string& extension, cTextureAtlas * 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 @@ -256,7 +256,7 @@ class EE_API cSprite { * @param NumSubFrame The Sub Frame Number * @return True if success */ - bool AddSubFrame( cSubTexture * 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(); @@ -311,13 +311,13 @@ class EE_API cSprite { void SetReverseFromStart(); /** @return The Current SubTexture */ - cSubTexture * GetCurrentSubTexture(); + SubTexture * GetCurrentSubTexture(); /** @return The SubTexture Frame from the current sub frame */ - cSubTexture * GetSubTexture( const unsigned int& frame ); + SubTexture * GetSubTexture( const unsigned int& frame ); /** @return The SubTexture Frame from the SubFrame */ - cSubTexture * 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 @@ -339,7 +339,7 @@ class EE_API cSprite { void ClearCallback(); /** Creates a copy of the current sprite and return it */ - cSprite * Copy(); + Sprite * Copy(); /** Update the sprite animation */ void Update( const Time& ElapsedTime ); @@ -384,7 +384,7 @@ class EE_API cSprite { class cFrame { public: - std::vector Spr; + std::vector Spr; }; std::vector mFrames; diff --git a/include/eepp/graphics/csubtexture.hpp b/include/eepp/graphics/subtexture.hpp similarity index 89% rename from include/eepp/graphics/csubtexture.hpp rename to include/eepp/graphics/subtexture.hpp index 23853ec39..695a00b4a 100644 --- a/include/eepp/graphics/csubtexture.hpp +++ b/include/eepp/graphics/subtexture.hpp @@ -2,29 +2,29 @@ #define EE_GRAPHICSCSUBTEXTURE_H #include -#include +#include #include namespace EE { namespace Graphics { -/** @brief A cSubTexture is a part of a texture that represent an sprite.*/ -class EE_API cSubTexture { +/** @brief A SubTexture is a part of a texture that represent an sprite.*/ +class EE_API SubTexture { public: /** Creates an empty SubTexture */ - cSubTexture(); + SubTexture(); /** Creates a SubTexture from a Texture. It will use the full Texture as a SubTexture. * @param TexId The texture id * @param Name The texture name ( if any ) */ - cSubTexture( const Uint32& TexId, const std::string& Name = "" ); + SubTexture( const Uint32& TexId, const std::string& Name = "" ); /** 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 ) */ - cSubTexture( const Uint32& TexId, const Recti& SrcRect, const std::string& Name = "" ); + SubTexture( const Uint32& TexId, const Recti& SrcRect, const std::string& Name = "" ); /** Creates a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -32,7 +32,7 @@ class EE_API cSubTexture { * @param DestSize The destination size that the SubTexture will have when rendered. * @param Name The texture name ( if any ) */ - cSubTexture( 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& Name = "" ); /** Creates a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -41,9 +41,9 @@ class EE_API cSubTexture { * @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 ) */ - cSubTexture( 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& Name = "" ); - virtual ~cSubTexture(); + virtual ~SubTexture(); /** @return The SubTexture Id. The Id is the String::Hash of the SubTexture name. */ const Uint32& Id() const; @@ -87,7 +87,7 @@ class EE_API cSubTexture { 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. */ - cTexture * GetTexture(); + Graphics::Texture * GetTexture(); /** Replaces a color in the SubTexture ( needs Lock() ) */ void ReplaceColor( ColorA ColorKey, ColorA NewColor ); @@ -121,11 +121,11 @@ class EE_API cSubTexture { void ClearCache(); /** @brief Locks the texture to be able to perform read/write operations. - * @see cTexture::Lock */ + * @see Texture::Lock */ Uint8 * Lock(); /** @brief Unlocks the current texture locked. - * @see cTexture::Unlock */ + * @see Texture::Unlock */ bool Unlock( const bool& KeepData = false, const bool& Modified = false ); /** @return The SubTexture size in the texture. This is the source rect size. */ @@ -149,7 +149,7 @@ class EE_API cSubTexture { std::string mName; Uint32 mId; Uint32 mTexId; - cTexture * mTexture; + Graphics::Texture * mTexture; Recti mSrcRect; Sizef mDestSize; Vector2i mOffset; diff --git a/include/eepp/graphics/ctextcache.hpp b/include/eepp/graphics/textcache.hpp similarity index 84% rename from include/eepp/graphics/ctextcache.hpp rename to include/eepp/graphics/textcache.hpp index 3179757dc..a71e3ec08 100644 --- a/include/eepp/graphics/ctextcache.hpp +++ b/include/eepp/graphics/textcache.hpp @@ -6,26 +6,26 @@ namespace EE { namespace Graphics { -class cFont; +class Font; /** @brief Caches text for a fast font rendering. */ -class EE_API cTextCache { +class EE_API TextCache { public: /** Create a text from a font */ - cTextCache( cFont * font, const String& text = "", ColorA FontColor = ColorA(255,255,255,255), ColorA FontShadowColor = ColorA(0,0,0,255) ); + TextCache( Graphics::Font * font, const String& text = "", ColorA FontColor = ColorA(255,255,255,255), ColorA FontShadowColor = ColorA(0,0,0,255) ); - cTextCache(); + TextCache(); - ~cTextCache(); + ~TextCache(); /** Create a text from a font */ - void Create( cFont * 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 */ - cFont * Font() const; + Graphics::Font * Font() const; /** Change the font used for the text cache */ - void Font( cFont * font ); + void Font( Graphics::Font * font ); /** @return The text cached */ String& Text(); @@ -86,10 +86,10 @@ class EE_API cTextCache { /** Force to cache the width of the current text */ void Cache(); protected: - friend class cFont; + friend class Font; String mText; - cFont * mFont; + Graphics::Font * mFont; Float mCachedWidth; int mNumLines; diff --git a/include/eepp/graphics/ctexture.hpp b/include/eepp/graphics/texture.hpp similarity index 93% rename from include/eepp/graphics/ctexture.hpp rename to include/eepp/graphics/texture.hpp index f952ff638..0c91ae35b 100755 --- a/include/eepp/graphics/ctexture.hpp +++ b/include/eepp/graphics/texture.hpp @@ -2,14 +2,14 @@ #define EE_GRAPHICSCTEXTURE_H #include -#include +#include #include #include #include namespace EE { namespace Graphics { -class EE_API cTexture : public cImage, private NonCopyable { +class EE_API Texture : public Image, private NonCopyable { public: /** Set the OpenGL Texture Id (texture handle) */ void Handle( const int& texture ) { mTexture = texture; } @@ -51,7 +51,7 @@ class EE_API cTexture : public cImage, private NonCopyable { /** @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 cTexture methods to do this, it will already know that this is true, so it will upload the changes to the GPU. + * @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); @@ -83,7 +83,7 @@ class EE_API cTexture : public cImage, private NonCopyable { void Scale( const Float& scale, EE_RESAMPLER_FILTER filter = RESAMPLER_LANCZOS4 ); /** Copy an image inside the texture */ - void CopyImage( cImage * 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 @@ -122,7 +122,7 @@ class EE_API cTexture : public cImage, 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( cImage * 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(); @@ -225,7 +225,7 @@ class EE_API cTexture : public cImage, private NonCopyable { /** Bind the texture. Activate the texture for rendering. */ void Bind(); - virtual ~cTexture(); + virtual ~Texture(); protected: enum TEXTURE_FLAGS { @@ -236,13 +236,13 @@ class EE_API cTexture : public cImage, private NonCopyable { TEX_FLAG_GRABED = ( 1 << 4 ) }; - friend class cTextureFactory; + friend class TextureFactory; - cTexture(); + Texture(); - cTexture( 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 ); - cTexture( const cTexture& 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 ); diff --git a/include/eepp/graphics/ctextureatlas.hpp b/include/eepp/graphics/textureatlas.hpp similarity index 78% rename from include/eepp/graphics/ctextureatlas.hpp rename to include/eepp/graphics/textureatlas.hpp index a12ee8b0d..31fbd0261 100644 --- a/include/eepp/graphics/ctextureatlas.hpp +++ b/include/eepp/graphics/textureatlas.hpp @@ -2,35 +2,35 @@ #define EE_GRAPHICSCTEXTUREATLAS_H #include -#include +#include namespace EE { namespace Graphics { /** @brief The texture atlas class represents a large image containing a collection of sub-images, or "atlas" which contains many smaller sub-images. * The texture atlas in eepp can represent more than one texture or image, but the common use should be a image with sub-images. * More information about Texture Atlases: http://en.wikipedia.org/wiki/Texture_atlas */ -class EE_API cTextureAtlas : public ResourceManager { +class EE_API TextureAtlas : public ResourceManager { public: /** Creates a new texture atlas with the given name. */ - cTextureAtlas( const std::string& name = "" ); + TextureAtlas( const std::string& name = "" ); - ~cTextureAtlas(); + ~TextureAtlas(); /** Adds a SubTexture to the Texture Atlas */ - cSubTexture * Add( cSubTexture * subTexture ); + SubTexture * Add( SubTexture * subTexture ); /** Creates and add to the texture atlas a SubTexture from a Texture. It will use the full Texture as a SubTexture. * @param TexId The texture id * @param Name The texture name ( if any ) */ - cSubTexture * Add( const Uint32& TexId, const std::string& Name = "" ); + SubTexture * Add( const Uint32& TexId, const std::string& Name = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id * @param SrcRect The texture part that will be used as the SubTexture. * @param Name The texture name ( if any ) */ - cSubTexture * Add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name = "" ); + SubTexture * Add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -38,7 +38,7 @@ class EE_API cTextureAtlas : public ResourceManager { * @param DestSize The destination size that the SubTexture will have when rendered. * @param Name The texture name ( if any ) */ - cSubTexture * Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name = "" ); + SubTexture * Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name = "" ); /** Creates and add to the texture atlas a SubTexture of the indicated part of the texture. * @param TexId The texture id @@ -47,7 +47,7 @@ class EE_API cTextureAtlas : 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 ) */ - cSubTexture * Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name = "" ); + SubTexture * Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name = "" ); /** @return The texture atlas name. */ const std::string& Name() const; @@ -73,19 +73,19 @@ class EE_API cTextureAtlas : 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. */ - cTexture * 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(); protected: - friend class cTextureAtlasLoader; + friend class TextureAtlasLoader; std::string mName; Uint32 mId; std::string mPath; - std::vector mTextures; + std::vector mTextures; - void SetTextures( std::vector textures ); + void SetTextures( std::vector textures ); }; }} diff --git a/include/eepp/graphics/ctextureatlasloader.hpp b/include/eepp/graphics/textureatlasloader.hpp similarity index 85% rename from include/eepp/graphics/ctextureatlasloader.hpp rename to include/eepp/graphics/textureatlasloader.hpp index aae08eea7..1a5b3f754 100644 --- a/include/eepp/graphics/ctextureatlasloader.hpp +++ b/include/eepp/graphics/textureatlasloader.hpp @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -12,15 +12,15 @@ namespace EE { namespace Graphics { using namespace Private; -class cTextureAtlas; +class TextureAtlas; /** @brief The Texture Atlas Loader loads any previously created Texture Atlas. */ -class EE_API cTextureAtlasLoader { +class EE_API TextureAtlasLoader { public: - typedef cb::Callback1 GLLoadCallback; + typedef cb::Callback1 GLLoadCallback; /** Creates an empty loader. The texture atlas can be loaded callin any Load* function. */ - cTextureAtlasLoader(); + TextureAtlasLoader(); /** 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. @@ -28,7 +28,7 @@ class EE_API cTextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - cTextureAtlasLoader( 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 cTextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - cTextureAtlasLoader( 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 cTextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - cTextureAtlasLoader( 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,9 +55,9 @@ class EE_API cTextureAtlasLoader { * @param Threaded Indicates if the loading is done in another thread. * @param LoadCallback The load notification callback. */ - cTextureAtlasLoader( IOStream& IOS, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); + TextureAtlasLoader( IOStream& IOS, const bool& Threaded = false, GLLoadCallback LoadCallback = GLLoadCallback() ); - ~cTextureAtlasLoader(); + ~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(); @@ -112,13 +112,13 @@ class EE_API cTextureAtlasLoader { /** @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. */ - cTexture * 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(); /** @return The texture atlas instance pointer ( NULL if the atlas isn't loaded yet ). */ - cTextureAtlas * GetTextureAtlas() const; + TextureAtlas * GetTextureAtlas() const; /** Sets a load notification callback. */ void SetLoadCallback( GLLoadCallback LoadCallback ); @@ -130,9 +130,9 @@ class EE_API cTextureAtlasLoader { Pack * mPack; bool mSkipResourceLoad; bool mIsLoading; - cTextureAtlas * mTextureAtlas; + TextureAtlas * mTextureAtlas; GLLoadCallback mLoadCallback; - std::vector mTexuresLoaded; + std::vector mTexuresLoaded; typedef struct sTempTexAtlasS { sTextureHdr Texture; diff --git a/include/eepp/graphics/ctextureatlasmanager.hpp b/include/eepp/graphics/textureatlasmanager.hpp similarity index 67% rename from include/eepp/graphics/ctextureatlasmanager.hpp rename to include/eepp/graphics/textureatlasmanager.hpp index 0189545b9..c1370f15d 100644 --- a/include/eepp/graphics/ctextureatlasmanager.hpp +++ b/include/eepp/graphics/textureatlasmanager.hpp @@ -2,38 +2,38 @@ #define EE_GRAPHICSCTEXTUREATLASMANAGER_HPP #include -#include -#include +#include +#include namespace EE { namespace Graphics { /** @brief The Texture Atlas Manager is a singleton class that manages all the instances of Texture Atlases instanciated. Releases the Texture Atlases instances automatically. So the user doesn't need to release any Texture Atlas instance. */ -class EE_API cTextureAtlasManager : public ResourceManager { - SINGLETON_DECLARE_HEADERS(cTextureAtlasManager) +class EE_API TextureAtlasManager : public ResourceManager { + SINGLETON_DECLARE_HEADERS(TextureAtlasManager) public: - virtual ~cTextureAtlasManager(); + virtual ~TextureAtlasManager(); /** Loads a texture atlas from its path ( the texture atlas binary is expected, not the texture, the ".eta" file ). */ - cTextureAtlas * Load( const std::string& TextureAtlasPath ); + TextureAtlas * Load( const std::string& TextureAtlasPath ); /** Loads a texture atlas from a io stream. */ - cTextureAtlas * LoadFromStream( IOStream& IOS ); + TextureAtlas * LoadFromStream( IOStream& IOS ); /** Loads a texture atlas from memory. */ - cTextureAtlas * 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. */ - cTextureAtlas * 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. */ - cSubTexture * 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. */ - cSubTexture * 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,13 +42,13 @@ class EE_API cTextureAtlasManager : 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 = "", cTextureAtlas * 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 = "", cTextureAtlas * 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(); @@ -61,7 +61,7 @@ class EE_API cTextureAtlasManager : public ResourceManager { protected: bool mWarnings; - cTextureAtlasManager(); + TextureAtlasManager(); }; }} diff --git a/include/eepp/graphics/ctexturefactory.hpp b/include/eepp/graphics/texturefactory.hpp similarity index 95% rename from include/eepp/graphics/ctexturefactory.hpp rename to include/eepp/graphics/texturefactory.hpp index 8f32e274f..652fc7669 100755 --- a/include/eepp/graphics/ctexturefactory.hpp +++ b/include/eepp/graphics/texturefactory.hpp @@ -6,11 +6,11 @@ namespace EE { namespace Graphics { -class cTexture; +class Texture; /** @brief The Texture Manager Class. Here we do all the textures stuff. (Singleton Class) */ -class EE_API cTextureFactory : protected Mutex { - SINGLETON_DECLARE_HEADERS(cTextureFactory) +class EE_API TextureFactory : protected Mutex { + SINGLETON_DECLARE_HEADERS(TextureFactory) public: /** Creates an empty texture @@ -101,7 +101,7 @@ class EE_API cTextureFactory : protected Mutex { * @param Tex The Texture Pointer * @param TextureUnit The Texture Unit binded */ - void Bind( const cTexture* Tex, const Uint32& TextureUnit = 0 ); + void Bind( const Texture* Tex, const Uint32& TextureUnit = 0 ); /** * @param TexId The internal Texture Id @@ -148,7 +148,7 @@ class EE_API cTextureFactory : protected Mutex { bool TextureIdExists( const Uint32& TexId ); /** @return A pointer to the Texture */ - cTexture* GetTexture( const Uint32& TexId ); + Texture* GetTexture( const Uint32& TexId ); /** Get a local copy for all the textures */ void GrabTextures(); @@ -182,25 +182,25 @@ class EE_API cTextureFactory : protected Mutex { * @param Name File path name * @return The texture, NULL if not exists. */ - cTexture * 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 */ - cTexture * GetByHash( const Uint32& Hash ); + Texture * GetByHash( const Uint32& Hash ); - ~cTextureFactory(); + ~TextureFactory(); protected: - friend class cTexture; + friend class Texture; - cTextureFactory(); + TextureFactory(); int mCurrentTexture[ EE_MAX_TEXTURE_UNITS ]; EE_BLEND_MODE mLastBlend; - std::vector mTextures; + std::vector mTextures; unsigned int mMemSize; @@ -214,7 +214,7 @@ class EE_API cTextureFactory : protected Mutex { const bool& IsErasing() const; - void RemoveReference( cTexture * Tex ); + void RemoveReference( Texture * Tex ); }; }} diff --git a/include/eepp/graphics/ctexturefont.hpp b/include/eepp/graphics/texturefont.hpp similarity index 71% rename from include/eepp/graphics/ctexturefont.hpp rename to include/eepp/graphics/texturefont.hpp index ae102d9c8..61c59d61d 100755 --- a/include/eepp/graphics/ctexturefont.hpp +++ b/include/eepp/graphics/texturefont.hpp @@ -2,22 +2,22 @@ #define EECTEXTUREFONT_H #include -#include -#include +#include +#include namespace EE { namespace Graphics { /** @brief This class loads texture fonts and draw strings to the screen. */ -class EE_API cTextureFont : public cFont { +class EE_API TextureFont : public Font { public: /** Creates an instance of a texture font */ - static cTextureFont * New( const std::string FontName ); + 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 ( cTextureFactory::instance()->Remove( MyFontInstance->GetTexId() ) ). */ - virtual ~cTextureFont(); + /** 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 - * @param TexId The texture id returned by cTextureFactory + * @param TexId The texture id returned by TextureFactory * @param StartChar The fist char represented on the texture * @param Spacing The space between every char ( default 0 means TextureWidth / TexColumns ) * @param TexColumns The number of chars per column @@ -27,31 +27,31 @@ class EE_API cTextureFont : public cFont { */ 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 cTTFFont class ) - * @param TexId The texture id returned by cTextureFactory + /** 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 ); /** - * @param TexId The texture id returned by cTextureFactory + * @param TexId The texture id returned by TextureFactory * @param Pack Pointer to the pack instance * @param FilePackPath The path of the file inside the pack * @return True success */ 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 cTTFFont class ) - * @param TexId The texture id returned by cTextureFactory + /** 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 * @param CoordData The character coordinates buffer pointer * @param CoordDataSize The size of CoordData * @return True if success */ 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 cTTFFont class ) - * @param TexId The texture id returned by cTextureFactory + /** 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 */ @@ -70,7 +70,7 @@ class EE_API cTextureFont : public cFont { bool mLoadedCoords; - cTextureFont( const std::string FontName ); + TextureFont( const std::string FontName ); void BuildFont(); diff --git a/include/eepp/graphics/ctexturefontloader.hpp b/include/eepp/graphics/texturefontloader.hpp similarity index 73% rename from include/eepp/graphics/ctexturefontloader.hpp rename to include/eepp/graphics/texturefontloader.hpp index 0549e5e52..92c67c770 100644 --- a/include/eepp/graphics/ctexturefontloader.hpp +++ b/include/eepp/graphics/texturefontloader.hpp @@ -2,16 +2,16 @@ #define EE_GRAPHICSCTEXTUREFONTLOADER #include -#include -#include +#include +#include #include -#include +#include namespace EE { namespace Graphics { /** @brief The Texture Font loads a texture font in synchronous or asynchronous mode. @see ObjectLoader */ -class EE_API cTextureFontLoader : public ObjectLoader { +class EE_API TextureFontLoader : public ObjectLoader { public: /** Loads a texture font from a texture ( only for monospaced fonts ) * @param FontName The font name @@ -22,32 +22,32 @@ class EE_API cTextureFontLoader : public ObjectLoader { * @param TexRows The number of chars per row * @param NumChars The number of characters to read from the texture */ - cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const unsigned int& StartChar = 0, const unsigned int& Spacing = 0, const unsigned int& TexColumns = 16, const unsigned int& TexRows = 16, const Uint16& NumChars = 256 ); + TextureFontLoader( const std::string FontName, TextureLoader * TexLoader, 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 cTTFFont class ) + /** Load's a texture font and then load's the character coordinates file ( generated by the TTFFont class ) * @param FontName The font name * @param TexLoader An instance of a texture loader that will be used to load the texture. The instance will be released by the Texture Font Loader when is destroyed. - * @param CoordinatesDatPath The character coordinates file ( this is the file created when the TTF font was converted to a texture font. @see cTTFFont::Save ). + * @param CoordinatesDatPath The character coordinates file ( this is the file created when the TTF font was converted to a texture font. @see TTFFont::Save ). */ - cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const std::string& CoordinatesDatPath ); + TextureFontLoader( const std::string FontName, TextureLoader * TexLoader, const std::string& CoordinatesDatPath ); - /** Load's a texture font and then load's the character coordinates file ( generated by the cTTFFont class ) stored in a pack file. + /** Load's a texture font and then load's the character coordinates file ( generated by the TTFFont class ) stored in a pack file. * @param FontName The font name * @param TexLoader An instance of a texture loader that will be used to load the texture. The instance will be released by the Texture Font Loader when is destroyed. * @param Pack The pack used to load the characters coordinates - * @param FilePackPath The character coordinates file path inside the pack ( this is the file created when the TTF font was converted to a texture font. @see cTTFFont::Save ). + * @param FilePackPath The character coordinates file path inside the pack ( this is the file created when the TTF font was converted to a texture font. @see TTFFont::Save ). */ - cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, Pack * Pack, const std::string& FilePackPath ); + TextureFontLoader( const std::string FontName, TextureLoader * TexLoader, Pack * Pack, const std::string& FilePackPath ); - /** Load's a texture font and then load's the character coordinates file ( generated by the cTTFFont class ) from memory. + /** Load's a texture font and then load's the character coordinates file ( generated by the TTFFont class ) from memory. * @param FontName The font name * @param TexLoader An instance of a texture loader that will be used to load the texture. The instance will be released by the Texture Font Loader when is destroyed. - * @param CoordData The character coordinates buffer pointer ( this is the file created when the TTF font was converted to a texture font. @see cTTFFont::Save ). + * @param CoordData The character coordinates buffer pointer ( this is the file created when the TTF font was converted to a texture font. @see TTFFont::Save ). * @param CoordDataSize The buffer pointer size */ - cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const char* CoordData, const Uint32& CoordDataSize ); + TextureFontLoader( const std::string FontName, TextureLoader * TexLoader, const char* CoordData, const Uint32& CoordDataSize ); - virtual ~cTextureFontLoader(); + virtual ~TextureFontLoader(); /** Updates the current state of the loading in progress ( must be called from the instancer thread, usually the main thread ). * @see ObjectLoader::Update */ @@ -60,7 +60,7 @@ class EE_API cTextureFontLoader : public ObjectLoader { const std::string& Id() const; /** @return The instance of the font created after loading it. ( NULL if was not created yet ) */ - cFont * Font() const; + Graphics::Font * Font() const; protected: enum TEXTURE_FONT_LOAD_TYPE { @@ -72,10 +72,10 @@ class EE_API cTextureFontLoader : public ObjectLoader { Uint32 mLoadType; // From memory, from path, from pack - cTextureFont * mFont; + TextureFont * mFont; std::string mFontName; - cTextureLoader * mTexLoader; + TextureLoader * mTexLoader; std::string mFilepath; diff --git a/include/eepp/graphics/ctextureloader.hpp b/include/eepp/graphics/textureloader.hpp similarity index 76% rename from include/eepp/graphics/ctextureloader.hpp rename to include/eepp/graphics/textureloader.hpp index f7cc900ca..87b35a57f 100644 --- a/include/eepp/graphics/ctextureloader.hpp +++ b/include/eepp/graphics/textureloader.hpp @@ -6,12 +6,12 @@ namespace EE { namespace Graphics { -class cTexture; +class Texture; /** @brief The Texture loader loads a texture in synchronous or asynchronous mode. @see ObjectLoader */ -class EE_API cTextureLoader : public ObjectLoader { +class EE_API TextureLoader : public ObjectLoader { public: /** Load a Texture from stream * @param Stream The io stream instance @@ -20,7 +20,7 @@ class EE_API cTextureLoader : 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 ) */ - cTextureLoader( IOStream& Stream, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + TextureLoader( 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 @@ -29,7 +29,7 @@ class EE_API cTextureLoader : 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 ) */ - cTextureLoader( 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 @@ -39,7 +39,7 @@ class EE_API cTextureLoader : 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 ) */ - cTextureLoader( 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 ); + TextureLoader( 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 a Pack file * @param Pack Pointer to the pack instance @@ -49,7 +49,7 @@ class EE_API cTextureLoader : 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 ) */ - cTextureLoader( 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 ); + TextureLoader( 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 ); /** Loads a RAW Texture from Memory * @param Pixels The Texture array @@ -62,9 +62,9 @@ class EE_API cTextureLoader : public ObjectLoader { * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @param FileName A filename to recognize the texture ( the path in case that was loaded from outside the texture factory ). */ - cTextureLoader( 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("") ); + TextureLoader( 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("") ); - virtual ~cTextureLoader(); + 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 ); @@ -83,7 +83,7 @@ class EE_API cTextureLoader : public ObjectLoader { const Uint32& Id() const; /** @return The texture instance ( if it was loaded ). */ - cTexture * GetTexture() const; + Texture * GetTexture() const; protected: Uint32 mLoadType; // From memory, from path, from pack Uint8 * mPixels; // Texture Info diff --git a/include/eepp/graphics/ctexturepacker.hpp b/include/eepp/graphics/texturepacker.hpp similarity index 84% rename from include/eepp/graphics/ctexturepacker.hpp rename to include/eepp/graphics/texturepacker.hpp index b4baf20d0..c267cdb91 100644 --- a/include/eepp/graphics/ctexturepacker.hpp +++ b/include/eepp/graphics/texturepacker.hpp @@ -35,19 +35,19 @@ #include namespace EE { namespace Graphics { -class cImage; +class Image; -namespace Private { class cTexturePackerNode; class cTexturePackerTex; } +namespace Private { class TexturePackerNode; class TexturePackerTex; } using namespace Private; /** @brief The Texture Packer class is used to create new Texture Atlases. * Atlases can be created indicating the texture atlas size and adding textures to the atlases. */ -class EE_API cTexturePacker { +class EE_API TexturePacker { public: /** Creates a new texture packer ( you will need to call SetOptions before adding any texture or image ). */ - cTexturePacker(); + TexturePacker(); /** Creates a new texture packer indicating the size of the texture atlas. * @param MaxWidth The maximum width that the texture atlas will use. @@ -56,16 +56,16 @@ class EE_API cTexturePacker { * @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. */ - cTexturePacker( const Uint32& MaxWidth, const Uint32& MaxHeight, const bool& ForcePowOfTwo = true, const Uint32& PixelBorder = 0, const bool& AllowFlipping = false ); + TexturePacker( const Uint32& MaxWidth, const Uint32& MaxHeight, const bool& ForcePowOfTwo = true, const Uint32& PixelBorder = 0, const bool& AllowFlipping = false ); - ~cTexturePacker(); + ~TexturePacker(); /** Adds a image/texture from its path to the texture atlas. * @param TexturePath The image path. */ 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( cImage * 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 ); @@ -109,19 +109,19 @@ class EE_API cTexturePacker { PackFail }; - std::list mTextures; + std::list mTextures; Int32 mLongestEdge; Int32 mTotalArea; - cTexturePackerNode * mFreeList; + TexturePackerNode * mFreeList; Int32 mWidth; Int32 mHeight; bool mPacked; bool mAllowFlipping; - cTexturePacker * mChild; + TexturePacker * mChild; Int32 mStrategy; Int32 mCount; - cTexturePacker * mParent; + TexturePacker * mParent; std::string mFilepath; Int32 mPlacedCount; bool mForcePowOfTwo; @@ -129,11 +129,11 @@ class EE_API cTexturePacker { bool mSaveExtensions; EE_SAVE_TYPE mFormat; - cTexturePacker * GetChild() const; + TexturePacker * GetChild() const; - cTexturePacker * GetParent() const; + TexturePacker * GetParent() const; - std::list * GetTexturePackPtr(); + std::list * GetTexturePackPtr(); void ChildSave( const EE_SAVE_TYPE& Format ); @@ -145,9 +145,9 @@ class EE_API cTexturePacker { void Validate(); - cTexturePackerTex * GetLonguestEdge(); + TexturePackerTex * GetLonguestEdge(); - cTexturePackerTex * GetShortestEdge(); + TexturePackerTex * GetShortestEdge(); Int32 GetChildCount(); @@ -157,19 +157,19 @@ class EE_API cTexturePacker { const Int32& GetPlacedCount() const; - sTextureHdr CreateTextureHdr( cTexturePacker * Packer ); + sTextureHdr CreateTextureHdr( TexturePacker * Packer ); - void CreateSubTexturesHdr( cTexturePacker * Packer, std::vector& SubTextures ); + void CreateSubTexturesHdr( TexturePacker * Packer, std::vector& SubTextures ); - cTexturePackerNode * GetBestFit( cTexturePackerTex * t, cTexturePackerNode ** prevBestFit, Int32 * EdgeCount ); + TexturePackerNode * GetBestFit( TexturePackerTex * t, TexturePackerNode ** prevBestFit, Int32 * EdgeCount ); - void InsertTexture( cTexturePackerTex * t, cTexturePackerNode * bestFit, Int32 edgeCount, cTexturePackerNode * previousBestFit ); + void InsertTexture( TexturePackerTex * t, TexturePackerNode * bestFit, Int32 edgeCount, TexturePackerNode * previousBestFit ); void AddBorderToTextures( const Int32& BorderSize ); void CreateChild(); - bool AddPackerTex( cTexturePackerTex * TPack ); + bool AddPackerTex( TexturePackerTex * TPack ); }; }} diff --git a/include/eepp/graphics/cttffont.hpp b/include/eepp/graphics/ttffont.hpp similarity index 92% rename from include/eepp/graphics/cttffont.hpp rename to include/eepp/graphics/ttffont.hpp index 2333a4b04..6a404fa87 100755 --- a/include/eepp/graphics/cttffont.hpp +++ b/include/eepp/graphics/ttffont.hpp @@ -2,8 +2,8 @@ #define EE_GRAPHICSCTTFFONT_H #include -#include -#include +#include +#include namespace HaikuTTF { class hkFont; @@ -12,7 +12,7 @@ namespace HaikuTTF { namespace EE { namespace Graphics { /** @brief This class loads True Type Font and then draw strings to the screen. */ -class EE_API cTTFFont : public cFont { +class EE_API TTFFont : public Font { public: enum OutlineMethods { @@ -24,10 +24,10 @@ class EE_API cTTFFont : public cFont { static OutlineMethods OutlineMethod; /** Creates an instance of a true type font */ - static cTTFFont * New( const std::string FontName ); + 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 ( cTextureFactory::instance()->Remove( MyFontInstance->GetTexId() ) ). */ - virtual ~cTTFFont(); + /** 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 * @param Filepath The TTF file path @@ -79,7 +79,7 @@ class EE_API cTTFFont : public cFont { /** 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 ); protected: - friend class cTTFFontLoader; + friend class TTFFontLoader; HaikuTTF::hkFont * mFont; HaikuTTF::hkFont * mFontOutline; @@ -101,7 +101,7 @@ class EE_API cTTFFont : public cFont { bool mThreadedLoading; bool mTexReady; - cTTFFont( const std::string FontName ); + TTFFont( const std::string FontName ); bool ThreadedLoading() const; diff --git a/include/eepp/graphics/cttffontloader.hpp b/include/eepp/graphics/ttffontloader.hpp similarity index 74% rename from include/eepp/graphics/cttffontloader.hpp rename to include/eepp/graphics/ttffontloader.hpp index 69197dce0..169460f3a 100644 --- a/include/eepp/graphics/cttffontloader.hpp +++ b/include/eepp/graphics/ttffontloader.hpp @@ -2,8 +2,8 @@ #define EE_GRAPHICSCTTFFONTLOADER #include -#include -#include +#include +#include #include namespace EE { namespace Graphics { @@ -11,7 +11,7 @@ namespace EE { namespace Graphics { /** @brief The TTF Font loader loads a true type font to memory in synchronous or asynchronous mode. @see ObjectLoader */ -class EE_API cTTFFontLoader : public ObjectLoader { +class EE_API TTFFontLoader : public ObjectLoader { public: /** Load a True Type Font from path * @param FontName The font name @@ -24,7 +24,7 @@ class EE_API cTTFFontLoader : public ObjectLoader { * @param OutlineColor The Outline Color * @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling */ - cTTFFontLoader( const std::string& FontName, 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 ); + TTFFontLoader( const std::string& FontName, 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 ); /** Load a True Type Font from a Pack * @param FontName The font name @@ -38,7 +38,7 @@ class EE_API cTTFFontLoader : public ObjectLoader { * @param OutlineColor The Outline Color * @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling */ - cTTFFontLoader( const std::string& FontName, 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 ); + TTFFontLoader( const std::string& FontName, 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 FontName The font name @@ -52,9 +52,9 @@ class EE_API cTTFFontLoader : public ObjectLoader { * @param OutlineColor The Outline Color * @param AddPixelSeparator Indicates if separates the glyphs by a pixel to avoid problems with font scaling */ - cTTFFontLoader( const std::string& FontName, 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 ); + TTFFontLoader( const std::string& FontName, 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 ); - virtual ~cTTFFontLoader(); + virtual ~TTFFontLoader(); /** This must be called for the asynchronous mode to update the texture data to the GPU, the call must be done from the same thread that the GL Context was created ( the main thread ). ** The TTF Font creates texture from the data obtained from the true type file. @@ -68,7 +68,7 @@ class EE_API cTTFFontLoader : public ObjectLoader { const std::string& Id() const; /** @return The font instance if already exists, otherwise returns NULL. */ - cFont * Font() const; + Graphics::Font * Font() const; protected: enum TTF_LOAD_TYPE { @@ -79,7 +79,7 @@ class EE_API cTTFFontLoader : public ObjectLoader { Uint32 mLoadType; // From memory, from path, from pack - cTTFFont * mFont; + TTFFont * mFont; std::string mFontName; std::string mFilepath; diff --git a/include/eepp/graphics/cvertexbuffer.hpp b/include/eepp/graphics/vertexbuffer.hpp similarity index 89% rename from include/eepp/graphics/cvertexbuffer.hpp rename to include/eepp/graphics/vertexbuffer.hpp index 6053452d4..32ca604de 100644 --- a/include/eepp/graphics/cvertexbuffer.hpp +++ b/include/eepp/graphics/vertexbuffer.hpp @@ -9,7 +9,7 @@ namespace EE { namespace Graphics { /** @brief The vertex buffer class holds vertex data. The vertex position, colors, texture coordinates and indexes. * This is useful to accelerate and encapsulate data. GPU VBOs are much faster because the data is in the GPU once is uploaded. eepp will try to use GPU VBOs if the GPU support them. */ -class EE_API cVertexBuffer { +class EE_API VertexBuffer { public: /** @brief Creates a new Vertex Buffer. * @param VertexFlags The vertex flags indicates which vertex data will be used. @see EE_VERTEX_FLAGS @@ -18,9 +18,9 @@ class EE_API cVertexBuffer { * @param ReserveIndexSize If the vertex size is known is possible to reserve the space in memory for the indices to avoid resizeing the array. * @param UsageType This indicates the kind of usage VBO will have. It's only useful if VBO extensions are supported ( almost for sure that it's supported ). More information here: http://www.opengl.org/sdk/docs/man/xhtml/glBufferData.xml */ - static cVertexBuffer * New( 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 ); + static VertexBuffer * New( 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 ~cVertexBuffer(); + virtual ~VertexBuffer(); /** @brief Adds a vertex of the type indicated to the buffer * @param Type Can be the position or texture coordinates. @@ -127,7 +127,7 @@ class EE_API cVertexBuffer { std::vector mColorArray; std::vector mIndexArray; - cVertexBuffer( 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 ); + 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; }; @@ -136,7 +136,7 @@ class EE_API cVertexBuffer { #endif -/** @class EE::Graphics::cVertexBuffer +/** @class EE::Graphics::VertexBuffer * @ingroup Graphics * * Some example usage of this class: @@ -144,7 +144,7 @@ class EE_API cVertexBuffer { // Creates a rounded rectangle. Polygon2f Poly = Polygon2f::CreateRoundedRectangle( 0, 0, 256, 50 ); - cVertexBuffer * VBO = cVertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); + VertexBuffer * VBO = VertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); if ( NULL != VBO ) { // Upload the rounded rectangle data to the vertex buffer. diff --git a/include/eepp/graphics/cvertexbufferogl.hpp b/include/eepp/graphics/vertexbufferogl.hpp similarity index 54% rename from include/eepp/graphics/cvertexbufferogl.hpp rename to include/eepp/graphics/vertexbufferogl.hpp index 304a77f66..a2c121ced 100644 --- a/include/eepp/graphics/cvertexbufferogl.hpp +++ b/include/eepp/graphics/vertexbufferogl.hpp @@ -1,18 +1,18 @@ #ifndef EE_GRAPHICSCVERTEXBUFFEROGL_HPP #define EE_GRAPHICSCVERTEXBUFFEROGL_HPP -#include +#include namespace EE { namespace Graphics { /** The Vertex Buffer OGL is the implementation of a Vertex Buffer without using the specific VBOs extensions from OpenGL. - @see cVertexBuffer + @see VertexBuffer */ -class EE_API cVertexBufferOGL : public cVertexBuffer { +class EE_API VertexBufferOGL : public VertexBuffer { public: - cVertexBufferOGL( 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 ); + VertexBufferOGL( 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 ~cVertexBufferOGL(); + virtual ~VertexBufferOGL(); void Bind(); diff --git a/include/eepp/graphics/cvertexbuffervbo.hpp b/include/eepp/graphics/vertexbuffervbo.hpp similarity index 63% rename from include/eepp/graphics/cvertexbuffervbo.hpp rename to include/eepp/graphics/vertexbuffervbo.hpp index 3ff5503c9..602ac3bdc 100644 --- a/include/eepp/graphics/cvertexbuffervbo.hpp +++ b/include/eepp/graphics/vertexbuffervbo.hpp @@ -1,19 +1,19 @@ #ifndef EE_GRAPHICSCVERTEXBUFFERVBO_HPP #define EE_GRAPHICSCVERTEXBUFFERVBO_HPP -#include +#include namespace EE { namespace Graphics { /** @brief The Vertex Buffer VBO class is the implementation of a Vertex Buffer using the OpenGL VBOs. - @see cVertexBuffer + @see VertexBuffer More information in http://en.wikipedia.org/wiki/Vertex_Buffer_Object */ -class EE_API cVertexBufferVBO : public cVertexBuffer { +class EE_API VertexBufferVBO : public VertexBuffer { public: - cVertexBufferVBO( 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 ); + VertexBufferVBO( 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 ~cVertexBufferVBO(); + virtual ~VertexBufferVBO(); void Bind(); diff --git a/include/eepp/physics/cshapecirclesprite.hpp b/include/eepp/physics/cshapecirclesprite.hpp index e9e0ffc0a..371660623 100644 --- a/include/eepp/physics/cshapecirclesprite.hpp +++ b/include/eepp/physics/cshapecirclesprite.hpp @@ -6,7 +6,7 @@ #ifdef PHYSICS_RENDERER_ENABLED namespace EE { namespace Graphics { -class cSprite; +class Sprite; }} using namespace EE::Graphics; @@ -14,9 +14,9 @@ CP_NAMESPACE_BEGIN class CP_API cShapeCircleSprite : public cShapeCircle { public: - static cShapeCircleSprite * New( cBody * body, cpFloat radius, cVect offset, cSprite * Sprite, bool AutoDeleteSprite = false ); + static cShapeCircleSprite * New( cBody * body, cpFloat radius, cVect offset, Sprite * Sprite, bool AutoDeleteSprite = false ); - cShapeCircleSprite( cBody * body, cpFloat radius, cVect offset, cSprite * Sprite, bool AutoDeleteSprite = false ); + cShapeCircleSprite( cBody * body, cpFloat radius, cVect offset, Sprite * Sprite, bool AutoDeleteSprite = false ); virtual ~cShapeCircleSprite(); @@ -26,9 +26,9 @@ class CP_API cShapeCircleSprite : public cShapeCircle { virtual void Offset( const cVect &offset ); - cSprite * GetSprite() const; + Sprite * GetSprite() const; protected: - cSprite * mSprite; + Sprite * mSprite; bool mSpriteAutoDelete; void OffsetSet(); diff --git a/include/eepp/physics/cshapepolysprite.hpp b/include/eepp/physics/cshapepolysprite.hpp index e39a5e85e..cd1899fb7 100644 --- a/include/eepp/physics/cshapepolysprite.hpp +++ b/include/eepp/physics/cshapepolysprite.hpp @@ -6,7 +6,7 @@ #ifdef PHYSICS_RENDERER_ENABLED namespace EE { namespace Graphics { -class cSprite; +class Sprite; }} using namespace EE::Graphics; @@ -14,21 +14,21 @@ CP_NAMESPACE_BEGIN class CP_API cShapePolySprite : public cShapePoly { public: - static cShapePolySprite * New( cBody * body, int numVerts, cVect *verts, cVect offset, cSprite * Sprite, bool AutoDeleteSprite = false ); + static cShapePolySprite * New( cBody * body, int numVerts, cVect *verts, cVect offset, Sprite * Sprite, bool AutoDeleteSprite = false ); - static cShapePolySprite * New( cBody * body, cpFloat width, cpFloat height, cSprite * Sprite, bool AutoDeleteSprite = false ); + static cShapePolySprite * New( cBody * body, cpFloat width, cpFloat height, Sprite * Sprite, bool AutoDeleteSprite = false ); - cShapePolySprite( cBody * body, int numVerts, cVect *verts, cVect offset, cSprite * Sprite, bool AutoDeleteSprite = false ); + cShapePolySprite( cBody * body, int numVerts, cVect *verts, cVect offset, Sprite * Sprite, bool AutoDeleteSprite = false ); - cShapePolySprite( cBody * body, cpFloat width, cpFloat height, cSprite * Sprite, bool AutoDeleteSprite = false ); + cShapePolySprite( cBody * body, cpFloat width, cpFloat height, Sprite * Sprite, bool AutoDeleteSprite = false ); virtual ~cShapePolySprite(); virtual void Draw( cSpace * space ); - cSprite * GetSprite() const; + Sprite * GetSprite() const; protected: - cSprite * mSprite; + Sprite * mSprite; bool mSpriteAutoDelete; Vector2i mOffset; diff --git a/include/eepp/system/objectloader.hpp b/include/eepp/system/objectloader.hpp index fd3a7104b..f1cc2f5bf 100644 --- a/include/eepp/system/objectloader.hpp +++ b/include/eepp/system/objectloader.hpp @@ -14,11 +14,11 @@ class EE_API ObjectLoader : protected Thread { /** @brief LoaderType Definition of the Object Loaders implemented by the engine. */ enum ObjLoaderType { - TextureLoader = 1, - SoundLoader = 2, - FontTTFLoader = 3, - FontTexLoader = 4, - UserObjLoader + TextureLoaderType = 1, + SoundLoaderType = 2, + FontTTFLoaderType = 3, + FontTexLoaderType = 4, + UserObjLoaderType }; /** Creates an instance of an object loader of the type defined */ diff --git a/include/eepp/system/packmanager.hpp b/include/eepp/system/packmanager.hpp index 36cfd574b..9ae8bf88a 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. - ** cTextureFactory::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/ui/cuidefaulttheme.hpp b/include/eepp/ui/cuidefaulttheme.hpp index 3cc475b87..c802182b8 100644 --- a/include/eepp/ui/cuidefaulttheme.hpp +++ b/include/eepp/ui/cuidefaulttheme.hpp @@ -7,7 +7,7 @@ namespace EE { namespace UI { class EE_API cUIDefaultTheme : public cUITheme { public: - cUIDefaultTheme( const std::string& Name, const std::string& Abbr, cFont * DefaultFont = NULL ); + cUIDefaultTheme( const std::string& Name, const std::string& Abbr, Graphics::Font * DefaultFont = NULL ); virtual cUIPopUpMenu * CreatePopUpMenu( cUIControl * 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/cuigfx.hpp b/include/eepp/ui/cuigfx.hpp index d07e6bbf9..221440b0a 100644 --- a/include/eepp/ui/cuigfx.hpp +++ b/include/eepp/ui/cuigfx.hpp @@ -19,9 +19,9 @@ class EE_API cUIGfx : public cUIComplexControl { inline ~CreateParams() {} - cSubTexture * SubTexture; - ColorA SubTextureColor; - EE_RENDER_MODE SubTextureRender; + Graphics::SubTexture * SubTexture; + ColorA SubTextureColor; + EE_RENDER_MODE SubTextureRender; }; cUIGfx( const cUIGfx::CreateParams& Params ); @@ -36,9 +36,9 @@ class EE_API cUIGfx : public cUIComplexControl { virtual void Alpha( const Float& alpha ); - cSubTexture * SubTexture() const; + Graphics::SubTexture * SubTexture() const; - void SubTexture( cSubTexture * subTexture ); + void SubTexture( Graphics::SubTexture * subTexture ); const ColorA& Color() const; @@ -50,10 +50,10 @@ class EE_API cUIGfx : public cUIComplexControl { const Vector2i& AlignOffset() const; protected: - cSubTexture * mSubTexture; - ColorA mColor; - EE_RENDER_MODE mRender; - Vector2i mAlignOffset; + Graphics::SubTexture * mSubTexture; + ColorA mColor; + EE_RENDER_MODE mRender; + Vector2i mAlignOffset; virtual void OnSizeChange(); diff --git a/include/eepp/ui/cuilistbox.hpp b/include/eepp/ui/cuilistbox.hpp index e8d02a3f1..8636ec943 100644 --- a/include/eepp/ui/cuilistbox.hpp +++ b/include/eepp/ui/cuilistbox.hpp @@ -47,10 +47,10 @@ class EE_API cUIListBox : public cUIComplexControl { Recti PaddingContainer; Recti HScrollPadding; Recti VScrollPadding; - cFont * Font; - ColorA FontColor; - ColorA FontOverColor; - ColorA FontSelectedColor; + Graphics::Font * Font; + ColorA FontColor; + ColorA FontOverColor; + ColorA FontSelectedColor; Float TouchDragDeceleration; }; @@ -114,9 +114,9 @@ class EE_API cUIListBox : public cUIComplexControl { const ColorA& FontSelectedColor() const; - void Font( cFont * Font ); + void Font( Graphics::Font * Font ); - cFont * Font() const; + Graphics::Font * Font() const; void PaddingContainer( const Recti& Padding ); @@ -170,16 +170,16 @@ class EE_API cUIListBox : public cUIComplexControl { UI_SCROLLBAR_MODE mVScrollMode; UI_SCROLLBAR_MODE mHScrollMode; bool mSmoothScroll; - Recti mPaddingContainer; + Recti mPaddingContainer; Recti mHScrollPadding; Recti mVScrollPadding; tUIItemContainer * mContainer; cUIScrollBar * mVScrollBar; cUIScrollBar * mHScrollBar; - cFont * mFont; - ColorA mFontColor; - ColorA mFontOverColor; - ColorA mFontSelectedColor; + Graphics::Font * mFont; + ColorA mFontColor; + ColorA mFontOverColor; + ColorA mFontSelectedColor; Uint32 mLastPos; Uint32 mMaxTextWidth; Int32 mHScrollInit; diff --git a/include/eepp/ui/cuimenu.hpp b/include/eepp/ui/cuimenu.hpp index dbef372ba..3fd5ba675 100644 --- a/include/eepp/ui/cuimenu.hpp +++ b/include/eepp/ui/cuimenu.hpp @@ -42,16 +42,16 @@ class EE_API cUIMenu : public cUIComplexControl { inline ~CreateParams() {} - Uint32 RowHeight; - Recti PaddingContainer; - Uint32 MinWidth; - Uint32 MinSpaceForIcons; - Uint32 MinRightMargin; - cFont * Font; - ColorA FontColor; - ColorA FontShadowColor; - ColorA FontOverColor; - ColorA FontSelectedColor; + Uint32 RowHeight; + Recti PaddingContainer; + Uint32 MinWidth; + Uint32 MinSpaceForIcons; + Uint32 MinRightMargin; + Graphics::Font * Font; + ColorA FontColor; + ColorA FontShadowColor; + ColorA FontOverColor; + ColorA FontSelectedColor; }; @@ -65,7 +65,7 @@ class EE_API cUIMenu : public cUIComplexControl { virtual bool IsType( const Uint32& type ) const; - Uint32 Add( const String& Text, cSubTexture * Icon = NULL ); + Uint32 Add( const String& Text, SubTexture * Icon = NULL ); Uint32 Add( cUIControl * Control ); @@ -73,7 +73,7 @@ class EE_API cUIMenu : public cUIComplexControl { Uint32 AddCheckBox( const String& Text, const bool& Active = false ); - Uint32 AddSubMenu( const String& Text, cSubTexture * Icon = NULL, cUIMenu * SubMenu = NULL ); + Uint32 AddSubMenu( const String& Text, SubTexture * Icon = NULL, cUIMenu * SubMenu = NULL ); cUIControl * GetItem( const Uint32& Index ); @@ -89,7 +89,7 @@ class EE_API cUIMenu : public cUIComplexControl { void RemoveAll(); - void Insert( const String& Text, cSubTexture * Icon, const Uint32& Index ); + void Insert( const String& Text, SubTexture * Icon, const Uint32& Index ); void Insert( cUIControl * Control, const Uint32& Index ); @@ -107,7 +107,7 @@ class EE_API cUIMenu : public cUIComplexControl { std::deque mItems; Recti mPadding; - cFont * mFont; + Font * mFont; ColorA mFontColor; ColorA mFontShadowColor; ColorA mFontOverColor; @@ -138,11 +138,11 @@ class EE_API cUIMenu : public cUIComplexControl { void ResizeMe(); - cUIMenuItem * CreateMenuItem( const String& Text, cSubTexture * Icon ); + cUIMenuItem * CreateMenuItem( const String& Text, SubTexture * Icon ); cUIMenuCheckBox * CreateMenuCheckBox( const String& Text, const bool& Active ); - cUIMenuSubMenu * CreateSubMenu( const String& Text, cSubTexture * Icon, cUIMenu * SubMenu ); + cUIMenuSubMenu * CreateSubMenu( const String& Text, SubTexture * Icon, cUIMenu * SubMenu ); void DoAfterSetTheme(); diff --git a/include/eepp/ui/cuiprogressbar.hpp b/include/eepp/ui/cuiprogressbar.hpp index 79b9e0a19..aef68e726 100644 --- a/include/eepp/ui/cuiprogressbar.hpp +++ b/include/eepp/ui/cuiprogressbar.hpp @@ -3,7 +3,7 @@ #include #include -#include +#include namespace EE { namespace UI { @@ -74,7 +74,7 @@ class EE_API cUIProgressBar : public cUIComplexControl { Float mProgress; Float mTotalSteps; - cScrollParallax * mParallax; + ScrollParallax * mParallax; cUITextBox * mTextBox; diff --git a/include/eepp/ui/cuipushbutton.hpp b/include/eepp/ui/cuipushbutton.hpp index c88bed8a1..5489c7751 100644 --- a/include/eepp/ui/cuipushbutton.hpp +++ b/include/eepp/ui/cuipushbutton.hpp @@ -37,21 +37,21 @@ class EE_API cUIPushButton : public cUIComplexControl { inline ~CreateParams() {} - inline void SetIcon( cSubTexture * icon ) { + inline void SetIcon( SubTexture * icon ) { Icon = icon; if ( !IconHorizontalMargin ) IconHorizontalMargin = 4; } - cFont * Font; - ColorA FontColor; - ColorA FontShadowColor; - ColorA FontOverColor; - cSubTexture * Icon; - Int32 IconHorizontalMargin; - bool IconAutoMargin; - Sizei IconMinSize; + Graphics::Font * Font; + ColorA FontColor; + ColorA FontShadowColor; + ColorA FontOverColor; + SubTexture * Icon; + Int32 IconHorizontalMargin; + bool IconAutoMargin; + Sizei IconMinSize; }; cUIPushButton( const cUIPushButton::CreateParams& Params ); @@ -64,7 +64,7 @@ class EE_API cUIPushButton : public cUIComplexControl { virtual void SetTheme( cUITheme * Theme ); - virtual void Icon( cSubTexture * Icon ); + virtual void Icon( SubTexture * Icon ); virtual cUIGfx * Icon() const; diff --git a/include/eepp/ui/cuiskin.hpp b/include/eepp/ui/cuiskin.hpp index bbc85950b..c968bc52c 100644 --- a/include/eepp/ui/cuiskin.hpp +++ b/include/eepp/ui/cuiskin.hpp @@ -5,7 +5,7 @@ #include namespace EE { namespace Graphics { -class cSubTexture; +class SubTexture; }} namespace EE { namespace UI { @@ -30,7 +30,7 @@ class EE_API cUISkin { virtual void SetSkin( const Uint32& State ) = 0; - virtual cSubTexture * GetSubTexture( const Uint32& State ) const = 0; + virtual SubTexture * GetSubTexture( const Uint32& State ) const = 0; virtual void SetColor( const Uint32& State, const ColorA& Color ); diff --git a/include/eepp/ui/cuiskincomplex.hpp b/include/eepp/ui/cuiskincomplex.hpp index 0ed163058..753da1b36 100644 --- a/include/eepp/ui/cuiskincomplex.hpp +++ b/include/eepp/ui/cuiskincomplex.hpp @@ -31,15 +31,15 @@ class EE_API cUISkinComplex : public cUISkin { void SetSkin( const Uint32& State ); - cSubTexture * GetSubTexture( const Uint32& State ) const; + SubTexture * GetSubTexture( const Uint32& State ) const; - cSubTexture * GetSubTextureSide( const Uint32& State, const Uint32& Side ); + SubTexture * GetSubTextureSide( const Uint32& State, const Uint32& Side ); cUISkinComplex * Copy( const std::string& NewName, const bool& CopyColorsState = true ); virtual cUISkin * Copy(); protected: - cSubTexture * mSubTexture[ cUISkinState::StateCount ][ SideCount ]; + SubTexture * mSubTexture[ cUISkinState::StateCount ][ SideCount ]; ColorA mTempColor; void StateNormalToState( const Uint32& State ); diff --git a/include/eepp/ui/cuiskinsimple.hpp b/include/eepp/ui/cuiskinsimple.hpp index d7fcabc86..9254c645a 100644 --- a/include/eepp/ui/cuiskinsimple.hpp +++ b/include/eepp/ui/cuiskinsimple.hpp @@ -16,13 +16,13 @@ class EE_API cUISkinSimple : public cUISkin { void SetSkin( const Uint32& State ); - cSubTexture * GetSubTexture( const Uint32& State ) const; + SubTexture * GetSubTexture( const Uint32& State ) const; cUISkinSimple * Copy( const std::string& NewName, const bool& CopyColorsState = true ); virtual cUISkin * Copy(); protected: - cSubTexture * mSubTexture[ cUISkinState::StateCount ]; + SubTexture * mSubTexture[ cUISkinState::StateCount ]; ColorA mTempColor; void StateNormalToState( const Uint32& State ); diff --git a/include/eepp/ui/cuisprite.hpp b/include/eepp/ui/cuisprite.hpp index 53e1d231d..46d1c363d 100644 --- a/include/eepp/ui/cuisprite.hpp +++ b/include/eepp/ui/cuisprite.hpp @@ -4,7 +4,7 @@ #include namespace EE { namespace Graphics { -class cSprite; +class Sprite; }} namespace EE { namespace UI { @@ -17,15 +17,15 @@ class EE_API cUISprite : public cUIComplexControl { cUIComplexControl::CreateParams(), Sprite( NULL ), SpriteRender( RN_NORMAL ), - DeallocSprite( true ) + DealloSprite( true ) { } inline ~CreateParams() {} - cSprite * Sprite; + Graphics::Sprite * Sprite; EE_RENDER_MODE SpriteRender; - bool DeallocSprite; + bool DealloSprite; }; cUISprite( const cUISprite::CreateParams& Params ); @@ -40,9 +40,9 @@ class EE_API cUISprite : public cUIComplexControl { virtual void Alpha( const Float& alpha ); - cSprite * Sprite() const; + Graphics::Sprite * Sprite() const; - void Sprite( cSprite * sprite ); + void Sprite( Graphics::Sprite * sprite ); ColorA Color() const; @@ -54,10 +54,10 @@ class EE_API cUISprite : public cUIComplexControl { const Vector2i& AlignOffset() const; protected: - cSprite * mSprite; + Graphics::Sprite * mSprite; EE_RENDER_MODE mRender; Vector2i mAlignOffset; - cSubTexture * mSubTextureLast; + SubTexture * mSubTextureLast; bool mDealloc; void UpdateSize(); @@ -68,7 +68,7 @@ class EE_API cUISprite : public cUIComplexControl { virtual void OnSizeChange(); - Uint32 DeallocSprite(); + Uint32 DealloSprite(); }; }} diff --git a/include/eepp/ui/cuitabwidget.hpp b/include/eepp/ui/cuitabwidget.hpp index ed2f7f422..a4c02a6b8 100644 --- a/include/eepp/ui/cuitabwidget.hpp +++ b/include/eepp/ui/cuitabwidget.hpp @@ -46,11 +46,11 @@ class EE_API cUITabWidget : public cUIComplexControl { inline ~CreateParams() {} - cFont * Font; - ColorA FontColor; - ColorA FontShadowColor; - ColorA FontOverColor; - ColorA FontSelectedColor; + Graphics::Font * Font; + ColorA FontColor; + ColorA FontShadowColor; + ColorA FontOverColor; + ColorA FontSelectedColor; Int32 TabSeparation; Uint32 MaxTextLength; Uint32 TabWidgetHeight; @@ -60,7 +60,7 @@ class EE_API cUITabWidget : public cUIComplexControl { bool TabsClosable; bool SpecialBorderTabs; //! Indicates if the periferical tabs ( the left and right border tab ) are different from the central tabs. bool DrawLineBelowTabs; - ColorA LineBelowTabsColor; + ColorA LineBelowTabsColor; Int32 LineBewowTabsYOffset; }; @@ -73,7 +73,7 @@ class EE_API cUITabWidget : public cUIComplexControl { virtual bool IsType( const Uint32& type ) const; - Uint32 Add( const String& Text, cUIControl * CtrlOwned, cSubTexture * Icon = NULL ); + Uint32 Add( const String& Text, cUIControl * CtrlOwned, SubTexture * Icon = NULL ); Uint32 Add( cUITab * Tab ); @@ -91,7 +91,7 @@ class EE_API cUITabWidget : public cUIComplexControl { void RemoveAll(); - void Insert( const String& Text, cUIControl * CtrlOwned, cSubTexture * Icon, const Uint32& Index ); + void Insert( const String& Text, cUIControl * CtrlOwned, SubTexture * Icon, const Uint32& Index ); void Insert( cUITab * Tab, const Uint32& Index ); @@ -111,7 +111,7 @@ class EE_API cUITabWidget : public cUIComplexControl { cUIComplexControl * mCtrlContainer; cUIComplexControl * mTabContainer; - cFont * mFont; + Font * mFont; ColorA mFontColor; ColorA mFontShadowColor; ColorA mFontOverColor; @@ -133,7 +133,7 @@ class EE_API cUITabWidget : public cUIComplexControl { void DoAfterSetTheme(); - cUITab * CreateTab( const String& Text, cUIControl * CtrlOwned, cSubTexture * Icon ); + cUITab * CreateTab( const String& Text, cUIControl * CtrlOwned, SubTexture * Icon ); virtual void OnSizeChange(); diff --git a/include/eepp/ui/cuitextbox.hpp b/include/eepp/ui/cuitextbox.hpp index 45f6745c7..eef77a347 100644 --- a/include/eepp/ui/cuitextbox.hpp +++ b/include/eepp/ui/cuitextbox.hpp @@ -30,10 +30,10 @@ class EE_API cUITextBox : public cUIComplexControl { inline ~CreateParams() {} - cFont * Font; - ColorA FontColor; - ColorA FontShadowColor; - ColorA FontSelectionBackColor; + Graphics::Font * Font; + ColorA FontColor; + ColorA FontShadowColor; + ColorA FontSelectionBackColor; }; cUITextBox( const cUITextBox::CreateParams& Params ); @@ -48,9 +48,9 @@ class EE_API cUITextBox : public cUIComplexControl { virtual void Alpha( const Float& alpha ); - cFont * Font() const; + Graphics::Font * Font() const; - void Font( cFont * font ); + void Font( Graphics::Font * font ); virtual const String& Text(); @@ -78,7 +78,7 @@ class EE_API cUITextBox : public cUIComplexControl { virtual void SetTheme( cUITheme * Theme ); - cTextCache * GetTextCache(); + TextCache * GetTextCache(); Float GetTextWidth(); @@ -92,7 +92,7 @@ class EE_API cUITextBox : public cUIComplexControl { bool IsTextSelectionEnabled() const; protected: - cTextCache * mTextCache; + TextCache * mTextCache; String mString; ColorA mFontColor; ColorA mFontShadowColor; diff --git a/include/eepp/ui/cuitextinputpassword.hpp b/include/eepp/ui/cuitextinputpassword.hpp index 16e064bf8..21d3c1bfd 100644 --- a/include/eepp/ui/cuitextinputpassword.hpp +++ b/include/eepp/ui/cuitextinputpassword.hpp @@ -16,9 +16,9 @@ class cUITextInputPassword : public cUITextInput virtual void Text( const String& text ); - cTextCache * GetPassCache() const; + TextCache * GetPassCache() const; protected: - cTextCache * mPassCache; + TextCache * mPassCache; void AlignFix(); diff --git a/include/eepp/ui/cuitheme.hpp b/include/eepp/ui/cuitheme.hpp index eec791139..ad0507f3d 100644 --- a/include/eepp/ui/cuitheme.hpp +++ b/include/eepp/ui/cuitheme.hpp @@ -7,9 +7,9 @@ #include namespace EE { namespace Graphics { -class cSprite; -class cTextureAtlas; -class cFont; +class Sprite; +class TextureAtlas; +class Font; }} namespace EE { namespace UI { @@ -48,11 +48,11 @@ class EE_API cUITheme : protected ResourceManager { using ResourceManager::Exists; using ResourceManager::ExistsId; - static cUITheme * LoadFromTextureAtlas( cUITheme * tTheme, cTextureAtlas * TextureAtlas ); + static cUITheme * LoadFromTextureAtlas( cUITheme * tTheme, Graphics::TextureAtlas * TextureAtlas ); static cUITheme * LoadFromPath( cUITheme * tTheme, const std::string& Path, const std::string ImgExt = "png" ); - static cUITheme * LoadFromTextureAtlas( cTextureAtlas * TextureAtlas, const std::string& Name, const std::string NameAbbr ); + static cUITheme * LoadFromTextureAtlas( Graphics::TextureAtlas * TextureAtlas, const std::string& Name, const std::string NameAbbr ); static cUITheme * LoadFromPath( const std::string& Path, const std::string& Name, const std::string& NameAbbr, const std::string ImgExt = "png" ); @@ -60,7 +60,7 @@ class EE_API cUITheme : protected ResourceManager { void AddThemeIcon( const std::string& Icon ); - cUITheme( const std::string& Name, const std::string& Abbr, cFont * DefaultFont = NULL ); + cUITheme( const std::string& Name, const std::string& Abbr, Graphics::Font * DefaultFont = NULL ); virtual ~cUITheme(); @@ -74,9 +74,9 @@ class EE_API cUITheme : protected ResourceManager { virtual cUISkin * Add( cUISkin * Resource ); - void Font( cFont * Font ); + void Font( Graphics::Font * Font ); - cFont * Font() const; + Graphics::Font * Font() const; const ColorA& FontColor() const; @@ -98,13 +98,13 @@ class EE_API cUITheme : protected ResourceManager { const bool& UseDefaultThemeValues() const; - cTextureAtlas * TextureAtlas() const; + Graphics::TextureAtlas * TextureAtlas() const; - cSubTexture * GetIconByName( const std::string& name ); + SubTexture * GetIconByName( const std::string& name ); - virtual cUIGfx * CreateGfx( cSubTexture * SubTexture, cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, ColorA SubTextureColor = ColorA(255,255,255,255), EE_RENDER_MODE SubTextureRender = RN_NORMAL ); + virtual cUIGfx * CreateGfx( SubTexture * SubTexture, cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, ColorA SubTextureColor = ColorA(255,255,255,255), EE_RENDER_MODE SubTextureRender = RN_NORMAL ); - virtual cUISprite * CreateSprite( cSprite * Sprite, cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, bool DeallocSprite = true, EE_RENDER_MODE SpriteRender = RN_NORMAL ); + virtual cUISprite * CreateSprite( Sprite * Sprite, cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, bool DealloSprite = true, EE_RENDER_MODE SpriteRender = RN_NORMAL ); virtual cUICheckBox * CreateCheckBox( cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS ); @@ -138,9 +138,9 @@ class EE_API cUITheme : protected ResourceManager { virtual cUIProgressBar * CreateProgressBar( cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS, bool DisplayPercent = false, bool VerticalExpand = false, Vector2f MovementSpeed = Vector2f( 64, 0 ), Rectf FillerMargin = Rectf() ); - virtual cUIPushButton * CreatePushButton( cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, cSubTexture * Icon = NULL, Int32 IconHorizontalMargin = 0, bool IconAutoMargin = true ); + virtual cUIPushButton * CreatePushButton( cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, SubTexture * Icon = NULL, Int32 IconHorizontalMargin = 0, bool IconAutoMargin = true ); - virtual cUISelectButton * CreateSelectButton( cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, cSubTexture * Icon = NULL, Int32 IconHorizontalMargin = 0, bool IconAutoMargin = true ); + virtual cUISelectButton * CreateSelectButton( cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, SubTexture * Icon = NULL, Int32 IconHorizontalMargin = 0, bool IconAutoMargin = true ); virtual cUIWinMenu * CreateWinMenu( cUIControl * Parent = NULL, const Sizei& Size = Sizei(), const Vector2i& Pos = Vector2i(), const Uint32& Flags = UI_CONTROL_DEFAULT_FLAGS, Uint32 MarginBetweenButtons = 0, Uint32 ButtonMargin = 4, Uint32 MenuHeight = 0, Uint32 FirstButtonMargin = 1 ); @@ -155,8 +155,8 @@ class EE_API cUITheme : protected ResourceManager { std::string mName; Uint32 mNameHash; std::string mAbbr; - cTextureAtlas * mTextureAtlas; - cFont * mFont; + Graphics::TextureAtlas * mTextureAtlas; + Graphics::Font * mFont; ColorA mFontColor; ColorA mFontShadowColor; ColorA mFontOverColor; @@ -165,11 +165,11 @@ class EE_API cUITheme : protected ResourceManager { std::list mUIElements; std::list mUIIcons; - void TextureAtlas( cTextureAtlas * SG ); + void TextureAtlas( Graphics::TextureAtlas * SG ); - static bool SearchFilesOfElement( cTextureAtlas * SG, const std::string& Path, std::string Element, Uint32& IsComplex, const std::string ImgExt ); + static bool SearchFilesOfElement( Graphics::TextureAtlas * SG, const std::string& Path, std::string Element, Uint32& IsComplex, const std::string ImgExt ); - static bool SearchFilesInAtlas( cTextureAtlas * SG, std::string Element, Uint32& IsComplex ); + static bool SearchFilesInAtlas( Graphics::TextureAtlas * SG, std::string Element, Uint32& IsComplex ); }; }} diff --git a/include/eepp/ui/cuithememanager.hpp b/include/eepp/ui/cuithememanager.hpp index b4541d16a..e33ccc656 100644 --- a/include/eepp/ui/cuithememanager.hpp +++ b/include/eepp/ui/cuithememanager.hpp @@ -14,9 +14,9 @@ class EE_API cUIThemeManager : public ResourceManager { public: virtual ~cUIThemeManager(); - void DefaultFont( cFont * Font ); + void DefaultFont( Font * Font ); - cFont * DefaultFont() const; + Font * DefaultFont() const; void SetTheme( const std::string& Theme ); @@ -58,7 +58,7 @@ class EE_API cUIThemeManager : public ResourceManager { const Sizei& CursorSize() const; protected: - cFont * mFont; + Font * mFont; cUITheme * mThemeDefault; bool mAutoApplyDefaultTheme; diff --git a/include/eepp/ui/cuitooltip.hpp b/include/eepp/ui/cuitooltip.hpp index ad1a49b1d..eb70539a7 100644 --- a/include/eepp/ui/cuitooltip.hpp +++ b/include/eepp/ui/cuitooltip.hpp @@ -4,7 +4,7 @@ #include namespace EE { namespace Graphics { -class cTextCache; +class TextCache; }} namespace EE { namespace UI { @@ -33,10 +33,10 @@ class EE_API cUITooltip : public cUIControlAnim { inline ~CreateParams() {} - cFont * Font; - ColorA FontColor; - ColorA FontShadowColor; - Recti Padding; + Graphics::Font * Font; + ColorA FontColor; + ColorA FontShadowColor; + Recti Padding; }; cUITooltip( cUITooltip::CreateParams& Params, cUIControl * TooltipOf ); @@ -57,9 +57,9 @@ class EE_API cUITooltip : public cUIControlAnim { virtual void Alpha( const Float& alpha ); - cFont * Font() const; + Graphics::Font * Font() const; - void Font( cFont * font ); + void Font( Graphics::Font * font ); virtual const String& Text(); @@ -81,7 +81,7 @@ class EE_API cUITooltip : public cUIControlAnim { const Recti& Padding() const; - cTextCache * GetTextCache(); + TextCache * GetTextCache(); Float GetTextWidth(); @@ -97,7 +97,7 @@ class EE_API cUITooltip : public cUIControlAnim { const Time & TooltipTime() const; protected: - cTextCache * mTextCache; + TextCache * mTextCache; ColorA mFontColor; ColorA mFontShadowColor; Vector2f mAlignOffset; diff --git a/include/eepp/ui/cuiwinmenu.hpp b/include/eepp/ui/cuiwinmenu.hpp index 28f65b2a2..e5ee397f4 100644 --- a/include/eepp/ui/cuiwinmenu.hpp +++ b/include/eepp/ui/cuiwinmenu.hpp @@ -38,15 +38,15 @@ class EE_API cUIWinMenu : public cUIComplexControl { Font = cUIThemeManager::instance()->DefaultFont(); } - cFont * Font; - ColorA FontColor; - ColorA FontShadowColor; - ColorA FontOverColor; - ColorA FontSelectedColor; - Uint32 MarginBetweenButtons; - Uint32 ButtonMargin; - Uint32 MenuHeight; - Uint32 FirstButtonMargin; + Graphics::Font * Font; + ColorA FontColor; + ColorA FontShadowColor; + ColorA FontOverColor; + ColorA FontSelectedColor; + Uint32 MarginBetweenButtons; + Uint32 ButtonMargin; + Uint32 MenuHeight; + Uint32 FirstButtonMargin; }; cUIWinMenu( const cUIWinMenu::CreateParams& Params ); @@ -75,7 +75,7 @@ class EE_API cUIWinMenu : public cUIComplexControl { const ColorA& FontSelectedColor() const; - cFont * Font() const; + Graphics::Font * Font() const; cUISelectButton * GetButton( const String& ButtonText ); @@ -83,11 +83,11 @@ class EE_API cUIWinMenu : public cUIComplexControl { protected: typedef std::list< std::pair< cUISelectButton *, cUIPopUpMenu * > > WinMenuList; - cFont * mFont; - ColorA mFontColor; - ColorA mFontShadowColor; - ColorA mFontOverColor; - ColorA mFontSelectedColor; + Graphics::Font *mFont; + ColorA mFontColor; + ColorA mFontShadowColor; + ColorA mFontOverColor; + ColorA mFontSelectedColor; cUIPopUpMenu * mCurrentMenu; Uint32 mMarginBetweenButtons; Uint32 mButtonMargin; diff --git a/include/eepp/ui/tools/ctextureatlaseditor.hpp b/include/eepp/ui/tools/ctextureatlaseditor.hpp index 32d3a0c72..7bb862619 100644 --- a/include/eepp/ui/tools/ctextureatlaseditor.hpp +++ b/include/eepp/ui/tools/ctextureatlaseditor.hpp @@ -6,21 +6,21 @@ #include #include #include -#include -#include -#include +#include +#include +#include namespace EE { namespace UI { namespace Tools { -class cTextureAtlasSubTextureEditor; +class TextureAtlasSubTextureEditor; -class EE_API cTextureAtlasEditor { +class EE_API TextureAtlasEditor { public: typedef cb::Callback0 TGEditorCloseCb; - cTextureAtlasEditor( cUIWindow * AttatchTo = NULL, const TGEditorCloseCb& callback = TGEditorCloseCb() ); + TextureAtlasEditor( cUIWindow * AttatchTo = NULL, const TGEditorCloseCb& callback = TGEditorCloseCb() ); - virtual ~cTextureAtlasEditor(); + virtual ~TextureAtlasEditor(); cUISpinBox * SpinOffX() const { return mSpinOffX; } @@ -29,10 +29,10 @@ class EE_API cTextureAtlasEditor { class cUITGEUpdater : public cUIControl { public: - cUITGEUpdater( const CreateParams& Params, cTextureAtlasEditor * TGEditor ) : cUIControl( Params ), mTGEditor( TGEditor ) {} + cUITGEUpdater( const CreateParams& Params, TextureAtlasEditor * TGEditor ) : cUIControl( Params ), mTGEditor( TGEditor ) {} virtual void Update() { mTGEditor->Update(); } protected: - cTextureAtlasEditor * mTGEditor; + TextureAtlasEditor * mTGEditor; }; friend class cUITGEUpdater; @@ -40,16 +40,16 @@ class EE_API cTextureAtlasEditor { cUIControl * mUIContainer; cUITheme * mTheme; TGEditorCloseCb mCloseCb; - cTexturePacker * mTexturePacker; - cTextureAtlasLoader * mTextureAtlasLoader; - cSubTexture * mCurSubTexture; + TexturePacker * mTexturePacker; + TextureAtlasLoader * mTextureAtlasLoader; + SubTexture * mCurSubTexture; cUISpinBox * mSpinOffX; cUISpinBox * mSpinOffY; cUISpinBox * mSpinDestW; cUISpinBox * mSpinDestH; cUIListBox * mSubTextureList; cUIWinMenu * mWinMenu; - cTextureAtlasSubTextureEditor * mSubTextureEditor; + TextureAtlasSubTextureEditor * mSubTextureEditor; cUITGEUpdater * mTGEU; void WindowClose( const cUIEvent * Event ); @@ -60,7 +60,7 @@ class EE_API cTextureAtlasEditor { void FileMenuClick( const cUIEvent * Event ); - void OnTextureAtlasCreate( cTexturePacker * TexPacker ); + void OnTextureAtlasCreate( TexturePacker * TexPacker ); void OpenTextureAtlas( const cUIEvent * Event ); @@ -92,7 +92,7 @@ class EE_API cTextureAtlasEditor { void OnHBOffset( const cUIEvent * Event ); - void OnTextureAtlasLoaded( cTextureAtlasLoader * TGLoader ); + void OnTextureAtlasLoaded( TextureAtlasLoader * TGLoader ); void Update(); }; diff --git a/include/eepp/window/cursor.hpp b/include/eepp/window/cursor.hpp index 7c1f38baf..ef2394fae 100644 --- a/include/eepp/window/cursor.hpp +++ b/include/eepp/window/cursor.hpp @@ -3,8 +3,8 @@ #include -#include -#include +#include +#include using namespace EE::Graphics; #include @@ -25,7 +25,7 @@ class EE_API Cursor { const Vector2i& HotSpot() const; /** @return The pointer to the image that represents the cursor */ - cImage * Image() const; + Graphics::Image * Image() const; virtual ~Cursor(); protected: @@ -33,13 +33,13 @@ class EE_API Cursor { Uint32 mId; std::string mName; - cImage * mImage; + Graphics::Image * mImage; Vector2i mHotSpot; EE::Window::Window * mWindow; - Cursor( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + Cursor( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - Cursor( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + Cursor( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); Cursor( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); diff --git a/include/eepp/window/cursormanager.hpp b/include/eepp/window/cursormanager.hpp index 189f186c7..c846c3807 100644 --- a/include/eepp/window/cursormanager.hpp +++ b/include/eepp/window/cursormanager.hpp @@ -3,8 +3,8 @@ #include -#include -#include +#include +#include using namespace EE::Graphics; #include @@ -26,14 +26,14 @@ class EE_API CursorManager { * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * Create( cTexture * tex, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ) = 0; /** Creates a cursor from a image * @param img The image path * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * Create( cImage * img, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * Create( Image * img, const Vector2i& hotspot, const std::string& name ) = 0; /** Creates a cursor from a image path * @param path The image pointer to use as cursor diff --git a/include/eepp/window/engine.hpp b/include/eepp/window/engine.hpp index 2f3d66708..388b85085 100755 --- a/include/eepp/window/engine.hpp +++ b/include/eepp/window/engine.hpp @@ -110,7 +110,7 @@ class EE_API Engine { ContextSettings CreateContextSettings( IniFile * ini, std::string iniKeyName = "EEPP" ); /** Enabling Shared GL Context allows asynchronous OpenGL resource loading ( only if is supported by the backend and the OS, SDL 2 backend is the only one supported ). - ** If the cTextureLoader is threaded, will upload the texture in another thread to the GPU. So, it will not block the main rendering thread. + ** If the TextureLoader is threaded, will upload the texture in another thread to the GPU. So, it will not block the main rendering thread. ** Shared GL Context is disabled by default. */ void EnableSharedGLContext(); diff --git a/include/eepp/window/inputtextbuffer.hpp b/include/eepp/window/inputtextbuffer.hpp index 2ad276395..334138ce9 100755 --- a/include/eepp/window/inputtextbuffer.hpp +++ b/include/eepp/window/inputtextbuffer.hpp @@ -95,7 +95,7 @@ class EE_API InputTextBuffer { /** Set the cursor position */ void CurPos( const Uint32& pos ); - /** This function it's for helping the cFont class to locate the cursor position for the correct rendering of it. + /** This function it's for helping the Font class to locate the cursor position for the correct rendering of it. * @param LastNewLinePos This will return the position of the closest "\n" to the current Cursor Pos * @return On which line it's the cursor */ diff --git a/include/eepp/window/platformimpl.hpp b/include/eepp/window/platformimpl.hpp index bcb2d5b0d..514c6cd91 100644 --- a/include/eepp/window/platformimpl.hpp +++ b/include/eepp/window/platformimpl.hpp @@ -13,8 +13,8 @@ using namespace EE::Math; namespace EE { namespace Graphics { -class cTexture; -class cImage; +class Texture; +class Image; } namespace Window { @@ -80,14 +80,14 @@ class PlatformImpl { * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * CreateMouseCursor( cTexture * tex, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) = 0; /** Creates a cursor from a image * @param img The image path * @param hotspot The hotspot where the mouse click is taken * @param name The name of the cursor */ - virtual Cursor * CreateMouseCursor( cImage * img, const Vector2i& hotspot, const std::string& name ) = 0; + virtual Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) = 0; /** Creates a cursor from a image path * @param path The image pointer to use as cursor diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 29e4137c0..dfb9beb1c 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget @@ -54,7 +54,7 @@ Desktop Desktop {388e5431-b31b-42b3-b9ad-9002d279d75d} - 10 + 12 0 0 diff --git a/projects/linux/ee.files b/projects/linux/ee.files index f46bdf821..941603d4f 100644 --- a/projects/linux/ee.files +++ b/projects/linux/ee.files @@ -118,46 +118,46 @@ ../../include/eepp/graphics/renders.hpp ../../include/eepp/graphics/pixelperfect.hpp ../../include/eepp/graphics/fonthelper.hpp -../../include/eepp/graphics/cvertexbuffervbo.hpp -../../include/eepp/graphics/cvertexbufferogl.hpp -../../src/eepp/graphics/cvertexbuffermanager.hpp -../../include/eepp/graphics/cvertexbuffer.hpp -../../include/eepp/graphics/cttffontloader.hpp -../../include/eepp/graphics/cttffont.hpp -../../src/eepp/graphics/ctexturepackertex.hpp -../../src/eepp/graphics/ctexturepackernode.hpp -../../include/eepp/graphics/ctexturepacker.hpp -../../include/eepp/graphics/ctextureloader.hpp -../../include/eepp/graphics/ctextureatlasloader.hpp -../../include/eepp/graphics/ctexturefontloader.hpp -../../include/eepp/graphics/ctexturefont.hpp -../../include/eepp/graphics/ctexturefactory.hpp -../../include/eepp/graphics/ctexture.hpp -../../include/eepp/graphics/ctextcache.hpp -../../include/eepp/graphics/csprite.hpp -../../include/eepp/graphics/ctextureatlasmanager.hpp -../../include/eepp/graphics/ctextureatlas.hpp -../../include/eepp/graphics/csubtexture.hpp -../../include/eepp/graphics/cshaderprogrammanager.hpp -../../include/eepp/graphics/cshaderprogram.hpp -../../include/eepp/graphics/cshader.hpp -../../include/eepp/graphics/cscrollparallax.hpp -../../include/eepp/graphics/cprimitives.hpp -../../include/eepp/graphics/cparticlesystem.hpp -../../include/eepp/graphics/cparticle.hpp -../../include/eepp/graphics/cimage.hpp -../../include/eepp/graphics/cglobaltextureatlas.hpp -../../include/eepp/graphics/cglobalbatchrenderer.hpp -../../src/eepp/graphics/cframebuffermanager.hpp -../../include/eepp/graphics/cframebuffer.hpp -../../include/eepp/graphics/cfontmanager.hpp -../../include/eepp/graphics/cfont.hpp -../../include/eepp/graphics/cconsole.hpp -../../include/eepp/graphics/cbatchrenderer.hpp +../../include/eepp/graphics/vertexbuffervbo.hpp +../../include/eepp/graphics/vertexbufferogl.hpp +../../src/eepp/graphics/vertexbuffermanager.hpp +../../include/eepp/graphics/vertexbuffer.hpp +../../include/eepp/graphics/ttffontloader.hpp +../../include/eepp/graphics/ttffont.hpp +../../src/eepp/graphics/texturepackertex.hpp +../../src/eepp/graphics/texturepackernode.hpp +../../include/eepp/graphics/texturepacker.hpp +../../include/eepp/graphics/textureloader.hpp +../../include/eepp/graphics/textureatlasloader.hpp +../../include/eepp/graphics/texturefontloader.hpp +../../include/eepp/graphics/texturefont.hpp +../../include/eepp/graphics/texturefactory.hpp +../../include/eepp/graphics/texture.hpp +../../include/eepp/graphics/textcache.hpp +../../include/eepp/graphics/sprite.hpp +../../include/eepp/graphics/textureatlasmanager.hpp +../../include/eepp/graphics/textureatlas.hpp +../../include/eepp/graphics/subtexture.hpp +../../include/eepp/graphics/shaderprogrammanager.hpp +../../include/eepp/graphics/shaderprogram.hpp +../../include/eepp/graphics/shader.hpp +../../include/eepp/graphics/scrollparallax.hpp +../../include/eepp/graphics/primitives.hpp +../../include/eepp/graphics/particlesystem.hpp +../../include/eepp/graphics/particle.hpp +../../include/eepp/graphics/image.hpp +../../include/eepp/graphics/globaltextureatlas.hpp +../../include/eepp/graphics/globalbatchrenderer.hpp +../../src/eepp/graphics/framebuffermanager.hpp +../../include/eepp/graphics/framebuffer.hpp +../../include/eepp/graphics/fontmanager.hpp +../../include/eepp/graphics/font.hpp +../../include/eepp/graphics/console.hpp +../../include/eepp/graphics/batchrenderer.hpp ../../include/eepp/graphics/base.hpp -../../include/eepp/graphics/renderer/crenderergl3.hpp -../../include/eepp/graphics/renderer/crenderergl.hpp -../../include/eepp/graphics/renderer/cgl.hpp +../../include/eepp/graphics/renderer/renderergl3.hpp +../../include/eepp/graphics/renderer/renderergl.hpp +../../include/eepp/graphics/renderer/gl.hpp ../../include/eepp/graphics/renderer/base.hpp ../../include/eepp/math/math.hpp ../../include/eepp/math/mtrand.hpp @@ -449,46 +449,46 @@ ../../src/eepp/window/platform/x11/cursorx11.cpp ../../src/eepp/window/platform/platformimpl.hpp ../../src/eepp/graphics/pixelperfect.cpp -../../src/eepp/graphics/cvertexbuffervbo.cpp -../../src/eepp/graphics/cvertexbufferogl.cpp -../../src/eepp/graphics/cvertexbuffermanager.cpp -../../src/eepp/graphics/cvertexbuffer.cpp -../../src/eepp/graphics/cttffontloader.cpp -../../src/eepp/graphics/cttffont.cpp -../../src/eepp/graphics/ctexturepackertex.cpp -../../src/eepp/graphics/ctexturepackernode.cpp -../../src/eepp/graphics/ctexturepacker.cpp -../../src/eepp/graphics/ctextureloader.cpp -../../src/eepp/graphics/ctextureatlasloader.cpp -../../src/eepp/graphics/ctexturefontloader.cpp -../../src/eepp/graphics/ctexturefont.cpp -../../src/eepp/graphics/ctexturefactory.cpp -../../src/eepp/graphics/ctexture.cpp -../../src/eepp/graphics/ctextcache.cpp -../../src/eepp/graphics/csprite.cpp -../../src/eepp/graphics/ctextureatlasmanager.cpp -../../src/eepp/graphics/ctextureatlas.cpp -../../src/eepp/graphics/csubtexture.cpp -../../src/eepp/graphics/cshaderprogrammanager.cpp -../../src/eepp/graphics/cshaderprogram.cpp -../../src/eepp/graphics/cshader.cpp -../../src/eepp/graphics/cscrollparallax.cpp -../../src/eepp/graphics/cprimitives.cpp -../../src/eepp/graphics/cparticlesystem.cpp -../../src/eepp/graphics/cparticle.cpp -../../src/eepp/graphics/cimage.cpp -../../src/eepp/graphics/cglobaltextureatlas.cpp -../../src/eepp/graphics/cglobalbatchrenderer.cpp -../../src/eepp/graphics/cframebuffermanager.cpp -../../src/eepp/graphics/cframebufferfbo.cpp -../../src/eepp/graphics/cframebuffer.cpp -../../src/eepp/graphics/cfontmanager.cpp -../../src/eepp/graphics/cfont.cpp -../../src/eepp/graphics/cconsole.cpp -../../src/eepp/graphics/cbatchrenderer.cpp -../../src/eepp/graphics/renderer/crenderergl3.cpp -../../src/eepp/graphics/renderer/crenderergl.cpp -../../src/eepp/graphics/renderer/cgl.cpp +../../src/eepp/graphics/vertexbuffervbo.cpp +../../src/eepp/graphics/vertexbufferogl.cpp +../../src/eepp/graphics/vertexbuffermanager.cpp +../../src/eepp/graphics/vertexbuffer.cpp +../../src/eepp/graphics/ttffontloader.cpp +../../src/eepp/graphics/ttffont.cpp +../../src/eepp/graphics/texturepackertex.cpp +../../src/eepp/graphics/texturepackernode.cpp +../../src/eepp/graphics/texturepacker.cpp +../../src/eepp/graphics/textureloader.cpp +../../src/eepp/graphics/textureatlasloader.cpp +../../src/eepp/graphics/texturefontloader.cpp +../../src/eepp/graphics/texturefont.cpp +../../src/eepp/graphics/texturefactory.cpp +../../src/eepp/graphics/texture.cpp +../../src/eepp/graphics/textcache.cpp +../../src/eepp/graphics/sprite.cpp +../../src/eepp/graphics/textureatlasmanager.cpp +../../src/eepp/graphics/textureatlas.cpp +../../src/eepp/graphics/subtexture.cpp +../../src/eepp/graphics/shaderprogrammanager.cpp +../../src/eepp/graphics/shaderprogram.cpp +../../src/eepp/graphics/shader.cpp +../../src/eepp/graphics/scrollparallax.cpp +../../src/eepp/graphics/primitives.cpp +../../src/eepp/graphics/particlesystem.cpp +../../src/eepp/graphics/particle.cpp +../../src/eepp/graphics/image.cpp +../../src/eepp/graphics/globaltextureatlas.cpp +../../src/eepp/graphics/globalbatchrenderer.cpp +../../src/eepp/graphics/framebuffermanager.cpp +../../src/eepp/graphics/framebufferfbo.cpp +../../src/eepp/graphics/framebuffer.cpp +../../src/eepp/graphics/fontmanager.cpp +../../src/eepp/graphics/font.cpp +../../src/eepp/graphics/console.cpp +../../src/eepp/graphics/batchrenderer.cpp +../../src/eepp/graphics/renderer/renderergl3.cpp +../../src/eepp/graphics/renderer/renderergl.cpp +../../src/eepp/graphics/renderer/gl.cpp ../../src/examples/empty_window/empty_window.cpp ../../src/test/eetest.hpp ../../src/test/eetest.cpp @@ -500,8 +500,8 @@ ../../src/eepp/graphics/renderer/shaders/clipped.frag ../../src/eepp/graphics/renderer/shaders/base.vert ../../src/eepp/graphics/renderer/shaders/base.frag -../../src/eepp/graphics/renderer/crenderergles2.cpp -../../include/eepp/graphics/renderer/crenderergles2.hpp +../../src/eepp/graphics/renderer/renderergles2.cpp +../../include/eepp/graphics/renderer/renderergles2.hpp ../../include/eepp/ee.hpp ../../include/eepp/config.hpp ../../include/eepp/core.hpp @@ -546,7 +546,7 @@ ../../src/eepp/window/backend/SFML/cursormanagersfml.cpp ../../src/eepp/window/backend/SFML/clipboardsfml.cpp ../../src/eepp/window/backend.hpp -../../src/eepp/graphics/cframebufferfbo.hpp +../../src/eepp/graphics/framebufferfbo.hpp ../../src/eepp/graphics/renderer/rendererhelper.hpp ../../include/eepp/graphics/packerhelper.hpp ../../include/eepp/system/filesystem.hpp @@ -616,8 +616,8 @@ ../../include/eepp/graphics/opengl.hpp ../../src/eepp/system/time.cpp ../../include/eepp/system/time.hpp -../../src/eepp/graphics/ctexturesaver.hpp -../../src/eepp/graphics/ctexturesaver.cpp +../../src/eepp/graphics/texturesaver.hpp +../../src/eepp/graphics/texturesaver.cpp ../../include/eepp/network/udpsocket.hpp ../../include/eepp/network/tcpsocket.hpp ../../include/eepp/network/tcplistener.hpp @@ -657,8 +657,8 @@ ../../external_projects.lua ../../src/eepp/ui/cuitextinputpassword.cpp ../../include/eepp/ui/cuitextinputpassword.hpp -../../src/eepp/graphics/renderer/crenderergl3cp.cpp -../../include/eepp/graphics/renderer/crenderergl3cp.hpp +../../src/eepp/graphics/renderer/renderergl3cp.cpp +../../include/eepp/graphics/renderer/renderergl3cp.hpp ../../src/eepp/graphics/renderer/shaders/basegl3cp.vert ../../src/eepp/graphics/renderer/shaders/basegl3cp.frag ../../src/eepp/window/backend/SDL/backendsdl.cpp diff --git a/src/eepp/gaming/cgameobjectobject.cpp b/src/eepp/gaming/cgameobjectobject.cpp index 6194bc14c..fb9602339 100644 --- a/src/eepp/gaming/cgameobjectobject.cpp +++ b/src/eepp/gaming/cgameobjectobject.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { @@ -38,7 +38,7 @@ void cGameObjectObject::Draw() { Int32 selAdd = mSelected ? 50 : 0; Int32 colFill = 100 + selAdd; - cPrimitives P; + Primitives P; P.FillMode( DRAW_FILL ); P.SetColor( ColorA( colFill, colFill, colFill, colFill ) ); P.DrawRectangle( mRect ); diff --git a/src/eepp/gaming/cgameobjectpolygon.cpp b/src/eepp/gaming/cgameobjectpolygon.cpp index eb1d4e1fc..7733f31f4 100644 --- a/src/eepp/gaming/cgameobjectpolygon.cpp +++ b/src/eepp/gaming/cgameobjectpolygon.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { @@ -31,7 +31,7 @@ void cGameObjectPolygon::Draw() { Int32 selAdd = mSelected ? 50 : 0; Int32 colFill = 100 + selAdd; - cPrimitives P; + Primitives P; P.FillMode( DRAW_FILL ); P.SetColor( ColorA( colFill, colFill, colFill, colFill ) ); P.DrawPolygon( mPoly ); diff --git a/src/eepp/gaming/cgameobjectpolyline.cpp b/src/eepp/gaming/cgameobjectpolyline.cpp index 1d1808baa..49b149acf 100644 --- a/src/eepp/gaming/cgameobjectpolyline.cpp +++ b/src/eepp/gaming/cgameobjectpolyline.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { @@ -23,7 +23,7 @@ bool cGameObjectPolyline::IsType( const Uint32& type ) { } void cGameObjectPolyline::Draw() { - cPrimitives P; + Primitives P; if ( mSelected ) { P.FillMode( DRAW_FILL ); diff --git a/src/eepp/gaming/cgameobjectsprite.cpp b/src/eepp/gaming/cgameobjectsprite.cpp index 5304a41f1..bf173a1c8 100644 --- a/src/eepp/gaming/cgameobjectsprite.cpp +++ b/src/eepp/gaming/cgameobjectsprite.cpp @@ -1,12 +1,12 @@ #include -#include -#include +#include +#include #include #include namespace EE { namespace Gaming { -cGameObjectSprite::cGameObjectSprite( const Uint32& Flags, cLayer * Layer, cSprite * Sprite ) : +cGameObjectSprite::cGameObjectSprite( const Uint32& Flags, cLayer * Layer, Graphics::Sprite * Sprite ) : cGameObject( Flags, Layer ), mSprite( Sprite ) { @@ -97,11 +97,11 @@ Sizei cGameObjectSprite::Size() { return Sizei(); } -cSprite * cGameObjectSprite::Sprite() const { +Graphics::Sprite * cGameObjectSprite::Sprite() const { return mSprite; } -void cGameObjectSprite::Sprite( cSprite * sprite ) { +void cGameObjectSprite::Sprite( Graphics::Sprite * sprite ) { eeSAFE_DELETE( mSprite ); mSprite = sprite; mSprite->RenderMode( RenderModeFromFlags() ); @@ -119,23 +119,23 @@ Uint32 cGameObjectSprite::DataId() { } void cGameObjectSprite::DataId( Uint32 Id ) { - cSprite * tSprite = NULL; + Graphics::Sprite * tSprite = NULL; if ( mFlags & GObjFlags::GAMEOBJECT_ANIMATED ) { - std::vector tSubTextureVec = cTextureAtlasManager::instance()->GetSubTexturesByPatternId( Id ); + std::vector tSubTextureVec = TextureAtlasManager::instance()->GetSubTexturesByPatternId( Id ); if ( tSubTextureVec.size() ) { - tSprite = eeNew( cSprite, () ); + tSprite = eeNew( Graphics::Sprite, () ); tSprite->CreateAnimation(); tSprite->AddFrames( tSubTextureVec ); Sprite( tSprite ); } } else { - cSubTexture * tSubTexture = cTextureAtlasManager::instance()->GetSubTextureById( Id ); + Graphics::SubTexture * tSubTexture = TextureAtlasManager::instance()->GetSubTextureById( Id ); if ( NULL != tSubTexture ) { - Sprite( eeNew( cSprite, ( tSubTexture ) ) ); + Sprite( eeNew( Graphics::Sprite, ( tSubTexture ) ) ); } } } diff --git a/src/eepp/gaming/cgameobjectsubtexture.cpp b/src/eepp/gaming/cgameobjectsubtexture.cpp index f061f8a9f..e8a8eb939 100644 --- a/src/eepp/gaming/cgameobjectsubtexture.cpp +++ b/src/eepp/gaming/cgameobjectsubtexture.cpp @@ -2,11 +2,11 @@ #include #include #include -#include +#include namespace EE { namespace Gaming { -cGameObjectSubTexture::cGameObjectSubTexture( const Uint32& Flags, cLayer * Layer, cSubTexture * SubTexture, const Vector2f& Pos ) : +cGameObjectSubTexture::cGameObjectSubTexture( const Uint32& Flags, cLayer * Layer, Graphics::SubTexture * SubTexture, const Vector2f& Pos ) : cGameObject( Flags, Layer ), mSubTexture( SubTexture ), mPos( Pos ) @@ -97,11 +97,11 @@ Sizei cGameObjectSubTexture::Size() { return Sizei(); } -cSubTexture * cGameObjectSubTexture::SubTexture() const { +Graphics::SubTexture * cGameObjectSubTexture::SubTexture() const { return mSubTexture; } -void cGameObjectSubTexture::SubTexture( cSubTexture * subTexture ) { +void cGameObjectSubTexture::SubTexture( Graphics::SubTexture * subTexture ) { mSubTexture = subTexture; } @@ -110,7 +110,7 @@ Uint32 cGameObjectSubTexture::DataId() { } void cGameObjectSubTexture::DataId( Uint32 Id ) { - SubTexture( cTextureAtlasManager::instance()->GetSubTextureById( Id ) ); + SubTexture( TextureAtlasManager::instance()->GetSubTextureById( Id ) ); } }} diff --git a/src/eepp/gaming/cgameobjectsubtextureex.cpp b/src/eepp/gaming/cgameobjectsubtextureex.cpp index 5fe847b3e..f051f30e2 100644 --- a/src/eepp/gaming/cgameobjectsubtextureex.cpp +++ b/src/eepp/gaming/cgameobjectsubtextureex.cpp @@ -4,7 +4,7 @@ namespace EE { namespace Gaming { -cGameObjectSubTextureEx::cGameObjectSubTextureEx( const Uint32& Flags, cLayer * Layer, cSubTexture * SubTexture, const Vector2f& Pos, EE_BLEND_MODE Blend, EE_RENDER_MODE Render, Float Angle, Vector2f Scale, ColorA Color ) : +cGameObjectSubTextureEx::cGameObjectSubTextureEx( const Uint32& Flags, cLayer * Layer, Graphics::SubTexture * SubTexture, const Vector2f& Pos, EE_BLEND_MODE Blend, EE_RENDER_MODE Render, Float Angle, Vector2f Scale, ColorA Color ) : cGameObjectSubTexture( Flags, Layer, SubTexture, Pos ), mBlend( Blend ), mRender( Render ), diff --git a/src/eepp/gaming/cgameobjectvirtual.cpp b/src/eepp/gaming/cgameobjectvirtual.cpp index 59a39e88a..fabc04cbb 100644 --- a/src/eepp/gaming/cgameobjectvirtual.cpp +++ b/src/eepp/gaming/cgameobjectvirtual.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { @@ -18,7 +18,7 @@ cGameObjectVirtual::cGameObjectVirtual( Uint32 DataId, cLayer * Layer, const Uin { } -cGameObjectVirtual::cGameObjectVirtual( cSubTexture * SubTexture, cLayer * Layer, const Uint32& Flags, Uint32 Type, const Vector2f& Pos ) : +cGameObjectVirtual::cGameObjectVirtual( SubTexture * SubTexture, cLayer * Layer, const Uint32& Flags, Uint32 Type, const Vector2f& Pos ) : cGameObject( Flags, Layer ), mType( Type ), mDataId( 0 ), @@ -101,7 +101,7 @@ void cGameObjectVirtual::Draw() { mSubTexture->Draw( mPos.x, mPos.y, ColorA(), GetAngle(), Vector2f::One, ALPHA_NORMAL, RenderModeFromFlags() ); } } else { - cPrimitives P; + Primitives P; ColorA C( mDataId ); C.Alpha = 255; diff --git a/src/eepp/gaming/cmap.cpp b/src/eepp/gaming/cmap.cpp index d5737ceaa..bd9fb0b6f 100644 --- a/src/eepp/gaming/cmap.cpp +++ b/src/eepp/gaming/cmap.cpp @@ -11,11 +11,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include using namespace EE::Graphics; #include @@ -117,17 +117,17 @@ void cMap::CreateLightManager() { void cMap::CreateEmptyTile() { //! I create a texture representing an empty tile to render instead of rendering with primitives because is a lot faster, at least with NVIDIA GPUs. - cTextureFactory * TF = cTextureFactory::instance(); + TextureFactory * TF = TextureFactory::instance(); std::string tileName( String::StrFormated( "maptile-%dx%d-%ul", mTileSize.Width(), mTileSize.Height(), mGridLinesColor.GetValue() ) ); - cTexture * Tex = TF->GetByName( tileName ); + Texture * Tex = TF->GetByName( tileName ); if ( NULL == Tex ) { Uint32 x, y; ColorA Col( mGridLinesColor ); - cImage Img( mTileSize.Width(), mTileSize.Height(), 4 ); + Image Img( mTileSize.Width(), mTileSize.Height(), 4 ); Img.FillWithColor( ColorA( 0, 0, 0, 0 ) ); @@ -211,14 +211,14 @@ cLayer* cMap::GetLayer( const std::string& name ) { } void cMap::Draw() { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); if ( ClipedArea() ) { mWindow->ClipEnable( mScreenPos.x, mScreenPos.y, mViewSize.x, mViewSize.y ); } if ( DrawBackground() ) { - cPrimitives P; + Primitives P; Uint8 Alpha = static_cast( (Float)mBackColor.A() * ( (Float)mBackAlpha / 255.f ) ); @@ -246,7 +246,7 @@ void cMap::Draw() { if ( mDrawCb.IsSet() ) mDrawCb(); - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->PopMatrix(); GLi->LoadMatrixf( oldM ); @@ -270,7 +270,7 @@ void cMap::GridDraw() { if ( 0 == mSize.x || 0 == mSize.y || NULL == mTileTex ) return; - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); Vector2i start = StartTile(); Vector2i end = EndTile(); @@ -308,7 +308,7 @@ void cMap::GridDraw() { } } - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); } const bool& cMap::IsMouseOver() const { @@ -655,7 +655,7 @@ cGameObject * cMap::CreateGameObject( const Uint32& Type, const Uint32& Flags, c return mCreateGOCb( Type, Flags, Layer, DataId ); } else { cGameObjectVirtual * tVirtual; - cSubTexture * tIsSubTexture = cTextureAtlasManager::instance()->GetSubTextureById( DataId ); + SubTexture * tIsSubTexture = TextureAtlasManager::instance()->GetSubTextureById( DataId ); if ( NULL != tIsSubTexture ) { tVirtual = eeNew( cGameObjectVirtual, ( tIsSubTexture, Layer, Flags, Type ) ); @@ -837,8 +837,8 @@ bool cMap::LoadFromStream( IOStream& IOS ) { for ( i = 0; i < TextureAtlases.size(); i++ ) { std::string sgname = FileSystem::FileRemoveExtension( FileSystem::FileNameFromPath( TextureAtlases[i] ) ); - if ( NULL == cTextureAtlasManager::instance()->GetByName( sgname ) ) { - cTextureAtlasLoader * tgl = eeNew( cTextureAtlasLoader, () ); + if ( NULL == TextureAtlasManager::instance()->GetByName( sgname ) ) { + TextureAtlasLoader * tgl = eeNew( TextureAtlasLoader, () ); tgl->Load( Sys::GetProcessPath() + TextureAtlases[i] ); @@ -1372,8 +1372,8 @@ void cMap::Save( const std::string& path ) { } std::vector cMap::GetTextureAtlases() { - cTextureAtlasManager * SGM = cTextureAtlasManager::instance(); - std::list& Res = SGM->GetResources(); + TextureAtlasManager * SGM = TextureAtlasManager::instance(); + std::list& Res = SGM->GetResources(); std::vector items; @@ -1381,7 +1381,7 @@ std::vector cMap::GetTextureAtlases() { Uint32 Restricted1 = String::Hash( std::string( "global" ) ); Uint32 Restricted2 = String::Hash( UI::cUIThemeManager::instance()->DefaultTheme()->TextureAtlas()->Name() ); - for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { + for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { if ( (*it)->Id() != Restricted1 && (*it)->Id() != Restricted2 ) items.push_back( (*it)->Path() ); } @@ -1397,7 +1397,7 @@ void cMap::SetUpdateCallback( MapUpdateCb Cb ) { mUpdateCb = Cb; } -cTexture * cMap::GetBlankTileTexture() { +Texture * cMap::GetBlankTileTexture() { return mTileTex; } diff --git a/src/eepp/gaming/cobjectlayer.cpp b/src/eepp/gaming/cobjectlayer.cpp index 5d4859396..053347c6b 100644 --- a/src/eepp/gaming/cobjectlayer.cpp +++ b/src/eepp/gaming/cobjectlayer.cpp @@ -3,9 +3,9 @@ #include #include -#include -#include -#include +#include +#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { @@ -30,7 +30,7 @@ void cObjectLayer::DeallocateLayer() { } void cObjectLayer::Draw( const Vector2f &Offset ) { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); ObjList::iterator it; @@ -41,7 +41,7 @@ void cObjectLayer::Draw( const Vector2f &Offset ) { (*it)->Draw(); } - cTexture * Tex = mMap->GetBlankTileTexture(); + Texture * Tex = mMap->GetBlankTileTexture(); if ( mMap->ShowBlocked() && NULL != Tex ) { ColorA Col( 255, 0, 0, 200 ); @@ -55,7 +55,7 @@ void cObjectLayer::Draw( const Vector2f &Offset ) { } } - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->PopMatrix(); } diff --git a/src/eepp/gaming/ctilelayer.cpp b/src/eepp/gaming/ctilelayer.cpp index dc70f0604..0274c032b 100644 --- a/src/eepp/gaming/ctilelayer.cpp +++ b/src/eepp/gaming/ctilelayer.cpp @@ -1,9 +1,9 @@ #include #include -#include -#include -#include +#include +#include +#include using namespace EE::Graphics; namespace EE { namespace Gaming { @@ -20,7 +20,7 @@ cTileLayer::~cTileLayer() { } void cTileLayer::Draw( const Vector2f& Offset ) { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->PushMatrix(); GLi->Translatef( mOffset.x, mOffset.y, 0.0f ); @@ -39,7 +39,7 @@ void cTileLayer::Draw( const Vector2f& Offset ) { } } - cTexture * Tex = mMap->GetBlankTileTexture(); + Texture * Tex = mMap->GetBlankTileTexture(); if ( mMap->ShowBlocked() && NULL != Tex ) { for ( Int32 x = start.x; x < end.x; x++ ) { @@ -53,7 +53,7 @@ void cTileLayer::Draw( const Vector2f& Offset ) { } } - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->PopMatrix(); } diff --git a/src/eepp/gaming/mapeditor/cmapeditor.cpp b/src/eepp/gaming/mapeditor/cmapeditor.cpp index 20ff67f30..01ef66da5 100644 --- a/src/eepp/gaming/mapeditor/cmapeditor.cpp +++ b/src/eepp/gaming/mapeditor/cmapeditor.cpp @@ -25,10 +25,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -443,7 +443,7 @@ void cMapEditor::CreateUIMap() { Float ScrollV = 16; if ( NULL != HScrollSkin ) { - cSubTexture * tTex = HScrollSkin->GetSubTexture( cUISkinState::StateNormal ); + SubTexture * tTex = HScrollSkin->GetSubTexture( cUISkinState::StateNormal ); if ( NULL != tTex ) { ScrollH = tTex->Size().Height(); @@ -451,7 +451,7 @@ void cMapEditor::CreateUIMap() { } if ( NULL != VScrollSkin ) { - cSubTexture * tTex = VScrollSkin->GetSubTexture( cUISkinState::StateNormal ); + SubTexture * tTex = VScrollSkin->GetSubTexture( cUISkinState::StateNormal ); if ( NULL != tTex ) { ScrollV = tTex->Size().Height(); @@ -710,8 +710,8 @@ void cMapEditor::OnNewGOTypeAdded( std::string name, Uint32 hash ) { } void cMapEditor::FillSGCombo() { - cTextureAtlasManager * SGM = cTextureAtlasManager::instance(); - std::list& Res = SGM->GetResources(); + TextureAtlasManager * SGM = TextureAtlasManager::instance(); + std::list& Res = SGM->GetResources(); mTextureAtlasesList->ListBox()->Clear(); @@ -720,7 +720,7 @@ void cMapEditor::FillSGCombo() { Uint32 Restricted1 = String::Hash( std::string( "global" ) ); Uint32 Restricted2 = String::Hash( mTheme->TextureAtlas()->Name() ); - for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { + for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { if ( (*it)->Id() != Restricted1 && (*it)->Id() != Restricted2 ) items.push_back( (*it)->Name() ); } @@ -735,16 +735,16 @@ void cMapEditor::FillSGCombo() { } void cMapEditor::FillSubTextureList() { - cTextureAtlasManager * SGM = cTextureAtlasManager::instance(); + TextureAtlasManager * SGM = TextureAtlasManager::instance(); mCurSG = SGM->GetByName( mTextureAtlasesList->Text() ); - std::list& Res = mCurSG->GetResources(); + std::list& Res = mCurSG->GetResources(); mSubTextureList->Clear(); if ( NULL != mCurSG ) { std::vector items; - for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { + for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { items.push_back( (*it)->Name() ); } @@ -761,7 +761,7 @@ void cMapEditor::FillSubTextureList() { void cMapEditor::OnSubTextureChange( const cUIEvent * Event ) { if ( NULL != mCurSG ) { - cSubTexture * tSubTexture = mCurSG->GetByName( mSubTextureList->GetItemSelectedText() ); + SubTexture * tSubTexture = mCurSG->GetByName( mSubTextureList->GetItemSelectedText() ); if ( NULL != tSubTexture ) { mGfxPreview->SubTexture( tSubTexture ); @@ -1012,7 +1012,7 @@ void cMapEditor::MapMenuClick( const cUIEvent * Event ) { if ( "New Texture Atlas..." == txt ) { cUIWindow * tWin = mTheme->CreateWindow( NULL, Sizei( 1024, 768 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_DRAGABLE_CONTAINER, Sizei( 1024, 768 ) ); - eeNew ( Tools::cTextureAtlasEditor, ( tWin ) ); + eeNew ( Tools::TextureAtlasEditor, ( tWin ) ); tWin->Center(); tWin->Show(); } else if ( "Add External Texture Atlas..." == txt ) { @@ -1129,10 +1129,10 @@ void cMapEditor::TextureAtlasOpen( const cUIEvent * Event ) { std::string sgname = FileSystem::FileRemoveExtension( FileSystem::FileNameFromPath( CDL->GetFullPath() ) ); - cTextureAtlas * SG = cTextureAtlasManager::instance()->GetByName( sgname ); + TextureAtlas * SG = TextureAtlasManager::instance()->GetByName( sgname ); if ( NULL == SG ) { - cTextureAtlasLoader tgl( CDL->GetFullPath() ); + TextureAtlasLoader tgl( CDL->GetFullPath() ); if ( tgl.IsLoaded() ) { mTextureAtlasesList->ListBox()->AddListBoxItem( sgname ); @@ -1194,13 +1194,13 @@ cGameObject * cMapEditor::CreateGameObject() { if ( mChkAnim->Active() ) { - cSprite * tAnimSprite = eeNew( cSprite, ( String::RemoveNumbersAtEnd( mGfxPreview->SubTexture()->Name() ) ) ); + Sprite * tAnimSprite = eeNew( Sprite, ( String::RemoveNumbersAtEnd( mGfxPreview->SubTexture()->Name() ) ) ); tObj = eeNew( cGameObjectSprite, ( mCurGOFlags, mCurLayer, tAnimSprite ) ); } else { - cSprite * tStaticSprite = eeNew( cSprite, ( mGfxPreview->SubTexture() ) ); - tObj = eeNew( cGameObjectSprite, ( mCurGOFlags, mCurLayer, tStaticSprite ) ); + Sprite * tStatiSprite = eeNew( Sprite, ( mGfxPreview->SubTexture() ) ); + tObj = eeNew( cGameObjectSprite, ( mCurGOFlags, mCurLayer, tStatiSprite ) ); } } else { diff --git a/src/eepp/gaming/mapeditor/cuimap.hpp b/src/eepp/gaming/mapeditor/cuimap.hpp index 1c28a61ef..7ec5538a9 100644 --- a/src/eepp/gaming/mapeditor/cuimap.hpp +++ b/src/eepp/gaming/mapeditor/cuimap.hpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include using namespace EE::UI; @@ -95,7 +95,7 @@ class EE_API cUIMap : public cUIComplexControl { cMap * mMap; cLayer * mCurLayer; Uint32 mEditingMode; - cPrimitives mP; + Primitives mP; Uint32 mEditingObjMode; diff --git a/src/eepp/graphics/cbatchrenderer.cpp b/src/eepp/graphics/batchrenderer.cpp similarity index 76% rename from src/eepp/graphics/cbatchrenderer.cpp rename to src/eepp/graphics/batchrenderer.cpp index d9404c864..f45efff09 100755 --- a/src/eepp/graphics/cbatchrenderer.cpp +++ b/src/eepp/graphics/batchrenderer.cpp @@ -1,19 +1,19 @@ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include namespace EE { namespace Graphics { -cBatchRenderer::cBatchRenderer() : +BatchRenderer::BatchRenderer() : mVertex( NULL ), mVertexSize( 0 ), mTVertex( NULL ), mNumVertex(0), mTexture(NULL), - mTF( cTextureFactory::instance() ), + mTF( TextureFactory::instance() ), mBlend(ALPHA_NORMAL), mCurrentMode(DM_QUADS), mRotation(0.0f), @@ -27,13 +27,13 @@ cBatchRenderer::cBatchRenderer() : Init(); } -cBatchRenderer::cBatchRenderer( const unsigned int& Prealloc ) : +BatchRenderer::BatchRenderer( const unsigned int& Prealloc ) : mVertex( NULL ), mVertexSize( 0 ), mTVertex( NULL ), mNumVertex(0), mTexture(NULL), - mTF( cTextureFactory::instance() ), + mTF( TextureFactory::instance() ), mBlend(ALPHA_NORMAL), mCurrentMode(DM_QUADS), mRotation(0.0f), @@ -47,64 +47,64 @@ cBatchRenderer::cBatchRenderer( const unsigned int& Prealloc ) : Init(); } -cBatchRenderer::~cBatchRenderer() { +BatchRenderer::~BatchRenderer() { eeSAFE_DELETE_ARRAY( mVertex ); } -void cBatchRenderer::Init() { +void BatchRenderer::Init() { QuadsBegin(); } -void cBatchRenderer::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 cBatchRenderer::DrawOpt() { +void BatchRenderer::DrawOpt() { if ( mForceRendering ) Flush(); } -void cBatchRenderer::Draw() { +void BatchRenderer::Draw() { Flush(); } -void cBatchRenderer::SetTexture( const cTexture * Tex ) { +void BatchRenderer::SetTexture( const Texture * Tex ) { if ( mTexture != Tex ) Flush(); mTexture = Tex; } -void cBatchRenderer::SetBlendMode( const EE_BLEND_MODE& Blend ) { +void BatchRenderer::SetBlendMode( const EE_BLEND_MODE& Blend ) { if ( Blend != mBlend ) Flush(); mBlend = Blend; } -void cBatchRenderer::AddVertexs( const unsigned int& num ) { +void BatchRenderer::AddVertexs( const unsigned int& num ) { mNumVertex += num; if ( ( mNumVertex + num ) >= mVertexSize ) Flush(); } -void cBatchRenderer::SetBlendMode( EE_DRAW_MODE Mode, const bool& Force ) { +void BatchRenderer::SetBlendMode( EE_DRAW_MODE Mode, const bool& Force ) { if ( Force && mCurrentMode != Mode ) { Flush(); mCurrentMode = Mode; } } -void cBatchRenderer::Flush() { +void BatchRenderer::Flush() { if ( mNumVertex == 0 ) return; - if ( cGlobalBatchRenderer::instance() != this ) - cGlobalBatchRenderer::instance()->Draw(); + if ( GlobalBatchRenderer::instance() != this ) + GlobalBatchRenderer::instance()->Draw(); Uint32 NumVertex = mNumVertex; mNumVertex = 0; @@ -167,11 +167,11 @@ void cBatchRenderer::Flush() { } } -void cBatchRenderer::BatchQuad( const Float& x, const Float& y, const Float& width, const Float& height, const Float& 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 cBatchRenderer::BatchQuadEx( Float x, Float y, Float width, Float height, Float angle, Vector2f scale, OriginPoint originPoint ) { +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; @@ -266,7 +266,7 @@ void cBatchRenderer::BatchQuadEx( Float x, Float y, Float width, Float height, F } } -void cBatchRenderer::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 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; @@ -339,7 +339,7 @@ void cBatchRenderer::BatchQuadFree( const Float& x0, const Float& y0, const Floa } } -void cBatchRenderer::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 ) { +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; @@ -423,24 +423,24 @@ void cBatchRenderer::BatchQuadFreeEx( const Float& x0, const Float& y0, const Fl } } -void cBatchRenderer::QuadsBegin() { +void BatchRenderer::QuadsBegin() { SetBlendMode( DM_QUADS, true ); QuadsSetSubset( 0, 0, 1, 1 ); QuadsSetColor( ColorA() ); } -void cBatchRenderer::QuadsSetColor( const ColorA& Color ) { +void BatchRenderer::QuadsSetColor( const ColorA& Color ) { mVerColor[0] = mVerColor[1] = mVerColor[2] = mVerColor[3] = Color; } -void cBatchRenderer::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 cBatchRenderer::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 cBatchRenderer::QuadsSetSubset( const Float& tl_u, const Float& tl_v, const mTexCoord[2].v = br_v; mTexCoord[3].v = tl_v; } -void cBatchRenderer::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 cBatchRenderer::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,17 +464,17 @@ void cBatchRenderer::Rotate( const Vector2f& center, Vector2f* point, const Floa } } -void cBatchRenderer::PointsBegin() { +void BatchRenderer::PointsBegin() { SetBlendMode( DM_POINTS, true ); QuadsSetSubset( 0, 0, 1, 1 ); PointSetColor( ColorA() ); } -void cBatchRenderer::PointSetColor( const ColorA& Color ) { +void BatchRenderer::PointSetColor( const ColorA& Color ) { QuadsSetColor( Color ); } -void cBatchRenderer::BatchPoint( const Float& x, const Float& y ) { +void BatchRenderer::BatchPoint( const Float& x, const Float& y ) { if ( mNumVertex + 1 >= mVertexSize ) return; @@ -489,21 +489,21 @@ void cBatchRenderer::BatchPoint( const Float& x, const Float& y ) { AddVertexs(1); } -void cBatchRenderer::LinesBegin() { +void BatchRenderer::LinesBegin() { SetBlendMode( DM_LINES, true ); QuadsSetSubset( 0, 0, 1, 1 ); PointSetColor( ColorA() ); } -void cBatchRenderer::LinesSetColor( const ColorA& Color ) { +void BatchRenderer::LinesSetColor( const ColorA& Color ) { QuadsSetColor( Color ); } -void cBatchRenderer::LinesSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { +void BatchRenderer::LinesSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { QuadsSetColorFree( Color0, Color1, Color0, Color0 ); } -void cBatchRenderer::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; @@ -524,21 +524,21 @@ void cBatchRenderer::BatchLine( const Float& x0, const Float& y0, const Float& x AddVertexs(2); } -void cBatchRenderer::LineLoopBegin() { +void BatchRenderer::LineLoopBegin() { SetBlendMode( DM_LINE_LOOP, true ); QuadsSetSubset( 0, 0, 1, 1 ); PointSetColor( ColorA() ); } -void cBatchRenderer::LineLoopSetColor( const ColorA& Color ) { +void BatchRenderer::LineLoopSetColor( const ColorA& Color ) { QuadsSetColor( Color ); } -void cBatchRenderer::LineLoopSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { +void BatchRenderer::LineLoopSetColorFree( const ColorA& Color0, const ColorA& Color1 ) { QuadsSetColorFree( Color0, Color1, Color0, Color0 ); } -void cBatchRenderer::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; @@ -559,11 +559,11 @@ void cBatchRenderer::BatchLineLoop( const Float& x0, const Float& y0, const Floa AddVertexs(2); } -void cBatchRenderer::BatchLineLoop( const Vector2f& vector1, const Vector2f& vector2 ) { +void BatchRenderer::BatchLineLoop( const Vector2f& vector1, const Vector2f& vector2 ) { BatchLineLoop( vector1.x, vector1.y, vector2.x, vector2.y ); } -void cBatchRenderer::BatchLineLoop( const Float& x0, const Float& y0 ) { +void BatchRenderer::BatchLineLoop( const Float& x0, const Float& y0 ) { if ( mNumVertex + 1 >= mVertexSize ) return; @@ -578,31 +578,31 @@ void cBatchRenderer::BatchLineLoop( const Float& x0, const Float& y0 ) { AddVertexs(1); } -void cBatchRenderer::BatchLineLoop( const Vector2f& vector1 ) { +void BatchRenderer::BatchLineLoop( const Vector2f& vector1 ) { BatchLineLoop( vector1.x, vector1.y ); } -void cBatchRenderer::TriangleFanBegin() { +void BatchRenderer::TriangleFanBegin() { SetBlendMode( DM_TRIANGLE_FAN, true ); TriangleFanSetSubset( 0, 0, 0, 1, 1, 1 ); TriangleFanSetColor( ColorA() ); } -void cBatchRenderer::TriangleFanSetColor( const ColorA& Color ) { +void BatchRenderer::TriangleFanSetColor( const ColorA& Color ) { QuadsSetColor( Color ); } -void cBatchRenderer::TriangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { +void BatchRenderer::TriangleFanSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { QuadsSetColorFree( Color0, Color1, Color2, Color0 ); } -void cBatchRenderer::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 cBatchRenderer::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; @@ -630,7 +630,7 @@ void cBatchRenderer::BatchTriangleFan( const Float& x0, const Float& y0, const F AddVertexs(3); } -void cBatchRenderer::BatchTriangleFan( const Float& x0, const Float& y0 ) { +void BatchRenderer::BatchTriangleFan( const Float& x0, const Float& y0 ) { if ( mNumVertex + 1 >= mVertexSize ) return; @@ -645,27 +645,27 @@ void cBatchRenderer::BatchTriangleFan( const Float& x0, const Float& y0 ) { AddVertexs(1); } -void cBatchRenderer::TrianglesBegin() { +void BatchRenderer::TrianglesBegin() { SetBlendMode( DM_TRIANGLES, true ); TrianglesSetSubset( 0, 0, 0, 1, 1, 1 ); TrianglesSetColor( ColorA() ); } -void cBatchRenderer::TrianglesSetColor( const ColorA& Color ) { +void BatchRenderer::TrianglesSetColor( const ColorA& Color ) { QuadsSetColor( Color ); } -void cBatchRenderer::TrianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { +void BatchRenderer::TrianglesSetColorFree( const ColorA& Color0, const ColorA& Color1, const ColorA& Color2 ) { QuadsSetColorFree( Color0, Color1, Color2, Color0 ); } -void cBatchRenderer::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 cBatchRenderer::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; @@ -693,11 +693,11 @@ void cBatchRenderer::BatchTriangle( const Float& x0, const Float& y0, const Floa AddVertexs(3); } -void cBatchRenderer::PolygonSetColor( const ColorA& Color ) { +void BatchRenderer::PolygonSetColor( const ColorA& Color ) { PointSetColor( Color ); } -void cBatchRenderer::BatchPolygon( const Polygon2f& Polygon ) { +void BatchRenderer::BatchPolygon( const Polygon2f& Polygon ) { if ( Polygon.Size() > mVertexSize ) return; @@ -715,7 +715,7 @@ void cBatchRenderer::BatchPolygon( const Polygon2f& Polygon ) { } } -void cBatchRenderer::BatchPolygonByPoint( const Float& x, const Float& y ) { +void BatchRenderer::BatchPolygonByPoint( const Float& x, const Float& y ) { if ( mNumVertex + 1 >= mVertexSize ) return; @@ -730,15 +730,15 @@ void cBatchRenderer::BatchPolygonByPoint( const Float& x, const Float& y ) { AddVertexs(1); } -void cBatchRenderer::BatchPolygonByPoint( const Vector2f& Vector ) { +void BatchRenderer::BatchPolygonByPoint( const Vector2f& Vector ) { BatchPolygonByPoint( Vector.x, Vector.y ); } -void cBatchRenderer::SetLineWidth( const Float& lineWidth ) { +void BatchRenderer::SetLineWidth( const Float& lineWidth ) { GLi->LineWidth( lineWidth ); } -Float cBatchRenderer::GetLineWidth() { +Float BatchRenderer::GetLineWidth() { float lw = 1; #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN @@ -748,19 +748,19 @@ Float cBatchRenderer::GetLineWidth() { return lw; } -void cBatchRenderer::SetPointSize( const Float& pointSize ) { +void BatchRenderer::SetPointSize( const Float& pointSize ) { GLi->PointSize( pointSize ); } -Float cBatchRenderer::GetPointSize() { +Float BatchRenderer::GetPointSize() { return GLi->PointSize(); } -void cBatchRenderer::ForceBlendModeChange( const bool& Force ) { +void BatchRenderer::ForceBlendModeChange( const bool& Force ) { mForceBlendMode = Force; } -const bool& cBatchRenderer::ForceBlendModeChange() const { +const bool& BatchRenderer::ForceBlendModeChange() const { return mForceBlendMode; } diff --git a/src/eepp/graphics/blendmode.cpp b/src/eepp/graphics/blendmode.cpp index 5babcf85b..c16b18720 100644 --- a/src/eepp/graphics/blendmode.cpp +++ b/src/eepp/graphics/blendmode.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include namespace EE { namespace Graphics { diff --git a/src/eepp/graphics/cfontmanager.cpp b/src/eepp/graphics/cfontmanager.cpp deleted file mode 100644 index ef3981b7a..000000000 --- a/src/eepp/graphics/cfontmanager.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include - -namespace EE { namespace Graphics { - -SINGLETON_DECLARE_IMPLEMENTATION(cFontManager) - -cFontManager::cFontManager() { -} - -cFontManager::~cFontManager() { -} - -cFont * cFontManager::Add( cFont * Font ) { - eeASSERT( NULL != Font ); - return ResourceManager::Add( Font ); -} - -}} diff --git a/src/eepp/graphics/cframebuffermanager.cpp b/src/eepp/graphics/cframebuffermanager.cpp deleted file mode 100644 index 1ffd625c5..000000000 --- a/src/eepp/graphics/cframebuffermanager.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include - -namespace EE { namespace Graphics { namespace Private { - -SINGLETON_DECLARE_IMPLEMENTATION(cFrameBufferManager) - -cFrameBufferManager::cFrameBufferManager() -{ -} - -cFrameBufferManager::~cFrameBufferManager() -{ -} - -void cFrameBufferManager::Reload() { - std::list::iterator it; - - for ( it = mResources.begin(); it != mResources.end(); it++ ) - (*it)->Reload(); -} - -}}} diff --git a/src/eepp/graphics/cglobalbatchrenderer.cpp b/src/eepp/graphics/cglobalbatchrenderer.cpp deleted file mode 100755 index ed99c1361..000000000 --- a/src/eepp/graphics/cglobalbatchrenderer.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include - -namespace EE { namespace Graphics { - -SINGLETON_DECLARE_IMPLEMENTATION(cGlobalBatchRenderer) - -cGlobalBatchRenderer::cGlobalBatchRenderer() { - AllocVertexs( 4096 ); -} - -cGlobalBatchRenderer::~cGlobalBatchRenderer() { -} - -}} diff --git a/src/eepp/graphics/cglobaltextureatlas.cpp b/src/eepp/graphics/cglobaltextureatlas.cpp deleted file mode 100644 index 4b52181ee..000000000 --- a/src/eepp/graphics/cglobaltextureatlas.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -namespace EE { namespace Graphics { - -SINGLETON_DECLARE_IMPLEMENTATION(cGlobalTextureAtlas) - -cGlobalTextureAtlas::cGlobalTextureAtlas() : - cTextureAtlas( "global" ) -{ -} - -cGlobalTextureAtlas::~cGlobalTextureAtlas() { -} - -}} diff --git a/src/eepp/graphics/cconsole.cpp b/src/eepp/graphics/console.cpp similarity index 81% rename from src/eepp/graphics/cconsole.cpp rename to src/eepp/graphics/console.cpp index ae12d1cf0..53ea82ee9 100755 --- a/src/eepp/graphics/cconsole.cpp +++ b/src/eepp/graphics/console.cpp @@ -1,6 +1,6 @@ -#include +#include #include -#include +#include #include #include #include @@ -12,7 +12,7 @@ using namespace EE::Window; namespace EE { namespace Graphics { -cConsole::cConsole( EE::Window::Window * window ) : +Console::Console( EE::Window::Window * window ) : mWindow( window ), mConColor(35, 47, 73, 230), mConLineColor(55, 67, 93, 230), @@ -46,7 +46,7 @@ cConsole::cConsole( EE::Window::Window * window ) : } } -cConsole::cConsole( cFont* Font, const bool& MakeDefaultCommands, const bool& AttachToLog, const unsigned int& MaxLogLines, const Uint32& TextureId, EE::Window::Window * window ) : +Console::Console( Font* Font, const bool& MakeDefaultCommands, const bool& AttachToLog, const unsigned int& MaxLogLines, const Uint32& TextureId, EE::Window::Window * window ) : mWindow( window ), mConColor(35, 47, 73, 230), mConLineColor(55, 67, 93, 230), @@ -82,7 +82,7 @@ cConsole::cConsole( cFont* Font, const bool& MakeDefaultCommands, const bool& At Create( Font, MakeDefaultCommands, AttachToLog, MaxLogLines, TextureId ); } -cConsole::~cConsole() { +Console::~Console() { if ( mMyCallback && NULL != Engine::ExistsSingleton() && Engine::instance()->ExistsWindow( mWindow ) @@ -99,7 +99,7 @@ cConsole::~cConsole() { } } -void cConsole::Create( cFont* 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(); } @@ -129,11 +129,11 @@ void cConsole::Create( cFont* Font, const bool& MakeDefaultCommands, const bool& if ( NULL != Engine::ExistsSingleton() && Engine::instance()->ExistsWindow( mWindow ) ) { - mMyCallback = mWindow->GetInput()->PushCallback( cb::Make1( this, &cConsole::PrivInputCallback ) ); - mVidCb = mWindow->PushResizeCallback( cb::Make1( this, &cConsole::PrivVideoResize ) ); + mMyCallback = mWindow->GetInput()->PushCallback( cb::Make1( this, &Console::PrivInputCallback ) ); + mVidCb = mWindow->PushResizeCallback( cb::Make1( this, &Console::PrivVideoResize ) ); } - mTBuf->SetReturnCallback( cb::Make0( this, &cConsole::ProcessLine ) ); + mTBuf->SetReturnCallback( cb::Make0( this, &Console::ProcessLine ) ); mTBuf->Start(); mTBuf->SupportNewLine( false ); mTBuf->Active( false ); @@ -148,12 +148,12 @@ void cConsole::Create( cFont* Font, const bool& MakeDefaultCommands, const bool& } } -void cConsole::AddCommand( const String& Command, ConsoleCallback CB ) { +void Console::AddCommand( const String& Command, ConsoleCallback CB ) { if ( !(mCallbacks.count( Command ) > 0) ) mCallbacks[Command] = CB; } -void cConsole::Draw() { +void Console::Draw() { if ( mEnabled && NULL != mFont ) { ColorA OldColor( mFont->Color() ); @@ -166,7 +166,7 @@ void cConsole::Draw() { } else { ColorA C( mConColor.R(), mConColor.G(), mConColor.B(), static_cast(mA) ); - cTexture * Tex = cTextureFactory::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 ); @@ -228,7 +228,7 @@ void cConsole::Draw() { } } -void cConsole::FadeIn() { +void Console::FadeIn() { if (!mFading) { mFading = true; mFadeIn = true; @@ -238,7 +238,7 @@ void cConsole::FadeIn() { } } -void cConsole::FadeOut() { +void Console::FadeOut() { if (!mFading) { mFading = true; mFadeOut = true; @@ -247,7 +247,7 @@ void cConsole::FadeOut() { } } -void cConsole::ProcessLine() { +void Console::ProcessLine() { String str = mTBuf->Buffer(); std::vector < String > params = String::Split( str, ' ' ); @@ -269,14 +269,14 @@ void cConsole::ProcessLine() { mTBuf->Clear(); } -void cConsole::PrivPushText( const String& str ) { +void Console::PrivPushText( const String& str ) { mCmdLog.push_back( str ); if ( mCmdLog.size() >= mMaxLogLines ) mCmdLog.pop_front(); } -void cConsole::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 ) ); @@ -288,7 +288,7 @@ void cConsole::PushText( const String& str ) { } } -void cConsole::PushText( const char * format, ... ) { +void Console::PushText( const char * format, ... ) { int n, size = 256; std::string tstr( size, '\0' ); @@ -318,14 +318,14 @@ void cConsole::PushText( const char * format, ... ) { } } -void cConsole::Toggle() { +void Console::Toggle() { if ( mVisible ) FadeOut(); else FadeIn(); } -void cConsole::Fade() { +void Console::Fade() { if (mCurSide) { mCurAlpha -= 255.f * mWindow->Elapsed().AsMilliseconds() / mFadeSpeed.AsMilliseconds(); if ( mCurAlpha <= 0.0f ) { @@ -373,7 +373,7 @@ void cConsole::Fade() { if ( mA < 0.0f ) mA = 0.0f; } -String cConsole::GetLastCommonSubStr( std::list& cmds ) { +String Console::GetLastCommonSubStr( std::list& cmds ) { String lastCommon( mTBuf->Buffer() ); String strTry( lastCommon ); @@ -410,7 +410,7 @@ String cConsole::GetLastCommonSubStr( std::list& cmds ) { return lastCommon; } -void cConsole::PrintCommandsStartingWith( const String& start ) { +void Console::PrintCommandsStartingWith( const String& start ) { std::list cmds; std::map < String, ConsoleCallback >::iterator it; @@ -440,7 +440,7 @@ void cConsole::PrintCommandsStartingWith( const String& start ) { } } -void cConsole::PrivVideoResize( EE::Window::Window * win ) { +void Console::PrivVideoResize( EE::Window::Window * win ) { mWidth = (Float) mWindow->GetWidth(); mHeight = (Float) mWindow->GetHeight(); @@ -454,7 +454,7 @@ void cConsole::PrivVideoResize( EE::Window::Window * win ) { } } -void cConsole::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; @@ -494,11 +494,11 @@ void cConsole::GetFilesFrom( std::string txt, const Uint32& curPos ) { } } -Int32 cConsole::LinesInScreen() { +Int32 Console::LinesInScreen() { return static_cast ( (mCurHeight / mFontSize) - 1 ); } -void cConsole::PrivInputCallback( InputEvent * Event ) { +void Console::PrivInputCallback( InputEvent * Event ) { Uint8 etype = Event->Type; if ( mVisible ) { @@ -586,27 +586,27 @@ void cConsole::PrivInputCallback( InputEvent * Event ) { } } -void cConsole::CreateDefaultCommands() { - AddCommand( "clear", cb::Make1( this, &cConsole::CmdClear) ); - AddCommand( "quit", cb::Make1( this, &cConsole::CmdQuit) ); - AddCommand( "maximize", cb::Make1( this, &cConsole::CmdMaximize) ); - AddCommand( "minimize", cb::Make1( this, &cConsole::CmdMinimize) ); - AddCommand( "cmdlist", cb::Make1( this, &cConsole::CmdCmdList) ); - AddCommand( "help", cb::Make1( this, &cConsole::CmdCmdList) ); - AddCommand( "showcursor", cb::Make1( this, &cConsole::CmdShowCursor) ); - AddCommand( "setfpslimit", cb::Make1( this, &cConsole::CmdFrameLimit) ); - AddCommand( "getlog", cb::Make1( this, &cConsole::CmdGetLog) ); - AddCommand( "setgamma", cb::Make1( this, &cConsole::CmdSetGamma) ); - AddCommand( "setvolume", cb::Make1( this, &cConsole::CmdSetVolume) ); - AddCommand( "getgpuextensions", cb::Make1( this, &cConsole::CmdGetGpuExtensions) ); - AddCommand( "dir", cb::Make1( this, &cConsole::CmdDir) ); - AddCommand( "ls", cb::Make1( this, &cConsole::CmdDir) ); - AddCommand( "showfps", cb::Make1( this, &cConsole::CmdShowFps) ); - AddCommand( "gettexturememory", cb::Make1( this, &cConsole::CmdGetTextureMemory) ); - AddCommand( "hide", cb::Make1( this, &cConsole::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 cConsole::CmdClear () { +void Console::CmdClear () { Uint16 CutLines; if ( mExpand ) { CutLines = (Uint16)( mHeight / mFontSize ); @@ -618,38 +618,38 @@ void cConsole::CmdClear () { PrivPushText( "" ); } -void cConsole::CmdClear ( const std::vector < String >& params ) { +void Console::CmdClear ( const std::vector < String >& params ) { CmdClear(); } -void cConsole::CmdMaximize ( const std::vector < String >& params ) { +void Console::CmdMaximize ( const std::vector < String >& params ) { mExpand = true; mY = mHeight; PrivPushText( "Console Maximized" ); } -void cConsole::CmdMinimize ( const std::vector < String >& params ) { +void Console::CmdMinimize ( const std::vector < String >& params ) { mExpand = false; mY = mHeightMin; PrivPushText( "Console Minimized" ); } -void cConsole::CmdQuit ( const std::vector < String >& params ) { +void Console::CmdQuit ( const std::vector < String >& params ) { mWindow->Close(); } -void cConsole::CmdGetTextureMemory ( const std::vector < String >& params ) { - PrivPushText( "Total texture memory used: " + FileSystem::SizeToString( cTextureFactory::instance()->MemorySize() ) ); +void Console::CmdGetTextureMemory ( const std::vector < String >& params ) { + PrivPushText( "Total texture memory used: " + FileSystem::SizeToString( TextureFactory::instance()->MemorySize() ) ); } -void cConsole::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 ); } } -void cConsole::CmdShowCursor ( const std::vector < String >& params ) { +void Console::CmdShowCursor ( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; @@ -665,7 +665,7 @@ void cConsole::CmdShowCursor ( const std::vector < String >& params ) { } } -void cConsole::CmdFrameLimit ( const std::vector < String >& params ) { +void Console::CmdFrameLimit ( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; @@ -681,7 +681,7 @@ void cConsole::CmdFrameLimit ( const std::vector < String >& params ) { PrivPushText( "Valid parameters are between 0 and 10000 (0 = no limit)." ); } -void cConsole::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++ ) @@ -689,11 +689,11 @@ void cConsole::CmdGetLog() { } } -void cConsole::CmdGetLog( const std::vector < String >& params ) { +void Console::CmdGetLog( const std::vector < String >& params ) { CmdGetLog(); } -void cConsole::CmdGetGpuExtensions() { +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++ ) @@ -701,11 +701,11 @@ void cConsole::CmdGetGpuExtensions() { } } -void cConsole::CmdGetGpuExtensions( const std::vector < String >& params ) { +void Console::CmdGetGpuExtensions( const std::vector < String >& params ) { CmdGetGpuExtensions(); } -void cConsole::CmdSetGamma( const std::vector < String >& params ) { +void Console::CmdSetGamma( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Float tFloat = 0.f; @@ -721,7 +721,7 @@ void cConsole::CmdSetGamma( const std::vector < String >& params ) { PrivPushText( "Valid parameters are between 0.1 and 10." ); } -void cConsole::CmdSetVolume( const std::vector < String >& params ) { +void Console::CmdSetVolume( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Float tFloat = 0.f; @@ -737,7 +737,7 @@ void cConsole::CmdSetVolume( const std::vector < String >& params ) { PrivPushText( "Valid parameters are between 0 and 100." ); } -void cConsole::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]; @@ -803,7 +803,7 @@ void cConsole::CmdDir( const std::vector < String >& params ) { } } -void cConsole::CmdShowFps( const std::vector < String >& params ) { +void Console::CmdShowFps( const std::vector < String >& params ) { if ( params.size() >= 2 ) { Int32 tInt = 0; @@ -819,23 +819,23 @@ void cConsole::CmdShowFps( const std::vector < String >& params ) { PrivPushText( "Valid parameters are 0 ( hide ) or 1 ( show )." ); } -void cConsole::CmdHideConsole( const std::vector < String >& params ) { +void Console::CmdHideConsole( const std::vector < String >& params ) { FadeOut(); } -void cConsole::IgnoreCharOnPrompt( const Uint32& ch ) { +void Console::IgnoreCharOnPrompt( const Uint32& ch ) { mTBuf->PushIgnoredChar( ch ); } -const bool& cConsole::IsShowingFps() const { +const bool& Console::IsShowingFps() const { return mShowFps; } -void cConsole::ShowFps( const bool& Show ) { +void Console::ShowFps( const bool& Show ) { mShowFps = Show; } -void cConsole::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++ ) { diff --git a/src/eepp/graphics/cshaderprogrammanager.cpp b/src/eepp/graphics/cshaderprogrammanager.cpp deleted file mode 100644 index 39ef086b8..000000000 --- a/src/eepp/graphics/cshaderprogrammanager.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include - -namespace EE { namespace Graphics { - -SINGLETON_DECLARE_IMPLEMENTATION(cShaderProgramManager) - -cShaderProgramManager::cShaderProgramManager() -{ -} - -cShaderProgramManager::~cShaderProgramManager() -{ -} - -void cShaderProgramManager::Reload() { - std::list::iterator it; - - for ( it = mResources.begin(); it != mResources.end(); it++ ) - (*it)->Reload(); -} - -}} diff --git a/src/eepp/graphics/ctextureatlas.cpp b/src/eepp/graphics/ctextureatlas.cpp deleted file mode 100644 index 4fe279fac..000000000 --- a/src/eepp/graphics/ctextureatlas.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include - -namespace EE { namespace Graphics { - -cTextureAtlas::cTextureAtlas( const std::string& name ) : - ResourceManager ( true ) -{ - Name( name ); -} - -cTextureAtlas::~cTextureAtlas() { -} - -const std::string& cTextureAtlas::Name() const { - return mName; -} - -void cTextureAtlas::Name( const std::string& name ) { - mName = name; - mId = String::Hash( mName ); -} - -const std::string& cTextureAtlas::Path() const { - return mPath; -} - -void cTextureAtlas::Path( const std::string& path ) { - mPath = path; -} - -const Uint32& cTextureAtlas::Id() const { - return mId; -} - -cSubTexture * cTextureAtlas::Add( cSubTexture * subTexture ) { - return ResourceManager::Add( subTexture ); -} - -cSubTexture * cTextureAtlas::Add( const Uint32& TexId, const std::string& Name ) { - return Add( eeNew( cSubTexture, ( TexId, Name ) ) ); -} - -cSubTexture * cTextureAtlas::Add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name ) { - return Add( eeNew( cSubTexture, ( TexId, SrcRect, Name ) ) ); -} - -cSubTexture * cTextureAtlas::Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name ) { - return Add( eeNew ( cSubTexture, ( TexId, SrcRect, DestSize, Name ) ) ); -} - -cSubTexture * cTextureAtlas::Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name ) { - return Add( eeNew ( cSubTexture, ( TexId, SrcRect, DestSize, Offset, Name ) ) ); -} - -Uint32 cTextureAtlas::Count() { - return ResourceManager::Count(); -} - -void cTextureAtlas::SetTextures( std::vector textures ) { - mTextures = textures; -} - -cTexture * cTextureAtlas::GetTexture( const Uint32& texnum ) const { - eeASSERT( texnum < mTextures.size() ); - return mTextures[ texnum ]; -} - -Uint32 cTextureAtlas::GetTexturesCount() { - return mTextures.size(); -} - -}} diff --git a/src/eepp/graphics/cvertexbuffermanager.cpp b/src/eepp/graphics/cvertexbuffermanager.cpp deleted file mode 100644 index 416b7da12..000000000 --- a/src/eepp/graphics/cvertexbuffermanager.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include - -namespace EE { namespace Graphics { namespace Private { - -SINGLETON_DECLARE_IMPLEMENTATION(cVertexBufferManager) - -cVertexBufferManager::cVertexBufferManager() -{ -} - -cVertexBufferManager::~cVertexBufferManager() -{ -} - -void cVertexBufferManager::Reload() { - std::list::iterator it; - - for ( it = mResources.begin(); it != mResources.end(); it++ ) - (*it)->Reload(); -} - -}}} diff --git a/src/eepp/graphics/cfont.cpp b/src/eepp/graphics/font.cpp similarity index 84% rename from src/eepp/graphics/cfont.cpp rename to src/eepp/graphics/font.cpp index d187c7bf5..8699c0707 100644 --- a/src/eepp/graphics/cfont.cpp +++ b/src/eepp/graphics/font.cpp @@ -1,12 +1,12 @@ -#include -#include -#include +#include +#include +#include #include -#include +#include namespace EE { namespace Graphics { -cFont::cFont( const Uint32& Type, const std::string& Name ) : +Font::Font( const Uint32& Type, const std::string& Name ) : mType( Type ), mTexId(0), mHeight(0), @@ -17,98 +17,98 @@ cFont::cFont( const Uint32& Type, const std::string& Name ) : mTextCache( this ) { this->Name( Name ); - cFontManager::instance()->Add( this ); + FontManager::instance()->Add( this ); } -cFont::~cFont() { +Font::~Font() { mGlyphs.clear(); - if ( !cFontManager::instance()->IsDestroying() ) { - cFontManager::instance()->Remove( this, false ); + if ( !FontManager::instance()->IsDestroying() ) { + FontManager::instance()->Remove( this, false ); } } -void cFont::SetText( const String& Text ) { +void Font::SetText( const String& Text ) { mTextCache.Text( Text ); } -const ColorA& cFont::Color() const { +const ColorA& Font::Color() const { return mTextCache.Color(); } -void cFont::Color(const ColorA& Color) { +void Font::Color(const ColorA& Color) { mTextCache.Color( Color ); } -const ColorA& cFont::ShadowColor() const { +const ColorA& Font::ShadowColor() const { return mTextCache.ShadowColor(); } -void cFont::ShadowColor(const ColorA& Color) { +void Font::ShadowColor(const ColorA& Color) { mTextCache.ShadowColor( Color ); } -int cFont::GetNumLines() { +int Font::GetNumLines() { return mTextCache.GetNumLines(); } -Float cFont::GetTextWidth( const String& Text ) { +Float Font::GetTextWidth( const String& Text ) { SetText( Text ); return mTextCache.GetTextWidth(); } -Float cFont::GetTextWidth() { +Float Font::GetTextWidth() { return mTextCache.GetTextWidth(); } -Uint32 cFont::GetFontSize() const { +Uint32 Font::GetFontSize() const { return mSize; } -Uint32 cFont::GetFontHeight() const { +Uint32 Font::GetFontHeight() const { return mHeight; } -Int32 cFont::GetLineSkip() const { +Int32 Font::GetLineSkip() const { return mLineSkip; } -Int32 cFont::GetFontAscent() const { +Int32 Font::GetFontAscent() const { return mAscent; } -Int32 cFont::GetFontDescent() const { +Int32 Font::GetFontDescent() const { return mDescent; } -String cFont::GetText() { +String Font::GetText() { return mTextCache.Text(); } -Float cFont::GetTextHeight() { +Float Font::GetTextHeight() { return (Float)GetFontHeight() * (Float)GetNumLines(); } -const std::vector& cFont::GetLinesWidth() { +const std::vector& Font::GetLinesWidth() { return mTextCache.LinesWidth(); } -void cFont::Draw( const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& 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 cFont::Draw( const String& Text, const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& 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 cFont::Draw( cTextCache& TextCache, const Float& X, const Float& Y, const Uint32& Flags, const Vector2f& Scale, const Float& Angle, const EE_BLEND_MODE& 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() ) return; - cGlobalBatchRenderer::instance()->Draw(); - cTextureFactory::instance()->Bind( mTexId ); + GlobalBatchRenderer::instance()->Draw(); + TextureFactory::instance()->Bind( mTexId ); BlendMode::SetMode( Effect ); if ( Flags & FONT_DRAW_SHADOW ) { @@ -306,7 +306,7 @@ void cFont::Draw( cTextCache& TextCache, const Float& X, const Float& Y, const U } } -void cFont::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,7 +357,7 @@ void cFont::CacheWidth( const String& Text, std::vector& LinesWidth, Floa NumLines = Lines; } -Int32 cFont::FindClosestCursorPosFromPoint( const String& Text, const Vector2i& pos ) { +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(); @@ -411,7 +411,7 @@ Int32 cFont::FindClosestCursorPosFromPoint( const String& Text, const Vector2i& return -1; } -Vector2i cFont::GetCursorPos( const String& Text, const Uint32& Pos ) { +Vector2i Font::GetCursorPos( const String& Text, const Uint32& Pos ) { Float Width = 0, Height = GetFontHeight(); Int32 CharID; Int32 tGlyphSize = mGlyphs.size(); @@ -449,7 +449,7 @@ static bool IsStopSelChar( Uint32 c ) { '\'' == c; } -void cFont::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 cFont::SelectSubStringFromCursor( const String& Text, const Int32& CurPos, } } -void cFont::CacheWidth() { +void Font::CacheWidth() { mTextCache.Cache(); } -void cFont::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 cFont::ShrinkText( std::string& Str, const Uint32& MaxWidth ) { } } -void cFont::ShrinkText( String& Str, const Uint32& MaxWidth ) { +void Font::ShrinkText( String& Str, const Uint32& MaxWidth ) { if ( !Str.size() ) return; @@ -602,24 +602,24 @@ void cFont::ShrinkText( String& Str, const Uint32& MaxWidth ) { } } -const Uint32& cFont::GetTexId() const { +const Uint32& Font::GetTexId() const { return mTexId; } -const Uint32& cFont::Type() const { +const Uint32& Font::Type() const { return mType; } -const std::string& cFont::Name() const { +const std::string& Font::Name() const { return mFontName; } -void cFont::Name( const std::string& name ) { +void Font::Name( const std::string& name ) { mFontName = name; mFontHash = String::Hash( mFontName ); } -const Uint32& cFont::Id() { +const Uint32& Font::Id() { return mFontHash; } diff --git a/src/eepp/graphics/fontmanager.cpp b/src/eepp/graphics/fontmanager.cpp new file mode 100644 index 000000000..1dd4c8f52 --- /dev/null +++ b/src/eepp/graphics/fontmanager.cpp @@ -0,0 +1,18 @@ +#include + +namespace EE { namespace Graphics { + +SINGLETON_DECLARE_IMPLEMENTATION(FontManager) + +FontManager::FontManager() { +} + +FontManager::~FontManager() { +} + +Graphics::Font * FontManager::Add( Graphics::Font * Font ) { + eeASSERT( NULL != Font ); + return ResourceManager::Add( Font ); +} + +}} diff --git a/src/eepp/graphics/cframebuffer.cpp b/src/eepp/graphics/framebuffer.cpp similarity index 55% rename from src/eepp/graphics/cframebuffer.cpp rename to src/eepp/graphics/framebuffer.cpp index ef45e4225..b082b360a 100644 --- a/src/eepp/graphics/cframebuffer.cpp +++ b/src/eepp/graphics/framebuffer.cpp @@ -1,23 +1,23 @@ -#include -#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include #include using namespace EE::Graphics::Private; namespace EE { namespace Graphics { -cFrameBuffer * cFrameBuffer::New( const Uint32& Width, const Uint32& Height, bool DepthBuffer, EE::Window::Window * window ) { - if ( cFrameBufferFBO::IsSupported() ) - return eeNew( cFrameBufferFBO, ( Width, Height, DepthBuffer, window ) ); +FrameBuffer * FrameBuffer::New( const Uint32& Width, const Uint32& Height, bool DepthBuffer, EE::Window::Window * window ) { + if ( FrameBufferFBO::IsSupported() ) + return eeNew( FrameBufferFBO, ( Width, Height, DepthBuffer, window ) ); return NULL; } -cFrameBuffer::cFrameBuffer( EE::Window::Window * window ) : +FrameBuffer::FrameBuffer( EE::Window::Window * window ) : mWindow( window ), mWidth(0), mHeight(0), @@ -29,36 +29,36 @@ cFrameBuffer::cFrameBuffer( EE::Window::Window * window ) : mWindow = Engine::instance()->GetCurrentWindow(); } - cFrameBufferManager::instance()->Add( this ); + FrameBufferManager::instance()->Add( this ); } -cFrameBuffer::~cFrameBuffer() { +FrameBuffer::~FrameBuffer() { if ( NULL != mTexture ) { eeSAFE_DELETE( mTexture ); } - cFrameBufferManager::instance()->Remove( this ); + FrameBufferManager::instance()->Remove( this ); } -cTexture * cFrameBuffer::GetTexture() const { +Texture * FrameBuffer::GetTexture() const { return mTexture; } -void cFrameBuffer::ClearColor( ColorAf Color ) { +void FrameBuffer::ClearColor( ColorAf Color ) { mClearColor = Color; } -ColorAf cFrameBuffer::ClearColor() const { +ColorAf FrameBuffer::ClearColor() const { return mClearColor; } -void cFrameBuffer::Clear() { +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 cFrameBuffer::SetBufferView() { +void FrameBuffer::SetBufferView() { mPrevView = mWindow->GetView(); // Get the user projection matrix @@ -72,8 +72,8 @@ void cFrameBuffer::SetBufferView() { GLi->LoadIdentity(); } -void cFrameBuffer::RecoverView() { - cGlobalBatchRenderer::instance()->Draw(); +void FrameBuffer::RecoverView() { + GlobalBatchRenderer::instance()->Draw(); mWindow->SetView( mPrevView ); @@ -85,15 +85,15 @@ void cFrameBuffer::RecoverView() { GLi->LoadIdentity(); } -const Int32& cFrameBuffer::GetWidth() const { +const Int32& FrameBuffer::GetWidth() const { return mWidth; } -const Int32& cFrameBuffer::GetHeight() const { +const Int32& FrameBuffer::GetHeight() const { return mHeight; } -const bool& cFrameBuffer::HasDepthBuffer() const { +const bool& FrameBuffer::HasDepthBuffer() const { return mHasDepthBuffer; } diff --git a/src/eepp/graphics/cframebufferfbo.cpp b/src/eepp/graphics/framebufferfbo.cpp similarity index 70% rename from src/eepp/graphics/cframebufferfbo.cpp rename to src/eepp/graphics/framebufferfbo.cpp index 3b84a7d1f..0e02c6c9f 100644 --- a/src/eepp/graphics/cframebufferfbo.cpp +++ b/src/eepp/graphics/framebufferfbo.cpp @@ -1,26 +1,26 @@ -#include -#include +#include +#include #include #include -#include -#include +#include +#include namespace EE { namespace Graphics { -bool cFrameBufferFBO::IsSupported() { +bool FrameBufferFBO::IsSupported() { return 0 != GLi->IsExtension( EEGL_EXT_framebuffer_object ); } -cFrameBufferFBO::cFrameBufferFBO( EE::Window::Window * window ) : - cFrameBuffer( window ), +FrameBufferFBO::FrameBufferFBO( EE::Window::Window * window ) : + FrameBuffer( window ), mFrameBuffer(0), mDepthBuffer(0), mLastFB(0), mLastRB(0) {} -cFrameBufferFBO::cFrameBufferFBO( const Uint32& Width, const Uint32& Height, bool DepthBuffer, EE::Window::Window * window ) : - cFrameBuffer( window ), +FrameBufferFBO::FrameBufferFBO( const Uint32& Width, const Uint32& Height, bool DepthBuffer, EE::Window::Window * window ) : + FrameBuffer( window ), mFrameBuffer(0), mDepthBuffer(0), mLastFB(0), @@ -29,7 +29,7 @@ cFrameBufferFBO::cFrameBufferFBO( const Uint32& Width, const Uint32& Height, boo Create( Width, Height, DepthBuffer ); } -cFrameBufferFBO::~cFrameBufferFBO() { +FrameBufferFBO::~FrameBufferFBO() { if ( !IsSupported() ) return; @@ -50,11 +50,11 @@ cFrameBufferFBO::~cFrameBufferFBO() { } } -bool cFrameBufferFBO::Create( const Uint32& Width, const Uint32& Height ) { +bool FrameBufferFBO::Create( const Uint32& Width, const Uint32& Height ) { return Create( Width, Height, false ); } -bool cFrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool DepthBuffer ) { +bool FrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool DepthBuffer ) { if ( !IsSupported() ) return false; @@ -95,10 +95,10 @@ bool cFrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool De } if ( NULL == mTexture ) { - Uint32 TexId = cTextureFactory::instance()->CreateEmptyTexture( Width, Height, 4, ColorA(0,0,0,0) ); + Uint32 TexId = TextureFactory::instance()->CreateEmptyTexture( Width, Height, 4, ColorA(0,0,0,0) ); - if ( cTextureFactory::instance()->TextureIdExists( TexId ) ) { - mTexture = cTextureFactory::instance()->GetTexture( TexId ); + if ( TextureFactory::instance()->TextureIdExists( TexId ) ) { + mTexture = TextureFactory::instance()->GetTexture( TexId ); } else { return false; } @@ -117,9 +117,9 @@ bool cFrameBufferFBO::Create( const Uint32& Width, const Uint32& Height, bool De return true; } -void cFrameBufferFBO::Bind() { +void FrameBufferFBO::Bind() { if ( mFrameBuffer ) { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); BindFrameBuffer(); BindRenderBuffer(); @@ -128,7 +128,7 @@ void cFrameBufferFBO::Bind() { } } -void cFrameBufferFBO::Unbind() { +void FrameBufferFBO::Unbind() { if ( mFrameBuffer ) { RecoverView(); @@ -140,11 +140,11 @@ void cFrameBufferFBO::Unbind() { } } -void cFrameBufferFBO::Reload() { +void FrameBufferFBO::Reload() { Create( mWidth, mHeight, mHasDepthBuffer ); } -void cFrameBufferFBO::BindFrameBuffer() { +void FrameBufferFBO::BindFrameBuffer() { int curFB; glGetIntegerv( GL_FRAMEBUFFER_BINDING, &curFB ); @@ -153,7 +153,7 @@ void cFrameBufferFBO::BindFrameBuffer() { glBindFramebufferEXT( GL_FRAMEBUFFER, mFrameBuffer ); } -void cFrameBufferFBO::BindRenderBuffer() { +void FrameBufferFBO::BindRenderBuffer() { if ( mDepthBuffer ) { int curRB; glGetIntegerv( GL_RENDERBUFFER_BINDING, &curRB ); diff --git a/src/eepp/graphics/cframebufferfbo.hpp b/src/eepp/graphics/framebufferfbo.hpp similarity index 62% rename from src/eepp/graphics/cframebufferfbo.hpp rename to src/eepp/graphics/framebufferfbo.hpp index 69968e534..1c5c81595 100644 --- a/src/eepp/graphics/cframebufferfbo.hpp +++ b/src/eepp/graphics/framebufferfbo.hpp @@ -2,18 +2,18 @@ #define EE_GRAPHICSCFRAMEBUFFERFBO_HPP #include -#include -#include +#include +#include namespace EE { namespace Graphics { -class EE_API cFrameBufferFBO : public cFrameBuffer { +class EE_API FrameBufferFBO : public FrameBuffer { public: - cFrameBufferFBO( EE::Window::Window * window = NULL ); + FrameBufferFBO( EE::Window::Window * window = NULL ); - ~cFrameBufferFBO(); + ~FrameBufferFBO(); - cFrameBufferFBO( const Uint32& Width, const Uint32& Height, bool DepthBuffer = false, EE::Window::Window * window = NULL ); + FrameBufferFBO( const Uint32& Width, const Uint32& Height, bool DepthBuffer = false, EE::Window::Window * window = NULL ); void Bind(); diff --git a/src/eepp/graphics/framebuffermanager.cpp b/src/eepp/graphics/framebuffermanager.cpp new file mode 100644 index 000000000..a006f9d66 --- /dev/null +++ b/src/eepp/graphics/framebuffermanager.cpp @@ -0,0 +1,22 @@ +#include + +namespace EE { namespace Graphics { namespace Private { + +SINGLETON_DECLARE_IMPLEMENTATION(FrameBufferManager) + +FrameBufferManager::FrameBufferManager() +{ +} + +FrameBufferManager::~FrameBufferManager() +{ +} + +void FrameBufferManager::Reload() { + std::list::iterator it; + + for ( it = mResources.begin(); it != mResources.end(); it++ ) + (*it)->Reload(); +} + +}}} diff --git a/src/eepp/graphics/cframebuffermanager.hpp b/src/eepp/graphics/framebuffermanager.hpp similarity index 51% rename from src/eepp/graphics/cframebuffermanager.hpp rename to src/eepp/graphics/framebuffermanager.hpp index 540032599..71b640722 100644 --- a/src/eepp/graphics/cframebuffermanager.hpp +++ b/src/eepp/graphics/framebuffermanager.hpp @@ -2,19 +2,19 @@ #define EE_GRAPHICSCFRAMEBUFFERMANAGER_HPP #include -#include +#include namespace EE { namespace Graphics { namespace Private { -class EE_API cFrameBufferManager : public Container { - SINGLETON_DECLARE_HEADERS(cFrameBufferManager) +class EE_API FrameBufferManager : public Container { + SINGLETON_DECLARE_HEADERS(FrameBufferManager) public: - virtual ~cFrameBufferManager(); + virtual ~FrameBufferManager(); void Reload(); protected: - cFrameBufferManager(); + FrameBufferManager(); }; }}} diff --git a/src/eepp/graphics/globalbatchrenderer.cpp b/src/eepp/graphics/globalbatchrenderer.cpp new file mode 100755 index 000000000..06083b54a --- /dev/null +++ b/src/eepp/graphics/globalbatchrenderer.cpp @@ -0,0 +1,14 @@ +#include + +namespace EE { namespace Graphics { + +SINGLETON_DECLARE_IMPLEMENTATION(GlobalBatchRenderer) + +GlobalBatchRenderer::GlobalBatchRenderer() { + AllocVertexs( 4096 ); +} + +GlobalBatchRenderer::~GlobalBatchRenderer() { +} + +}} diff --git a/src/eepp/graphics/globaltextureatlas.cpp b/src/eepp/graphics/globaltextureatlas.cpp new file mode 100644 index 000000000..719bdf10c --- /dev/null +++ b/src/eepp/graphics/globaltextureatlas.cpp @@ -0,0 +1,16 @@ +#include +#include + +namespace EE { namespace Graphics { + +SINGLETON_DECLARE_IMPLEMENTATION(GlobalTextureAtlas) + +GlobalTextureAtlas::GlobalTextureAtlas() : + TextureAtlas( "global" ) +{ +} + +GlobalTextureAtlas::~GlobalTextureAtlas() { +} + +}} diff --git a/src/eepp/graphics/cimage.cpp b/src/eepp/graphics/image.cpp similarity index 82% rename from src/eepp/graphics/cimage.cpp rename to src/eepp/graphics/image.cpp index 24ee00fe2..e446c4fa6 100644 --- a/src/eepp/graphics/cimage.cpp +++ b/src/eepp/graphics/image.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -149,18 +149,18 @@ static unsigned char * resample_image( unsigned char* pSrc_image, int src_width, return dst_image; } -Uint32 cImage::sJpegQuality = 85; +Uint32 Image::sJpegQuality = 85; -Uint32 cImage::JpegQuality() { +Uint32 Image::JpegQuality() { return sJpegQuality; } -void cImage::JpegQuality( Uint32 level ) { +void Image::JpegQuality( Uint32 level ) { level = eemin( level, 100 ); sJpegQuality = level; } -std::string cImage::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 cImage::SaveTypeToExtension( const Int32& Format ) { return ""; } -EE_SAVE_TYPE cImage::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 cImage::ExtensionToSaveType( const std::string& Extension ) { return saveType; } -EE_PIXEL_FORMAT cImage::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 cImage::ChannelsToPixelFormat( const Uint32& channels ) { return pf; } -bool cImage::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,15 +219,15 @@ bool cImage::GetInfo( const std::string& path, int * width, int * height, int * return res; } -bool cImage::IsImage( const std::string& path ) { +bool Image::IsImage( const std::string& path ) { return STBI_unknown != stbi_test( path.c_str() ); } -std::string cImage::GetLastFailureReason() { +std::string Image::GetLastFailureReason() { return std::string( stbi_failure_reason() ); } -cImage::cImage() : +Image::Image() : mPixels(NULL), mWidth(0), mHeight(0), @@ -238,7 +238,7 @@ cImage::cImage() : { } -cImage::cImage( cImage * image ) : +Image::Image( Graphics::Image * image ) : mPixels(NULL), mWidth(image->mWidth), mHeight(image->mHeight), @@ -250,7 +250,7 @@ cImage::cImage( cImage * image ) : SetPixels( image->GetPixelsPtr() ); } -cImage::cImage( const Uint8* data, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels ) : +Image::Image( const Uint8* data, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels ) : mPixels(NULL), mWidth(Width), mHeight(Height), @@ -262,7 +262,7 @@ cImage::cImage( const Uint8* data, const unsigned int& Width, const unsigned int SetPixels( data ); } -cImage::cImage( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) : +Image::Image( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) : mPixels(NULL), mWidth(Width), mHeight(Height), @@ -274,7 +274,7 @@ cImage::cImage( const Uint32& Width, const Uint32& Height, const Uint32& Channel Create( Width, Height, Channels, DefaultColor, initWithDefaultColor ); } -cImage::cImage( Uint8* data, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels ) : +Image::Image( Uint8* data, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels ) : mPixels( data ), mWidth(Width), mHeight(Height), @@ -285,7 +285,7 @@ cImage::cImage( Uint8* data, const unsigned int& Width, const unsigned int& Heig { } -cImage::cImage( std::string Path, const unsigned int& forceChannels ) : +Image::Image( std::string Path, const unsigned int& forceChannels ) : mPixels(NULL), mWidth(0), mHeight(0), @@ -326,7 +326,7 @@ cImage::cImage( std::string Path, const unsigned int& forceChannels ) : } } -cImage::cImage( Pack * Pack, std::string FilePackPath, const unsigned int& forceChannels ) : +Image::Image( Pack * Pack, std::string FilePackPath, const unsigned int& forceChannels ) : mPixels(NULL), mWidth(0), mHeight(0), @@ -338,12 +338,12 @@ cImage::cImage( Pack * Pack, std::string FilePackPath, const unsigned int& force LoadFromPack( Pack, FilePackPath ); } -cImage::~cImage() { +Image::~Image() { if ( !mAvoidFree ) ClearCache(); } -void cImage::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,7 +371,7 @@ void cImage::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { } } -void cImage::SetPixels( const Uint8* data ) { +void Image::SetPixels( const Uint8* data ) { if ( data != NULL ) { Allocate( mWidth * mHeight * mChannels, ColorA(0,0,0,0), false ); @@ -379,23 +379,23 @@ void cImage::SetPixels( const Uint8* data ) { } } -const Uint8* cImage::GetPixelsPtr() { +const Uint8* Image::GetPixelsPtr() { return reinterpret_cast (&mPixels[0]); } -ColorA cImage::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 cImage::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 ); } -void cImage::Create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) { +void Image::Create( const Uint32& Width, const Uint32& Height, const Uint32& Channels, const ColorA& DefaultColor, const bool& initWithDefaultColor ) { mWidth = Width; mHeight = Height; mChannels = Channels; @@ -403,11 +403,11 @@ void cImage::Create( const Uint32& Width, const Uint32& Height, const Uint32& Ch Allocate( mWidth * mHeight * mChannels, DefaultColor, initWithDefaultColor ); } -Uint8* cImage::GetPixels() const { +Uint8* Image::GetPixels() const { return mPixels; } -void cImage::Allocate( const Uint32& size, ColorA DefaultColor, bool memsetData ) { +void Image::Allocate( const Uint32& size, ColorA DefaultColor, bool memsetData ) { ClearCache(); mPixels = eeNewArray( unsigned char, size ); @@ -418,15 +418,15 @@ void cImage::Allocate( const Uint32& size, ColorA DefaultColor, bool memsetData } } -unsigned int cImage::MemSize() const { +unsigned int Image::MemSize() const { return mSize; } -Sizei cImage::Size() { +Sizei Image::Size() { return Sizei( mWidth, mHeight ); } -void cImage::ClearCache() { +void Image::ClearCache() { if ( mLoadedFromStbi ) { if ( NULL != mPixels ) free( mPixels ); @@ -435,31 +435,31 @@ void cImage::ClearCache() { } } -void cImage::Width( const unsigned int& width ) { +void Image::Width( const unsigned int& width ) { mWidth = width; } -unsigned int cImage::Width() const { +unsigned int Image::Width() const { return mWidth; } -void cImage::Height( const unsigned int& height ) { +void Image::Height( const unsigned int& height ) { mHeight = height; } -unsigned int cImage::Height() const { +unsigned int Image::Height() const { return mHeight; } -void cImage::Channels( const unsigned int& channels ) { +void Image::Channels( const unsigned int& channels ) { mChannels = channels; } -unsigned int cImage::Channels() const { +unsigned int Image::Channels() const { return mChannels; } -bool cImage::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 )); @@ -480,7 +480,7 @@ bool cImage::SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Format return Res; } -void cImage::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 cImage::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { } } -void cImage::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { +void Image::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) ); } -void cImage::CreateMaskFromColor( const RGB& ColorKey, Uint8 Alpha ) { +void Image::CreateMaskFromColor( const RGB& ColorKey, Uint8 Alpha ) { CreateMaskFromColor( ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), 255 ), Alpha ); } -void cImage::FillWithColor( const ColorA& Color ) { +void Image::FillWithColor( const ColorA& Color ) { if ( NULL == mPixels ) return; @@ -546,7 +546,7 @@ void cImage::FillWithColor( const ColorA& Color ) { } } -void cImage::CopyImage( cImage * image, const Uint32& x, const Uint32& y ) { +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(); @@ -569,7 +569,7 @@ void cImage::CopyImage( cImage * image, const Uint32& x, const Uint32& y ) { } } -void cImage::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 ); @@ -584,7 +584,7 @@ void cImage::Resize( const Uint32 &newWidth, const Uint32 &newHeight , EE_RESAMP } } -void cImage::Scale( const Float& scale , EE_RESAMPLER_FILTER filter ) { +void Image::Scale( const Float& scale , EE_RESAMPLER_FILTER filter ) { if ( 1.f == scale ) return; @@ -594,7 +594,7 @@ void cImage::Scale( const Float& scale , EE_RESAMPLER_FILTER filter ) { Resize( new_width, new_height, filter ); } -cImage * cImage::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 ); @@ -605,16 +605,16 @@ cImage * cImage::Thumbnail( const Uint32& maxWidth, const Uint32& maxHeight, EE_ unsigned char * resampled = resample_image( mPixels, mWidth, mHeight, mChannels, new_width, new_height, filter ); if ( NULL != resampled ) { - return eeNew( cImage, ( (Uint8*)resampled, new_width, new_height, mChannels ) ); + return eeNew( Image, ( (Uint8*)resampled, new_width, new_height, mChannels ) ); } } return NULL; } -cImage * cImage::Crop( Recti rect ) { +Graphics::Image * Image::Crop( Recti rect ) { if ( rect.Left >= 0 && rect.Right <= (Int32)mWidth && rect.Top >= 0 && rect.Bottom <= (Int32)mHeight ) { - cImage * img = eeNew( cImage, ( rect.Size().Width(), rect.Size().Height(), mChannels ) ); + Image * img = eeNew( Image, ( rect.Size().Width(), rect.Size().Height(), mChannels ) ); // Copy per row for ( unsigned int ty = 0; ty < img->mHeight; ty++ ) { @@ -630,9 +630,9 @@ cImage * cImage::Crop( Recti rect ) { return NULL; } -void cImage::Flip() { +void Image::Flip() { if ( NULL != mPixels ) { - cImage tImg( mHeight, mWidth, mChannels ); + Image tImg( mHeight, mWidth, mChannels ); for ( unsigned int y = 0; y < mHeight; y++ ) for ( unsigned int x = 0; x < mWidth; x++ ) @@ -648,11 +648,11 @@ void cImage::Flip() { } } -void cImage::AvoidFreeImage( const bool& AvoidFree ) { +void Image::AvoidFreeImage( const bool& AvoidFree ) { mAvoidFree = AvoidFree; } -void cImage::Blit( cImage * image, const Uint32& x, const Uint32& y ) { +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() ); @@ -668,11 +668,11 @@ void cImage::Blit( cImage * image, const Uint32& x, const Uint32& y ) { } } -cImage * cImage::Copy() { - return eeNew( cImage, ( this ) ); +Graphics::Image * Image::Copy() { + return eeNew( Graphics::Image, ( this ) ); } -cImage &cImage::operator =(const cImage &right) { +Graphics::Image &Image::operator =(const Image &right) { mWidth = right.mWidth; mHeight = right.mHeight; mChannels = right.mChannels; diff --git a/src/eepp/graphics/cparticle.cpp b/src/eepp/graphics/particle.cpp similarity index 60% rename from src/eepp/graphics/cparticle.cpp rename to src/eepp/graphics/particle.cpp index 552b2e44d..19baae4c0 100755 --- a/src/eepp/graphics/cparticle.cpp +++ b/src/eepp/graphics/particle.cpp @@ -1,19 +1,19 @@ -#include +#include namespace EE { namespace Graphics { -cParticle::cParticle() { +Particle::Particle() { Reset(0.f, 0.f, 0.f, 0.f, 0.f, 0.f); } -cParticle::~cParticle() {} +Particle::~Particle() {} -void cParticle::Color(ColorAf Color, Float AlphaDecay) { +void Particle::Color(ColorAf Color, Float AlphaDecay) { mColor = Color; mAlphaDecay = AlphaDecay; } -void cParticle::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 cParticle::Reset(const Float &x, const Float &y, const Float &xspeed, const mAlphaDecay = 0.01f; } -void cParticle::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/cparticlesystem.cpp b/src/eepp/graphics/particlesystem.cpp similarity index 79% rename from src/eepp/graphics/cparticlesystem.cpp rename to src/eepp/graphics/particlesystem.cpp index 34f4fe55c..406eec491 100755 --- a/src/eepp/graphics/cparticlesystem.cpp +++ b/src/eepp/graphics/particlesystem.cpp @@ -1,16 +1,16 @@ -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include using namespace EE::Window; namespace EE { namespace Graphics { -cParticleSystem::cParticleSystem() : +ParticleSystem::ParticleSystem() : mParticle( NULL ), mPCount( 0 ), mTexId( 0 ), @@ -35,11 +35,11 @@ cParticleSystem::cParticleSystem() : { } -cParticleSystem::~cParticleSystem() { +ParticleSystem::~ParticleSystem() { eeSAFE_DELETE_ARRAY( mParticle ); } -void cParticleSystem::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 ) { +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; @@ -71,14 +71,14 @@ void cParticleSystem::Create( const EE_PARTICLE_EFFECT& Effect, const Uint32& Nu Begin(); } -void cParticleSystem::Begin() { +void ParticleSystem::Begin() { mPLeft = mPCount; eeSAFE_DELETE_ARRAY( mParticle ); - mParticle = eeNewArray( cParticle, mPCount ); + mParticle = eeNewArray( Particle, mPCount ); - cParticle * P; + Particle * P; for ( Uint32 i=0; i < mPCount; i++ ) { P = &mParticle[i]; @@ -89,11 +89,11 @@ void cParticleSystem::Begin() { } } -void cParticleSystem::SetCallbackReset( const ParticleCallback& pc ) { +void ParticleSystem::SetCallbackReset( const ParticleCallback& pc ) { mPC = pc; } -void cParticleSystem::Reset( cParticle * P ) { +void ParticleSystem::Reset( Particle * P ) { Float x, y, radio, q, z, w; switch ( mEffect ) { @@ -315,11 +315,11 @@ void cParticleSystem::Reset( cParticle * P ) { } } -void cParticleSystem::Draw() { +void ParticleSystem::Draw() { if ( !mUsed ) return; - cTextureFactory * TF = cTextureFactory::instance(); + TextureFactory * TF = TextureFactory::instance(); TF->Bind( mTexId ); BlendMode::SetMode( mBlend ); @@ -328,23 +328,23 @@ void cParticleSystem::Draw() { GLi->Enable( GL_POINT_SPRITE ); GLi->PointSize( mSize ); - Uint32 alloc = mPCount * sizeof(cParticle); + Uint32 alloc = mPCount * sizeof(Particle); - GLi->ColorPointer ( 4, GL_FP, sizeof(cParticle), reinterpret_cast( &mParticle[0] ) + sizeof(Float) * 2 , alloc ); - GLi->VertexPointer ( 2, GL_FP, sizeof(cParticle), 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->Disable( GL_POINT_SPRITE ); } else { - cTexture * Tex = TF->GetTexture( mTexId ); + Texture * Tex = TF->GetTexture( mTexId ); if ( NULL == Tex ) return; - cParticle* P; + Particle* P; - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); BR->SetTexture( Tex ); BR->SetBlendMode( mBlend ); BR->QuadsBegin(); @@ -362,15 +362,15 @@ void cParticleSystem::Draw() { } } -void cParticleSystem::Update() { +void ParticleSystem::Update() { Update( Engine::instance()->Elapsed() ); } -void cParticleSystem::Update( const System::Time& time ) { +void ParticleSystem::Update( const System::Time& time ) { if ( !mUsed ) return; - cParticle * P; + Particle * P; for ( Uint32 i = 0; i < mPCount; i++ ) { P = &mParticle[i]; @@ -401,12 +401,12 @@ void cParticleSystem::Update( const System::Time& time ) { } } -void cParticleSystem::End() { +void ParticleSystem::End() { mLoop = false; mLoops = 1; } -void cParticleSystem::ReUse() { +void ParticleSystem::ReUse() { mLoop = true; mLoops = 0; @@ -414,91 +414,91 @@ void cParticleSystem::ReUse() { mParticle[i].Used( true ); } -void cParticleSystem::Kill() { +void ParticleSystem::Kill() { mUsed = false; } -void cParticleSystem::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& cParticleSystem::Position() const { +const Vector2f& ParticleSystem::Position() const { return mPos; } -void cParticleSystem::Position(const Float& x, const Float& y) { +void ParticleSystem::Position(const Float& x, const Float& y) { Position( Vector2f( x, y ) ); } -void cParticleSystem::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& cParticleSystem::Position2() const { +const Vector2f& ParticleSystem::Position2() const { return mPos2; } -void cParticleSystem::Position2( const Float& x, const Float& y ) { +void ParticleSystem::Position2( const Float& x, const Float& y ) { Position( Vector2f( x, y ) ); } -void cParticleSystem::Time( const Float& time ) { +void ParticleSystem::Time( const Float& time ) { mTime = ( time >= 0 ) ? time : mTime; } -Float cParticleSystem::Time() const { +Float ParticleSystem::Time() const { return mTime; } -void cParticleSystem::Using(const bool& inuse) { +void ParticleSystem::Using(const bool& inuse) { mUsed = inuse; } -bool cParticleSystem::Using() const { +bool ParticleSystem::Using() const { return mUsed; } -const EE_BLEND_MODE& cParticleSystem::BlendMode() const { +const EE_BLEND_MODE& ParticleSystem::BlendMode() const { return mBlend; } -void cParticleSystem::BlendMode( const EE_BLEND_MODE& mode ) { +void ParticleSystem::BlendMode( const EE_BLEND_MODE& mode ) { mBlend = mode; } -const ColorAf& cParticleSystem::Color() const { +const ColorAf& ParticleSystem::Color() const { return mColor; } -void cParticleSystem::Color( const ColorAf& Col ) { +void ParticleSystem::Color( const ColorAf& Col ) { mColor = Col; } -const Float& cParticleSystem::AlphaDecay() const { +const Float& ParticleSystem::AlphaDecay() const { return mAlphaDecay; } -void cParticleSystem::AlphaDecay( const Float& Decay ) { +void ParticleSystem::AlphaDecay( const Float& Decay ) { mAlphaDecay = Decay; } -const Vector2f& cParticleSystem::Speed() const { +const Vector2f& ParticleSystem::Speed() const { return mSpeed; } -void cParticleSystem::Speed( const Vector2f& speed ) { +void ParticleSystem::Speed( const Vector2f& speed ) { mSpeed = speed; } -const Vector2f& cParticleSystem::Acceleration() const { +const Vector2f& ParticleSystem::Acceleration() const { return mAcc; } -void cParticleSystem::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 f66621fb8..9803bf8b6 100644 --- a/src/eepp/graphics/pixelperfect.cpp +++ b/src/eepp/graphics/pixelperfect.cpp @@ -2,7 +2,7 @@ namespace EE { namespace Graphics { -bool PixelPerfectCollide( cTexture * Tex1, const unsigned int& x1, const unsigned int& y1, cTexture * 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; @@ -65,7 +65,7 @@ bool PixelPerfectCollide( cTexture * Tex1, const unsigned int& x1, const unsigne return Collide; } -bool PixelPerfectCollide( cTexture * 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; diff --git a/src/eepp/graphics/cprimitives.cpp b/src/eepp/graphics/primitives.cpp similarity index 80% rename from src/eepp/graphics/cprimitives.cpp rename to src/eepp/graphics/primitives.cpp index c18012ebe..5b09ce803 100755 --- a/src/eepp/graphics/cprimitives.cpp +++ b/src/eepp/graphics/primitives.cpp @@ -1,29 +1,29 @@ -#include +#include #include -#include -#include +#include +#include #include -#include +#include namespace EE { namespace Graphics { -static cGlobalBatchRenderer * sBR = NULL; +static GlobalBatchRenderer * sBR = NULL; -cPrimitives::cPrimitives() : +Primitives::Primitives() : mFillMode( DRAW_FILL ), mBlendMode( ALPHA_NORMAL ), mLineWidth( 1.f ), mForceDraw( true ) { if ( NULL == sBR ) { - sBR = cGlobalBatchRenderer::instance(); + sBR = GlobalBatchRenderer::instance(); } } -cPrimitives::~cPrimitives() { +Primitives::~Primitives() { } -void cPrimitives::DrawPoint( const Vector2f& p, const Float& pointSize ) { +void Primitives::DrawPoint( const Vector2f& p, const Float& pointSize ) { sBR->SetPointSize( pointSize ); sBR->SetTexture( NULL ); @@ -35,7 +35,7 @@ void cPrimitives::DrawPoint( const Vector2f& p, const Float& pointSize ) { DrawBatch(); } -void cPrimitives::DrawLine( const Line2f& line ) { +void Primitives::DrawLine( const Line2f& line ) { sBR->SetLineWidth( mLineWidth ); sBR->SetTexture( NULL ); @@ -47,7 +47,7 @@ void cPrimitives::DrawLine( const Line2f& line ) { DrawBatch(); } -void cPrimitives::DrawTriangle( const Triangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { +void Primitives::DrawTriangle( const Triangle2f& t, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3 ) { sBR->SetTexture( NULL ); sBR->SetBlendMode( mBlendMode ); @@ -79,11 +79,11 @@ void cPrimitives::DrawTriangle( const Triangle2f& t, const ColorA& Color1, const DrawBatch(); } -void cPrimitives::DrawTriangle( const Triangle2f& t ) { +void Primitives::DrawTriangle( const Triangle2f& t ) { DrawTriangle( t, mColor, mColor, mColor ); } -void cPrimitives::DrawCircle( const Vector2f& p, const Float& radius, Uint32 points ) { +void Primitives::DrawCircle( const Vector2f& p, const Float& radius, Uint32 points ) { if ( 0 == points ) { // Optimized circle rendering static const float circleVAR[] = { @@ -186,7 +186,7 @@ void cPrimitives::DrawCircle( const Vector2f& p, const Float& radius, Uint32 poi DrawBatch(); } -void cPrimitives::DrawRectangle( const Rectf& R, const ColorA& TopLeft, const ColorA& BottomLeft, const ColorA& BottomRight, const ColorA& TopRight, const Float& Angle, const Vector2f& Scale ) { +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 ); @@ -231,11 +231,11 @@ void cPrimitives::DrawRectangle( const Rectf& R, const ColorA& TopLeft, const Co DrawBatch(); } -void cPrimitives::DrawRectangle( const Rectf& R, const Float& Angle, const Vector2f& Scale ) { +void Primitives::DrawRectangle( const Rectf& R, const Float& Angle, const Vector2f& Scale ) { DrawRectangle( R, mColor, mColor, mColor, mColor, Angle, Scale ); } -void cPrimitives::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 ) { +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 ); @@ -314,11 +314,11 @@ void cPrimitives::DrawRoundedRectangle( const Rectf& R, const ColorA& TopLeft, c DrawBatch(); } -void cPrimitives::DrawRoundedRectangle( const Rectf& R, const Float& Angle, const Vector2f& Scale, const unsigned int& 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 cPrimitives::DrawQuad( const Quad2f& q, const ColorA& Color1, const ColorA& Color2, const ColorA& Color3, const ColorA& Color4, const Float& OffsetX, const Float& OffsetY ) { +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 ); @@ -346,11 +346,11 @@ void cPrimitives::DrawQuad( const Quad2f& q, const ColorA& Color1, const ColorA& DrawBatch(); } -void cPrimitives::DrawQuad( const Quad2f& q, const Float& OffsetX, const Float& OffsetY ) { +void Primitives::DrawQuad( const Quad2f& q, const Float& OffsetX, const Float& OffsetY ) { DrawQuad( q, mColor, mColor, mColor, mColor, OffsetX, OffsetY ); } -void cPrimitives::DrawPolygon( const Polygon2f& p ) { +void Primitives::DrawPolygon( const Polygon2f& p ) { sBR->SetTexture( NULL ); sBR->SetBlendMode( mBlendMode ); @@ -378,49 +378,49 @@ void cPrimitives::DrawPolygon( const Polygon2f& p ) { DrawBatch(); } -void cPrimitives::DrawBatch() { +void Primitives::DrawBatch() { if ( mForceDraw ) sBR->Draw(); else sBR->DrawOpt(); } -void cPrimitives::ForceDraw( const bool& force ) { +void Primitives::ForceDraw( const bool& force ) { mForceDraw = force; if ( force ) DrawBatch(); } -const bool& cPrimitives::ForceDraw() const { +const bool& Primitives::ForceDraw() const { return mForceDraw; } -void cPrimitives::SetColor( const ColorA& Color ) { +void Primitives::SetColor( const ColorA& Color ) { mColor = Color; } -void cPrimitives::FillMode( const EE_FILL_MODE& Mode ) { +void Primitives::FillMode( const EE_FILL_MODE& Mode ) { mFillMode = Mode; } -const EE_FILL_MODE& cPrimitives::FillMode() const { +const EE_FILL_MODE& Primitives::FillMode() const { return mFillMode; } -void cPrimitives::BlendMode( const EE_BLEND_MODE& Mode ) { +void Primitives::BlendMode( const EE_BLEND_MODE& Mode ) { mBlendMode = Mode; } -const EE_BLEND_MODE& cPrimitives::BlendMode() const { +const EE_BLEND_MODE& Primitives::BlendMode() const { return mBlendMode; } -void cPrimitives::LineWidth( const Float& width ) { +void Primitives::LineWidth( const Float& width ) { mLineWidth = width; } -const Float& cPrimitives::LineWidth() const { +const Float& Primitives::LineWidth() const { return mLineWidth; } diff --git a/src/eepp/graphics/renderer/cgl.cpp b/src/eepp/graphics/renderer/gl.cpp similarity index 94% rename from src/eepp/graphics/renderer/cgl.cpp rename to src/eepp/graphics/renderer/gl.cpp index e7d48b8b2..03944f19e 100644 --- a/src/eepp/graphics/renderer/cgl.cpp +++ b/src/eepp/graphics/renderer/gl.cpp @@ -1,9 +1,9 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include namespace EE { namespace Graphics { @@ -44,21 +44,21 @@ cGL * cGL::CreateSingleton( EEGL_version ver ) { case GLv_ES2: { #if defined( EE_GL3_ENABLED ) || defined( EE_GLES2 ) - ms_singleton = eeNew( cRendererGLES2, () ); + ms_singleton = eeNew( RendererGLES2, () ); break; #endif } case GLv_3: { #if defined( EE_GL3_ENABLED ) || defined( EE_GLES2 ) - ms_singleton = eeNew( cRendererGL3, () ); + ms_singleton = eeNew( RendererGL3, () ); break; #endif } case GLv_3CP: { #if defined( EE_GL3_ENABLED ) || defined( EE_GLES2 ) - ms_singleton = eeNew( cRendererGL3CP, () ); + ms_singleton = eeNew( RendererGL3CP, () ); break; #endif } @@ -68,7 +68,7 @@ cGL * cGL::CreateSingleton( EEGL_version ver ) { default: { #ifndef EE_GLES2 - ms_singleton = eeNew( cRendererGL, () ); + ms_singleton = eeNew( RendererGL, () ); #endif } } @@ -79,13 +79,13 @@ cGL * cGL::CreateSingleton( EEGL_version ver ) { cGL * cGL::CreateSingleton() { if ( ms_singleton == 0 ) { #if defined( EE_GLES_BOTH ) - ms_singleton = eeNew( cRendererGL, () ); + ms_singleton = eeNew( RendererGL, () ); #elif defined( EE_GLES2 ) - ms_singleton = eeNew( cRendererGLES2, () ); + ms_singleton = eeNew( RendererGLES2, () ); #elif defined( EE_GLES1 ) - ms_singleton = eeNew( cRendererGL, () ); + ms_singleton = eeNew( RendererGL, () ); #else - ms_singleton = eeNew( cRendererGL, () ); + ms_singleton = eeNew( RendererGL, () ); #endif } @@ -124,20 +124,20 @@ cGL::~cGL() { GLi = NULL; } -cRendererGL * cGL::GetRendererGL() { - return reinterpret_cast( this ); +RendererGL * cGL::GetRendererGL() { + return reinterpret_cast( this ); } -cRendererGL3 * cGL::GetRendererGL3() { - return reinterpret_cast( this ); +RendererGL3 * cGL::GetRendererGL3() { + return reinterpret_cast( this ); } -cRendererGL3CP * cGL::GetRendererGL3CP() { - return reinterpret_cast( this ); +RendererGL3CP * cGL::GetRendererGL3CP() { + return reinterpret_cast( this ); } -cRendererGLES2 * cGL::GetRendererGLES2() { - return reinterpret_cast( this ); +RendererGLES2 * cGL::GetRendererGLES2() { + return reinterpret_cast( this ); } void cGL::WriteExtension( Uint8 Pos, Uint32 BitWrite ) { @@ -454,7 +454,7 @@ void cGL::BlendFunc ( unsigned int sfactor, unsigned int dfactor ) { glBlendFunc( sfactor, dfactor ); } -void cGL::SetShader( cShaderProgram * Shader ) { +void cGL::SetShader( ShaderProgram * Shader ) { #ifdef EE_SHADERS_SUPPORTED if ( NULL != Shader ) { glUseProgram( Shader->Handler() ); diff --git a/src/eepp/graphics/renderer/crenderergl.cpp b/src/eepp/graphics/renderer/renderergl.cpp similarity index 80% rename from src/eepp/graphics/renderer/crenderergl.cpp rename to src/eepp/graphics/renderer/renderergl.cpp index bf3f577a2..6e21dc6fa 100644 --- a/src/eepp/graphics/renderer/crenderergl.cpp +++ b/src/eepp/graphics/renderer/renderergl.cpp @@ -1,5 +1,5 @@ #include -#include +#include /* * Some of this code is based on the implementation of the functions from @@ -52,17 +52,17 @@ namespace EE { namespace Graphics { #endif #endif -cRendererGL::cRendererGL() { +RendererGL::RendererGL() { #ifdef EE_GLES1 mQuadsSupported = false; mQuadVertexs = 6; #endif } -cRendererGL::~cRendererGL() { +RendererGL::~RendererGL() { } -EEGL_version cRendererGL::Version() { +EEGL_version RendererGL::Version() { #ifndef EE_GLES1 return GLv_2; #else @@ -70,7 +70,7 @@ EEGL_version cRendererGL::Version() { #endif } -std::string cRendererGL::VersionStr() { +std::string RendererGL::VersionStr() { #ifndef EE_GLES1 return "OpenGL 2"; #else @@ -78,39 +78,39 @@ std::string cRendererGL::VersionStr() { #endif } -void cRendererGL::PushMatrix() { +void RendererGL::PushMatrix() { glPushMatrix(); } -void cRendererGL::PopMatrix() { +void RendererGL::PopMatrix() { glPopMatrix(); } -void cRendererGL::LoadIdentity() { +void RendererGL::LoadIdentity() { glLoadIdentity(); } -void cRendererGL::Translatef( float x, float y, float z ) { +void RendererGL::Translatef( float x, float y, float z ) { glTranslatef( x, y, z ); } -void cRendererGL::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 cRendererGL::Scalef( float x, float y, float z ) { +void RendererGL::Scalef( float x, float y, float z ) { glScalef( x,y, z ); } -void cRendererGL::MatrixMode(unsigned int mode) { +void RendererGL::MatrixMode(unsigned int mode) { glMatrixMode( mode ); } -void cRendererGL::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 cRendererGL::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 cRendererGL::LookAt( float eyeX, float eyeY, float eyeZ, float centerX, flo glTranslatef(-eyeX, -eyeY, -eyeZ); } -void cRendererGL::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); @@ -198,37 +198,37 @@ void cRendererGL::Perspective ( float fovy, float aspect, float zNear, float zFa Frustum( xmin, xmax, ymin, ymax, zNear, zFar ); } -void cRendererGL::EnableClientState( unsigned int array ) { +void RendererGL::EnableClientState( unsigned int array ) { glEnableClientState( array ); } -void cRendererGL::DisableClientState( unsigned int array ) { +void RendererGL::DisableClientState( unsigned int array ) { glDisableClientState( array ); } -void cRendererGL::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 cRendererGL::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 cRendererGL::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 cRendererGL::ClientActiveTexture( unsigned int texture ) { +void RendererGL::ClientActiveTexture( unsigned int texture ) { glClientActiveTexture( texture ); } -void cRendererGL::PointSize( float size ) { +void RendererGL::PointSize( float size ) { #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN glPointSize( size ); #endif } -void cRendererGL::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; @@ -254,7 +254,7 @@ void cRendererGL::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int32 } } -void cRendererGL::Clip2DPlaneDisable() { +void RendererGL::Clip2DPlaneDisable() { if ( ! mPlanesClipped.empty() ) { // This should always be true mPlanesClipped.pop_back(); } @@ -272,7 +272,7 @@ void cRendererGL::Clip2DPlaneDisable() { } } -void cRendererGL::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 cRendererGL::ClipPlane( unsigned int plane, const double *equation ) { #endif } -void cRendererGL::MultMatrixf ( const float *m ) { +void RendererGL::MultMatrixf ( const float *m ) { glMultMatrixf( m ); } -void cRendererGL::LoadMatrixf( const float *m ) { +void RendererGL::LoadMatrixf( const float *m ) { glLoadMatrixf( m ); } -void cRendererGL::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 cRendererGL::PointSize() { +float RendererGL::PointSize() { float ps = 1; #if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN @@ -304,15 +304,15 @@ float cRendererGL::PointSize() { return ps; } -void cRendererGL::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 cRendererGL::GetCurrentMatrix( unsigned int mode, float * m ) { +void RendererGL::GetCurrentMatrix( unsigned int mode, float * m ) { glGetFloatv( mode, m ); } -unsigned int cRendererGL::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 cRendererGL::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 cRendererGL::Project( float objx, float objy, float objz, const float modelM return GL_TRUE; } -int cRendererGL::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/crenderergl3.cpp b/src/eepp/graphics/renderer/renderergl3.cpp similarity index 79% rename from src/eepp/graphics/renderer/crenderergl3.cpp rename to src/eepp/graphics/renderer/renderergl3.cpp index e7215f607..1b8b15c39 100644 --- a/src/eepp/graphics/renderer/crenderergl3.cpp +++ b/src/eepp/graphics/renderer/renderergl3.cpp @@ -1,5 +1,5 @@ #include -#include +#include #ifdef EE_GL3_ENABLED @@ -44,7 +44,7 @@ const GLchar * EEGL3_SHADER_BASE_VS = const GLchar * EEGL3_SHADER_BASE_FS = #include "shaders/basegl3.frag" -cRendererGL3::cRendererGL3() : +RendererGL3::RendererGL3() : mProjectionMatrix_id(0), mModelViewMatrix_id(0), mCurrentMode(0), @@ -70,19 +70,19 @@ cRendererGL3::cRendererGL3() : cGL::Enable( GL_VERTEX_PROGRAM_POINT_SIZE ); } -cRendererGL3::~cRendererGL3() { +RendererGL3::~RendererGL3() { eeSAFE_DELETE( mStack ); } -EEGL_version cRendererGL3::Version() { +EEGL_version RendererGL3::Version() { return GLv_3; } -std::string cRendererGL3::VersionStr() { +std::string RendererGL3::VersionStr() { return "OpenGL 3"; } -void cRendererGL3::Init() { +void RendererGL3::Init() { if ( !mLoaded ) { Uint32 i; @@ -108,12 +108,12 @@ void cRendererGL3::Init() { mTextureUnitsStates[i] = 0; } - cShader::Ensure( false ); + Shader::Ensure( false ); - mShaders[ EEGL3_SHADER_BASE ] = cShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGL3_SHADER_BASE ]->SetReloadCb( cb::Make1( this, &cRendererGL3::ReloadShader ) ); + 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 ) ); - cShader::Ensure( true ); + Shader::Ensure( true ); SetShader( EEGL3_SHADER_BASE ); } else { @@ -129,25 +129,25 @@ void cRendererGL3::Init() { mLoaded = true; } -unsigned int cRendererGL3::BaseShaderId() { +unsigned int RendererGL3::BaseShaderId() { return mCurShader->Handler(); } -void cRendererGL3::ReloadCurrentShader() { +void RendererGL3::ReloadCurrentShader() { ReloadShader( mCurShader ); } -void cRendererGL3::ReloadShader( cShaderProgram * Shader ) { +void RendererGL3::ReloadShader( ShaderProgram * Shader ) { mCurShader = NULL; SetShader( Shader ); } -void cRendererGL3::SetShader( const EEGL3_SHADERS& Shader ) { +void RendererGL3::SetShader( const EEGL3_SHADERS& Shader ) { SetShader( mShaders[ Shader ] ); } -void cRendererGL3::SetShader( cShaderProgram * Shader ) { +void RendererGL3::SetShader( ShaderProgram * Shader ) { if ( NULL == Shader ) { Shader = mShaders[ EEGL3_SHADER_BASE ]; } @@ -219,7 +219,7 @@ void cRendererGL3::SetShader( cShaderProgram * Shader ) { } } -void cRendererGL3::Enable( unsigned int cap ) { +void RendererGL3::Enable( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { @@ -261,7 +261,7 @@ void cRendererGL3::Enable( unsigned int cap ) { cGL::Enable( cap ); } -void cRendererGL3::Disable ( unsigned int cap ) { +void RendererGL3::Disable ( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { @@ -303,7 +303,7 @@ void cRendererGL3::Disable ( unsigned int cap ) { cGL::Disable( cap ); } -void cRendererGL3::EnableClientState( unsigned int array ) { +void RendererGL3::EnableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -323,7 +323,7 @@ void cRendererGL3::EnableClientState( unsigned int array ) { } } -void cRendererGL3::DisableClientState( unsigned int array ) { +void RendererGL3::DisableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -343,7 +343,7 @@ void cRendererGL3::DisableClientState( unsigned int array ) { } } -void cRendererGL3::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 cRendererGL3::VertexPointer ( int size, unsigned int type, int stride, cons } } -void cRendererGL3::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 cRendererGL3::ColorPointer ( int size, unsigned int type, int stride, const } } -void cRendererGL3::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 cRendererGL3::TexCoordPointer ( int size, unsigned int type, int stride, co } } -int cRendererGL3::GetStateIndex( const Uint32& State ) { +int RendererGL3::GetStateIndex( const Uint32& State ) { eeASSERT( State < EEGL_ARRAY_STATES_COUNT ); if ( EEGL_TEXTURE_COORD_ARRAY == State ) @@ -398,7 +398,7 @@ int cRendererGL3::GetStateIndex( const Uint32& State ) { return mAttribsLoc[ State ]; } -void cRendererGL3::PlaneStateCheck( bool tryEnable ) { +void RendererGL3::PlaneStateCheck( bool tryEnable ) { int i; if ( tryEnable ) { @@ -419,7 +419,7 @@ void cRendererGL3::PlaneStateCheck( bool tryEnable ) { } } -void cRendererGL3::UpdateMatrix() { +void RendererGL3::UpdateMatrix() { switch ( mCurrentMode ) { case GL_PROJECTION: { @@ -440,67 +440,67 @@ void cRendererGL3::UpdateMatrix() { } } -void cRendererGL3::PushMatrix() { +void RendererGL3::PushMatrix() { mStack->mCurMatrix->push( mStack->mCurMatrix->top() ); UpdateMatrix(); } -void cRendererGL3::PopMatrix() { +void RendererGL3::PopMatrix() { mStack->mCurMatrix->pop(); UpdateMatrix(); } -void cRendererGL3::LoadIdentity() { +void RendererGL3::LoadIdentity() { mStack->mCurMatrix->top() = glm::mat4(1.0); UpdateMatrix(); } -void cRendererGL3::MultMatrixf ( const float * m ) { +void RendererGL3::MultMatrixf ( const float * m ) { mStack->mCurMatrix->top() *= toGLMmat4( m ); UpdateMatrix(); } -void cRendererGL3::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(); } -void cRendererGL3::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(); } -void cRendererGL3::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(); } -void cRendererGL3::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(); } -void cRendererGL3::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(); } -void cRendererGL3::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(); } -void cRendererGL3::LoadMatrixf( const float * m ) { +void RendererGL3::LoadMatrixf( const float * m ) { mStack->mCurMatrix->top() = toGLMmat4( m ); UpdateMatrix(); } -void cRendererGL3::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(); } -void cRendererGL3::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 cRendererGL3::GetCurrentMatrix( unsigned int mode, float * m ) { } } -unsigned int cRendererGL3::GetCurrentMatrixMode() { +unsigned int RendererGL3::GetCurrentMatrixMode() { return mCurrentMode; } -void cRendererGL3::MatrixMode(unsigned int mode) { +void RendererGL3::MatrixMode(unsigned int mode) { mCurrentMode = mode; switch ( mCurrentMode ) { @@ -540,7 +540,7 @@ void cRendererGL3::MatrixMode(unsigned int mode) { } } -void cRendererGL3::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; @@ -573,7 +573,7 @@ void cRendererGL3::Clip2DPlaneEnable( const Int32& x, const Int32& y, const Int3 } } -void cRendererGL3::Clip2DPlaneDisable() { +void RendererGL3::Clip2DPlaneDisable() { if ( ! mPlanesClipped.empty() ) { // This should always be true mPlanesClipped.pop_back(); } @@ -591,13 +591,13 @@ void cRendererGL3::Clip2DPlaneDisable() { } } -void cRendererGL3::PointSize( float size ) { +void RendererGL3::PointSize( float size ) { mCurShader->SetUniform( "dgl_PointSize", size ); mPointSize = size; } -void cRendererGL3::ClipPlane( unsigned int plane, const double * equation ) { +void RendererGL3::ClipPlane( unsigned int plane, const double * equation ) { Int32 nplane = plane - GL_CLIP_PLANE0; Int32 location; @@ -616,26 +616,26 @@ void cRendererGL3::ClipPlane( unsigned int plane, const double * equation ) { glUniform4f( location, (float)teq[0], (float)teq[1], (float)teq[2], (float)teq[3] ); } -float cRendererGL3::PointSize() { +float RendererGL3::PointSize() { return mPointSize; } -void cRendererGL3::ClientActiveTexture( unsigned int texture ) { +void RendererGL3::ClientActiveTexture( unsigned int texture ) { mCurActiveTex = texture - GL_TEXTURE0; if ( mCurActiveTex >= EE_MAX_TEXTURE_UNITS ) mCurActiveTex = 0; } -void cRendererGL3::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 cRendererGL3::GetBaseVertexShader() { +std::string RendererGL3::GetBaseVertexShader() { return mBaseVertexShader; } -int cRendererGL3::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 cRendererGL3::Project( float objx, float objy, float objz, const float model return GL_TRUE; } -int cRendererGL3::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/crenderergl3cp.cpp b/src/eepp/graphics/renderer/renderergl3cp.cpp similarity index 82% rename from src/eepp/graphics/renderer/crenderergl3cp.cpp rename to src/eepp/graphics/renderer/renderergl3cp.cpp index d9e74ffa0..9a75a142c 100644 --- a/src/eepp/graphics/renderer/crenderergl3cp.cpp +++ b/src/eepp/graphics/renderer/renderergl3cp.cpp @@ -1,5 +1,5 @@ #include -#include +#include #ifdef EE_GL3_ENABLED @@ -56,7 +56,7 @@ const GLchar * EEGL3CP_SHADER_BASE_FS = #endif -cRendererGL3CP::cRendererGL3CP() : +RendererGL3CP::RendererGL3CP() : mProjectionMatrix_id(0), mModelViewMatrix_id(0), mCurrentMode(0), @@ -80,7 +80,7 @@ cRendererGL3CP::cRendererGL3CP() : mStack->mModelViewMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix } -cRendererGL3CP::~cRendererGL3CP() { +RendererGL3CP::~RendererGL3CP() { for ( Uint32 i = 0; i < eeARRAY_SIZE( mVBO ); i++ ) { if ( 0 != mVBO[i] ) { glDeleteBuffersARB( 1, &mVBO[i] ); @@ -96,15 +96,15 @@ cRendererGL3CP::~cRendererGL3CP() { #endif } -EEGL_version cRendererGL3CP::Version() { +EEGL_version RendererGL3CP::Version() { return GLv_3CP; } -std::string cRendererGL3CP::VersionStr() { +std::string RendererGL3CP::VersionStr() { return "OpenGL 3 Core Profile"; } -void cRendererGL3CP::Init() { +void RendererGL3CP::Init() { if ( !mLoaded ) { Uint32 i; @@ -133,12 +133,12 @@ void cRendererGL3CP::Init() { mTextureUnitsStates[i] = 0; } - cShader::Ensure( false ); + Shader::Ensure( false ); - mShaders[ EEGL3CP_SHADER_BASE ] = cShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGL3CP_SHADER_BASE ]->SetReloadCb( cb::Make1( this, &cRendererGL3CP::ReloadShader ) ); + 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 ) ); - cShader::Ensure( true ); + Shader::Ensure( true ); } else { mCurShader = NULL; @@ -159,25 +159,25 @@ void cRendererGL3CP::Init() { mLoaded = true; } -unsigned int cRendererGL3CP::BaseShaderId() { +unsigned int RendererGL3CP::BaseShaderId() { return mCurShader->Handler(); } -void cRendererGL3CP::ReloadCurrentShader() { +void RendererGL3CP::ReloadCurrentShader() { ReloadShader( mCurShader ); } -void cRendererGL3CP::ReloadShader( cShaderProgram * Shader ) { +void RendererGL3CP::ReloadShader( ShaderProgram * Shader ) { mCurShader = NULL; SetShader( Shader ); } -void cRendererGL3CP::SetShader( const EEGL3CP_SHADERS& Shader ) { +void RendererGL3CP::SetShader( const EEGL3CP_SHADERS& Shader ) { SetShader( mShaders[ Shader ] ); } -void cRendererGL3CP::SetShader( cShaderProgram * Shader ) { +void RendererGL3CP::SetShader( ShaderProgram * Shader ) { if ( NULL == Shader ) { Shader = mShaders[ EEGL3CP_SHADER_BASE ]; } @@ -249,7 +249,7 @@ void cRendererGL3CP::SetShader( cShaderProgram * Shader ) { } } -void cRendererGL3CP::Enable( unsigned int cap ) { +void RendererGL3CP::Enable( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { @@ -292,7 +292,7 @@ void cRendererGL3CP::Enable( unsigned int cap ) { cGL::Enable( cap ); } -void cRendererGL3CP::Disable ( unsigned int cap ) { +void RendererGL3CP::Disable ( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { @@ -333,7 +333,7 @@ void cRendererGL3CP::Disable ( unsigned int cap ) { cGL::Disable( cap ); } -void cRendererGL3CP::EnableClientState( unsigned int array ) { +void RendererGL3CP::EnableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -353,7 +353,7 @@ void cRendererGL3CP::EnableClientState( unsigned int array ) { } } -void cRendererGL3CP::DisableClientState( unsigned int array ) { +void RendererGL3CP::DisableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -373,7 +373,7 @@ void cRendererGL3CP::DisableClientState( unsigned int array ) { } } -void cRendererGL3CP::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 @@ -404,7 +404,7 @@ void cRendererGL3CP::VertexPointer ( int size, unsigned int type, int stride, co } } -void cRendererGL3CP::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 @@ -435,7 +435,7 @@ void cRendererGL3CP::ColorPointer ( int size, unsigned int type, int stride, con } } -void cRendererGL3CP::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 @@ -462,7 +462,7 @@ void cRendererGL3CP::TexCoordPointer ( int size, unsigned int type, int stride, } } -int cRendererGL3CP::GetStateIndex( const Uint32& State ) { +int RendererGL3CP::GetStateIndex( const Uint32& State ) { eeASSERT( State < EEGL_ARRAY_STATES_COUNT ); if ( EEGL_TEXTURE_COORD_ARRAY == State ) @@ -471,7 +471,7 @@ int cRendererGL3CP::GetStateIndex( const Uint32& State ) { return mAttribsLoc[ State ]; } -void cRendererGL3CP::PlaneStateCheck( bool tryEnable ) { +void RendererGL3CP::PlaneStateCheck( bool tryEnable ) { int i; if ( tryEnable ) { @@ -492,7 +492,7 @@ void cRendererGL3CP::PlaneStateCheck( bool tryEnable ) { } } -void cRendererGL3CP::UpdateMatrix() { +void RendererGL3CP::UpdateMatrix() { switch ( mCurrentMode ) { case GL_PROJECTION: { @@ -513,67 +513,67 @@ void cRendererGL3CP::UpdateMatrix() { } } -void cRendererGL3CP::PushMatrix() { +void RendererGL3CP::PushMatrix() { mStack->mCurMatrix->push( mStack->mCurMatrix->top() ); UpdateMatrix(); } -void cRendererGL3CP::PopMatrix() { +void RendererGL3CP::PopMatrix() { mStack->mCurMatrix->pop(); UpdateMatrix(); } -void cRendererGL3CP::LoadIdentity() { +void RendererGL3CP::LoadIdentity() { mStack->mCurMatrix->top() = glm::mat4(1.0); UpdateMatrix(); } -void cRendererGL3CP::MultMatrixf ( const float * m ) { +void RendererGL3CP::MultMatrixf ( const float * m ) { mStack->mCurMatrix->top() *= toGLMmat4( m ); UpdateMatrix(); } -void cRendererGL3CP::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(); } -void cRendererGL3CP::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(); } -void cRendererGL3CP::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(); } -void cRendererGL3CP::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(); } -void cRendererGL3CP::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(); } -void cRendererGL3CP::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(); } -void cRendererGL3CP::LoadMatrixf( const float * m ) { +void RendererGL3CP::LoadMatrixf( const float * m ) { mStack->mCurMatrix->top() = toGLMmat4( m ); UpdateMatrix(); } -void cRendererGL3CP::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(); } -void cRendererGL3CP::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 cRendererGL3CP::GetCurrentMatrix( unsigned int mode, float * m ) { } } -unsigned int cRendererGL3CP::GetCurrentMatrixMode() { +unsigned int RendererGL3CP::GetCurrentMatrixMode() { return mCurrentMode; } -void cRendererGL3CP::MatrixMode(unsigned int mode) { +void RendererGL3CP::MatrixMode(unsigned int mode) { mCurrentMode = mode; switch ( mCurrentMode ) { @@ -613,7 +613,7 @@ void cRendererGL3CP::MatrixMode(unsigned int mode) { } } -void cRendererGL3CP::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; @@ -646,7 +646,7 @@ void cRendererGL3CP::Clip2DPlaneEnable( const Int32& x, const Int32& y, const In } } -void cRendererGL3CP::Clip2DPlaneDisable() { +void RendererGL3CP::Clip2DPlaneDisable() { if ( ! mPlanesClipped.empty() ) { // This should always be true mPlanesClipped.pop_back(); } @@ -664,13 +664,13 @@ void cRendererGL3CP::Clip2DPlaneDisable() { } } -void cRendererGL3CP::PointSize( float size ) { +void RendererGL3CP::PointSize( float size ) { mCurShader->SetUniform( "dgl_PointSize", size ); mPointSize = size; } -void cRendererGL3CP::ClipPlane( unsigned int plane, const double * equation ) { +void RendererGL3CP::ClipPlane( unsigned int plane, const double * equation ) { Int32 nplane = plane - GL_CLIP_PLANE0; Int32 location; @@ -689,11 +689,11 @@ void cRendererGL3CP::ClipPlane( unsigned int plane, const double * equation ) { glUniform4f( location, (float)teq[0], (float)teq[1], (float)teq[2], (float)teq[3] ); } -float cRendererGL3CP::PointSize() { +float RendererGL3CP::PointSize() { return mPointSize; } -void cRendererGL3CP::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 cRendererGL3CP::ClientActiveTexture( unsigned int texture ) { } } -void cRendererGL3CP::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 cRendererGL3CP::GetBaseVertexShader() { +std::string RendererGL3CP::GetBaseVertexShader() { return mBaseVertexShader; } -int cRendererGL3CP::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 cRendererGL3CP::Project( float objx, float objy, float objz, const float mod return GL_TRUE; } -int cRendererGL3CP::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 cRendererGL3CP::UnProject( float winx, float winy, float winz, const float m return GL_TRUE; } -void cRendererGL3CP::BindGlobalVAO() { +void RendererGL3CP::BindGlobalVAO() { BindVertexArray( mVAO ); } -void cRendererGL3CP::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/crenderergles2.cpp b/src/eepp/graphics/renderer/renderergles2.cpp similarity index 79% rename from src/eepp/graphics/renderer/crenderergles2.cpp rename to src/eepp/graphics/renderer/renderergles2.cpp index 1376b0226..c01ff9a50 100644 --- a/src/eepp/graphics/renderer/crenderergles2.cpp +++ b/src/eepp/graphics/renderer/renderergles2.cpp @@ -1,5 +1,5 @@ #include -#include +#include #ifdef EE_GL3_ENABLED @@ -62,7 +62,7 @@ const GLchar * EEGLES2_SHADER_PRIMITIVE_VS = const GLchar * EEGLES2_SHADER_PRIMITIVE_FS = #include "shaders/primitive.frag" -cRendererGLES2::cRendererGLES2() : +RendererGLES2::RendererGLES2() : mStack( eeNew( cMatrixStack, () ) ), mProjectionMatrix_id(0), mModelViewMatrix_id(0), @@ -86,19 +86,19 @@ cRendererGLES2::cRendererGLES2() : mStack->mModelViewMatrix.push ( glm::mat4( 1.0f ) ); // identity matrix } -cRendererGLES2::~cRendererGLES2() { +RendererGLES2::~RendererGLES2() { eeSAFE_DELETE( mStack ); } -EEGL_version cRendererGLES2::Version() { +EEGL_version RendererGLES2::Version() { return GLv_ES2; } -std::string cRendererGLES2::VersionStr() { +std::string RendererGLES2::VersionStr() { return "OpenGL ES 2"; } -void cRendererGLES2::Init() { +void RendererGLES2::Init() { if ( !mLoaded ) { Uint32 i; @@ -124,30 +124,30 @@ void cRendererGLES2::Init() { mTextureUnitsStates[i] = 0; } - cShader::Ensure( false ); + Shader::Ensure( false ); - mShaders[ EEGLES2_SHADER_BASE ] = cShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGLES2_SHADER_BASE ]->SetReloadCb( cb::Make1( this, &cRendererGLES2::ReloadShader ) ); + 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 ) ); vs = EEGLES2_SHADER_CLIPPED_VS; fs = EEGLES2_SHADER_CLIPPED_FS; - mShaders[ EEGLES2_SHADER_CLIPPED ] = cShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGLES2_SHADER_CLIPPED ]->SetReloadCb( cb::Make1( this, &cRendererGLES2::ReloadShader ) ); + 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 ) ); vs = EEGLES2_SHADER_POINTSPRITE_VS; fs = EEGLES2_SHADER_POINTSPRITE_FS; - mShaders[ EEGLES2_SHADER_POINTSPRITE ] = cShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGLES2_SHADER_POINTSPRITE ]->SetReloadCb( cb::Make1( this, &cRendererGLES2::ReloadShader ) ); + 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 ) ); vs = EEGLES2_SHADER_PRIMITIVE_VS; fs = EEGLES2_SHADER_PRIMITIVE_FS; - mShaders[ EEGLES2_SHADER_PRIMITIVE ] = cShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); - mShaders[ EEGLES2_SHADER_PRIMITIVE ]->SetReloadCb( cb::Make1( this, &cRendererGLES2::ReloadShader ) ); + 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 ) ); - cShader::Ensure( true ); + Shader::Ensure( true ); SetShader( EEGLES2_SHADER_BASE ); } else { @@ -163,25 +163,25 @@ void cRendererGLES2::Init() { mLoaded = true; } -unsigned int cRendererGLES2::BaseShaderId() { +unsigned int RendererGLES2::BaseShaderId() { return mCurShader->Handler(); } -void cRendererGLES2::ReloadCurrentShader() { +void RendererGLES2::ReloadCurrentShader() { ReloadShader( mCurShader ); } -void cRendererGLES2::ReloadShader( cShaderProgram * Shader ) { +void RendererGLES2::ReloadShader( ShaderProgram * Shader ) { mCurShader = NULL; SetShader( Shader ); } -void cRendererGLES2::SetShader( const EEGLES2_SHADERS& Shader ) { +void RendererGLES2::SetShader( const EEGLES2_SHADERS& Shader ) { SetShader( mShaders[ Shader ] ); } -void cRendererGLES2::CheckLocalShader() { +void RendererGLES2::CheckLocalShader() { for ( Uint32 i = 0; i < EEGLES2_SHADERS_COUNT; i++ ) { if ( mShaders[i] == mCurShader ) { mCurShaderLocal = true; @@ -192,7 +192,7 @@ void cRendererGLES2::CheckLocalShader() { mCurShaderLocal = false; } -void cRendererGLES2::SetShader( cShaderProgram * Shader ) { +void RendererGLES2::SetShader( ShaderProgram * Shader ) { if ( NULL == Shader ) { Shader = mShaders[ EEGLES2_SHADER_BASE ]; } @@ -268,7 +268,7 @@ void cRendererGLES2::SetShader( cShaderProgram * Shader ) { } } -void cRendererGLES2::Enable( unsigned int cap ) { +void RendererGLES2::Enable( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { @@ -314,7 +314,7 @@ void cRendererGLES2::Enable( unsigned int cap ) { cGL::Enable( cap ); } -void cRendererGLES2::Disable ( unsigned int cap ) { +void RendererGLES2::Disable ( unsigned int cap ) { switch ( cap ) { case GL_TEXTURE_2D: { @@ -362,7 +362,7 @@ void cRendererGLES2::Disable ( unsigned int cap ) { cGL::Disable( cap ); } -void cRendererGLES2::EnableClientState( unsigned int array ) { +void RendererGLES2::EnableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -382,7 +382,7 @@ void cRendererGLES2::EnableClientState( unsigned int array ) { } } -void cRendererGLES2::DisableClientState( unsigned int array ) { +void RendererGLES2::DisableClientState( unsigned int array ) { int state; if ( GL_TEXTURE_COORD_ARRAY == array ) { @@ -402,7 +402,7 @@ void cRendererGLES2::DisableClientState( unsigned int array ) { } } -void cRendererGLES2::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 cRendererGLES2::VertexPointer ( int size, unsigned int type, int stride, co } } -void cRendererGLES2::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,7 +434,7 @@ void cRendererGLES2::ColorPointer ( int size, unsigned int type, int stride, con } } -void cRendererGLES2::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 ] ) { @@ -462,7 +462,7 @@ void cRendererGLES2::TexCoordPointer ( int size, unsigned int type, int stride, } } -int cRendererGLES2::GetStateIndex( const Uint32& State ) { +int RendererGLES2::GetStateIndex( const Uint32& State ) { eeASSERT( State < EEGL_ARRAY_STATES_COUNT ); if ( EEGL_TEXTURE_COORD_ARRAY == State ) @@ -471,7 +471,7 @@ int cRendererGLES2::GetStateIndex( const Uint32& State ) { return mAttribsLoc[ State ]; } -void cRendererGLES2::PlaneStateCheck( bool tryEnable ) { +void RendererGLES2::PlaneStateCheck( bool tryEnable ) { int i; if ( tryEnable ) { @@ -495,7 +495,7 @@ void cRendererGLES2::PlaneStateCheck( bool tryEnable ) { } } -void cRendererGLES2::UpdateMatrix() { +void RendererGLES2::UpdateMatrix() { switch ( mCurrentMode ) { case GL_PROJECTION: { @@ -516,67 +516,67 @@ void cRendererGLES2::UpdateMatrix() { } } -void cRendererGLES2::PushMatrix() { +void RendererGLES2::PushMatrix() { mStack->mCurMatrix->push( mStack->mCurMatrix->top() ); UpdateMatrix(); } -void cRendererGLES2::PopMatrix() { +void RendererGLES2::PopMatrix() { mStack->mCurMatrix->pop(); UpdateMatrix(); } -void cRendererGLES2::LoadIdentity() { +void RendererGLES2::LoadIdentity() { mStack->mCurMatrix->top() = glm::mat4(1.0); UpdateMatrix(); } -void cRendererGLES2::MultMatrixf ( const float * m ) { +void RendererGLES2::MultMatrixf ( const float * m ) { mStack->mCurMatrix->top() *= toGLMmat4( m ); UpdateMatrix(); } -void cRendererGLES2::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(); } -void cRendererGLES2::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(); } -void cRendererGLES2::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(); } -void cRendererGLES2::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(); } -void cRendererGLES2::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(); } -void cRendererGLES2::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(); } -void cRendererGLES2::LoadMatrixf( const float * m ) { +void RendererGLES2::LoadMatrixf( const float * m ) { mStack->mCurMatrix->top() = toGLMmat4( m ); UpdateMatrix(); } -void cRendererGLES2::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(); } -void cRendererGLES2::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 cRendererGLES2::GetCurrentMatrix( unsigned int mode, float * m ) { } } -unsigned int cRendererGLES2::GetCurrentMatrixMode() { +unsigned int RendererGLES2::GetCurrentMatrixMode() { return mCurrentMode; } -void cRendererGLES2::MatrixMode(unsigned int mode) { +void RendererGLES2::MatrixMode(unsigned int mode) { mCurrentMode = mode; switch ( mCurrentMode ) { @@ -616,7 +616,7 @@ void cRendererGLES2::MatrixMode(unsigned int mode) { } } -void cRendererGLES2::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; @@ -649,7 +649,7 @@ void cRendererGLES2::Clip2DPlaneEnable( const Int32& x, const Int32& y, const In } } -void cRendererGLES2::Clip2DPlaneDisable() { +void RendererGLES2::Clip2DPlaneDisable() { if ( ! mPlanesClipped.empty() ) { // This should always be true mPlanesClipped.pop_back(); } @@ -667,7 +667,7 @@ void cRendererGLES2::Clip2DPlaneDisable() { } } -void cRendererGLES2::PointSize( float size ) { +void RendererGLES2::PointSize( float size ) { #if !defined( EE_GLES2 ) && EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN glPointSize( size ); #endif @@ -677,7 +677,7 @@ void cRendererGLES2::PointSize( float size ) { mPointSize = size; } -void cRendererGLES2::ClipPlane( unsigned int plane, const double * equation ) { +void RendererGLES2::ClipPlane( unsigned int plane, const double * equation ) { Int32 nplane = plane - GL_CLIP_PLANE0; Int32 location; @@ -696,26 +696,26 @@ void cRendererGLES2::ClipPlane( unsigned int plane, const double * equation ) { glUniform4f( location, (float)teq[0], (float)teq[1], (float)teq[2], (float)teq[3] ); } -float cRendererGLES2::PointSize() { +float RendererGLES2::PointSize() { return mPointSize; } -void cRendererGLES2::ClientActiveTexture( unsigned int texture ) { +void RendererGLES2::ClientActiveTexture( unsigned int texture ) { mCurActiveTex = texture - GL_TEXTURE0; if ( mCurActiveTex >= EE_MAX_TEXTURE_UNITS ) mCurActiveTex = 0; } -void cRendererGLES2::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 cRendererGLES2::GetBaseVertexShader() { +std::string RendererGLES2::GetBaseVertexShader() { return mBaseVertexShader; } -int cRendererGLES2::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 cRendererGLES2::Project( float objx, float objy, float objz, const float mod return GL_TRUE; } -int cRendererGLES2::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/cscrollparallax.cpp b/src/eepp/graphics/scrollparallax.cpp similarity index 74% rename from src/eepp/graphics/cscrollparallax.cpp rename to src/eepp/graphics/scrollparallax.cpp index bca55add9..493554d35 100755 --- a/src/eepp/graphics/cscrollparallax.cpp +++ b/src/eepp/graphics/scrollparallax.cpp @@ -1,32 +1,32 @@ -#include +#include namespace EE { namespace Graphics { -cScrollParallax::cScrollParallax() : +ScrollParallax::ScrollParallax() : mSubTexture( NULL ), mBlend( ALPHA_NORMAL ), mColor( 255, 255, 255, 255 ) { } -cScrollParallax::~cScrollParallax() +ScrollParallax::~ScrollParallax() {} -cScrollParallax::cScrollParallax( cSubTexture * SubTexture, const Vector2f& Position, const Sizef& Size, const Vector2f& Speed, const ColorA& Color, const EE_BLEND_MODE& Blend ) { +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 ); } -cSubTexture * cScrollParallax::SubTexture() const { +Graphics::SubTexture * ScrollParallax::SubTexture() const { return mSubTexture; } -void cScrollParallax::SubTexture( cSubTexture * subTexture ) { +void ScrollParallax::SubTexture( Graphics::SubTexture * subTexture ) { mSubTexture = subTexture; SetSubTexture(); } -void cScrollParallax::SetSubTexture() { +void ScrollParallax::SetSubTexture() { if ( NULL != mSubTexture ) { mRect = mSubTexture->SrcRect(); mRealSize = Vector2f( (Float)mSubTexture->RealSize().Width(), (Float)mSubTexture->RealSize().Height() ); @@ -36,11 +36,11 @@ void cScrollParallax::SetSubTexture() { } } -void cScrollParallax::SetAABB() { +void ScrollParallax::SetAABB() { mAABB = Rectf( mInitPos.x, mInitPos.y, mInitPos.x + mSize.Width(), mInitPos.y + mSize.Height() ); } -bool cScrollParallax::Create( cSubTexture * 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; @@ -55,14 +55,14 @@ bool cScrollParallax::Create( cSubTexture * SubTexture, const Vector2f& Position return true; } -void cScrollParallax::Size( const Sizef& size ) { +void ScrollParallax::Size( const Sizef& size ) { mSize = size; SetSubTexture(); SetAABB(); } -void cScrollParallax::Position( const Vector2f& Pos ) { +void ScrollParallax::Position( const Vector2f& Pos ) { Vector2f Diff = mPos - mInitPos; mInitPos = Pos; @@ -72,15 +72,15 @@ void cScrollParallax::Position( const Vector2f& Pos ) { SetAABB(); } -const Sizef& cScrollParallax::Size() const { +const Sizef& ScrollParallax::Size() const { return mSize; } -const Vector2f& cScrollParallax::Position() const { +const Vector2f& ScrollParallax::Position() const { return mInitPos; } -void cScrollParallax::Draw() { +void ScrollParallax::Draw() { if ( NULL != mSubTexture && mAABB.Left != mAABB.Right && mAABB.Top != mAABB.Bottom && 0 != mColor.Alpha ) { mPos += mSpeed * (Float)mElapsed.Elapsed().AsSeconds(); @@ -148,11 +148,11 @@ void cScrollParallax::Draw() { } } -void cScrollParallax::Speed( const Vector2f& speed ) { +void ScrollParallax::Speed( const Vector2f& speed ) { mSpeed = speed; } -const Vector2f& cScrollParallax::Speed() const { +const Vector2f& ScrollParallax::Speed() const { return mSpeed; } diff --git a/src/eepp/graphics/cshader.cpp b/src/eepp/graphics/shader.cpp similarity index 75% rename from src/eepp/graphics/cshader.cpp rename to src/eepp/graphics/shader.cpp index 1d00fb06a..585d5ad25 100644 --- a/src/eepp/graphics/cshader.cpp +++ b/src/eepp/graphics/shader.cpp @@ -1,27 +1,27 @@ -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace EE { namespace Graphics { -bool cShader::sEnsure = true; +bool Shader::sEnsure = true; -void cShader::Ensure( bool ensure ) { +void Shader::Ensure( bool ensure ) { sEnsure = ensure; } -bool cShader::Ensure() { +bool Shader::Ensure() { return sEnsure; } -cShader::cShader( const Uint32& Type ) { +Shader::Shader( const Uint32& Type ) { Init( Type ); } -cShader::cShader( const Uint32& Type, const std::string& Filename ) { +Shader::Shader( const Uint32& Type, const std::string& Filename ) { Init( Type ); mFilename = FileSystem::FileNameFromPath( Filename ); @@ -50,7 +50,7 @@ cShader::cShader( const Uint32& Type, const std::string& Filename ) { Compile(); } -cShader::cShader( const Uint32& Type, const char * Data, const Uint32& DataSize ) { +Shader::Shader( const Uint32& Type, const char * Data, const Uint32& DataSize ) { Init( Type ); SetSource( Data, DataSize ); @@ -58,7 +58,7 @@ cShader::cShader( const Uint32& Type, const char * Data, const Uint32& DataSize Compile(); } -cShader::cShader( const Uint32& Type, Pack * Pack, const std::string& Filename ) { +Shader::Shader( const Uint32& Type, Pack * Pack, const std::string& Filename ) { SafeDataPointer PData; Init( Type ); @@ -74,7 +74,7 @@ cShader::cShader( const Uint32& Type, Pack * Pack, const std::string& Filename ) Compile(); } -cShader::cShader( const Uint32& Type, const char ** Data, const Uint32& NumLines ) { +Shader::Shader( const Uint32& Type, const char ** Data, const Uint32& NumLines ) { Init( Type ); SetSource( Data, NumLines ); @@ -82,7 +82,7 @@ cShader::cShader( const Uint32& Type, const char ** Data, const Uint32& NumLines Compile(); } -cShader::~cShader() { +Shader::~Shader() { if ( 0 != mGLId ) { #ifdef EE_SHADERS_SUPPORTED glDeleteShader( mGLId ); @@ -90,7 +90,7 @@ cShader::~cShader() { } } -void cShader::Init( const Uint32& Type ) { +void Shader::Init( const Uint32& Type ) { mType = Type; mValid = false; mCompiled = false; @@ -99,17 +99,17 @@ void cShader::Init( const Uint32& Type ) { #endif } -void cShader::Reload() { +void Shader::Reload() { Init( mType ); - cShader::Ensure( false ); + Shader::Ensure( false ); SetSource( mSource ); - cShader::Ensure( true ); + Shader::Ensure( true ); Compile(); } -std::string cShader::GetName() { +std::string Shader::GetName() { std::string name; if ( mFilename.size() ) { @@ -121,9 +121,9 @@ std::string cShader::GetName() { return name; } -void cShader::EnsureVersion() { +void Shader::EnsureVersion() { #ifdef EE_GL3_ENABLED - if ( cShader::Ensure() && ( GLi->Version() == GLv_3 || GLi->Version() == GLv_3CP || GLi->Version() == GLv_ES2 ) ) { + 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 ) { @@ -175,7 +175,7 @@ void cShader::EnsureVersion() { #endif } -void cShader::SetSource( const std::string& Source ) { +void Shader::SetSource( const std::string& Source ) { if ( IsCompiled() ) { eePRINTL( "Shader %s report: can't set source for compiled shaders", GetName().c_str() ); return; @@ -192,7 +192,7 @@ void cShader::SetSource( const std::string& Source ) { #endif } -void cShader::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++ ) { @@ -202,7 +202,7 @@ void cShader::SetSource( const char** Data, const Uint32& NumLines ) { SetSource( tstr ); } -void cShader::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 ); @@ -210,7 +210,7 @@ void cShader::SetSource( const char * Data, const Uint32& DataSize ) { SetSource( _dst ); } -void cShader::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() ); @@ -218,7 +218,7 @@ void cShader::SetSource( const std::vector& Source ) { SetSource( _dst ); } -bool cShader::Compile() { +bool Shader::Compile() { if ( IsCompiled() ) { eePRINTL( "Shader %s report: can't compile a shader twice", GetName().c_str() ); return false; @@ -255,73 +255,73 @@ bool cShader::Compile() { return mValid; } -bool cShader::IsValid() const { +bool Shader::IsValid() const { return mValid; } -bool cShader::IsCompiled() const { +bool Shader::IsCompiled() const { return mCompiled; } -std::string cShader::CompileLog() const { +std::string Shader::CompileLog() const { return mCompileLog; } -Uint32 cShader::GetType() const { +Uint32 Shader::GetType() const { return mType; } -Uint32 cShader::GetId() const { +Uint32 Shader::GetId() const { return mGLId; } cVertexShader::cVertexShader() : - cShader( GL_VERTEX_SHADER ) + Shader( GL_VERTEX_SHADER ) { } cVertexShader::cVertexShader( const std::string& Filename ) : - cShader( GL_VERTEX_SHADER, Filename ) + Shader( GL_VERTEX_SHADER, Filename ) { } cVertexShader::cVertexShader( const char * Data, const Uint32& DataSize ) : - cShader( GL_VERTEX_SHADER, Data, DataSize ) + Shader( GL_VERTEX_SHADER, Data, DataSize ) { } cVertexShader::cVertexShader( Pack * Pack, const std::string& Filename ) : - cShader( GL_VERTEX_SHADER, Pack, Filename ) + Shader( GL_VERTEX_SHADER, Pack, Filename ) { } cVertexShader::cVertexShader( const char ** Data, const Uint32& NumLines ) : - cShader( GL_VERTEX_SHADER, Data, NumLines ) + Shader( GL_VERTEX_SHADER, Data, NumLines ) { } cFragmentShader::cFragmentShader() : - cShader( GL_FRAGMENT_SHADER ) + Shader( GL_FRAGMENT_SHADER ) { } cFragmentShader::cFragmentShader( const std::string& Filename ) : - cShader( GL_FRAGMENT_SHADER, Filename ) + Shader( GL_FRAGMENT_SHADER, Filename ) { } cFragmentShader::cFragmentShader( const char * Data, const Uint32& DataSize ) : - cShader( GL_FRAGMENT_SHADER, Data, DataSize ) + Shader( GL_FRAGMENT_SHADER, Data, DataSize ) { } cFragmentShader::cFragmentShader( Pack * Pack, const std::string& Filename ) : - cShader( GL_FRAGMENT_SHADER, Pack, Filename ) + Shader( GL_FRAGMENT_SHADER, Pack, Filename ) { } cFragmentShader::cFragmentShader( const char ** Data, const Uint32& NumLines ) : - cShader( GL_FRAGMENT_SHADER, Data, NumLines ) + Shader( GL_FRAGMENT_SHADER, Data, NumLines ) { } diff --git a/src/eepp/graphics/cshaderprogram.cpp b/src/eepp/graphics/shaderprogram.cpp similarity index 56% rename from src/eepp/graphics/cshaderprogram.cpp rename to src/eepp/graphics/shaderprogram.cpp index a05b3e627..c7811083b 100644 --- a/src/eepp/graphics/cshaderprogram.cpp +++ b/src/eepp/graphics/shaderprogram.cpp @@ -1,36 +1,36 @@ -#include -#include -#include +#include +#include +#include #include -#include +#include namespace EE { namespace Graphics { -cShaderProgram * cShaderProgram::New( const std::string& name ) { - return eeNew( cShaderProgram, ( name ) ); +ShaderProgram * ShaderProgram::New( const std::string& name ) { + return eeNew( ShaderProgram, ( name ) ); } -cShaderProgram * cShaderProgram::New( const std::vector& Shaders, const std::string& name ) { - return eeNew( cShaderProgram, ( Shaders, name ) ); +ShaderProgram * ShaderProgram::New( const std::vector& Shaders, const std::string& name ) { + return eeNew( ShaderProgram, ( Shaders, name ) ); } -cShaderProgram * cShaderProgram::New( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& name ) { - return eeNew( cShaderProgram, ( VertexShaderFile, FragmentShaderFile, name ) ); +ShaderProgram * ShaderProgram::New( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& name ) { + return eeNew( ShaderProgram, ( VertexShaderFile, FragmentShaderFile, name ) ); } -cShaderProgram * cShaderProgram::New( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& name ) { - return eeNew( cShaderProgram, ( VertexShaderData, VertexShaderDataSize, FragmentShaderData, FragmentShaderDataSize, name ) ); +ShaderProgram * ShaderProgram::New( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& name ) { + return eeNew( ShaderProgram, ( VertexShaderData, VertexShaderDataSize, FragmentShaderData, FragmentShaderDataSize, name ) ); } -cShaderProgram * cShaderProgram::New( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name ) { - return eeNew( cShaderProgram, ( Pack, VertexShaderPath, FragmentShaderPath, name ) ); +ShaderProgram * ShaderProgram::New( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name ) { + return eeNew( ShaderProgram, ( Pack, VertexShaderPath, FragmentShaderPath, name ) ); } -cShaderProgram * cShaderProgram::New( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& name ) { - return eeNew( cShaderProgram, ( VertexShaderData, NumLinesVS, FragmentShaderData, NumLinesFS, name ) ); +ShaderProgram * ShaderProgram::New( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& name ) { + return eeNew( ShaderProgram, ( VertexShaderData, NumLinesVS, FragmentShaderData, NumLinesFS, name ) ); } -cShaderProgram::cShaderProgram( const std::string& name ) : +ShaderProgram::ShaderProgram( const std::string& name ) : mHandler(0), mId(0) { @@ -38,7 +38,7 @@ cShaderProgram::cShaderProgram( const std::string& name ) : Init(); } -cShaderProgram::cShaderProgram( const std::vector& Shaders, const std::string& name ) : +ShaderProgram::ShaderProgram( const std::vector& Shaders, const std::string& name ) : mHandler(0), mId(0) { @@ -50,7 +50,7 @@ cShaderProgram::cShaderProgram( const std::vector& Shaders, const std: Link(); } -cShaderProgram::cShaderProgram( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& name ) : +ShaderProgram::ShaderProgram( const std::string& VertexShaderFile, const std::string& FragmentShaderFile, const std::string& name ) : mHandler(0), mId(0) { @@ -72,7 +72,7 @@ cShaderProgram::cShaderProgram( const std::string& VertexShaderFile, const std:: Link(); } -cShaderProgram::cShaderProgram( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name ) : +ShaderProgram::ShaderProgram( Pack * Pack, const std::string& VertexShaderPath, const std::string& FragmentShaderPath, const std::string& name ) : mHandler(0), mId(0) { @@ -96,7 +96,7 @@ cShaderProgram::cShaderProgram( Pack * Pack, const std::string& VertexShaderPath } } -cShaderProgram::cShaderProgram( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& name ) : +ShaderProgram::ShaderProgram( const char * VertexShaderData, const Uint32& VertexShaderDataSize, const char * FragmentShaderData, const Uint32& FragmentShaderDataSize, const std::string& name ) : mHandler(0), mId(0) { @@ -118,7 +118,7 @@ cShaderProgram::cShaderProgram( const char * VertexShaderData, const Uint32& Ver Link(); } -cShaderProgram::cShaderProgram( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& name ) : +ShaderProgram::ShaderProgram( const char ** VertexShaderData, const Uint32& NumLinesVS, const char ** FragmentShaderData, const Uint32& NumLinesFS, const std::string& name ) : mHandler(0), mId(0) { @@ -140,7 +140,7 @@ cShaderProgram::cShaderProgram( const char ** VertexShaderData, const Uint32& Nu Link(); } -cShaderProgram::~cShaderProgram() { +ShaderProgram::~ShaderProgram() { if ( Handler() > 0 ) { #ifdef EE_SHADERS_SUPPORTED glDeleteProgram( Handler() ); @@ -153,22 +153,22 @@ cShaderProgram::~cShaderProgram() { for ( unsigned int i = 0; i < mShaders.size(); i++ ) eeSAFE_DELETE( mShaders[i] ); - if ( !cShaderProgramManager::instance()->IsDestroying() ) { + if ( !ShaderProgramManager::instance()->IsDestroying() ) { RemoveFromManager(); } } -void cShaderProgram::AddToManager( const std::string& name ) { +void ShaderProgram::AddToManager( const std::string& name ) { Name( name ); - cShaderProgramManager::instance()->Add( this ); + ShaderProgramManager::instance()->Add( this ); } -void cShaderProgram::RemoveFromManager() { - cShaderProgramManager::instance()->Remove( this, false ); +void ShaderProgram::RemoveFromManager() { + ShaderProgramManager::instance()->Remove( this, false ); } -void cShaderProgram::Init() { +void ShaderProgram::Init() { if ( GLi->ShadersSupported() && 0 == Handler() ) { #ifdef EE_SHADERS_SUPPORTED mHandler = glCreateProgram(); @@ -177,16 +177,16 @@ void cShaderProgram::Init() { mUniformLocations.clear(); mAttributeLocations.clear(); } else { - eePRINTL( "cShaderProgram::Init() %s: Couldn't create program.", mName.c_str() ); + eePRINTL( "ShaderProgram::Init() %s: Couldn't create program.", mName.c_str() ); } } -void cShaderProgram::Reload() { +void ShaderProgram::Reload() { mHandler = 0; Init(); - std::vector tmpShader = mShaders; + std::vector tmpShader = mShaders; mShaders.clear(); @@ -202,9 +202,9 @@ void cShaderProgram::Reload() { } } -void cShaderProgram::AddShader( cShader* Shader ) { +void ShaderProgram::AddShader( Shader* Shader ) { if ( !Shader->IsValid() ) { - eePRINTL( "cShaderProgram::AddShader() %s: Cannot add invalid shader", mName.c_str() ); + eePRINTL( "ShaderProgram::AddShader() %s: Cannot add invalid shader", mName.c_str() ); return; } @@ -217,12 +217,12 @@ void cShaderProgram::AddShader( cShader* Shader ) { } } -void cShaderProgram::AddShaders( const std::vector& Shaders ) { +void ShaderProgram::AddShaders( const std::vector& Shaders ) { for ( Uint32 i = 0; i < Shaders.size(); i++ ) AddShader( Shaders[i] ); } -bool cShaderProgram::Link() { +bool ShaderProgram::Link() { #ifdef EE_SHADERS_SUPPORTED glLinkProgram( Handler() ); @@ -243,10 +243,10 @@ bool cShaderProgram::Link() { #endif if ( !mValid ) { - eePRINTL( "cShaderProgram::Link(): %s: Couldn't link program. Log follows:\n%s", mName.c_str(), mLinkLog.c_str() ); + eePRINTL( "ShaderProgram::Link(): %s: Couldn't link program. Log follows:\n%s", mName.c_str(), mLinkLog.c_str() ); } else { if ( mLinkLog.size() > 1 ) { - eePRINTL( "cShaderProgram::Link() %s: Program linked, but received some log:\n%s", mName.c_str(), mLinkLog.c_str() ); + eePRINTL( "ShaderProgram::Link() %s: Program linked, but received some log:\n%s", mName.c_str(), mLinkLog.c_str() ); } mUniformLocations.clear(); @@ -256,19 +256,19 @@ bool cShaderProgram::Link() { return mValid; } -void cShaderProgram::Bind() const { - cGlobalBatchRenderer::instance()->Draw(); +void ShaderProgram::Bind() const { + GlobalBatchRenderer::instance()->Draw(); - GLi->SetShader( const_cast( this ) ); + GLi->SetShader( const_cast( this ) ); } -void cShaderProgram::Unbind() const { - cGlobalBatchRenderer::instance()->Draw(); +void ShaderProgram::Unbind() const { + GlobalBatchRenderer::instance()->Draw(); GLi->SetShader( NULL ); } -Int32 cShaderProgram::UniformLocation( const std::string& Name ) { +Int32 ShaderProgram::UniformLocation( const std::string& Name ) { if ( !mValid ) return -1; @@ -282,7 +282,7 @@ Int32 cShaderProgram::UniformLocation( const std::string& Name ) { return mUniformLocations[Name]; } -Int32 cShaderProgram::AttributeLocation( const std::string& Name ) { +Int32 ShaderProgram::AttributeLocation( const std::string& Name ) { if ( !mValid ) return -1; @@ -296,12 +296,12 @@ Int32 cShaderProgram::AttributeLocation( const std::string& Name ) { return mAttributeLocations[Name]; } -void cShaderProgram::InvalidateLocations() { +void ShaderProgram::InvalidateLocations() { mUniformLocations.clear(); mAttributeLocations.clear(); } -bool cShaderProgram::SetUniform( const std::string& Name, float Value ) { +bool ShaderProgram::SetUniform( const std::string& Name, float Value ) { Int32 Location = UniformLocation( Name ); if ( Location >= 0 ) { @@ -313,7 +313,7 @@ bool cShaderProgram::SetUniform( const std::string& Name, float Value ) { return ( Location >= 0 ); } -bool cShaderProgram::SetUniform( const std::string& Name, Vector2ff Value ) { +bool ShaderProgram::SetUniform( const std::string& Name, Vector2ff Value ) { Int32 Location = UniformLocation( Name ); if ( Location >= 0 ) { @@ -325,7 +325,7 @@ bool cShaderProgram::SetUniform( const std::string& Name, Vector2ff Value ) { return ( Location >= 0 ); } -bool cShaderProgram::SetUniform( const std::string& Name, Vector3ff Value ) { +bool ShaderProgram::SetUniform( const std::string& Name, Vector3ff Value ) { Int32 Location = UniformLocation( Name ); if ( Location >= 0 ) { @@ -337,7 +337,7 @@ bool cShaderProgram::SetUniform( const std::string& Name, Vector3ff Value ) { return ( Location >= 0 ); } -bool cShaderProgram::SetUniform( const std::string& Name, float x, float y, float z, float w ) { +bool ShaderProgram::SetUniform( const std::string& Name, float x, float y, float z, float w ) { Int32 Location = UniformLocation( Name ); if ( Location >= 0 ) { @@ -349,7 +349,7 @@ bool cShaderProgram::SetUniform( const std::string& Name, float x, float y, floa return ( Location >= 0 ); } -bool cShaderProgram::SetUniform( const std::string& Name, Int32 Value ) { +bool ShaderProgram::SetUniform( const std::string& Name, Int32 Value ) { Int32 Location = UniformLocation( Name ); if ( Location >= 0 ) { @@ -361,7 +361,7 @@ bool cShaderProgram::SetUniform( const std::string& Name, Int32 Value ) { return ( Location >= 0 ); } -bool cShaderProgram::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 cShaderProgram::SetUniform( const Int32& Location, Int32 Value ) { return false; } -bool cShaderProgram::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 cShaderProgram::SetUniform( const Int32& Location, float Value ) { return false; } -bool cShaderProgram::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 cShaderProgram::SetUniform( const Int32& Location, Vector2ff Value ) { return false; } -bool cShaderProgram::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 cShaderProgram::SetUniform( const Int32& Location, Vector3ff Value ) { return false; } -bool cShaderProgram::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 cShaderProgram::SetUniform( const Int32& Location, float x, float y, float return false; } -bool cShaderProgram::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,7 +433,7 @@ bool cShaderProgram::SetUniformMatrix( const Int32& Location, const float * Valu return false; } -bool cShaderProgram::SetUniformMatrix( const std::string Name, const float * Value ) { +bool ShaderProgram::SetUniformMatrix( const std::string Name, const float * Value ) { Int32 Location = UniformLocation( Name ); if ( Location >= 0 ) { @@ -445,40 +445,40 @@ bool cShaderProgram::SetUniformMatrix( const std::string Name, const float * Val return ( Location >= 0 ); } -const std::string& cShaderProgram::Name() const { +const std::string& ShaderProgram::Name() const { return mName; } -void cShaderProgram::Name( const std::string& name ) { +void ShaderProgram::Name( const std::string& name ) { mName = name; mId = String::Hash( mName ); - Uint32 NameCount = cShaderProgramManager::instance()->Exists( mName ); + Uint32 NameCount = ShaderProgramManager::instance()->Exists( mName ); if ( 0 != NameCount || 0 == name.size() ) { Name( name + String::ToStr( NameCount + 1 ) ); } } -void cShaderProgram::SetReloadCb( ShaderProgramReloadCb Cb ) { +void ShaderProgram::SetReloadCb( ShaderProgramReloadCb Cb ) { mReloadCb = Cb; } -void cShaderProgram::EnableVertexAttribArray( const std::string& Name ) { +void ShaderProgram::EnableVertexAttribArray( const std::string& Name ) { EnableVertexAttribArray( AttributeLocation( Name ) ); } -void cShaderProgram::EnableVertexAttribArray( const Int32& Location ) { +void ShaderProgram::EnableVertexAttribArray( const Int32& Location ) { #ifdef EE_SHADERS_SUPPORTED glEnableVertexAttribArray( Location ); #endif } -void cShaderProgram::DisableVertexAttribArray( const std::string& Name ) { +void ShaderProgram::DisableVertexAttribArray( const std::string& Name ) { DisableVertexAttribArray( AttributeLocation( Name ) ); } -void cShaderProgram::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 new file mode 100644 index 000000000..7c099b5cb --- /dev/null +++ b/src/eepp/graphics/shaderprogrammanager.cpp @@ -0,0 +1,22 @@ +#include + +namespace EE { namespace Graphics { + +SINGLETON_DECLARE_IMPLEMENTATION(ShaderProgramManager) + +ShaderProgramManager::ShaderProgramManager() +{ +} + +ShaderProgramManager::~ShaderProgramManager() +{ +} + +void ShaderProgramManager::Reload() { + std::list::iterator it; + + for ( it = mResources.begin(); it != mResources.end(); it++ ) + (*it)->Reload(); +} + +}} diff --git a/src/eepp/graphics/csprite.cpp b/src/eepp/graphics/sprite.cpp similarity index 70% rename from src/eepp/graphics/csprite.cpp rename to src/eepp/graphics/sprite.cpp index 847cfac9b..6dbd7e341 100755 --- a/src/eepp/graphics/csprite.cpp +++ b/src/eepp/graphics/sprite.cpp @@ -1,7 +1,7 @@ -#include +#include #include -#include -#include +#include +#include #include using namespace EE::Window; @@ -10,7 +10,7 @@ using namespace EE::Window; namespace EE { namespace Graphics { -cSprite::cSprite() : +Sprite::Sprite() : mFlags( SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED ), mPos(), mAngle( 0.f ), @@ -31,7 +31,7 @@ cSprite::cSprite() : mCb.Reset(); } -cSprite::cSprite( const std::string& name, const std::string& extension, cTextureAtlas * SearchInTextureAtlas ) : +Sprite::Sprite( const std::string& name, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) : mFlags( SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED ), mPos(), mAngle( 0.f ), @@ -53,7 +53,7 @@ cSprite::cSprite( const std::string& name, const std::string& extension, cTextur AddFramesByPattern( name, extension, SearchInTextureAtlas ); } -cSprite::cSprite( cSubTexture * SubTexture ) : +Sprite::Sprite( SubTexture * SubTexture ) : mFlags( SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED ), mPos(), mAngle( 0.f ), @@ -75,7 +75,7 @@ cSprite::cSprite( cSubTexture * SubTexture ) : CreateStatic( SubTexture ); } -cSprite::cSprite( const Uint32& TexId, const Sizef &DestSize, const Vector2i &Offset, const Recti& TexSector ) : +Sprite::Sprite( const Uint32& TexId, const Sizef &DestSize, const Vector2i &Offset, const Recti& TexSector ) : mFlags( SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED ), mPos(), mAngle( 0.f ), @@ -97,11 +97,11 @@ cSprite::cSprite( const Uint32& TexId, const Sizef &DestSize, const Vector2i &Of CreateStatic( TexId, DestSize, Offset, TexSector ); } -cSprite::~cSprite() { +Sprite::~Sprite() { eeSAFE_DELETE_ARRAY( mVertexColors ); } -cSprite& cSprite::operator =( const cSprite& Other ) { +Sprite& Sprite::operator =( const Sprite& Other ) { mFrames = Other.mFrames; mFlags = Other.mFlags; mPos = Other.mPos; @@ -132,8 +132,8 @@ cSprite& cSprite::operator =( const cSprite& Other ) { return *this; } -cSprite * cSprite::Copy() { - cSprite * Spr = eeNew( cSprite, () ); +Sprite * Sprite::Copy() { + Sprite * Spr = eeNew( Sprite, () ); Spr->mFrames = mFrames; Spr->mFlags = mFlags; @@ -165,14 +165,14 @@ cSprite * cSprite::Copy() { return Spr; } -void cSprite::ClearFrame() { +void Sprite::ClearFrame() { for ( unsigned int i = 0; i < mFrames.size(); i++ ) mFrames[i].Spr.clear(); mFrames.clear(); } -void cSprite::Reset() { +void Sprite::Reset() { ClearFrame(); mFlags = SPRITE_FLAG_AUTO_ANIM | SPRITE_FLAG_EVENTS_ENABLED; @@ -196,7 +196,7 @@ void cSprite::Reset() { DisableVertexColors(); } -void cSprite::CurrentFrame ( unsigned int CurFrame ) { +void Sprite::CurrentFrame ( unsigned int CurFrame ) { if ( CurFrame ) CurFrame--; @@ -214,13 +214,13 @@ void cSprite::CurrentFrame ( unsigned int CurFrame ) { } } -void cSprite::CurrentSubFrame( const unsigned int& CurSubFrame ) { +void Sprite::CurrentSubFrame( const unsigned int& CurSubFrame ) { if ( CurSubFrame < mSubFrames ) mCurrentSubFrame = CurSubFrame; } -Quad2f cSprite::GetQuad() { - cSubTexture * S; +Quad2f Sprite::GetQuad() { + SubTexture * S; if ( mFrames.size() && ( S = GetCurrentSubTexture() ) ) { Rectf TmpR( mPos.x, @@ -276,9 +276,9 @@ Quad2f cSprite::GetQuad() { return Quad2f(); } -eeAABB cSprite::GetAABB() { +eeAABB Sprite::GetAABB() { eeAABB TmpR; - cSubTexture * S; + SubTexture * S; if ( mFrames.size() && ( S = GetCurrentSubTexture() ) ) { if ( mAngle != 0 || mEffect >= 4 ) { @@ -303,20 +303,20 @@ eeAABB cSprite::GetAABB() { return TmpR; } -const Vector2f cSprite::Position() const { +const Vector2f Sprite::Position() const { return mPos; } -void cSprite::Position(const Float& x, const Float& y) { +void Sprite::Position(const Float& x, const Float& y) { mPos.x = x; mPos.y = y; } -void cSprite::Position( const Vector2f& NewPos ) { +void Sprite::Position( const Vector2f& NewPos ) { mPos = NewPos; } -void cSprite::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,16 +326,16 @@ void cSprite::UpdateVertexColors( const ColorA& Color0, const ColorA& Color1, co mVertexColors[3] = Color3; } -void cSprite::DisableVertexColors() { +void Sprite::DisableVertexColors() { eeSAFE_DELETE_ARRAY( mVertexColors ); } -unsigned int cSprite::FramePos() { +unsigned int Sprite::FramePos() { mFrames.push_back( cFrame() ); return (unsigned int)mFrames.size() - 1; } -bool cSprite::CreateStatic( cSubTexture * SubTexture ) { +bool Sprite::CreateStatic( SubTexture * SubTexture ) { Reset(); AddFrame( SubTexture ); @@ -343,8 +343,8 @@ bool cSprite::CreateStatic( cSubTexture * SubTexture ) { return true; } -bool cSprite::CreateStatic( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector ) { - if ( cTextureFactory::instance()->TextureIdExists( TexId ) ) { +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 ); @@ -355,7 +355,7 @@ bool cSprite::CreateStatic( const Uint32& TexId, const Sizef& DestSize, const Ve return false; } -void cSprite::CreateAnimation( const unsigned int& SubFramesNum ) { +void Sprite::CreateAnimation( const unsigned int& SubFramesNum ) { Reset(); if ( SubFramesNum < 1 ) @@ -364,7 +364,7 @@ void cSprite::CreateAnimation( const unsigned int& SubFramesNum ) { mSubFrames = SubFramesNum; } -bool cSprite::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] ) { @@ -378,8 +378,8 @@ bool cSprite::AddFrames( const std::vector SubTextures ) { return false; } -bool cSprite::AddFramesByPatternId( const Uint32& SubTextureId, const std::string& extension, cTextureAtlas * SearchInTextureAtlas ) { - std::vector SubTextures = cTextureAtlasManager::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 ); @@ -387,13 +387,13 @@ bool cSprite::AddFramesByPatternId( const Uint32& SubTextureId, const std::strin return true; } - eePRINTL( "cSprite::AddFramesByPatternId: Couldn't find any pattern with Id: %d", SubTextureId ); + eePRINTL( "Sprite::AddFramesByPatternId: Couldn't find any pattern with Id: %d", SubTextureId ); return false; } -bool cSprite::AddFramesByPattern( const std::string& name, const std::string& extension, cTextureAtlas * SearchInTextureAtlas ) { - std::vector SubTextures = cTextureAtlasManager::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 ); @@ -401,12 +401,12 @@ bool cSprite::AddFramesByPattern( const std::string& name, const std::string& ex return true; } - eePRINTL( "cSprite::AddFramesByPattern: Couldn't find any pattern with: %s", name.c_str() ); + eePRINTL( "Sprite::AddFramesByPattern: Couldn't find any pattern with: %s", name.c_str() ); return false; } -bool cSprite::AddSubFrame( cSubTexture * 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,7 +431,7 @@ bool cSprite::AddSubFrame( cSubTexture * SubTexture, const unsigned int& NumFram return false; } -unsigned int cSprite::AddFrame( cSubTexture * SubTexture ) { +unsigned int Sprite::AddFrame( SubTexture * SubTexture ) { unsigned int id = FramePos(); AddSubFrame( SubTexture, id, mCurrentSubFrame ); @@ -439,7 +439,7 @@ unsigned int cSprite::AddFrame( cSubTexture * SubTexture ) { return id; } -unsigned int cSprite::AddFrame( const Uint32& TexId, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector ) { +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 ) ) @@ -448,12 +448,12 @@ unsigned int cSprite::AddFrame( const Uint32& TexId, const Sizef& DestSize, cons return 0; } -bool cSprite::AddSubFrame(const Uint32& TexId, const unsigned int& NumFrame, const unsigned int& NumSubFrame, const Sizef& DestSize, const Vector2i& Offset, const Recti& TexSector) { - if ( !cTextureFactory::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; - cTexture * Tex = cTextureFactory::instance()->GetTexture( TexId ); - cSubTexture * S = cGlobalTextureAtlas::instance()->Add( eeNew( cSubTexture, () ) ); + Texture * Tex = TextureFactory::instance()->GetTexture( TexId ); + SubTexture * S = GlobalTextureAtlas::instance()->Add( eeNew( SubTexture, () ) ); S->Texture( TexId ); @@ -480,11 +480,11 @@ bool cSprite::AddSubFrame(const Uint32& TexId, const unsigned int& NumFrame, con return true; } -void cSprite::Update() { +void Sprite::Update() { Update( Engine::instance()->Elapsed() ); } -void cSprite::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; @@ -560,7 +560,7 @@ void cSprite::Update( const Time& ElapsedTime ) { } } -unsigned int cSprite::GetEndFrame() { +unsigned int Sprite::GetEndFrame() { if ( SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) ) { return 0; } else { @@ -568,7 +568,7 @@ unsigned int cSprite::GetEndFrame() { } } -void cSprite::SetReverseFromStart() { +void Sprite::SetReverseFromStart() { if ( !SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ) ) mFlags |= SPRITE_FLAG_REVERSE_ANIM; @@ -578,11 +578,11 @@ void cSprite::SetReverseFromStart() { mCurrentFrame = Size; } -void cSprite::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(); - cSubTexture * S = GetCurrentSubTexture(); + SubTexture * S = GetCurrentSubTexture(); if ( S == NULL ) return; @@ -593,19 +593,19 @@ void cSprite::Draw( const EE_BLEND_MODE& Blend, const EE_RENDER_MODE& Effect ) { S->Draw( mPos.x, mPos.y, mAngle, mScale, mVertexColors[0], mVertexColors[1], mVertexColors[2], mVertexColors[3], Blend, Effect, mOrigin ); } -void cSprite::Draw() { +void Sprite::Draw() { Draw( mBlend, mEffect ); } -void cSprite::Draw( const EE_BLEND_MODE& Blend ) { +void Sprite::Draw( const EE_BLEND_MODE& Blend ) { Draw( Blend, mEffect ); } -void cSprite::Draw( const EE_RENDER_MODE& Effect ) { +void Sprite::Draw( const EE_RENDER_MODE& Effect ) { Draw( mBlend, Effect ); } -unsigned int cSprite::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 cSprite::GetFrame( const unsigned int& FrameNum ) { return FN; } -unsigned int cSprite::GetSubFrame( const unsigned int& SubFrame ) { +unsigned int Sprite::GetSubFrame( const unsigned int& SubFrame ) { unsigned int SFN; if ( SubFrame >= mSubFrames ) @@ -627,8 +627,8 @@ unsigned int cSprite::GetSubFrame( const unsigned int& SubFrame ) { return SFN; } -Vector2i cSprite::Offset() { - cSubTexture* S = GetCurrentSubTexture(); +Vector2i Sprite::Offset() { + SubTexture* S = GetCurrentSubTexture(); if ( S != NULL ) return S->Offset(); @@ -636,35 +636,35 @@ Vector2i cSprite::Offset() { return Vector2i(); } -void cSprite::Offset( const Vector2i& offset ) { - cSubTexture* S = GetCurrentSubTexture(); +void Sprite::Offset( const Vector2i& offset ) { + SubTexture* S = GetCurrentSubTexture(); if ( S != NULL ) { S->Offset( offset ); } } -void cSprite::Size( const Sizef& Size, const unsigned int& FrameNum, const unsigned int& SubFrame ) { +void Sprite::Size( const Sizef& Size, const unsigned int& FrameNum, const unsigned int& SubFrame ) { mFrames[ GetFrame(FrameNum) ].Spr[ GetSubFrame(SubFrame) ]->DestSize( Size ); } -void cSprite::Size( const Sizef& Size ) { +void Sprite::Size( const Sizef& Size ) { mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->DestSize( Size ); } -Sizef cSprite::Size( const unsigned int& FrameNum, const unsigned int& SubFrame ) { +Sizef Sprite::Size( const unsigned int& FrameNum, const unsigned int& SubFrame ) { return mFrames[ GetFrame(FrameNum) ].Spr[ GetSubFrame(SubFrame) ]->DestSize(); } -Sizef cSprite::Size() { +Sizef Sprite::Size() { return mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]->DestSize(); } -void cSprite::SetRepeations( const int& Repeations ) { +void Sprite::SetRepeations( const int& Repeations ) { mRepeations = Repeations; } -void cSprite::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 cSprite::AutoAnimate( const bool& Autoanim ) { } -bool cSprite::AutoAnimate() const { +bool Sprite::AutoAnimate() const { return 0 != SPR_FGET( SPRITE_FLAG_AUTO_ANIM ); } -cSubTexture* cSprite::GetCurrentSubTexture() { +SubTexture* Sprite::GetCurrentSubTexture() { if ( mFrames.size() ) return mFrames[ mCurrentFrame ].Spr[ mCurrentSubFrame ]; return NULL; } -cSubTexture * cSprite::GetSubTexture( const unsigned int& frame ) { +SubTexture * Sprite::GetSubTexture( const unsigned int& frame ) { if ( frame < mFrames.size() ) return mFrames[ frame ].Spr[ mCurrentSubFrame ]; return NULL; } -cSubTexture * cSprite::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 cSprite::X( const Float& X ) { +void Sprite::X( const Float& X ) { mPos.x = X; } -Float cSprite::X() const { +Float Sprite::X() const { return mPos.x; } -void cSprite::Y( const Float& Y ) { +void Sprite::Y( const Float& Y ) { mPos.y = Y; } -Float cSprite::Y() const { +Float Sprite::Y() const { return mPos.y; } -void cSprite::Angle( const Float& Angle) { +void Sprite::Angle( const Float& Angle) { mAngle = Angle; } -Float cSprite::Angle() const { +Float Sprite::Angle() const { return mAngle; } -void cSprite::Scale( const Float& Scale ) { +void Sprite::Scale( const Float& Scale ) { this->Scale( Vector2f( Scale, Scale ) ); } -void cSprite::Scale( const Vector2f& Scale ) { +void Sprite::Scale( const Vector2f& Scale ) { mScale = Scale; } -const Vector2f& cSprite::Scale() const { +const Vector2f& Sprite::Scale() const { return mScale; } -void cSprite::AnimSpeed( const Float& AnimSpeed ) { +void Sprite::AnimSpeed( const Float& AnimSpeed ) { mAnimSpeed = AnimSpeed; } -Float cSprite::AnimSpeed() const { +Float Sprite::AnimSpeed() const { return mAnimSpeed; } -bool cSprite::AnimPaused() const { +bool Sprite::AnimPaused() const { return 0 != SPR_FGET( SPRITE_FLAG_ANIM_PAUSED ); } -void cSprite::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 cSprite::AnimPaused( const bool& Pause ) { } } -void cSprite::Color( const ColorA& Color) { +void Sprite::Color( const ColorA& Color) { mColor = Color; } -const ColorA& cSprite::Color() const { +const ColorA& Sprite::Color() const { return mColor; } -void cSprite::Alpha( const Uint8& Alpha ) { +void Sprite::Alpha( const Uint8& Alpha ) { mColor.Alpha = Alpha; } -const Uint8& cSprite::Alpha() const { +const Uint8& Sprite::Alpha() const { return mColor.Alpha; } -const unsigned int& cSprite::CurrentFrame() const { +const unsigned int& Sprite::CurrentFrame() const { return mCurrentFrame; } -const Float& cSprite::ExactCurrentFrame() const { +const Float& Sprite::ExactCurrentFrame() const { return mfCurrentFrame; } -void cSprite::ExactCurrentFrame( const Float& CurrentFrame ) { +void Sprite::ExactCurrentFrame( const Float& CurrentFrame ) { mfCurrentFrame = CurrentFrame; } -const unsigned int& cSprite::CurrentSubFrame() const { +const unsigned int& Sprite::CurrentSubFrame() const { return mCurrentSubFrame; } -void cSprite::RenderMode( const EE_RENDER_MODE& Effect ) { +void Sprite::RenderMode( const EE_RENDER_MODE& Effect ) { mEffect = Effect; } -const EE_RENDER_MODE& cSprite::RenderMode() const { +const EE_RENDER_MODE& Sprite::RenderMode() const { return mEffect; } -void cSprite::BlendMode( const EE_BLEND_MODE& Blend ) { +void Sprite::BlendMode( const EE_BLEND_MODE& Blend ) { mBlend = Blend; } -const EE_BLEND_MODE& cSprite::BlendMode() const { +const EE_BLEND_MODE& Sprite::BlendMode() const { return mBlend; } -void cSprite::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 cSprite::ReverseAnim( const bool& Reverse ) { } } -bool cSprite::ReverseAnim() const { +bool Sprite::ReverseAnim() const { return 0 != SPR_FGET( SPRITE_FLAG_REVERSE_ANIM ); } -Uint32 cSprite::GetNumFrames() { +Uint32 Sprite::GetNumFrames() { return (Uint32)mFrames.size(); } -void cSprite::GoToAndPlay( Uint32 GoTo ) { +void Sprite::GoToAndPlay( Uint32 GoTo ) { if ( GoTo ) GoTo--; @@ -836,12 +836,12 @@ void cSprite::GoToAndPlay( Uint32 GoTo ) { } } -void cSprite::GoToAndStop( Uint32 GoTo ) { +void Sprite::GoToAndStop( Uint32 GoTo ) { GoToAndPlay( GoTo ); AnimPaused( true ); } -void cSprite::AnimToFrameAndStop( Uint32 GoTo ) { +void Sprite::AnimToFrameAndStop( Uint32 GoTo ) { if ( GoTo ) GoTo--; @@ -854,30 +854,30 @@ void cSprite::AnimToFrameAndStop( Uint32 GoTo ) { } } -void cSprite::SetEventsCallback(const SpriteCallback& Cb , void * UserData ) { +void Sprite::SetEventsCallback(const SpriteCallback& Cb , void * UserData ) { mCb = Cb; mUserData = UserData; } -void cSprite::ClearCallback() { +void Sprite::ClearCallback() { mCb.Reset(); } -void cSprite::FireEvent( const Uint32& Event ) { +void Sprite::FireEvent( const Uint32& Event ) { if ( SPR_FGET( SPRITE_FLAG_EVENTS_ENABLED ) && mCb.IsSet() ) { mCb( Event, this, mUserData ); } } -void cSprite::Origin( const OriginPoint& origin ) { +void Sprite::Origin( const OriginPoint& origin ) { mOrigin = origin; } -const OriginPoint& cSprite:: Origin() const { +const OriginPoint& Sprite:: Origin() const { return mOrigin; } -void cSprite::Rotate( const Float& angle ) { +void Sprite::Rotate( const Float& angle ) { mAngle += angle; } diff --git a/src/eepp/graphics/csubtexture.cpp b/src/eepp/graphics/subtexture.cpp similarity index 68% rename from src/eepp/graphics/csubtexture.cpp rename to src/eepp/graphics/subtexture.cpp index dadbec1b1..301a512e6 100644 --- a/src/eepp/graphics/csubtexture.cpp +++ b/src/eepp/graphics/subtexture.cpp @@ -1,14 +1,14 @@ -#include -#include -#include +#include +#include +#include #include #include -#include +#include using namespace EE::Graphics::Private; namespace EE { namespace Graphics { -cSubTexture::cSubTexture() : +SubTexture::SubTexture() : mPixels(NULL), mAlpha(NULL), mId(0), @@ -21,13 +21,13 @@ cSubTexture::cSubTexture() : CreateUnnamed(); } -cSubTexture::cSubTexture( const Uint32& TexId, const std::string& Name ) : +SubTexture::SubTexture( const Uint32& TexId, const std::string& Name ) : mPixels(NULL), mAlpha(NULL), mName( Name ), mId( String::Hash( mName ) ), mTexId( TexId ), - mTexture( cTextureFactory::instance()->GetTexture( TexId ) ), + 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) @@ -35,13 +35,13 @@ cSubTexture::cSubTexture( const Uint32& TexId, const std::string& Name ) : CreateUnnamed(); } -cSubTexture::cSubTexture( const Uint32& TexId, const Recti& SrcRect, const std::string& Name ) : +SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const std::string& Name ) : mPixels(NULL), mAlpha(NULL), mName( Name ), mId( String::Hash( mName ) ), mTexId( TexId ), - mTexture( cTextureFactory::instance()->GetTexture( TexId ) ), + mTexture( TextureFactory::instance()->GetTexture( TexId ) ), mSrcRect( SrcRect ), mDestSize( (Float)( mSrcRect.Right - mSrcRect.Left ), (Float)( mSrcRect.Bottom - mSrcRect.Top ) ), mOffset(0,0) @@ -49,13 +49,13 @@ cSubTexture::cSubTexture( const Uint32& TexId, const Recti& SrcRect, const std:: CreateUnnamed(); } -cSubTexture::cSubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name ) : +SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name ) : mPixels(NULL), mAlpha(NULL), mName( Name ), mId( String::Hash( mName ) ), mTexId( TexId ), - mTexture( cTextureFactory::instance()->GetTexture( TexId ) ), + mTexture( TextureFactory::instance()->GetTexture( TexId ) ), mSrcRect(SrcRect), mDestSize(DestSize), mOffset(0,0) @@ -63,13 +63,13 @@ cSubTexture::cSubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef CreateUnnamed(); } -cSubTexture::cSubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i &Offset, const std::string& Name ) : +SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i &Offset, const std::string& Name ) : mPixels(NULL), mAlpha(NULL), mName( Name ), mId( String::Hash( mName ) ), mTexId( TexId ), - mTexture( cTextureFactory::instance()->GetTexture( TexId ) ), + mTexture( TextureFactory::instance()->GetTexture( TexId ) ), mSrcRect(SrcRect), mDestSize(DestSize), mOffset(Offset) @@ -77,42 +77,42 @@ cSubTexture::cSubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef CreateUnnamed(); } -cSubTexture::~cSubTexture() { +SubTexture::~SubTexture() { ClearCache(); } -void cSubTexture::CreateUnnamed() { +void SubTexture::CreateUnnamed() { if ( !mName.size() ) Name( std::string( "unnamed" ) ); } -const Uint32& cSubTexture::Id() const { +const Uint32& SubTexture::Id() const { return mId; } -const std::string cSubTexture::Name() const { +const std::string SubTexture::Name() const { return mName; } -void cSubTexture::Name( const std::string& name ) { +void SubTexture::Name( const std::string& name ) { mName = name; mId = String::Hash( mName ); } -const Uint32& cSubTexture::Texture() { +const Uint32& SubTexture::Texture() { return mTexId; } -void cSubTexture::Texture( const Uint32& TexId ) { +void SubTexture::Texture( const Uint32& TexId ) { mTexId = TexId; - mTexture = cTextureFactory::instance()->GetTexture( TexId ); + mTexture = TextureFactory::instance()->GetTexture( TexId ); } -const Recti& cSubTexture::SrcRect() const { +const Recti& SubTexture::SrcRect() const { return mSrcRect; } -void cSubTexture::SrcRect( const Recti& Rect ) { +void SubTexture::SrcRect( const Recti& Rect ) { mSrcRect = Rect; if ( NULL != mPixels ) @@ -122,42 +122,42 @@ void cSubTexture::SrcRect( const Recti& Rect ) { CacheAlphaMask(); } -const Sizef& cSubTexture::DestSize() const { +const Sizef& SubTexture::DestSize() const { return mDestSize; } -void cSubTexture::DestSize( const Sizef& destSize ) { +void SubTexture::DestSize( const Sizef& destSize ) { mDestSize = destSize; } -const Vector2i& cSubTexture::Offset() const { +const Vector2i& SubTexture::Offset() const { return mOffset; } -void cSubTexture::Offset( const Vector2i& offset ) { +void SubTexture::Offset( const Vector2i& offset ) { mOffset = offset; } -void cSubTexture::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 ); } -void cSubTexture::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 ); } -void cSubTexture::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 ); } -cTexture * cSubTexture::GetTexture() { +Graphics::Texture * SubTexture::GetTexture() { return mTexture; } -void cSubTexture::ReplaceColor( ColorA ColorKey, ColorA NewColor ) { +void SubTexture::ReplaceColor( ColorA ColorKey, ColorA NewColor ) { mTexture->Lock(); for ( int y = mSrcRect.Top; y < mSrcRect.Bottom; y++ ) { @@ -170,15 +170,15 @@ void cSubTexture::ReplaceColor( ColorA ColorKey, ColorA NewColor ) { mTexture->Unlock( false, true ); } -void cSubTexture::CreateMaskFromColor(ColorA ColorKey, Uint8 Alpha) { +void SubTexture::CreateMaskFromColor(ColorA ColorKey, Uint8 Alpha) { ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) ); } -void cSubTexture::CreateMaskFromColor(RGB ColorKey, Uint8 Alpha) { +void SubTexture::CreateMaskFromColor(RGB ColorKey, Uint8 Alpha) { CreateMaskFromColor( ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), 255 ), Alpha ); } -void cSubTexture::CacheAlphaMask() { +void SubTexture::CacheAlphaMask() { Uint32 size = ( mSrcRect.Right - mSrcRect.Left ) * ( mSrcRect.Bottom - mSrcRect.Top ); eeSAFE_DELETE_ARRAY( mAlpha ); @@ -203,7 +203,7 @@ void cSubTexture::CacheAlphaMask() { mTexture->Unlock(); } -void cSubTexture::CacheColors() { +void SubTexture::CacheColors() { mTexture->Lock(); Uint32 size = ( mSrcRect.Right - mSrcRect.Left ) * ( mSrcRect.Bottom - mSrcRect.Top ) * mTexture->Channels(); @@ -239,7 +239,7 @@ void cSubTexture::CacheColors() { mTexture->Unlock(); } -Uint8 cSubTexture::GetAlphaAt( const Int32& X, const Int32& Y ) { +Uint8 SubTexture::GetAlphaAt( const Int32& X, const Int32& Y ) { if ( mTexture->LocalCopy() ) return mTexture->GetPixel( mSrcRect.Left + X, mSrcRect.Right + Y ).A(); @@ -254,7 +254,7 @@ Uint8 cSubTexture::GetAlphaAt( const Int32& X, const Int32& Y ) { return GetAlphaAt( X, Y ); } -ColorA cSubTexture::GetColorAt( const Int32& X, const Int32& Y ) { +ColorA SubTexture::GetColorAt( const Int32& X, const Int32& Y ) { if ( mTexture->LocalCopy() ) return mTexture->GetPixel( mSrcRect.Left + X, mSrcRect.Right + Y ); @@ -277,7 +277,7 @@ ColorA cSubTexture::GetColorAt( const Int32& X, const Int32& Y ) { return GetColorAt( X, Y ); } -void cSubTexture::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(); unsigned int Pos = ( X + Y * ( mSrcRect.Right - mSrcRect.Left ) ) * Channels; @@ -292,21 +292,21 @@ void cSubTexture::SetColorAt( const Int32& X, const Int32& Y, const ColorA& Colo } } -void cSubTexture::ClearCache() { +void SubTexture::ClearCache() { eeSAFE_DELETE_ARRAY( mPixels ); eeSAFE_DELETE_ARRAY( mAlpha ); } -Uint8 * cSubTexture::Lock() { +Uint8 * SubTexture::Lock() { CacheColors(); return &mPixels[0]; } -bool cSubTexture::Unlock( const bool& KeepData, const bool& Modified ) { +bool SubTexture::Unlock( const bool& KeepData, const bool& Modified ) { if ( NULL != mPixels && NULL != mTexture ) { if ( Modified ) { - cTextureSaver saver( mTexture->Handle() ); + TextureSaver saver( mTexture->Handle() ); Uint32 Channels = mTexture->Channels(); Uint32 Channel = GL_RGBA; @@ -331,15 +331,15 @@ bool cSubTexture::Unlock( const bool& KeepData, const bool& Modified ) { return false; } -Sizei cSubTexture::RealSize() { +Sizei SubTexture::RealSize() { return mSrcRect.Size(); } -Sizei cSubTexture::Size() { +Sizei SubTexture::Size() { return Sizei( (Int32)mDestSize.x, (Int32)mDestSize.y ); } -const Uint8* cSubTexture::GetPixelsPtr() { +const Uint8* SubTexture::GetPixelsPtr() { if ( mPixels == NULL ) { Lock(); Unlock(true); @@ -348,7 +348,7 @@ const Uint8* cSubTexture::GetPixelsPtr() { return reinterpret_cast (&mPixels[0]); } -bool cSubTexture::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(); @@ -358,7 +358,7 @@ bool cSubTexture::SaveToFile(const std::string& filepath, const EE_SAVE_TYPE& Fo Res = 0 != ( SOIL_save_image ( filepath.c_str(), Format, RealSize().Width(), RealSize().Height(), mTexture->Channels(), GetPixelsPtr() ) ); } else { jpge::params params; - params.m_quality = cImage::JpegQuality(); + params.m_quality = Image::JpegQuality(); Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), RealSize().Width(), RealSize().Height(), mTexture->Channels(), GetPixelsPtr(), params); } } @@ -368,7 +368,7 @@ bool cSubTexture::SaveToFile(const std::string& filepath, const EE_SAVE_TYPE& Fo return Res; } -void cSubTexture::ResetDestSize() { +void SubTexture::ResetDestSize() { Sizei Size = mSrcRect.Size(); mDestSize.x = (Float)Size.Width(); mDestSize.y = (Float)Size.Height(); diff --git a/src/eepp/graphics/ctextcache.cpp b/src/eepp/graphics/textcache.cpp similarity index 66% rename from src/eepp/graphics/ctextcache.cpp rename to src/eepp/graphics/textcache.cpp index c8b29fccf..216af9fe9 100644 --- a/src/eepp/graphics/ctextcache.cpp +++ b/src/eepp/graphics/textcache.cpp @@ -1,11 +1,11 @@ -#include -#include -#include -#include +#include +#include +#include +#include namespace EE { namespace Graphics { -cTextCache::cTextCache() : +TextCache::TextCache() : mFont(NULL), mCachedWidth(0.f), mNumLines(1), @@ -18,7 +18,7 @@ cTextCache::cTextCache() : { } -cTextCache::cTextCache( cFont * font, const String& text, ColorA FontColor, ColorA FontShadowColor ) : +TextCache::TextCache( Graphics::Font * font, const String& text, ColorA FontColor, ColorA FontShadowColor ) : mText( text ), mFont( font ), mCachedWidth(0.f), @@ -34,10 +34,10 @@ cTextCache::cTextCache( cFont * font, const String& text, ColorA FontColor, Colo ShadowColor( FontShadowColor ); } -cTextCache::~cTextCache() { +TextCache::~TextCache() { } -void cTextCache::Create( cFont * 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(); @@ -46,27 +46,27 @@ void cTextCache::Create( cFont * font, const String& text, ColorA FontColor, Col Cache(); } -cFont * cTextCache::Font() const { +Graphics::Font * TextCache::Font() const { return mFont; } -void cTextCache::Font( cFont * font ) { +void TextCache::Font( Graphics::Font * font ) { mFont = font; Cache(); } -String& cTextCache::Text() { +String& TextCache::Text() { return mText; } -void cTextCache::UpdateCoords() { +void TextCache::UpdateCoords() { Uint32 size = (Uint32)mText.size() * GLi->QuadVertexs(); mRenderCoords.resize( size ); mColors.resize( size, mFontColor ); } -void cTextCache::Text( const String& text ) { +void TextCache::Text( const String& text ) { bool needUpdate = false; if ( mText.size() != text.size() ) @@ -80,18 +80,18 @@ void cTextCache::Text( const String& text ) { Cache(); } -const ColorA& cTextCache::Color() const { +const ColorA& TextCache::Color() const { return mFontColor; } -void cTextCache::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 cTextCache::Color( const ColorA& color ) { +void TextCache::Color( const ColorA& color ) { if ( mFontColor != color ) { mFontColor = color; @@ -99,7 +99,7 @@ void cTextCache::Color( const ColorA& color ) { } } -void cTextCache::Color( const ColorA& color, Uint32 from, Uint32 to ) { +void TextCache::Color( const ColorA& color, Uint32 from, Uint32 to ) { std::vector colors( GLi->QuadVertexs(), color ); std::size_t s = mText.size(); @@ -144,23 +144,23 @@ void cTextCache::Color( const ColorA& color, Uint32 from, Uint32 to ) { } } -const ColorA& cTextCache::ShadowColor() const { +const ColorA& TextCache::ShadowColor() const { return mFontShadowColor; } -void cTextCache::ShadowColor(const ColorA& color) { +void TextCache::ShadowColor(const ColorA& color) { mFontShadowColor = color; } -std::vector& cTextCache::VertextCoords() { +std::vector& TextCache::VertextCoords() { return mRenderCoords; } -std::vector& cTextCache::Colors() { +std::vector& TextCache::Colors() { return mColors; } -void cTextCache::Cache() { +void TextCache::Cache() { if ( NULL != mFont && mText.size() ) { mFont->CacheWidth( mText, mLinesWidth, mCachedWidth, mNumLines, mLargestLineCharCount ); }else { @@ -170,25 +170,25 @@ void cTextCache::Cache() { mCachedCoords = false; } -Float cTextCache::GetTextWidth() { +Float TextCache::GetTextWidth() { return ( mFlags & FONT_DRAW_VERTICAL ) ? (Float)mFont->GetFontHeight() * (Float)mNumLines : mCachedWidth; } -Float cTextCache::GetTextHeight() { +Float TextCache::GetTextHeight() { return ( mFlags & FONT_DRAW_VERTICAL ) ? mLargestLineCharCount * (Float)mFont->GetFontHeight() : (Float)mFont->GetFontHeight() * (Float)mNumLines; } -const int& cTextCache::GetNumLines() const { +const int& TextCache::GetNumLines() const { return mNumLines; } -const std::vector& cTextCache::LinesWidth() { +const std::vector& TextCache::LinesWidth() { return mLinesWidth; } -void cTextCache::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 ) { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); if ( Angle != 0.0f || Scale != 1.0f ) { mFont->Draw( *this, X, Y, mFlags, Scale, Angle, Effect ); @@ -202,23 +202,23 @@ void cTextCache::Draw( const Float& X, const Float& Y, const Vector2f& Scale, co } } -const bool& cTextCache::CachedCoords() const { +const bool& TextCache::CachedCoords() const { return mCachedCoords; } -void cTextCache::CachedCoords( const bool& cached ) { +void TextCache::CachedCoords( const bool& cached ) { mCachedCoords = cached; } -const unsigned int& cTextCache::CachedVerts() const { +const unsigned int& TextCache::CachedVerts() const { return mVertexNumCached; } -void cTextCache::CachedVerts( const unsigned int& num ) { +void TextCache::CachedVerts( const unsigned int& num ) { mVertexNumCached = num; } -void cTextCache::Flags( const Uint32& flags ) { +void TextCache::Flags( const Uint32& flags ) { if ( mFlags != flags ) { mFlags = flags; mCachedCoords = false; @@ -229,7 +229,7 @@ void cTextCache::Flags( const Uint32& flags ) { } } -const Uint32& cTextCache::Flags() const { +const Uint32& TextCache::Flags() const { return mFlags; } diff --git a/src/eepp/graphics/ctexture.cpp b/src/eepp/graphics/texture.cpp similarity index 75% rename from src/eepp/graphics/ctexture.cpp rename to src/eepp/graphics/texture.cpp index 662b6ecd9..778b76adc 100755 --- a/src/eepp/graphics/ctexture.cpp +++ b/src/eepp/graphics/texture.cpp @@ -1,19 +1,19 @@ -#include -#include -#include +#include +#include +#include #include #include -#include +#include #include -#include +#include using namespace EE::Graphics::Private; namespace EE { namespace Graphics { -static cBatchRenderer * sBR = NULL; +static BatchRenderer * sBR = NULL; -cTexture::cTexture() : - cImage(), +Texture::Texture() : + Image(), mFilepath(""), mId(0), mTexture(0), @@ -24,12 +24,12 @@ cTexture::cTexture() : mFilter( TEX_FILTER_LINEAR ) { if ( NULL == sBR ) { - sBR = cGlobalBatchRenderer::instance(); + sBR = GlobalBatchRenderer::instance(); } } -cTexture::cTexture( const cTexture& Copy ) : - cImage(), +Texture::Texture( const Texture& Copy ) : + Image(), mFilepath( Copy.mFilepath ), mId( Copy.mId ), mTexture( Copy.mTexture ), @@ -47,15 +47,15 @@ cTexture::cTexture( const cTexture& Copy ) : SetPixels( reinterpret_cast( &Copy.mPixels[0] ) ); } -cTexture::~cTexture() { +Texture::~Texture() { DeleteTexture(); - if ( !cTextureFactory::instance()->IsErasing() ) { - cTextureFactory::instance()->RemoveReference( this ); + if ( !TextureFactory::instance()->IsErasing() ) { + TextureFactory::instance()->RemoveReference( this ); } } -void cTexture::DeleteTexture() { +void Texture::DeleteTexture() { if ( mTexture ) { unsigned int Texture = static_cast(mTexture); glDeleteTextures(1, &Texture); @@ -67,11 +67,11 @@ void cTexture::DeleteTexture() { } } -cTexture::cTexture( 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 ) { +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 ); } -void cTexture::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; @@ -93,13 +93,13 @@ void cTexture::Create( const Uint32& texture, const unsigned int& width, const u SetPixels( data ); } -Uint8 * cTexture::iLock( const bool& ForceRGBA, const bool& KeepFormat ) { +Uint8 * Texture::iLock( const bool& ForceRGBA, const bool& KeepFormat ) { #ifndef EE_GLES if ( !( mFlags & TEX_FLAG_LOCKED ) ) { if ( ForceRGBA ) mChannels = 4; - cTextureSaver saver( mTexture ); + TextureSaver saver( mTexture ); Int32 width = 0, height = 0; glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width ); @@ -140,18 +140,18 @@ Uint8 * cTexture::iLock( const bool& ForceRGBA, const bool& KeepFormat ) { #endif } -Uint8 * cTexture::Lock( const bool& ForceRGBA ) { +Uint8 * Texture::Lock( const bool& ForceRGBA ) { return iLock( ForceRGBA, false ); } -bool cTexture::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; unsigned int NTexId = 0; if ( Modified || ( mFlags & TEX_FLAG_MODIFIED ) ) { - cTextureSaver saver( mTexture ); + TextureSaver saver( mTexture ); Uint32 flags = ( mFlags & TEX_FLAG_MIPMAP ) ? SOIL_FLAG_MIPMAPS : 0; flags = (mClampMode == CLAMP_REPEAT) ? (flags | SOIL_FLAG_TEXTURE_REPEATS) : flags; @@ -181,32 +181,32 @@ bool cTexture::Unlock( const bool& KeepData, const bool& Modified ) { #endif } -const Uint8 * cTexture::GetPixelsPtr() { +const Uint8 * Texture::GetPixelsPtr() { if ( !LocalCopy() ) { Lock(); Unlock(true); } - return cImage::GetPixelsPtr(); + return Image::GetPixelsPtr(); } -void cTexture::SetPixel( const unsigned int& x, const unsigned int& y, const ColorA& Color ) { - cImage::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 cTexture::Bind() { - cTextureFactory::instance()->Bind( this ); +void Texture::Bind() { + TextureFactory::instance()->Bind( this ); } -bool cTexture::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(); - Res = cImage::SaveToFile( filepath, Format ); + Res = Image::SaveToFile( filepath, Format ); Unlock(); } @@ -214,17 +214,17 @@ bool cTexture::SaveToFile( const std::string& filepath, const EE_SAVE_TYPE& Form return Res; } -void cTexture::Filter(const EE_TEX_FILTER& filter) { +void Texture::Filter(const EE_TEX_FILTER& filter) { if ( mFilter != filter ) { iTextureFilter( filter ); } } -void cTexture::iTextureFilter( const EE_TEX_FILTER& filter ) { +void Texture::iTextureFilter( const EE_TEX_FILTER& filter ) { if (mTexture) { mFilter = filter; - cTextureSaver saver( mTexture ); + TextureSaver saver( mTexture ); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (mFilter == TEX_FILTER_LINEAR) ? GL_LINEAR : GL_NEAREST); @@ -235,62 +235,62 @@ void cTexture::iTextureFilter( const EE_TEX_FILTER& filter ) { } } -const EE_TEX_FILTER& cTexture::Filter() const { +const EE_TEX_FILTER& Texture::Filter() const { return mFilter; } -void cTexture::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { +void Texture::ReplaceColor( const ColorA& ColorKey, const ColorA& NewColor ) { Lock(); - cImage::ReplaceColor( ColorKey, NewColor ); + Image::ReplaceColor( ColorKey, NewColor ); Unlock( false, true ); } -void cTexture::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { +void Texture::CreateMaskFromColor( const ColorA& ColorKey, Uint8 Alpha ) { Lock( true ); - cImage::ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) ); + Image::ReplaceColor( ColorKey, ColorA( ColorKey.R(), ColorKey.G(), ColorKey.B(), Alpha ) ); Unlock( false, true ); } -void cTexture::FillWithColor( const ColorA& Color ) { +void Texture::FillWithColor( const ColorA& Color ) { Lock(); - cImage::FillWithColor( Color ); + Image::FillWithColor( Color ); Unlock( false, true ); } -void cTexture::Resize( const Uint32& newWidth, const Uint32& newHeight , EE_RESAMPLER_FILTER filter ) { +void Texture::Resize( const Uint32& newWidth, const Uint32& newHeight , EE_RESAMPLER_FILTER filter ) { Lock(); - cImage::Resize( newWidth, newHeight, filter ); + Image::Resize( newWidth, newHeight, filter ); Unlock( false, true ); } -void cTexture::Scale( const Float& scale, EE_RESAMPLER_FILTER filter ) { +void Texture::Scale( const Float& scale, EE_RESAMPLER_FILTER filter ) { Lock(); - cImage::Scale( scale, filter ); + Image::Scale( scale, filter ); Unlock( false, true ); } -void cTexture::CopyImage(cImage * image, const Uint32& x, const Uint32& y ) { +void Texture::CopyImage(Image * image, const Uint32& x, const Uint32& y ) { Lock(); - cImage::CopyImage( image, x, y ); + Image::CopyImage( image, x, y ); Unlock( false, true ); } -void cTexture::Flip() { +void Texture::Flip() { Lock(); - cImage::Flip(); + Image::Flip(); Unlock( false, true ); @@ -298,20 +298,20 @@ void cTexture::Flip() { mImgHeight = mHeight; } -bool cTexture::LocalCopy() { +bool Texture::LocalCopy() { return ( mPixels != NULL ); } -void cTexture::ClampMode( const EE_CLAMP_MODE& clampmode ) { +void Texture::ClampMode( const EE_CLAMP_MODE& clampmode ) { if ( mClampMode != clampmode ) { mClampMode = clampmode; ApplyClampMode(); } } -void cTexture::ApplyClampMode() { +void Texture::ApplyClampMode() { if (mTexture) { - cTextureSaver saver( mTexture ); + TextureSaver saver( mTexture ); if( mClampMode == CLAMP_REPEAT ) { glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); @@ -324,20 +324,20 @@ void cTexture::ApplyClampMode() { } } -void cTexture::Id( const Uint32& id ) { +void Texture::Id( const Uint32& id ) { mTexId = id; } -const Uint32& cTexture::Id() const { +const Uint32& Texture::Id() const { return mTexId; } -void cTexture::Reload() { +void Texture::Reload() { if ( LocalCopy() ) { Int32 width = (Int32)mWidth; Int32 height = (Int32)mHeight; - cTextureSaver saver( mTexture ); + TextureSaver saver( mTexture ); Uint32 flags = ( mFlags & TEX_FLAG_MIPMAP ) ? SOIL_FLAG_MIPMAPS : 0; flags = (mClampMode == CLAMP_REPEAT) ? (flags | SOIL_FLAG_TEXTURE_REPEATS) : flags; @@ -350,7 +350,7 @@ void cTexture::Reload() { } else { mTexture = SOIL_create_OGL_texture( reinterpret_cast ( &mPixels[0] ), &width, &height, mChannels, mTexture, flags ); - cTextureFactory::instance()->mMemSize -= mSize; + TextureFactory::instance()->mMemSize -= mSize; mSize = mWidth * mHeight * mChannels; @@ -365,7 +365,7 @@ void cTexture::Reload() { } } - cTextureFactory::instance()->mMemSize += mSize; + TextureFactory::instance()->mMemSize += mSize; } iTextureFilter( mFilter ); @@ -376,27 +376,27 @@ void cTexture::Reload() { } } -void cTexture::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 ) { - cTextureSaver saver( mTexture ); + TextureSaver saver( mTexture ); glTexSubImage2D( GL_TEXTURE_2D, 0, x, y, width, height, (unsigned int)pf, GL_UNSIGNED_BYTE, pixels ); } } -void cTexture::Update( const Uint8* pixels ) { +void Texture::Update( const Uint8* pixels ) { Update( pixels, mWidth, mHeight, 0, 0, ChannelsToPixelFormat( mChannels ) ); } -void cTexture::Update( cImage *image, Uint32 x, Uint32 y ) { +void Texture::Update( Image *image, Uint32 x, Uint32 y ) { Update( image->GetPixelsPtr(), image->Width(), image->Height(), x, y, ChannelsToPixelFormat( image->Channels() ) ); } -const Uint32& cTexture::HashName() const { +const Uint32& Texture::HashName() const { return mId; } -void cTexture::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 cTexture::Mipmap( const bool& UseMipmap ) { } } -bool cTexture::Mipmap() const { +bool Texture::Mipmap() const { return mFlags & TEX_FLAG_MIPMAP; } -void cTexture::Grabed( const bool& isGrabed ) { +void Texture::Grabed( const bool& isGrabed ) { if ( mFlags & TEX_FLAG_GRABED ) { if ( !isGrabed ) mFlags &= ~TEX_FLAG_GRABED; @@ -420,19 +420,19 @@ void cTexture::Grabed( const bool& isGrabed ) { } } -bool cTexture::Grabed() const { +bool Texture::Grabed() const { return 0 != ( mFlags & TEX_FLAG_GRABED ); } -bool cTexture::IsCompressed() const { +bool Texture::IsCompressed() const { return 0 != ( mFlags & TEX_FLAG_COMPRESSED ); } -void cTexture::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) { +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 cTexture::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 ) { +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(); @@ -451,7 +451,7 @@ void cTexture::DrawFast( const Float& x, const Float& y, const Float& Angle, con sBR->DrawOpt(); } -void cTexture::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(); @@ -618,11 +618,11 @@ void cTexture::DrawEx( Float x, Float y, Float width, Float height, const Float sBR->DrawOpt(); } -void cTexture::DrawQuad( const Quad2f& Q, const Vector2f& Offset, const Float &Angle, const Vector2f &Scale, const ColorA& Color, const EE_BLEND_MODE &Blend, const Recti& 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 cTexture::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(); diff --git a/src/eepp/graphics/textureatlas.cpp b/src/eepp/graphics/textureatlas.cpp new file mode 100644 index 000000000..ef4c57dec --- /dev/null +++ b/src/eepp/graphics/textureatlas.cpp @@ -0,0 +1,72 @@ +#include + +namespace EE { namespace Graphics { + +TextureAtlas::TextureAtlas( const std::string& name ) : + ResourceManager ( true ) +{ + Name( name ); +} + +TextureAtlas::~TextureAtlas() { +} + +const std::string& TextureAtlas::Name() const { + return mName; +} + +void TextureAtlas::Name( const std::string& name ) { + mName = name; + mId = String::Hash( mName ); +} + +const std::string& TextureAtlas::Path() const { + return mPath; +} + +void TextureAtlas::Path( const std::string& path ) { + mPath = path; +} + +const Uint32& TextureAtlas::Id() const { + return mId; +} + +SubTexture * TextureAtlas::Add( SubTexture * subTexture ) { + return ResourceManager::Add( subTexture ); +} + +SubTexture * TextureAtlas::Add( const Uint32& TexId, const std::string& Name ) { + return Add( eeNew( SubTexture, ( TexId, Name ) ) ); +} + +SubTexture * TextureAtlas::Add( const Uint32& TexId, const Recti& SrcRect, const std::string& Name ) { + return Add( eeNew( SubTexture, ( TexId, SrcRect, Name ) ) ); +} + +SubTexture * TextureAtlas::Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const std::string& Name ) { + return Add( eeNew ( SubTexture, ( TexId, SrcRect, DestSize, Name ) ) ); +} + +SubTexture * TextureAtlas::Add( const Uint32& TexId, const Recti& SrcRect, const Sizef& DestSize, const Vector2i& Offset, const std::string& Name ) { + return Add( eeNew ( SubTexture, ( TexId, SrcRect, DestSize, Offset, Name ) ) ); +} + +Uint32 TextureAtlas::Count() { + return ResourceManager::Count(); +} + +void TextureAtlas::SetTextures( std::vector textures ) { + mTextures = textures; +} + +Texture * TextureAtlas::GetTexture( const Uint32& texnum ) const { + eeASSERT( texnum < mTextures.size() ); + return mTextures[ texnum ]; +} + +Uint32 TextureAtlas::GetTexturesCount() { + return mTextures.size(); +} + +}} diff --git a/src/eepp/graphics/ctextureatlasloader.cpp b/src/eepp/graphics/textureatlasloader.cpp similarity index 77% rename from src/eepp/graphics/ctextureatlasloader.cpp rename to src/eepp/graphics/textureatlasloader.cpp index 233cee7a5..087e95af4 100644 --- a/src/eepp/graphics/ctextureatlasloader.cpp +++ b/src/eepp/graphics/textureatlasloader.cpp @@ -1,8 +1,8 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -12,7 +12,7 @@ namespace EE { namespace Graphics { using namespace Private; -cTextureAtlasLoader::cTextureAtlasLoader() : +TextureAtlasLoader::TextureAtlasLoader() : mThreaded(false), mLoaded(false), mPack(NULL), @@ -22,7 +22,7 @@ cTextureAtlasLoader::cTextureAtlasLoader() : { } -cTextureAtlasLoader::cTextureAtlasLoader( const std::string& TextureAtlasPath, const bool& Threaded, GLLoadCallback LoadCallback ) : +TextureAtlasLoader::TextureAtlasLoader( const std::string& TextureAtlasPath, const bool& Threaded, GLLoadCallback LoadCallback ) : mTextureAtlasPath( TextureAtlasPath ), mThreaded( Threaded ), mLoaded(false), @@ -35,7 +35,7 @@ cTextureAtlasLoader::cTextureAtlasLoader( const std::string& TextureAtlasPath, c Load(); } -cTextureAtlasLoader::cTextureAtlasLoader( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName, const bool& Threaded, GLLoadCallback LoadCallback ) : +TextureAtlasLoader::TextureAtlasLoader( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName, const bool& Threaded, GLLoadCallback LoadCallback ) : mTextureAtlasPath( TextureAtlasName ), mThreaded( Threaded ), mLoaded(false), @@ -48,7 +48,7 @@ cTextureAtlasLoader::cTextureAtlasLoader( const Uint8* Data, const Uint32& DataS LoadFromMemory( Data, DataSize, TextureAtlasName ); } -cTextureAtlasLoader::cTextureAtlasLoader( Pack * Pack, const std::string& FilePackPath, const bool& Threaded, GLLoadCallback LoadCallback ) : +TextureAtlasLoader::TextureAtlasLoader( Pack * Pack, const std::string& FilePackPath, const bool& Threaded, GLLoadCallback LoadCallback ) : mTextureAtlasPath( FilePackPath ), mThreaded( Threaded ), mLoaded(false), @@ -61,7 +61,7 @@ cTextureAtlasLoader::cTextureAtlasLoader( Pack * Pack, const std::string& FilePa LoadFromPack( Pack, FilePackPath ); } -cTextureAtlasLoader::cTextureAtlasLoader( IOStream& IOS, const bool& Threaded, GLLoadCallback LoadCallback ) : +TextureAtlasLoader::TextureAtlasLoader( IOStream& IOS, const bool& Threaded, GLLoadCallback LoadCallback ) : mThreaded( Threaded ), mLoaded(false), mPack(NULL), @@ -73,22 +73,22 @@ cTextureAtlasLoader::cTextureAtlasLoader( IOStream& IOS, const bool& Threaded, G LoadFromStream( IOS ); } -cTextureAtlasLoader::~cTextureAtlasLoader() +TextureAtlasLoader::~TextureAtlasLoader() { } -void cTextureAtlasLoader::SetLoadCallback( GLLoadCallback LoadCallback ) { +void TextureAtlasLoader::SetLoadCallback( GLLoadCallback LoadCallback ) { mLoadCallback = LoadCallback; } -void cTextureAtlasLoader::Update() { +void TextureAtlasLoader::Update() { mRL.Update(); if ( mRL.IsLoaded() && !mLoaded ) CreateSubTextures(); } -void cTextureAtlasLoader::LoadFromStream( IOStream& IOS ) { +void TextureAtlasLoader::LoadFromStream( IOStream& IOS ) { mRL.Threaded( mThreaded ); if ( IOS.IsOpen() ) { @@ -108,13 +108,13 @@ void cTextureAtlasLoader::LoadFromStream( IOStream& IOS ) { std::string path( FileSystem::FileRemoveFileName( mTextureAtlasPath ) + name ); //! Checks if the texture is already loaded - cTexture * tTex = cTextureFactory::instance()->GetByName( path ); + Texture * tTex = TextureFactory::instance()->GetByName( path ); if ( !mSkipResourceLoad && NULL == tTex ) { if ( NULL != mPack ) { - mRL.Add( eeNew( cTextureLoader, ( mPack, path ) ) ); + mRL.Add( eeNew( TextureLoader, ( mPack, path ) ) ); } else { - mRL.Add( eeNew( cTextureLoader, ( path ) ) ); + mRL.Add( eeNew( TextureLoader, ( path ) ) ); } } @@ -134,7 +134,7 @@ void cTextureAtlasLoader::LoadFromStream( IOStream& IOS ) { } } -void cTextureAtlasLoader::Load( const std::string& TextureAtlasPath ) { +void TextureAtlasLoader::Load( const std::string& TextureAtlasPath ) { if ( TextureAtlasPath.size() ) mTextureAtlasPath = TextureAtlasPath; @@ -153,7 +153,7 @@ void cTextureAtlasLoader::Load( const std::string& TextureAtlasPath ) { } } -void cTextureAtlasLoader::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; @@ -165,7 +165,7 @@ void cTextureAtlasLoader::LoadFromPack( Pack * Pack, const std::string& FilePack } } -void cTextureAtlasLoader::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; @@ -174,11 +174,11 @@ void cTextureAtlasLoader::LoadFromMemory( const Uint8* Data, const Uint32& DataS LoadFromStream( IOS ); } -cTextureAtlas * cTextureAtlasLoader::GetTextureAtlas() const { +TextureAtlas * TextureAtlasLoader::GetTextureAtlas() const { return mTextureAtlas; } -void cTextureAtlasLoader::CreateSubTextures() { +void TextureAtlasLoader::CreateSubTextures() { mIsLoading = false; bool IsAlreadyLoaded = false; @@ -191,7 +191,7 @@ void cTextureAtlasLoader::CreateSubTextures() { FileSystem::FilePathRemoveProcessPath( path ); - cTexture * tTex = cTextureFactory::instance()->GetByName( path ); + Texture * tTex = TextureFactory::instance()->GetByName( path ); if ( NULL != tTex ) mTexuresLoaded.push_back( tTex ); @@ -203,18 +203,18 @@ void cTextureAtlasLoader::CreateSubTextures() { std::string etapath = FileSystem::FileRemoveExtension( path ) + EE_TEXTURE_ATLAS_EXTENSION; - cTextureAtlas * tTextureAtlas = cTextureAtlasManager::instance()->GetByName( name ); + TextureAtlas * tTextureAtlas = TextureAtlasManager::instance()->GetByName( name ); if ( NULL != tTextureAtlas && tTextureAtlas->Path() == etapath ) { mTextureAtlas = tTextureAtlas; IsAlreadyLoaded = true; } else { - mTextureAtlas = eeNew( cTextureAtlas, ( name ) ); + mTextureAtlas = eeNew( TextureAtlas, ( name ) ); mTextureAtlas->Path( etapath ); - cTextureAtlasManager::instance()->Add( mTextureAtlas ); + TextureAtlasManager::instance()->Add( mTextureAtlas ); } } @@ -230,7 +230,7 @@ void cTextureAtlasLoader::CreateSubTextures() { Recti tRect( tSh->X, tSh->Y, tSh->X + tSh->Width, tSh->Y + tSh->Height ); - cSubTexture * tSubTexture = eeNew( cSubTexture, ( tTex->Id(), tRect, Sizef( (Float)tSh->DestWidth, (Float)tSh->DestHeight ), Vector2i( tSh->OffsetX, tSh->OffsetY ), SubTextureName ) ); + SubTexture * tSubTexture = eeNew( SubTexture, ( tTex->Id(), 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. @@ -239,7 +239,7 @@ void cTextureAtlasLoader::CreateSubTextures() { } } } else { - eePRINTL( "cTextureAtlasLoader::CreateSubTextures: Failed to find texture atlas texture, it seems that is not loaded for some reason. Couldn't find: %s", path.c_str() ); + eePRINTL( "TextureAtlasLoader::CreateSubTextures: Failed to find texture atlas texture, it seems that is not loaded for some reason. Couldn't find: %s", path.c_str() ); eeASSERT( NULL != tTex ); @@ -258,32 +258,32 @@ void cTextureAtlasLoader::CreateSubTextures() { } } -bool cTextureAtlasLoader::Threaded() const { +bool TextureAtlasLoader::Threaded() const { return mThreaded; } -void cTextureAtlasLoader::Threaded( const bool& threaded ) { +void TextureAtlasLoader::Threaded( const bool& threaded ) { mThreaded = threaded; } -const bool& cTextureAtlasLoader::IsLoaded() const { +const bool& TextureAtlasLoader::IsLoaded() const { return mLoaded; } -const bool& cTextureAtlasLoader::IsLoading() const { +const bool& TextureAtlasLoader::IsLoading() const { return mIsLoading; } -cTexture * cTextureAtlasLoader::GetTexture( const Uint32& texnum ) const { +Texture * TextureAtlasLoader::GetTexture( const Uint32& texnum ) const { eeASSERT( texnum < mTexuresLoaded.size() ); return mTexuresLoaded[ texnum ]; } -Uint32 cTextureAtlasLoader::GetTexturesLoadedCount() { +Uint32 TextureAtlasLoader::GetTexturesLoadedCount() { return mTexuresLoaded.size(); } -bool cTextureAtlasLoader::UpdateTextureAtlas() { +bool TextureAtlasLoader::UpdateTextureAtlas() { if ( NULL == mTextureAtlas || !mTextureAtlasPath.size() ) return false; @@ -294,7 +294,7 @@ bool cTextureAtlasLoader::UpdateTextureAtlas() { for ( Int32 i = 0; i < tTexHdr->SubTextureCount; i++ ) { sSubTextureHdr * tSh = &tTexAtlas->SubTextures[i]; - cSubTexture * tSubTexture = mTextureAtlas->GetById( tSh->ResourceID ); + SubTexture * tSubTexture = mTextureAtlas->GetById( tSh->ResourceID ); if ( NULL != tSubTexture ) { tSh->OffsetX = tSubTexture->Offset().x; @@ -346,14 +346,14 @@ static bool IsImage( std::string path ) { ) { return true; } else { - return cImage::IsImage( path ); + return Image::IsImage( path ); } } return false; } -bool cTextureAtlasLoader::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; @@ -430,10 +430,10 @@ bool cTextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std: } if ( NeedUpdate ) { - std::string tapath( FileSystem::FileRemoveExtension( TextureAtlasPath ) + "." + cImage::SaveTypeToExtension( mTexGrHdr.Format ) ); + std::string tapath( FileSystem::FileRemoveExtension( TextureAtlasPath ) + "." + Image::SaveTypeToExtension( mTexGrHdr.Format ) ); if ( 2 == NeedUpdate ) { - cTexturePacker tp( mTexGrHdr.Width, mTexGrHdr.Height, 0 != ( mTexGrHdr.Flags & HDR_TEXTURE_ATLAS_POW_OF_TWO ), mTexGrHdr.PixelBorder, mTexGrHdr.Flags & HDR_TEXTURE_ATLAS_ALLOW_FLIPPING ); + 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 ); @@ -452,13 +452,13 @@ bool cTextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std: for ( Uint32 z = 0; z < mTempAtlass.size(); z++ ) { if ( z != 0 ) { - tapath = FileSystem::FileRemoveExtension( TextureAtlasPath ) + "_ch" + String::ToStr( z ) + "." + cImage::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 ) { - cImage Img( imgPtr, x, y, c ); + Image Img( imgPtr, x, y, c ); Img.AvoidFreeImage( true ); sTempTexAtlas * tTexAtlas = &mTempAtlass[z]; @@ -479,7 +479,7 @@ bool cTextureAtlasLoader::UpdateTextureAtlas( std::string TextureAtlasPath, std: unsigned char * imgCopyPtr = stbi_load( imgcopypath.c_str(), &x, &y, &c, 0 ); if ( NULL != imgCopyPtr ) { - cImage ImgCopy( imgCopyPtr, x, y, c ); + Image ImgCopy( imgCopyPtr, x, y, c ); ImgCopy.AvoidFreeImage( true ); Img.CopyImage( &ImgCopy, tSh->X, tSh->Y ); // Update the image into the texture atlas diff --git a/src/eepp/graphics/ctextureatlasmanager.cpp b/src/eepp/graphics/textureatlasmanager.cpp similarity index 69% rename from src/eepp/graphics/ctextureatlasmanager.cpp rename to src/eepp/graphics/textureatlasmanager.cpp index a660b02b5..8770cffa2 100644 --- a/src/eepp/graphics/ctextureatlasmanager.cpp +++ b/src/eepp/graphics/textureatlasmanager.cpp @@ -1,59 +1,59 @@ -#include -#include -#include +#include +#include +#include namespace EE { namespace Graphics { -SINGLETON_DECLARE_IMPLEMENTATION(cTextureAtlasManager) +SINGLETON_DECLARE_IMPLEMENTATION(TextureAtlasManager) -cTextureAtlasManager::cTextureAtlasManager() : - ResourceManager( false ), +TextureAtlasManager::TextureAtlasManager() : + ResourceManager( false ), mWarnings( false ) { - Add( cGlobalTextureAtlas::instance() ); + Add( GlobalTextureAtlas::instance() ); } -cTextureAtlasManager::~cTextureAtlasManager() { +TextureAtlasManager::~TextureAtlasManager() { } -cTextureAtlas * cTextureAtlasManager::Load( const std::string& TextureAtlasPath ) { - cTextureAtlasLoader loader( TextureAtlasPath ); +TextureAtlas * TextureAtlasManager::Load( const std::string& TextureAtlasPath ) { + TextureAtlasLoader loader( TextureAtlasPath ); return loader.GetTextureAtlas(); } -cTextureAtlas * cTextureAtlasManager::LoadFromStream( IOStream& IOS ) { - cTextureAtlasLoader loader( IOS ); +TextureAtlas * TextureAtlasManager::LoadFromStream( IOStream& IOS ) { + TextureAtlasLoader loader( IOS ); return loader.GetTextureAtlas(); } -cTextureAtlas * cTextureAtlasManager::LoadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ) { - cTextureAtlasLoader loader( Data, DataSize, TextureAtlasName ); +TextureAtlas * TextureAtlasManager::LoadFromMemory( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName ) { + TextureAtlasLoader loader( Data, DataSize, TextureAtlasName ); return loader.GetTextureAtlas(); } -cTextureAtlas * cTextureAtlasManager::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { - cTextureAtlasLoader loader( Pack, FilePackPath ); +TextureAtlas * TextureAtlasManager::LoadFromPack( Pack * Pack, const std::string& FilePackPath ) { + TextureAtlasLoader loader( Pack, FilePackPath ); return loader.GetTextureAtlas(); } -cSubTexture * cTextureAtlasManager::GetSubTextureByName( const std::string& Name ) { - cSubTexture * tSubTexture = GetSubTextureById( String::Hash( Name ) ); +SubTexture * TextureAtlasManager::GetSubTextureByName( const std::string& Name ) { + SubTexture * tSubTexture = GetSubTextureById( String::Hash( Name ) ); if ( mWarnings ) { - eePRINTC( NULL == tSubTexture, "cTextureAtlasManager::GetSubTextureByName SubTexture '%s' not found\n", Name.c_str() ); + eePRINTC( NULL == tSubTexture, "TextureAtlasManager::GetSubTextureByName SubTexture '%s' not found\n", Name.c_str() ); } return tSubTexture; } -cSubTexture * cTextureAtlasManager::GetSubTextureById( const Uint32& Id ) { - std::list::iterator it; +SubTexture * TextureAtlasManager::GetSubTextureById( const Uint32& Id ) { + std::list::iterator it; - cTextureAtlas * tSG = NULL; - cSubTexture * tSubTexture = NULL; + TextureAtlas * tSG = NULL; + SubTexture * tSubTexture = NULL; for ( it = mResources.begin(); it != mResources.end(); it++ ) { tSG = (*it); @@ -67,15 +67,15 @@ cSubTexture * cTextureAtlasManager::GetSubTextureById( const Uint32& Id ) { return NULL; } -void cTextureAtlasManager::PrintResources() { - std::list::iterator it; +void TextureAtlasManager::PrintResources() { + std::list::iterator it; for ( it = mResources.begin(); it != mResources.end(); it++ ) (*it)->PrintNames(); } -std::vector cTextureAtlasManager::GetSubTexturesByPatternId( const Uint32& SubTextureId, const std::string& extension, cTextureAtlas * SearchInTextureAtlas ) { - cSubTexture * tSubTexture = NULL; +std::vector TextureAtlasManager::GetSubTexturesByPatternId( const Uint32& SubTextureId, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { + SubTexture * tSubTexture = NULL; std::string tName; if ( NULL == SearchInTextureAtlas ) @@ -92,22 +92,22 @@ std::vector cTextureAtlasManager::GetSubTexturesByPatternId( const return GetSubTexturesByPattern( String::RemoveNumbersAtEnd( tSubTexture->Name() ), "", SearchInTextureAtlas ); } - return std::vector(); + return std::vector(); } -void cTextureAtlasManager::PrintWarnings( const bool& warn ) { +void TextureAtlasManager::PrintWarnings( const bool& warn ) { mWarnings = warn; } -const bool& cTextureAtlasManager::PrintWarnings() const { +const bool& TextureAtlasManager::PrintWarnings() const { return mWarnings; } -std::vector cTextureAtlasManager::GetSubTexturesByPattern( const std::string& name, const std::string& extension, cTextureAtlas * SearchInTextureAtlas ) { - std::vector SubTextures; +std::vector TextureAtlasManager::GetSubTexturesByPattern( const std::string& name, const std::string& extension, TextureAtlas * SearchInTextureAtlas ) { + std::vector SubTextures; std::string search; bool found = true; - cSubTexture * tSubTexture = NULL; + SubTexture * tSubTexture = NULL; std::string realext = ""; int c = 0; int t = 0; diff --git a/src/eepp/graphics/ctexturefactory.cpp b/src/eepp/graphics/texturefactory.cpp similarity index 54% rename from src/eepp/graphics/ctexturefactory.cpp rename to src/eepp/graphics/texturefactory.cpp index b2a40e033..e651c326c 100755 --- a/src/eepp/graphics/ctexturefactory.cpp +++ b/src/eepp/graphics/texturefactory.cpp @@ -1,17 +1,17 @@ -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include #include namespace EE { namespace Graphics { -SINGLETON_DECLARE_IMPLEMENTATION(cTextureFactory) +SINGLETON_DECLARE_IMPLEMENTATION(TextureFactory) -cTextureFactory::cTextureFactory() : +TextureFactory::TextureFactory() : mLastBlend(ALPHA_NORMAL), mMemSize(0), mErasing(false) @@ -22,49 +22,49 @@ cTextureFactory::cTextureFactory() : memset( &mCurrentTexture[0], 0, EE_MAX_TEXTURE_UNITS ); } -cTextureFactory::~cTextureFactory() { +TextureFactory::~TextureFactory() { UnloadTextures(); } -Uint32 cTextureFactory::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 ) { - cImage TmpImg( Width, Height, Channels, DefaultColor ); +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 ); } -Uint32 cTextureFactory::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 ) { - cTextureLoader myTex( Pixels, Width, Height, Channels, Mipmap, ClampMode, CompressTexture, KeepLocalCopy, 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(); } -Uint32 cTextureFactory::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { - cTextureLoader myTex( Pack, FilePackPath, Mipmap, ClampMode, CompressTexture, 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(); } -Uint32 cTextureFactory::LoadFromMemory( const unsigned char * ImagePtr, const unsigned int& Size, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { - cTextureLoader myTex( ImagePtr, Size, Mipmap, ClampMode, CompressTexture, 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(); } -Uint32 cTextureFactory::LoadFromStream( IOStream& Stream, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { - cTextureLoader myTex( Stream, Mipmap, ClampMode, CompressTexture, 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(); } -Uint32 cTextureFactory::Load( const std::string& Filepath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { - cTextureLoader myTex( Filepath, Mipmap, ClampMode, CompressTexture, 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(); } -Uint32 cTextureFactory::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(); - cTexture * Tex = NULL; + Texture * Tex = NULL; Uint32 Pos; std::string FPath( Filepath ); @@ -72,7 +72,7 @@ Uint32 cTextureFactory::PushTexture( const std::string& Filepath, const Uint32& FileSystem::FilePathRemoveProcessPath( FPath ); Pos = FindFreeSlot(); - Tex = mTextures[ Pos ] = eeNew( cTexture, () ); + Tex = mTextures[ Pos ] = eeNew( Texture, () ); Tex->Create( TexId, Width, Height, ImgWidth, ImgHeight, Mipmap, Channels, FPath, ClampMode, CompressTexture, MemSize ); Tex->Id( Pos ); @@ -89,7 +89,7 @@ Uint32 cTextureFactory::PushTexture( const std::string& Filepath, const Uint32& return Pos; } -Uint32 cTextureFactory::FindFreeSlot() { +Uint32 TextureFactory::FindFreeSlot() { if ( mVectorFreeSlots.size() ) { Uint32 Pos = mVectorFreeSlots.front(); @@ -103,7 +103,7 @@ Uint32 cTextureFactory::FindFreeSlot() { return (Uint32)mTextures.size() - 1; } -void cTextureFactory::Bind( const cTexture* Tex, const Uint32& 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 ); @@ -117,11 +117,11 @@ void cTextureFactory::Bind( const cTexture* Tex, const Uint32& TextureUnit ) { } } -void cTextureFactory::Bind( const Uint32& TexId, const Uint32& TextureUnit ) { +void TextureFactory::Bind( const Uint32& TexId, const Uint32& TextureUnit ) { Bind( GetTexture( TexId ), TextureUnit ); } -void cTextureFactory::UnloadTextures() { +void TextureFactory::UnloadTextures() { mErasing = true; for ( Uint32 i = 1; i < mTextures.size(); i++ ) @@ -134,8 +134,8 @@ void cTextureFactory::UnloadTextures() { eePRINTL( "Textures Unloaded." ); } -bool cTextureFactory::Remove( Uint32 TexId ) { - cTexture * Tex; +bool TextureFactory::Remove( Uint32 TexId ) { + Texture * Tex; if ( TexId < mTextures.size() && NULL != ( Tex = mTextures[ TexId ] ) ) { RemoveReference( mTextures[ TexId ] ); @@ -150,7 +150,7 @@ bool cTextureFactory::Remove( Uint32 TexId ) { return false; } -void cTextureFactory::RemoveReference( cTexture * Tex ) { +void TextureFactory::RemoveReference( Texture * Tex ) { mMemSize -= Tex->MemSize(); int glTexId = Tex->Handle(); @@ -165,23 +165,23 @@ void cTextureFactory::RemoveReference( cTexture * Tex ) { mVectorFreeSlots.push_back( Tex->Id() ); } -const bool& cTextureFactory::IsErasing() const { +const bool& TextureFactory::IsErasing() const { return mErasing; } -int cTextureFactory::GetCurrentTexture( const Uint32& TextureUnit ) const { +int TextureFactory::GetCurrentTexture( const Uint32& TextureUnit ) const { eeASSERT( TextureUnit < EE_MAX_TEXTURE_UNITS ); return mCurrentTexture[ TextureUnit ]; } -void cTextureFactory::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 cTextureFactory::ReloadAllTextures() { +void TextureFactory::ReloadAllTextures() { for ( Uint32 i = 1; i < mTextures.size(); i++ ) { - cTexture* Tex = GetTexture(i); + Texture* Tex = GetTexture(i); if ( Tex ) Tex->Reload(); @@ -190,9 +190,9 @@ void cTextureFactory::ReloadAllTextures() { eePRINTL("Textures Reloaded."); } -void cTextureFactory::GrabTextures() { +void TextureFactory::GrabTextures() { for ( Uint32 i = 1; i < mTextures.size(); i++ ) { - cTexture* Tex = GetTexture(i); + Texture* Tex = GetTexture(i); if ( Tex && !Tex->LocalCopy() ) { Tex->Lock(); @@ -201,9 +201,9 @@ void cTextureFactory::GrabTextures() { } } -void cTextureFactory::UngrabTextures() { +void TextureFactory::UngrabTextures() { for ( Uint32 i = 1; i < mTextures.size(); i++ ) { - cTexture* Tex = GetTexture(i); + Texture* Tex = GetTexture(i); if ( NULL != Tex && Tex->Grabed() ) { Tex->Reload(); @@ -213,11 +213,11 @@ void cTextureFactory::UngrabTextures() { } } -void cTextureFactory::SetActiveTextureUnit( const Uint32& Unit ) { +void TextureFactory::SetActiveTextureUnit( const Uint32& Unit ) { GLi->ActiveTexture( GL_TEXTURE0 + Unit ); } -void cTextureFactory::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 ); @@ -235,36 +235,36 @@ void cTextureFactory::SetTextureEnv( const EE_TEXTURE_PARAM& Param, const Int32& #endif } -unsigned int cTextureFactory::GetValidTextureSize( const unsigned int& Size ) { +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 cTextureFactory::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 = cImage::JpegQuality(); + params.m_quality = Image::JpegQuality(); Res = jpge::compress_image_to_jpeg_file( filepath.c_str(), Width, Height, Channels, data, params); } return Res; } -bool cTextureFactory::TextureIdExists( const Uint32& TexId ) { +bool TextureFactory::TextureIdExists( const Uint32& TexId ) { return ( TexId < mTextures.size() && TexId > 0 && NULL != mTextures[ TexId ] ); } -cTexture * cTextureFactory::GetTexture( const Uint32& TexId ) { +Texture * TextureFactory::GetTexture( const Uint32& TexId ) { return mTextures[TexId]; } -void cTextureFactory::Allocate( const unsigned int& size ) { +void TextureFactory::Allocate( const unsigned int& size ) { if ( size > mTextures.size() ) { mTextures.resize( size + 1, NULL ); @@ -273,12 +273,12 @@ void cTextureFactory::Allocate( const unsigned int& size ) { } } -cTexture * cTextureFactory::GetByName( const std::string& Name ) { +Texture * TextureFactory::GetByName( const std::string& Name ) { return GetByHash( String::Hash( Name ) ); } -cTexture * cTextureFactory::GetByHash( const Uint32& Hash ) { - cTexture * tTex = NULL; +Texture * TextureFactory::GetByHash( const Uint32& Hash ) { + Texture * tTex = NULL; for ( Uint32 i = (Uint32)mTextures.size() - 1; i > 0; i-- ) { tTex = mTextures[ i ]; diff --git a/src/eepp/graphics/ctexturefont.cpp b/src/eepp/graphics/texturefont.cpp similarity index 79% rename from src/eepp/graphics/ctexturefont.cpp rename to src/eepp/graphics/texturefont.cpp index 7bffdb5cd..be8147028 100755 --- a/src/eepp/graphics/ctexturefont.cpp +++ b/src/eepp/graphics/texturefont.cpp @@ -1,27 +1,27 @@ -#include -#include +#include +#include #include #include namespace EE { namespace Graphics { -cTextureFont * cTextureFont::New( const std::string FontName ) { - return eeNew( cTextureFont, ( FontName ) ); +TextureFont * TextureFont::New( const std::string FontName ) { + return eeNew( TextureFont, ( FontName ) ); } -cTextureFont::cTextureFont( const std::string FontName ) : - cFont( FONT_TYPE_TEX, FontName ), +TextureFont::TextureFont( const std::string FontName ) : + Font( FONT_TYPE_TEX, FontName ), mStartChar(0), mNumChars(256), mLoadedCoords(false) { } -cTextureFont::~cTextureFont() { +TextureFont::~TextureFont() { } -bool cTextureFont::Load( const Uint32& TexId, const unsigned int& StartChar, const unsigned int& Spacing, const unsigned int& TexColumns, const unsigned int& TexRows, const Uint16& NumChars ) { - cTexture * Tex = cTextureFactory::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; @@ -55,13 +55,13 @@ bool cTextureFont::Load( const Uint32& TexId, const unsigned int& StartChar, con return false; } -void cTextureFont::BuildFont() { +void TextureFont::BuildFont() { Float cX = 0, cY = 0; mTexCoords.resize( mNumChars ); mGlyphs.resize( mNumChars ); - cTextureFactory::instance()->Bind( mTexId ); + TextureFactory::instance()->Bind( mTexId ); int c = 0; @@ -99,15 +99,15 @@ void cTextureFont::BuildFont() { } } -void cTextureFont::BuildFromGlyphs() { +void TextureFont::BuildFromGlyphs() { Float Top, Bottom; Rectf tR; mTexCoords.resize( mNumChars ); - cTexture * Tex = cTextureFactory::instance()->GetTexture( mTexId ); + Texture * Tex = TextureFactory::instance()->GetTexture( mTexId ); - cTextureFactory::instance()->Bind( Tex ); + TextureFactory::instance()->Bind( Tex ); eeGlyph tGlyph; @@ -142,7 +142,7 @@ void cTextureFont::BuildFromGlyphs() { } } -bool cTextureFont::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 ); @@ -160,7 +160,7 @@ bool cTextureFont::Load( const Uint32& TexId, const std::string& CoordinatesDatP return false; } -bool cTextureFont::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; @@ -172,13 +172,13 @@ bool cTextureFont::LoadFromPack( const Uint32& TexId, Pack* Pack, const std::str return false; } -bool cTextureFont::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 ); } -bool cTextureFont::LoadFromStream( const Uint32& TexId, IOStream& IOS ) { +bool TextureFont::LoadFromStream( const Uint32& TexId, IOStream& IOS ) { mTexId = TexId; if ( mTexId > 0 ) { diff --git a/src/eepp/graphics/ctexturefontloader.cpp b/src/eepp/graphics/texturefontloader.cpp similarity index 55% rename from src/eepp/graphics/ctexturefontloader.cpp rename to src/eepp/graphics/texturefontloader.cpp index 9b5433ddf..8ae883040 100644 --- a/src/eepp/graphics/ctexturefontloader.cpp +++ b/src/eepp/graphics/texturefontloader.cpp @@ -1,10 +1,10 @@ -#include -#include +#include +#include namespace EE { namespace Graphics { -cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const unsigned int& StartChar, const unsigned int& Spacing, const unsigned int& TexColumns, const unsigned int& TexRows, const Uint16& NumChars ) : - ObjectLoader( FontTexLoader ), +TextureFontLoader::TextureFontLoader( const std::string FontName, TextureLoader * TexLoader, const unsigned int& StartChar, const unsigned int& Spacing, const unsigned int& TexColumns, const unsigned int& TexRows, const Uint16& NumChars ) : + ObjectLoader( FontTexLoaderType ), mLoadType( TEF_LT_TEX ), mFontName( FontName ), mStartChar( StartChar ), @@ -18,8 +18,8 @@ cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoad mTexLoader = TexLoader; } -cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const std::string& CoordinatesDatPath ) : - ObjectLoader( FontTexLoader ), +TextureFontLoader::TextureFontLoader( const std::string FontName, TextureLoader * TexLoader, const std::string& CoordinatesDatPath ) : + ObjectLoader( FontTexLoaderType ), mLoadType( TEF_LT_PATH ), mFontName( FontName ), mFilepath( CoordinatesDatPath ), @@ -29,8 +29,8 @@ cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoad mTexLoader = TexLoader; } -cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, Pack * Pack, const std::string& FilePackPath ) : - ObjectLoader( FontTexLoader ), +TextureFontLoader::TextureFontLoader( const std::string FontName, TextureLoader * TexLoader, Pack * Pack, const std::string& FilePackPath ) : + ObjectLoader( FontTexLoaderType ), mLoadType( TEF_LT_PACK ), mFontName( FontName ), mFilepath( FilePackPath ), @@ -41,8 +41,8 @@ cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoad mTexLoader = TexLoader; } -cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoader * TexLoader, const char* CoordData, const Uint32& CoordDataSize ) : - ObjectLoader( FontTexLoader ), +TextureFontLoader::TextureFontLoader( const std::string FontName, TextureLoader * TexLoader, const char* CoordData, const Uint32& CoordDataSize ) : + ObjectLoader( FontTexLoaderType ), mLoadType( TEF_LT_MEM ), mFontName( FontName ), mData( CoordData ), @@ -53,11 +53,11 @@ cTextureFontLoader::cTextureFontLoader( const std::string FontName, cTextureLoad mTexLoader = TexLoader; } -cTextureFontLoader::~cTextureFontLoader() { +TextureFontLoader::~TextureFontLoader() { eeSAFE_DELETE( mTexLoader ); } -void cTextureFontLoader::Start() { +void TextureFontLoader::Start() { ObjectLoader::Start(); mTexLoader->Threaded( false ); @@ -67,7 +67,7 @@ void cTextureFontLoader::Start() { } } -void cTextureFontLoader::Update() { +void TextureFontLoader::Update() { if ( !mLoaded ) { if ( !mTexLoaded ) { mTexLoader->Load(); @@ -87,28 +87,28 @@ void cTextureFontLoader::Update() { } } -const std::string& cTextureFontLoader::Id() const { +const std::string& TextureFontLoader::Id() const { return mFontName; } -void cTextureFontLoader::LoadFromPath() { +void TextureFontLoader::LoadFromPath() { mFont->Load( mTexLoader->Id(), mFilepath ); } -void cTextureFontLoader::LoadFromMemory() { +void TextureFontLoader::LoadFromMemory() { mFont->LoadFromMemory( mTexLoader->Id(), mData, mDataSize ); } -void cTextureFontLoader::LoadFromPack() { +void TextureFontLoader::LoadFromPack() { mFont->LoadFromPack( mTexLoader->Id(), mPack, mFilepath ); } -void cTextureFontLoader::LoadFromTex() { +void TextureFontLoader::LoadFromTex() { mFont->Load( mTexLoader->Id(), mStartChar, mSpacing, mTexColumns, mTexRows, mNumChars ); } -void cTextureFontLoader::LoadFont() { - mFont = cTextureFont::New( mFontName ); +void TextureFontLoader::LoadFont() { + mFont = TextureFont::New( mFontName ); if ( TEF_LT_PATH == mLoadType ) LoadFromPath(); @@ -122,21 +122,21 @@ void cTextureFontLoader::LoadFont() { mFontLoaded = true; } -cFont * cTextureFontLoader::Font() const { +Graphics::Font * TextureFontLoader::Font() const { return mFont; } -void cTextureFontLoader::Unload() { +void TextureFontLoader::Unload() { if ( mLoaded ) { mTexLoader->Unload(); - cFontManager::instance()->Remove( mFont ); + FontManager::instance()->Remove( mFont ); Reset(); } } -void cTextureFontLoader::Reset() { +void TextureFontLoader::Reset() { ObjectLoader::Reset(); mFont = NULL; diff --git a/src/eepp/graphics/ctextureloader.cpp b/src/eepp/graphics/textureloader.cpp similarity index 89% rename from src/eepp/graphics/ctextureloader.cpp rename to src/eepp/graphics/textureloader.cpp index dfb1480fb..dd3574e9d 100644 --- a/src/eepp/graphics/ctextureloader.cpp +++ b/src/eepp/graphics/textureloader.cpp @@ -1,9 +1,9 @@ -#include -#include -#include +#include +#include +#include #include #include -#include +#include #include #include #include @@ -58,12 +58,12 @@ namespace jpeg }; } -cTextureLoader::cTextureLoader( IOStream& Stream, +TextureLoader::TextureLoader( IOStream& Stream, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy -) : ObjectLoader( ObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoaderType ), mLoadType(TEX_LT_STREAM), mPixels(NULL), mTexId(0), @@ -89,12 +89,12 @@ cTextureLoader::cTextureLoader( IOStream& Stream, { } -cTextureLoader::cTextureLoader( const std::string& Filepath, +TextureLoader::TextureLoader( const std::string& Filepath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy -) : ObjectLoader( ObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoaderType ), mLoadType(TEX_LT_PATH), mPixels(NULL), mTexId(0), @@ -120,13 +120,13 @@ cTextureLoader::cTextureLoader( const std::string& Filepath, { } -cTextureLoader::cTextureLoader( const unsigned char * ImagePtr, +TextureLoader::TextureLoader( const unsigned char * ImagePtr, const unsigned int& Size, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy -) : ObjectLoader( ObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoaderType ), mLoadType(TEX_LT_MEM), mPixels(NULL), mTexId(0), @@ -152,13 +152,13 @@ cTextureLoader::cTextureLoader( const unsigned char * ImagePtr, { } -cTextureLoader::cTextureLoader( Pack * Pack, +TextureLoader::TextureLoader( Pack * Pack, const std::string& FilePackPath, const bool& Mipmap , const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy -) : ObjectLoader( ObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoaderType ), mLoadType(TEX_LT_PACK), mPixels(NULL), mTexId(0), @@ -184,7 +184,7 @@ cTextureLoader::cTextureLoader( Pack * Pack, { } -cTextureLoader::cTextureLoader( const unsigned char * Pixels, +TextureLoader::TextureLoader( const unsigned char * Pixels, const unsigned int& Width, const unsigned int& Height, const unsigned int& Channels, @@ -193,7 +193,7 @@ cTextureLoader::cTextureLoader( const unsigned char * Pixels, const bool& CompressTexture, const bool& KeepLocalCopy, const std::string& FileName -) : ObjectLoader( ObjectLoader::TextureLoader ), +) : ObjectLoader( ObjectLoader::TextureLoaderType ), mLoadType(TEX_LT_PIXELS), mPixels( const_cast ( Pixels ) ), mTexId(0), @@ -219,14 +219,14 @@ cTextureLoader::cTextureLoader( const unsigned char * Pixels, { } -cTextureLoader::~cTextureLoader() { +TextureLoader::~TextureLoader() { eeSAFE_DELETE( mColorKey ); if ( TEX_LT_PIXELS != mLoadType ) eeSAFE_FREE( mPixels ); } -void cTextureLoader::Start() { +void TextureLoader::Start() { ObjectLoader::Start(); mTE.Restart(); @@ -247,7 +247,7 @@ void cTextureLoader::Start() { } } -void cTextureLoader::LoadFile() { +void TextureLoader::LoadFile() { IOStreamFile fs( mFilepath , std::ios::in | std::ios::binary ); mSize = FileSystem::FileSize( mFilepath ); @@ -255,7 +255,7 @@ void cTextureLoader::LoadFile() { fs.Read( reinterpret_cast ( mPixels ), mSize ); } -void cTextureLoader::LoadFromPath() { +void TextureLoader::LoadFromPath() { if ( FileSystem::FileExists( mFilepath ) ) { mImgType = stbi_test( mFilepath.c_str() ); @@ -305,7 +305,7 @@ void cTextureLoader::LoadFromPath() { } } -void cTextureLoader::LoadFromPack() { +void TextureLoader::LoadFromPack() { SafeDataPointer PData; if ( NULL != mPack && mPack->IsOpen() && mPack->ExtractFileToMemory( mFilepath, PData ) ) { @@ -316,7 +316,7 @@ void cTextureLoader::LoadFromPack() { } } -void cTextureLoader::LoadFromMemory() { +void TextureLoader::LoadFromMemory() { mImgType = stbi_test_from_memory( mImagePtr, mSize ); if ( STBI_dds == mImgType && GLi->IsExtension( EEGL_EXT_texture_compression_s3tc ) ) { @@ -353,7 +353,7 @@ void cTextureLoader::LoadFromMemory() { } } -void cTextureLoader::LoadFromStream() { +void TextureLoader::LoadFromStream() { if ( mStream->IsOpen() ) { mSize = mStream->GetSize(); @@ -411,7 +411,7 @@ void cTextureLoader::LoadFromStream() { } } -void cTextureLoader::LoadFromPixels() { +void TextureLoader::LoadFromPixels() { if ( !mLoaded && mTexLoaded ) { Uint32 tTexId = 0; @@ -448,7 +448,7 @@ void cTextureLoader::LoadFromPixels() { if ( NULL != mColorKey ) { mChannels = STBI_rgb_alpha; - cImage * tImg = eeNew ( cImage, ( mPixels, mImgWidth, mImgHeight, mChannels ) ); + Image * tImg = eeNew ( Image, ( mPixels, mImgWidth, mImgHeight, mChannels ) ); tImg->CreateMaskFromColor( ColorA( mColorKey->R(), mColorKey->G(), mColorKey->B(), 255 ), 0 ); @@ -494,7 +494,7 @@ void cTextureLoader::LoadFromPixels() { } } - mTexId = cTextureFactory::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 { @@ -526,41 +526,41 @@ void cTextureLoader::LoadFromPixels() { } } -void cTextureLoader::Update() { +void TextureLoader::Update() { if ( !( Engine::instance()->IsSharedGLContextEnabled() && Engine::instance()->GetCurrentWindow()->IsThreadedGLContext() ) ) { LoadFromPixels(); } } -const Uint32& cTextureLoader::Id() const { +const Uint32& TextureLoader::Id() const { return mTexId; } -void cTextureLoader::SetColorKey( RGB Color ) { +void TextureLoader::SetColorKey( RGB Color ) { eeSAFE_DELETE( mColorKey ); mColorKey = eeNew( RGB, ( Color.R(), Color.G(), Color.B() ) ); } -const std::string& cTextureLoader::Filepath() const { +const std::string& TextureLoader::Filepath() const { return mFilepath; } -cTexture * cTextureLoader::GetTexture() const { +Texture * TextureLoader::GetTexture() const { if ( 0 != mTexId ) - return cTextureFactory::instance()->GetTexture( mTexId ); + return TextureFactory::instance()->GetTexture( mTexId ); return NULL; } -void cTextureLoader::Unload() { +void TextureLoader::Unload() { if ( mLoaded ) { - cTextureFactory::instance()->Remove( mTexId ); + TextureFactory::instance()->Remove( mTexId ); Reset(); } } -void cTextureLoader::Reset() { +void TextureLoader::Reset() { ObjectLoader::Reset(); mPixels = NULL; diff --git a/src/eepp/graphics/ctexturepacker.cpp b/src/eepp/graphics/texturepacker.cpp similarity index 76% rename from src/eepp/graphics/ctexturepacker.cpp rename to src/eepp/graphics/texturepacker.cpp index f1912995c..032737fd7 100644 --- a/src/eepp/graphics/ctexturepacker.cpp +++ b/src/eepp/graphics/texturepacker.cpp @@ -1,14 +1,14 @@ -#include -#include +#include +#include #include -#include -#include +#include +#include #include #include namespace EE { namespace Graphics { -cTexturePacker::cTexturePacker( const Uint32& MaxWidth, const Uint32& MaxHeight, const bool& ForcePowOfTwo, const Uint32& PixelBorder, const bool& AllowFlipping ) : +TexturePacker::TexturePacker( const Uint32& MaxWidth, const Uint32& MaxHeight, const bool& ForcePowOfTwo, const Uint32& PixelBorder, const bool& AllowFlipping ) : mLongestEdge(0), mTotalArea(0), mFreeList(NULL), @@ -27,7 +27,7 @@ cTexturePacker::cTexturePacker( const Uint32& MaxWidth, const Uint32& MaxHeight, SetOptions( MaxWidth, MaxHeight, ForcePowOfTwo, PixelBorder, AllowFlipping ); } -cTexturePacker::cTexturePacker() : +TexturePacker::TexturePacker() : mLongestEdge(0), mTotalArea(0), mFreeList(NULL), @@ -45,16 +45,16 @@ cTexturePacker::cTexturePacker() : { } -cTexturePacker::~cTexturePacker() +TexturePacker::~TexturePacker() { Close(); } -void cTexturePacker::Close() { +void TexturePacker::Close() { mLongestEdge = 0; mTotalArea = 0; - std::list::iterator it; + std::list::iterator it; for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { eeSAFE_DELETE( (*it) ); @@ -63,8 +63,8 @@ void cTexturePacker::Close() { mTextures.clear(); if ( NULL != mFreeList ) { - cTexturePackerNode * next = mFreeList; - cTexturePackerNode * kill = NULL; + TexturePackerNode * next = mFreeList; + TexturePackerNode * kill = NULL; while ( NULL != next ) { kill = next; @@ -78,7 +78,7 @@ void cTexturePacker::Close() { eeSAFE_DELETE( mChild ); } -void cTexturePacker::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,18 +95,18 @@ void cTexturePacker::SetOptions( const Uint32& MaxWidth, const Uint32& MaxHeight } } -void cTexturePacker::NewFree( Int32 x, Int32 y, Int32 width, Int32 height ) { - cTexturePackerNode * node = eeNew( cTexturePackerNode, ( x, y, width, height ) ); +void TexturePacker::NewFree( Int32 x, Int32 y, Int32 width, Int32 height ) { + TexturePackerNode * node = eeNew( TexturePackerNode, ( x, y, width, height ) ); node->SetNext( mFreeList ); mFreeList = node; } -bool cTexturePacker::MergeNodes() { - cTexturePackerNode *f = mFreeList; +bool TexturePacker::MergeNodes() { + TexturePackerNode *f = mFreeList; while ( f ) { - cTexturePackerNode * prev = NULL; - cTexturePackerNode * c = mFreeList; + TexturePackerNode * prev = NULL; + TexturePackerNode * c = mFreeList; while ( c ) { if ( f != c ) { @@ -133,11 +133,11 @@ bool cTexturePacker::MergeNodes() { return false; } -void cTexturePacker::Validate() { +void TexturePacker::Validate() { #ifdef EE_DEBUG - cTexturePackerNode * f = mFreeList; + TexturePackerNode * f = mFreeList; while ( f ) { - cTexturePackerNode * c = mFreeList; + TexturePackerNode * c = mFreeList; while ( c ) { if ( f != c ) @@ -151,9 +151,9 @@ void cTexturePacker::Validate() { #endif } -cTexturePackerTex * cTexturePacker::GetLonguestEdge() { - cTexturePackerTex * t = NULL; - std::list::iterator it; +TexturePackerTex * TexturePacker::GetLonguestEdge() { + TexturePackerTex * t = NULL; + std::list::iterator it; for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { if ( !(*it)->Placed() ) { @@ -165,9 +165,9 @@ cTexturePackerTex * cTexturePacker::GetLonguestEdge() { return t; } -cTexturePackerTex * cTexturePacker::GetShortestEdge() { - cTexturePackerTex * t = NULL; - std::list::reverse_iterator it; +TexturePackerTex * TexturePacker::GetShortestEdge() { + TexturePackerTex * t = NULL; + std::list::reverse_iterator it; for ( it = mTextures.rbegin(); it != mTextures.rend(); it++ ) { if ( !(*it)->Placed() ) { @@ -179,11 +179,11 @@ cTexturePackerTex * cTexturePacker::GetShortestEdge() { return t; } -void cTexturePacker::AddBorderToTextures( const Int32& BorderSize ) { - cTexturePackerTex * t; +void TexturePacker::AddBorderToTextures( const Int32& BorderSize ) { + TexturePackerTex * t; if ( 0 != BorderSize ) { - std::list::iterator it; + std::list::iterator it; for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { t = (*it); @@ -196,13 +196,13 @@ void cTexturePacker::AddBorderToTextures( const Int32& BorderSize ) { } } -cTexturePackerNode * cTexturePacker::GetBestFit( cTexturePackerTex * t, cTexturePackerNode ** prevBestFit, Int32 * EdgeCount ) { +TexturePackerNode * TexturePacker::GetBestFit( TexturePackerTex * t, TexturePackerNode ** prevBestFit, Int32 * EdgeCount ) { Int32 leastY = 0x7FFFFFFF; Int32 leastX = 0x7FFFFFFF; - cTexturePackerNode * previousBestFit = NULL; - cTexturePackerNode * bestFit = NULL; - cTexturePackerNode * previous = NULL; - cTexturePackerNode * search = mFreeList; + TexturePackerNode * previousBestFit = NULL; + TexturePackerNode * bestFit = NULL; + TexturePackerNode * previous = NULL; + TexturePackerNode * search = mFreeList; Int32 edgeCount = 0; // Walk the singly linked list of free nodes @@ -245,7 +245,7 @@ cTexturePackerNode * cTexturePacker::GetBestFit( cTexturePackerTex * t, cTexture return bestFit; } -void cTexturePacker::InsertTexture( cTexturePackerTex * t, cTexturePackerNode * bestFit, Int32 edgeCount, cTexturePackerNode * previousBestFit ) { +void TexturePacker::InsertTexture( TexturePackerTex * t, TexturePackerNode * bestFit, Int32 edgeCount, TexturePackerNode * previousBestFit ) { if ( NULL != bestFit ) { Validate(); @@ -340,13 +340,13 @@ void cTexturePacker::InsertTexture( cTexturePackerTex * t, cTexturePackerNode * } } -void cTexturePacker::CreateChild() { - mChild = eeNew( cTexturePacker, ( mWidth, mHeight, mForcePowOfTwo, mPixelBorder, mAllowFlipping ) ); +void TexturePacker::CreateChild() { + mChild = eeNew( TexturePacker, ( mWidth, mHeight, mForcePowOfTwo, mPixelBorder, mAllowFlipping ) ); - std::list::iterator it; - std::list< std::list::iterator > remove; + std::list::iterator it; + std::list< std::list::iterator > remove; - cTexturePackerTex * t = NULL; + TexturePackerTex * t = NULL; for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { t = (*it); @@ -364,7 +364,7 @@ void cTexturePacker::CreateChild() { } // Removes the non-placed textures from the pack - std::list< std::list::iterator >::iterator itit; + std::list< std::list::iterator >::iterator itit; for ( itit = remove.begin(); itit != remove.end(); itit++ ) { mTextures.erase( *itit ); @@ -373,7 +373,7 @@ void cTexturePacker::CreateChild() { mChild->PackTextures(); } -bool cTexturePacker::AddTexturesPath( std::string TexturesPath ) { +bool TexturePacker::AddTexturesPath( std::string TexturesPath ) { if ( FileSystem::IsDirectory( TexturesPath ) ) { FileSystem::DirPathAddSlashAtEnd( TexturesPath ); @@ -393,7 +393,7 @@ bool cTexturePacker::AddTexturesPath( std::string TexturesPath ) { return false; } -bool cTexturePacker::AddPackerTex( cTexturePackerTex * TPack ) { +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 ) || @@ -403,7 +403,7 @@ bool cTexturePacker::AddPackerTex( cTexturePackerTex * TPack ) { mTotalArea += TPack->Area(); // Insert ordered - std::list::iterator it; + std::list::iterator it; bool Added = false; @@ -426,25 +426,25 @@ bool cTexturePacker::AddPackerTex( cTexturePackerTex * TPack ) { return false; } -bool cTexturePacker::AddImage( cImage * Img, const std::string& Name ) { - cTexturePackerTex * TPack = eeNew( cTexturePackerTex, ( Img, Name ) ); +bool TexturePacker::AddImage( Image * Img, const std::string& Name ) { + TexturePackerTex * TPack = eeNew( TexturePackerTex, ( Img, Name ) ); return AddPackerTex( TPack ); } -bool cTexturePacker::AddTexture( const std::string& TexturePath ) { +bool TexturePacker::AddTexture( const std::string& TexturePath ) { if ( FileSystem::FileExists( TexturePath ) ) { - cTexturePackerTex * TPack = eeNew( cTexturePackerTex, ( TexturePath ) ); + TexturePackerTex * TPack = eeNew( TexturePackerTex, ( TexturePath ) ); return AddPackerTex( TPack ); } return false; } -Int32 cTexturePacker::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; - cTexturePackerTex * t = NULL; + TexturePackerTex * t = NULL; AddBorderToTextures( (Int32)mPixelBorder ); @@ -453,7 +453,7 @@ Int32 cTexturePacker::PackTextures() { // pack the textures, the return code is mCount = (Int32)mTextures.size(); // We must place each texture - std::list::iterator it; + std::list::iterator it; for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { // For the texture with the longest edge we place it according to this criteria. // (1) If it is a perfect match, we always accept it as it causes the least amount of fragmentation. @@ -465,9 +465,9 @@ Int32 cTexturePacker::PackTextures() { // pack the textures, the return code is else if ( PackTiny == mStrategy ) t = GetShortestEdge(); - cTexturePackerNode * previousBestFit = NULL; + TexturePackerNode * previousBestFit = NULL; Int32 edgeCount = 0; - cTexturePackerNode * bestFit = GetBestFit( t, &previousBestFit, &edgeCount ); + TexturePackerNode * bestFit = GetBestFit( t, &previousBestFit, &edgeCount ); if ( NULL == bestFit ) { if ( PackBig == mStrategy ) { @@ -508,7 +508,7 @@ Int32 cTexturePacker::PackTextures() { // pack the textures, the return code is return ( mWidth * mHeight ) - mTotalArea; } -void cTexturePacker::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(); @@ -518,13 +518,13 @@ void cTexturePacker::Save( const std::string& Filepath, const EE_SAVE_TYPE& Form mFilepath = Filepath; mSaveExtensions = SaveExtensions; - cImage Img( (Uint32)mWidth, (Uint32)mHeight, (Uint32)4 ); + Image Img( (Uint32)mWidth, (Uint32)mHeight, (Uint32)4 ); Img.FillWithColor( ColorA(0,0,0,0) ); - cTexturePackerTex * t = NULL; + TexturePackerTex * t = NULL; int w, h, c; - std::list::iterator it; + std::list::iterator it; for ( it = mTextures.begin(); it != mTextures.end(); it++ ) { t = (*it); @@ -536,7 +536,7 @@ void cTexturePacker::Save( const std::string& Filepath, const EE_SAVE_TYPE& Form data = stbi_load( t->Name().c_str(), &w, &h, &c, 0 ); if ( NULL != data && t->Width() == w && t->Height() == h ) { - cImage * ImgCopy = eeNew( cImage, ( data, w, h, c ) ); + Image * ImgCopy = eeNew( Image, ( data, w, h, c ) ); if ( t->Flipped() ) ImgCopy->Flip(); @@ -576,8 +576,8 @@ void cTexturePacker::Save( const std::string& Filepath, const EE_SAVE_TYPE& Form SaveSubTextures(); } -Int32 cTexturePacker::GetChildCount() { - cTexturePacker * Child = mChild; +Int32 TexturePacker::GetChildCount() { + TexturePacker * Child = mChild; Int32 ChildCount = 0; while ( NULL != Child ) { @@ -588,7 +588,7 @@ Int32 cTexturePacker::GetChildCount() { return ChildCount; } -void cTexturePacker::SaveSubTextures() { +void TexturePacker::SaveSubTextures() { if ( NULL != mParent ) return; @@ -616,7 +616,7 @@ void cTexturePacker::SaveSubTextures() { TexHdr[ 0 ] = CreateTextureHdr( this ); Int32 HdrPos = 1; - cTexturePacker * Child = mChild; + TexturePacker * Child = mChild; while ( NULL != Child ) { TexHdr[ HdrPos ] = CreateTextureHdr( Child ); @@ -640,7 +640,7 @@ void cTexturePacker::SaveSubTextures() { fs.Write( reinterpret_cast (&tSubTexturesHdr[ 0 ]), sizeof(sSubTextureHdr) * (std::streamsize)tSubTexturesHdr.size() ); Int32 HdrPos = 1; - cTexturePacker * Child = mChild; + TexturePacker * Child = mChild; while ( NULL != Child ) { fs.Write( reinterpret_cast (&TexHdr[ HdrPos ]), sizeof(sTextureHdr) ); @@ -657,15 +657,15 @@ void cTexturePacker::SaveSubTextures() { } } -void cTexturePacker::CreateSubTexturesHdr( cTexturePacker * 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::iterator it; - cTexturePackerTex * tTex; + std::list tTextures = *(Packer->GetTexturePackPtr()); + std::list::iterator it; + TexturePackerTex * tTex; SubTextures.resize( tTextures.size() ); @@ -705,7 +705,7 @@ void cTexturePacker::CreateSubTexturesHdr( cTexturePacker * Packer, std::vector< } } -sTextureHdr cTexturePacker::CreateTextureHdr( cTexturePacker * Packer ) { +sTextureHdr TexturePacker::CreateTextureHdr( TexturePacker * Packer ) { sTextureHdr TexHdr; std::string name( FileSystem::FileNameFromPath( Packer->GetFilepath() ) ); @@ -721,10 +721,10 @@ sTextureHdr cTexturePacker::CreateTextureHdr( cTexturePacker * Packer ) { return TexHdr; } -void cTexturePacker::ChildSave( const EE_SAVE_TYPE& Format ) { +void TexturePacker::ChildSave( const EE_SAVE_TYPE& Format ) { if ( NULL != mChild ) { - cTexturePacker * Parent = mChild->GetParent(); - cTexturePacker * LastParent = NULL; + TexturePacker * Parent = mChild->GetParent(); + TexturePacker * LastParent = NULL; Int32 ParentCount = 0; // Find the grand parent @@ -744,39 +744,39 @@ void cTexturePacker::ChildSave( const EE_SAVE_TYPE& Format ) { } } -cTexturePacker * cTexturePacker::GetChild() const { +TexturePacker * TexturePacker::GetChild() const { return mChild; } -cTexturePacker * cTexturePacker::GetParent() const { +TexturePacker * TexturePacker::GetParent() const { return mParent; } -std::list * cTexturePacker::GetTexturePackPtr() { +std::list * TexturePacker::GetTexturePackPtr() { return &mTextures; } -const std::string& cTexturePacker::GetFilepath() const { +const std::string& TexturePacker::GetFilepath() const { return mFilepath; } -const Int32& cTexturePacker::GetWidth() const { +const Int32& TexturePacker::GetWidth() const { return mWidth; } -const Int32& cTexturePacker::GetHeight() const { +const Int32& TexturePacker::GetHeight() const { return mHeight; } -const Int32& cTexturePacker::GetPlacedCount() const { +const Int32& TexturePacker::GetPlacedCount() const { return mPlacedCount; } -const Int32& cTexturePacker::Width() const { +const Int32& TexturePacker::Width() const { return mWidth; } -const Int32& cTexturePacker::Height() const { +const Int32& TexturePacker::Height() const { return mHeight; } diff --git a/src/eepp/graphics/ctexturepackernode.cpp b/src/eepp/graphics/texturepackernode.cpp similarity index 77% rename from src/eepp/graphics/ctexturepackernode.cpp rename to src/eepp/graphics/texturepackernode.cpp index ce065a847..a992d7ff0 100644 --- a/src/eepp/graphics/ctexturepackernode.cpp +++ b/src/eepp/graphics/texturepackernode.cpp @@ -1,8 +1,8 @@ -#include +#include namespace EE { namespace Graphics { namespace Private { -cTexturePackerNode::cTexturePackerNode( Int32 x, Int32 y, Int32 width, Int32 height ) { +TexturePackerNode::TexturePackerNode( Int32 x, Int32 y, Int32 width, Int32 height ) { mX = x; mY = y; mWidth = width; @@ -10,11 +10,11 @@ cTexturePackerNode::cTexturePackerNode( Int32 x, Int32 y, Int32 width, Int32 hei mNext = NULL; } -cTexturePackerNode * cTexturePackerNode::GetNext() const { +TexturePackerNode * TexturePackerNode::GetNext() const { return mNext; } -bool cTexturePackerNode::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,11 +45,11 @@ bool cTexturePackerNode::Fits( Int32 width, Int32 height, Int32 &edgeCount, cons return ret; } -void cTexturePackerNode::GetRect( Recti &r ) const { +void TexturePackerNode::GetRect( Recti &r ) const { r = Recti( mX, mY, mX + mWidth - 1, mY + mHeight - 1 ); } -void cTexturePackerNode::Validate( cTexturePackerNode * n ) { +void TexturePackerNode::Validate( TexturePackerNode * n ) { Recti r1; Recti r2; GetRect( r1 ); @@ -57,7 +57,7 @@ void cTexturePackerNode::Validate( cTexturePackerNode * n ) { eeASSERT( !r1.Intersect(r2) ); } -bool cTexturePackerNode::Merge( const cTexturePackerNode& n ) { +bool TexturePackerNode::Merge( const TexturePackerNode& n ) { bool ret = false; Recti r1; diff --git a/src/eepp/graphics/ctexturepackernode.hpp b/src/eepp/graphics/texturepackernode.hpp similarity index 72% rename from src/eepp/graphics/ctexturepackernode.hpp rename to src/eepp/graphics/texturepackernode.hpp index f6266482c..2412f75a9 100644 --- a/src/eepp/graphics/ctexturepackernode.hpp +++ b/src/eepp/graphics/texturepackernode.hpp @@ -5,21 +5,21 @@ namespace EE { namespace Graphics { namespace Private { -class cTexturePackerNode { +class TexturePackerNode { public: - cTexturePackerNode( Int32 x, Int32 y, Int32 width, Int32 height ); + TexturePackerNode( Int32 x, Int32 y, Int32 width, Int32 height ); bool Fits( Int32 wid, Int32 hit, Int32 &edgeCount, const bool& AllowFlipping = false ) const; void GetRect( Recti &r ) const; - void Validate( cTexturePackerNode * n ); + void Validate( TexturePackerNode * n ); - bool Merge( const cTexturePackerNode &n ); + bool Merge( const TexturePackerNode &n ); - cTexturePackerNode * GetNext() const; + TexturePackerNode * GetNext() const; - inline void SetNext( cTexturePackerNode * Next ) { mNext = Next; } + inline void SetNext( TexturePackerNode * Next ) { mNext = Next; } inline const Int32& X() const { return mX; } @@ -37,7 +37,7 @@ class cTexturePackerNode { inline void Height( const Int32& H ) { mHeight = H; } protected: - cTexturePackerNode * mNext; + TexturePackerNode * mNext; Int32 mX; Int32 mY; Int32 mWidth; diff --git a/src/eepp/graphics/ctexturepackertex.cpp b/src/eepp/graphics/texturepackertex.cpp similarity index 72% rename from src/eepp/graphics/ctexturepackertex.cpp rename to src/eepp/graphics/texturepackertex.cpp index 1d6edb3a8..305fdadf7 100644 --- a/src/eepp/graphics/ctexturepackertex.cpp +++ b/src/eepp/graphics/texturepackertex.cpp @@ -1,10 +1,10 @@ -#include -#include +#include +#include #include namespace EE { namespace Graphics { namespace Private { -cTexturePackerTex::cTexturePackerTex( const std::string& Name ) : +TexturePackerTex::TexturePackerTex( const std::string& Name ) : mName(Name), mWidth(0), mHeight(0), @@ -26,7 +26,7 @@ cTexturePackerTex::cTexturePackerTex( const std::string& Name ) : } } -cTexturePackerTex::cTexturePackerTex(cImage * Img , const std::string& Name ) : +TexturePackerTex::TexturePackerTex( EE::Graphics::Image * Img , const std::string& Name ) : mName( Name ), mWidth( Img->Width() ), mHeight( Img->Height() ), @@ -46,7 +46,7 @@ cTexturePackerTex::cTexturePackerTex(cImage * Img , const std::string& Name ) : mLoadedInfo = true; } -void cTexturePackerTex::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 cTexturePackerTex::Place( Int32 x, Int32 y, bool flipped ) { } } -cImage * cTexturePackerTex::Image() const { +EE::Graphics::Image * TexturePackerTex::Image() const { return mImg; } diff --git a/src/eepp/graphics/ctexturepackertex.hpp b/src/eepp/graphics/texturepackertex.hpp similarity index 90% rename from src/eepp/graphics/ctexturepackertex.hpp rename to src/eepp/graphics/texturepackertex.hpp index 8461b2a2b..8f3f1b45d 100644 --- a/src/eepp/graphics/ctexturepackertex.hpp +++ b/src/eepp/graphics/texturepackertex.hpp @@ -4,15 +4,16 @@ #include namespace EE { namespace Graphics { -class cImage; + +class Image; namespace Private { -class cTexturePackerTex { +class TexturePackerTex { public: - cTexturePackerTex( const std::string& Name ); + TexturePackerTex( const std::string& Name ); - cTexturePackerTex( cImage * Img, const std::string& Name ); + TexturePackerTex( EE::Graphics::Image * Img, const std::string& Name ); void Place( Int32 x, Int32 y, bool flipped ); @@ -66,7 +67,7 @@ class cTexturePackerTex { inline void OffsetY( const Int32& offy ){ mDestHeight = offy; } - cImage * Image() const; + EE::Graphics::Image * Image() const; protected: std::string mName; Int32 mWidth; @@ -84,7 +85,7 @@ class cTexturePackerTex { bool mPlaced; bool mLoadedInfo; bool mDisabled; - cImage * mImg; + EE::Graphics::Image * mImg; }; }}} diff --git a/src/eepp/graphics/ctexturesaver.cpp b/src/eepp/graphics/texturesaver.cpp similarity index 69% rename from src/eepp/graphics/ctexturesaver.cpp rename to src/eepp/graphics/texturesaver.cpp index f36cbc263..9639255b6 100644 --- a/src/eepp/graphics/ctexturesaver.cpp +++ b/src/eepp/graphics/texturesaver.cpp @@ -1,9 +1,9 @@ -#include -#include +#include +#include namespace EE { namespace Graphics { namespace Private { -cTextureSaver::cTextureSaver( int textureBind ) : +TextureSaver::TextureSaver( int textureBind ) : mTextureBinded( 0 ), mTextureToBind( textureBind ) { @@ -13,7 +13,7 @@ cTextureSaver::cTextureSaver( int textureBind ) : GLi->BindTexture( GL_TEXTURE_2D, mTextureToBind ); } -cTextureSaver::~cTextureSaver() { +TextureSaver::~TextureSaver() { if ( mTextureBinded != mTextureToBind ) GLi->BindTexture( GL_TEXTURE_2D, mTextureBinded ); } diff --git a/src/eepp/graphics/ctexturesaver.hpp b/src/eepp/graphics/texturesaver.hpp similarity index 67% rename from src/eepp/graphics/ctexturesaver.hpp rename to src/eepp/graphics/texturesaver.hpp index b0c99c081..64710b727 100644 --- a/src/eepp/graphics/ctexturesaver.hpp +++ b/src/eepp/graphics/texturesaver.hpp @@ -6,11 +6,11 @@ namespace EE { namespace Graphics { namespace Private { -class cTextureSaver { +class TextureSaver { public: - cTextureSaver( int textureBind = -1 /** with -1 as default it avoid the auto-binding */ ); + TextureSaver( int textureBind = -1 /** with -1 as default it avoid the auto-binding */ ); - ~cTextureSaver(); + ~TextureSaver(); private: int mTextureBinded; int mTextureToBind; diff --git a/src/eepp/graphics/cttffont.cpp b/src/eepp/graphics/ttffont.cpp similarity index 81% rename from src/eepp/graphics/cttffont.cpp rename to src/eepp/graphics/ttffont.cpp index efc243a35..30624fac1 100755 --- a/src/eepp/graphics/cttffont.cpp +++ b/src/eepp/graphics/ttffont.cpp @@ -1,19 +1,19 @@ -#include -#include +#include +#include #include #include using namespace HaikuTTF; namespace EE { namespace Graphics { -cTTFFont::OutlineMethods cTTFFont::OutlineMethod = cTTFFont::OutlineEntropia; +TTFFont::OutlineMethods TTFFont::OutlineMethod = TTFFont::OutlineEntropia; -cTTFFont * cTTFFont::New( const std::string FontName ) { - return eeNew( cTTFFont, ( FontName ) ); +TTFFont * TTFFont::New( const std::string FontName ) { + return eeNew( TTFFont, ( FontName ) ); } -cTTFFont::cTTFFont( const std::string FontName ) : - cFont( FONT_TYPE_TTF, FontName ), +TTFFont::TTFFont( const std::string FontName ) : + Font( FONT_TYPE_TTF, FontName ), mFont(NULL), mFontOutline(NULL), mPixels(NULL), @@ -22,11 +22,11 @@ cTTFFont::cTTFFont( const std::string FontName ) : { } -cTTFFont::~cTTFFont() { +TTFFont::~TTFFont() { hkFontManager::instance()->Destroy(); } -bool cTTFFont::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; @@ -39,7 +39,7 @@ bool cTTFFont::LoadFromPack( Pack* Pack, const std::string& FilePackPath, const return Ret; } -bool cTTFFont::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 cTTFFont::LoadFromMemory( Uint8* TTFData, const unsigned int& TTFDataSize, return iLoad( Size, Style, NumCharsToGen, FontColor, OutlineSize, OutlineColor, AddPixelSeparator ); } -bool cTTFFont::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 ) ) { @@ -80,7 +80,7 @@ bool cTTFFont::Load( const std::string& Filepath, const unsigned int& Size, EE_T return false; } -bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, Uint8 OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) { +bool TTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const Uint16& NumCharsToGen, const RGB& FontColor, Uint8 OutlineSize, const RGB& OutlineColor, const bool& AddPixelSeparator ) { Rect CurrentPos; Sizei GlyphRect; @@ -188,8 +188,8 @@ bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const U TempGlyph.MaxX = TempGlyph.MinX + GlyphRect.x; } - cImage out( TempOutGlyphSurface, GlyphRect.x, GlyphRect.y, 4 ); out.AvoidFreeImage( true ); - cImage 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 ); @@ -311,11 +311,11 @@ bool cTTFFont::iLoad( const unsigned int& Size, EE_TTF_FONT_STYLE Style, const U return true; } -void cTTFFont::UpdateLoading() { +void TTFFont::UpdateLoading() { if ( mTexReady && NULL != mPixels ) { std::string name( FileSystem::FileRemoveExtension( FileSystem::FileNameFromPath( mFilepath ) ) ); - mTexId = cTextureFactory::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 ); @@ -325,15 +325,15 @@ void cTTFFont::UpdateLoading() { } } -void cTTFFont::RebuildFromGlyphs() { +void TTFFont::RebuildFromGlyphs() { Float Top, Bottom; Rectf tR; mTexCoords.resize( mNumChars ); - cTexture * Tex = cTextureFactory::instance()->GetTexture( mTexId ); + Texture * Tex = TextureFactory::instance()->GetTexture( mTexId ); - cTextureFactory::instance()->Bind( Tex ); + TextureFactory::instance()->Bind( Tex ); eeGlyph tGlyph; @@ -368,8 +368,8 @@ void cTTFFont::RebuildFromGlyphs() { } } -bool cTTFFont::SaveTexture( const std::string& Filepath, const EE_SAVE_TYPE& Format ) { - cTexture* Tex = cTextureFactory::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 ); @@ -377,7 +377,7 @@ bool cTTFFont::SaveTexture( const std::string& Filepath, const EE_SAVE_TYPE& For return false; } -bool cTTFFont::SaveCoordinates( const std::string& Filepath ) { +bool TTFFont::SaveCoordinates( const std::string& Filepath ) { IOStreamFile fs( Filepath, std::ios::out | std::ios::binary ); if ( fs.IsOpen() ) { @@ -402,17 +402,17 @@ bool cTTFFont::SaveCoordinates( const std::string& Filepath ) { return true; } else { - eePRINTL("cTTFFont::SaveCoordinates(): Unable to write file: %s.", Filepath.c_str() ); + eePRINTL("TTFFont::SaveCoordinates(): Unable to write file: %s.", Filepath.c_str() ); } return false; } -bool cTTFFont::Save( const std::string& TexturePath, const std::string& CoordinatesDatPath, const EE_SAVE_TYPE& Format ) { +bool TTFFont::Save( const std::string& TexturePath, const std::string& CoordinatesDatPath, const EE_SAVE_TYPE& Format ) { return SaveTexture(TexturePath, Format) && SaveCoordinates( CoordinatesDatPath ); } -void cTTFFont::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 cTTFFont::MakeOutline( Uint8 *in, Uint8 *out, Int16 w, Int16 h , Int16 Outl } } -bool cTTFFont::ThreadedLoading() const { +bool TTFFont::ThreadedLoading() const { return mThreadedLoading; } -void cTTFFont::ThreadedLoading( const bool& isThreaded ) { +void TTFFont::ThreadedLoading( const bool& isThreaded ) { mThreadedLoading = isThreaded; } diff --git a/src/eepp/graphics/cttffontloader.cpp b/src/eepp/graphics/ttffontloader.cpp similarity index 53% rename from src/eepp/graphics/cttffontloader.cpp rename to src/eepp/graphics/ttffontloader.cpp index 26b4be4e1..347cdf820 100644 --- a/src/eepp/graphics/cttffontloader.cpp +++ b/src/eepp/graphics/ttffontloader.cpp @@ -1,11 +1,11 @@ -#include -#include -#include +#include +#include +#include namespace EE { namespace Graphics { -cTTFFontLoader::cTTFFontLoader( const std::string& FontName, 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 ) : - ObjectLoader( FontTTFLoader ), +TTFFontLoader::TTFFontLoader( const std::string& FontName, 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 ) : + ObjectLoader( FontTTFLoaderType ), mLoadType( TTF_LT_PATH ), mFontName( FontName ), mFilepath( Filepath ), @@ -21,8 +21,8 @@ cTTFFontLoader::cTTFFontLoader( const std::string& FontName, const std::string& Create(); } -cTTFFontLoader::cTTFFontLoader( 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 ) : - ObjectLoader( FontTTFLoader ), +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 ) : + ObjectLoader( FontTTFLoaderType ), mLoadType( TTF_LT_PACK ), mFontName( FontName ), mFilepath( FilePackPath ), @@ -39,8 +39,8 @@ cTTFFontLoader::cTTFFontLoader( const std::string& FontName, Pack * Pack, const Create(); } -cTTFFontLoader::cTTFFontLoader( 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 ) : - ObjectLoader( FontTTFLoader ), +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 ) : + ObjectLoader( FontTTFLoaderType ), mLoadType( TTF_LT_MEM ), mFontName( FontName ), mSize( Size ), @@ -57,14 +57,14 @@ cTTFFontLoader::cTTFFontLoader( const std::string& FontName, Uint8* TTFData, con Create(); } -cTTFFontLoader::~cTTFFontLoader() { +TTFFontLoader::~TTFFontLoader() { } -void cTTFFontLoader::Create() { - mFont = cTTFFont::New( mFontName ); +void TTFFontLoader::Create() { + mFont = TTFFont::New( mFontName ); } -void cTTFFontLoader::Start() { +void TTFFontLoader::Start() { ObjectLoader::Start(); mFont->ThreadedLoading( mThreaded ); @@ -82,7 +82,7 @@ void cTTFFontLoader::Start() { Update(); } -void cTTFFontLoader::Update() { +void TTFFontLoader::Update() { if ( !mLoaded && mFontLoaded ) { mFont->UpdateLoading(); @@ -90,37 +90,37 @@ void cTTFFontLoader::Update() { } } -const std::string& cTTFFontLoader::Id() const { +const std::string& TTFFontLoader::Id() const { return mFontName; } -void cTTFFontLoader::LoadFromPath() { +void TTFFontLoader::LoadFromPath() { mFont->Load( mFilepath, mSize, mStyle, mNumCharsToGen, mFontColor, mOutlineSize, mOutlineColor, mAddPixelSeparator ); } -void cTTFFontLoader::LoadFromMemory() { +void TTFFontLoader::LoadFromMemory() { mFont->LoadFromMemory( mData, mDataSize, mSize, mStyle, mNumCharsToGen, mFontColor, mOutlineSize, mOutlineColor, mAddPixelSeparator ); } -void cTTFFontLoader::LoadFromPack() { +void TTFFontLoader::LoadFromPack() { mFont->LoadFromPack( mPack, mFilepath, mSize, mStyle, mNumCharsToGen, mFontColor, mOutlineSize, mOutlineColor, mAddPixelSeparator ); } -cFont * cTTFFontLoader::Font() const { +Graphics::Font * TTFFontLoader::Font() const { return mFont; } -void cTTFFontLoader::Unload() { +void TTFFontLoader::Unload() { if ( mLoaded ) { - cTextureFactory::instance()->Remove( mFont->GetTexId() ); + TextureFactory::instance()->Remove( mFont->GetTexId() ); - cFontManager::instance()->Remove( mFont ); + FontManager::instance()->Remove( mFont ); Reset(); } } -void cTTFFontLoader::Reset() { +void TTFFontLoader::Reset() { ObjectLoader::Reset(); mFontLoaded = false; diff --git a/src/eepp/graphics/cvertexbuffer.cpp b/src/eepp/graphics/vertexbuffer.cpp similarity index 55% rename from src/eepp/graphics/cvertexbuffer.cpp rename to src/eepp/graphics/vertexbuffer.cpp index 36bce0e2c..27b7782e6 100644 --- a/src/eepp/graphics/cvertexbuffer.cpp +++ b/src/eepp/graphics/vertexbuffer.cpp @@ -1,20 +1,20 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include using namespace EE::Graphics::Private; namespace EE { namespace Graphics { -cVertexBuffer * cVertexBuffer::New( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, EE_VBO_USAGE_TYPE UsageType ) { +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 ) ) - return eeNew( cVertexBufferVBO, ( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) ); + return eeNew( VertexBufferVBO, ( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) ); - return eeNew( cVertexBufferOGL, ( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) ); + return eeNew( VertexBufferOGL, ( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) ); } -cVertexBuffer::cVertexBuffer( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, EE_VBO_USAGE_TYPE UsageType ) : +VertexBuffer::VertexBuffer( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, EE_VBO_USAGE_TYPE UsageType ) : mVertexFlags( VertexFlags ), mDrawType( DrawType ), mUsageType( UsageType ), @@ -31,82 +31,82 @@ cVertexBuffer::cVertexBuffer( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, } } - cVertexBufferManager::instance()->Add( this ); + VertexBufferManager::instance()->Add( this ); } -cVertexBuffer::~cVertexBuffer() { - cVertexBufferManager::instance()->Remove( this ); +VertexBuffer::~VertexBuffer() { + VertexBufferManager::instance()->Remove( this ); } -void cVertexBuffer::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 cVertexBuffer::AddVertex( const Vector2f& Vertex ) { +void VertexBuffer::AddVertex( const Vector2f& Vertex ) { AddVertex( VERTEX_FLAG_POSITION, Vertex ); } -void cVertexBuffer::AddVertexCoord( const Vector2f& VertexCoord, const Uint32& TextureLevel ) { +void VertexBuffer::AddVertexCoord( const Vector2f& VertexCoord, const Uint32& TextureLevel ) { AddVertex( VERTEX_FLAG_TEXTURE0 + TextureLevel, VertexCoord ); } -void cVertexBuffer::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 cVertexBuffer::AddIndex( const Uint32& Index ) { +void VertexBuffer::AddIndex( const Uint32& Index ) { mIndexArray.push_back( Index ); VERTEX_FLAG_SET( mVertexFlags, VERTEX_FLAG_USE_INDICES ); } -void cVertexBuffer::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 cVertexBuffer::ResizeIndices( const Uint32& Size ) { +void VertexBuffer::ResizeIndices( const Uint32& Size ) { mIndexArray.resize( Size ); } -Float * cVertexBuffer::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 * cVertexBuffer::GetColorArray() { +Uint8 * VertexBuffer::GetColorArray() { if ( mColorArray.size() ) return &mColorArray[0]; return NULL; } -Uint32 * cVertexBuffer::GetIndices() { +Uint32 * VertexBuffer::GetIndices() { if ( mIndexArray.size() ) return &mIndexArray[0]; return NULL; } -Uint32 cVertexBuffer::GetVertexCount() { +Uint32 VertexBuffer::GetVertexCount() { return (Uint32)mVertexArray[ VERTEX_FLAG_POSITION ].size() / eeVertexElements[ VERTEX_FLAG_POSITION ]; } -Uint32 cVertexBuffer::GetIndexCount() { +Uint32 VertexBuffer::GetIndexCount() { return (Uint32)mIndexArray.size(); } -Vector2f cVertexBuffer::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 cVertexBuffer::GetVector2( const Uint32& Type, const Uint32& Index ) { return Vector2f( mVertexArray[ Type ][ pos ], mVertexArray[ Type ][ pos + 1 ] ); } -ColorA cVertexBuffer::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 cVertexBuffer::GetColor( const Uint32& Index ) { return ColorA( mColorArray[ pos ], mColorArray[ pos + 1 ], mColorArray[ pos + 2 ], mColorArray[ pos + 3 ] ); } -Uint32 cVertexBuffer::GetIndex( const Uint32& Index ) { +Uint32 VertexBuffer::GetIndex( const Uint32& Index ) { eeASSERT( Index < mIndexArray.size() ); return mIndexArray[ Index ]; } -void cVertexBuffer::SetElementNum( Int32 Num ) { +void VertexBuffer::SetElementNum( Int32 Num ) { mElemDraw = Num; } -const Int32& cVertexBuffer::GetElementNum() const { +const Int32& VertexBuffer::GetElementNum() const { return mElemDraw; } -void cVertexBuffer::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 new file mode 100644 index 000000000..8acab62bd --- /dev/null +++ b/src/eepp/graphics/vertexbuffermanager.cpp @@ -0,0 +1,22 @@ +#include + +namespace EE { namespace Graphics { namespace Private { + +SINGLETON_DECLARE_IMPLEMENTATION(VertexBufferManager) + +VertexBufferManager::VertexBufferManager() +{ +} + +VertexBufferManager::~VertexBufferManager() +{ +} + +void VertexBufferManager::Reload() { + std::list::iterator it; + + for ( it = mResources.begin(); it != mResources.end(); it++ ) + (*it)->Reload(); +} + +}}} diff --git a/src/eepp/graphics/cvertexbuffermanager.hpp b/src/eepp/graphics/vertexbuffermanager.hpp similarity index 51% rename from src/eepp/graphics/cvertexbuffermanager.hpp rename to src/eepp/graphics/vertexbuffermanager.hpp index 2f17c2b71..685c23824 100644 --- a/src/eepp/graphics/cvertexbuffermanager.hpp +++ b/src/eepp/graphics/vertexbuffermanager.hpp @@ -2,19 +2,19 @@ #define EE_GRAPHICSCVERTEXBUFFERMANAGER_HPP #include -#include +#include namespace EE { namespace Graphics { namespace Private { -class EE_API cVertexBufferManager : public Container { - SINGLETON_DECLARE_HEADERS(cVertexBufferManager) +class EE_API VertexBufferManager : public Container { + SINGLETON_DECLARE_HEADERS(VertexBufferManager) public: - virtual ~cVertexBufferManager(); + virtual ~VertexBufferManager(); void Reload(); protected: - cVertexBufferManager(); + VertexBufferManager(); }; }}} diff --git a/src/eepp/graphics/cvertexbufferogl.cpp b/src/eepp/graphics/vertexbufferogl.cpp similarity index 80% rename from src/eepp/graphics/cvertexbufferogl.cpp rename to src/eepp/graphics/vertexbufferogl.cpp index fe2bb2d51..4ad6cc59a 100644 --- a/src/eepp/graphics/cvertexbufferogl.cpp +++ b/src/eepp/graphics/vertexbufferogl.cpp @@ -1,26 +1,26 @@ -#include +#include #include -#include +#include namespace EE { namespace Graphics { -cVertexBufferOGL::cVertexBufferOGL( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, EE_VBO_USAGE_TYPE UsageType ) : - cVertexBuffer( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) +VertexBufferOGL::VertexBufferOGL( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, EE_VBO_USAGE_TYPE UsageType ) : + VertexBuffer( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ) { } -cVertexBufferOGL::~cVertexBufferOGL() { +VertexBufferOGL::~VertexBufferOGL() { } -void cVertexBufferOGL::Bind() { +void VertexBufferOGL::Bind() { SetVertexStates(); } -bool cVertexBufferOGL::Compile() { +bool VertexBufferOGL::Compile() { return true; } -void cVertexBufferOGL::Draw() { +void VertexBufferOGL::Draw() { if( VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_USE_INDICES ) ) { Int32 lSize = mElemDraw; @@ -33,7 +33,7 @@ void cVertexBufferOGL::Draw() { } } -void cVertexBufferOGL::SetVertexStates() { +void VertexBufferOGL::SetVertexStates() { Uint32 alloc = GetVertexCount() * sizeof(Float) * 2; Uint32 allocC = GetVertexCount() * 4; @@ -83,7 +83,7 @@ void cVertexBufferOGL::SetVertexStates() { } -void cVertexBufferOGL::Unbind() { +void VertexBufferOGL::Unbind() { if( !VERTEX_FLAG_QUERY( mVertexFlags, VERTEX_FLAG_POSITION ) ) { GLi->EnableClientState( GL_VERTEX_ARRAY ); } @@ -98,10 +98,10 @@ void cVertexBufferOGL::Unbind() { } } -void cVertexBufferOGL::Update( const Uint32& Types, bool Indices ) { +void VertexBufferOGL::Update( const Uint32& Types, bool Indices ) { } -void cVertexBufferOGL::Reload() { +void VertexBufferOGL::Reload() { } }} diff --git a/src/eepp/graphics/cvertexbuffervbo.cpp b/src/eepp/graphics/vertexbuffervbo.cpp similarity index 91% rename from src/eepp/graphics/cvertexbuffervbo.cpp rename to src/eepp/graphics/vertexbuffervbo.cpp index 147f223a8..a30a3ca50 100644 --- a/src/eepp/graphics/cvertexbuffervbo.cpp +++ b/src/eepp/graphics/vertexbuffervbo.cpp @@ -1,14 +1,14 @@ -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace EE { namespace Graphics { -cVertexBufferVBO::cVertexBufferVBO( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, EE_VBO_USAGE_TYPE UsageType ) : - cVertexBuffer( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ), +VertexBufferVBO::VertexBufferVBO( const Uint32& VertexFlags, EE_DRAW_MODE DrawType, const Int32& ReserveVertexSize, const Int32& ReserveIndexSize, EE_VBO_USAGE_TYPE UsageType ) : + VertexBuffer( VertexFlags, DrawType, ReserveVertexSize, ReserveIndexSize, UsageType ), mCompiled( false ), mBuffersSet( false ), mTextured( false ), @@ -18,7 +18,7 @@ cVertexBufferVBO::cVertexBufferVBO( const Uint32& VertexFlags, EE_DRAW_MODE Draw memset( mArrayHandle, VERTEX_FLAGS_COUNT, 0 ); } -cVertexBufferVBO::~cVertexBufferVBO() { +VertexBufferVBO::~VertexBufferVBO() { for( Int32 i = 0; i < VERTEX_FLAGS_COUNT; i++ ) { if( VERTEX_FLAG_QUERY( mVertexFlags, i ) && mArrayHandle[ i ] ) { glDeleteBuffersARB( 1,(unsigned int *)&mArrayHandle[ i ] ); @@ -34,7 +34,7 @@ cVertexBufferVBO::~cVertexBufferVBO() { } } -void cVertexBufferVBO::Bind() { +void VertexBufferVBO::Bind() { if ( !mCompiled ) { Compile(); @@ -45,7 +45,7 @@ void cVertexBufferVBO::Bind() { SetVertexStates(); } -bool cVertexBufferVBO::Compile() { +bool VertexBufferVBO::Compile() { if( mCompiled ) return false; @@ -105,7 +105,7 @@ bool cVertexBufferVBO::Compile() { return true; } -void cVertexBufferVBO::Draw() { +void VertexBufferVBO::Draw() { if ( !mCompiled ) return; @@ -143,7 +143,7 @@ void cVertexBufferVBO::Draw() { } } -void cVertexBufferVBO::SetVertexStates() { +void VertexBufferVBO::SetVertexStates() { #ifdef EE_GL3_ENABLED int index; #endif @@ -281,7 +281,7 @@ void cVertexBufferVBO::SetVertexStates() { } } -void cVertexBufferVBO::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; @@ -312,7 +312,7 @@ void cVertexBufferVBO::Update( const Uint32& Types, bool Indices ) { mBuffersSet = false; } -void cVertexBufferVBO::Reload() { +void VertexBufferVBO::Reload() { mCompiled = false; mBuffersSet = false; @@ -320,7 +320,7 @@ void cVertexBufferVBO::Reload() { } -void cVertexBufferVBO::Unbind() { +void VertexBufferVBO::Unbind() { if ( GLv_3CP != GLi->Version() ) { glBindBufferARB( GL_ARRAY_BUFFER, 0 ); } @@ -341,10 +341,10 @@ void cVertexBufferVBO::Unbind() { } } -void cVertexBufferVBO::Clear() { +void VertexBufferVBO::Clear() { mCompiled = false; mBuffersSet = false; - cVertexBuffer::Clear(); + VertexBuffer::Clear(); } diff --git a/src/eepp/physics/constraints/cdampedspring.cpp b/src/eepp/physics/constraints/cdampedspring.cpp index 998364cbd..9e4cfeee8 100644 --- a/src/eepp/physics/constraints/cdampedspring.cpp +++ b/src/eepp/physics/constraints/cdampedspring.cpp @@ -2,8 +2,8 @@ #ifdef PHYSICS_RENDERER_ENABLED #include -#include -#include +#include +#include using namespace EE::Graphics; #endif @@ -92,7 +92,7 @@ void cDampedSpring::Draw() { GLi->PointSize( mDrawPointSize ); - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); BR->SetTexture( NULL ); BR->PointsBegin(); BR->BatchPoint( a.x, a.y ); diff --git a/src/eepp/physics/constraints/cgroovejoint.cpp b/src/eepp/physics/constraints/cgroovejoint.cpp index 91a112d7e..e71e739fa 100644 --- a/src/eepp/physics/constraints/cgroovejoint.cpp +++ b/src/eepp/physics/constraints/cgroovejoint.cpp @@ -1,7 +1,7 @@ #include #ifdef PHYSICS_RENDERER_ENABLED -#include +#include using namespace EE::Graphics; #endif @@ -51,7 +51,7 @@ void cGrooveJoint::Draw() { cVect a = tovect( cpvadd(body_a->p, cpvrotate(joint->grv_a, body_a->rot)) ); cVect b = tovect( cpvadd(body_a->p, cpvrotate(joint->grv_b, body_a->rot)) ); cVect c = tovect( cpvadd(body_b->p, cpvrotate(joint->anchr2, body_b->rot)) ); - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); cpFloat ps = BR->GetPointSize(); BR->SetTexture( NULL ); diff --git a/src/eepp/physics/constraints/cpinjoint.cpp b/src/eepp/physics/constraints/cpinjoint.cpp index ffd9906e1..b01464620 100644 --- a/src/eepp/physics/constraints/cpinjoint.cpp +++ b/src/eepp/physics/constraints/cpinjoint.cpp @@ -1,7 +1,7 @@ #include #ifdef PHYSICS_RENDERER_ENABLED -#include +#include using namespace EE::Graphics; #endif @@ -50,7 +50,7 @@ void cPinJoint::Draw() { cpBody * body_b = mConstraint->b; cVect a = tovect( cpvadd( body_a->p, cpvrotate( joint->anchr1, body_a->rot ) ) ); cVect b = tovect( cpvadd( body_b->p, cpvrotate(joint->anchr2, body_b->rot ) ) ); - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); cpFloat ps = BR->GetPointSize(); BR->SetTexture( NULL ); diff --git a/src/eepp/physics/constraints/cpivotjoint.cpp b/src/eepp/physics/constraints/cpivotjoint.cpp index cf712f0b1..edc351582 100644 --- a/src/eepp/physics/constraints/cpivotjoint.cpp +++ b/src/eepp/physics/constraints/cpivotjoint.cpp @@ -1,7 +1,7 @@ #include #ifdef PHYSICS_RENDERER_ENABLED -#include +#include using namespace EE::Graphics; #endif @@ -51,7 +51,7 @@ void cPivotJoint::Draw() { cpPivotJoint* joint = (cpPivotJoint *)mConstraint; cVect a = tovect( cpvadd(body_a->p, cpvrotate(joint->anchr1, body_a->rot)) ); cVect b = tovect( cpvadd(body_b->p, cpvrotate(joint->anchr2, body_b->rot)) ); - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); cpFloat ps = BR->GetPointSize(); BR->SetTexture( NULL ); diff --git a/src/eepp/physics/constraints/cslidejoint.cpp b/src/eepp/physics/constraints/cslidejoint.cpp index 04e362ad7..a35753429 100644 --- a/src/eepp/physics/constraints/cslidejoint.cpp +++ b/src/eepp/physics/constraints/cslidejoint.cpp @@ -1,7 +1,7 @@ #include #ifdef PHYSICS_RENDERER_ENABLED -#include +#include using namespace EE::Graphics; #endif @@ -59,7 +59,7 @@ void cSlideJoint::Draw() { cVect a = tovect( cpvadd( body_a->p, cpvrotate( joint->anchr1, body_a->rot ) ) ); cVect b = tovect( cpvadd( body_b->p, cpvrotate( joint->anchr2, body_b->rot ) ) ); - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); cpFloat ps = BR->GetPointSize(); BR->SetTexture( NULL ); diff --git a/src/eepp/physics/cshape.cpp b/src/eepp/physics/cshape.cpp index f4c9fe73a..f2457bdfb 100644 --- a/src/eepp/physics/cshape.cpp +++ b/src/eepp/physics/cshape.cpp @@ -5,7 +5,7 @@ #include #ifdef PHYSICS_RENDERER_ENABLED -#include +#include using namespace EE::Graphics; #endif @@ -168,7 +168,7 @@ cShapeSegment * cShape::GetAsSegment() { void cShape::DrawBB() { #ifdef PHYSICS_RENDERER_ENABLED - cPrimitives P; + 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 ) ) ); diff --git a/src/eepp/physics/cshapecircle.cpp b/src/eepp/physics/cshapecircle.cpp index 59c0708fc..61759384a 100644 --- a/src/eepp/physics/cshapecircle.cpp +++ b/src/eepp/physics/cshapecircle.cpp @@ -3,8 +3,8 @@ #include #ifdef PHYSICS_RENDERER_ENABLED -#include -#include +#include +#include using namespace EE::Graphics; #endif @@ -38,7 +38,7 @@ void cShapeCircle::Radius( const cpFloat& radius ) { void cShapeCircle::Draw( cSpace * space ) { #ifdef PHYSICS_RENDERER_ENABLED - cPrimitives p; + Primitives p; cpCircleShape * cs = (cpCircleShape*)mShape; p.SetColor( ColorForShape( mShape, space->Space() ) ); diff --git a/src/eepp/physics/cshapecirclesprite.cpp b/src/eepp/physics/cshapecirclesprite.cpp index 9e5f4bb51..c4113bbdc 100644 --- a/src/eepp/physics/cshapecirclesprite.cpp +++ b/src/eepp/physics/cshapecirclesprite.cpp @@ -2,15 +2,15 @@ #ifdef PHYSICS_RENDERER_ENABLED -#include +#include CP_NAMESPACE_BEGIN -cShapeCircleSprite * cShapeCircleSprite::New( cBody * body, cpFloat radius, cVect offset, cSprite * Sprite, bool AutoDeleteSprite ) { +cShapeCircleSprite * cShapeCircleSprite::New( cBody * body, cpFloat radius, cVect offset, Sprite * Sprite, bool AutoDeleteSprite ) { return cpNew( cShapeCircleSprite, ( body, radius, offset, Sprite, AutoDeleteSprite ) ); } -cShapeCircleSprite::cShapeCircleSprite( cBody * body, cpFloat radius, cVect offset, cSprite * Sprite, bool AutoDeleteSprite ) : +cShapeCircleSprite::cShapeCircleSprite( cBody * body, cpFloat radius, cVect offset, Sprite * Sprite, bool AutoDeleteSprite ) : cShapeCircle( body, radius, offset ), mSprite( Sprite ), mSpriteAutoDelete( AutoDeleteSprite ) @@ -36,7 +36,7 @@ void cShapeCircleSprite::OffsetSet() { mSprite->Offset( Vector2i( -cShapeCircle::Radius() + cShapeCircle::Offset().x, -cShapeCircle::Radius() + cShapeCircle::Offset().y ) ); } -cSprite * cShapeCircleSprite::GetSprite() const { +Sprite * cShapeCircleSprite::GetSprite() const { return mSprite; } diff --git a/src/eepp/physics/cshapepoint.cpp b/src/eepp/physics/cshapepoint.cpp index f5be13d35..2d467abd7 100644 --- a/src/eepp/physics/cshapepoint.cpp +++ b/src/eepp/physics/cshapepoint.cpp @@ -3,8 +3,8 @@ #include #ifdef PHYSICS_RENDERER_ENABLED -#include -#include +#include +#include using namespace EE::Graphics; #endif @@ -41,7 +41,7 @@ void cShapePoint::Radius( const cpFloat& radius ) { void cShapePoint::Draw( cSpace * space ) { #ifdef PHYSICS_RENDERER_ENABLED - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); BR->SetPointSize( mDrawRadius ); diff --git a/src/eepp/physics/cshapepoly.cpp b/src/eepp/physics/cshapepoly.cpp index b3711f7fe..a315e78fb 100644 --- a/src/eepp/physics/cshapepoly.cpp +++ b/src/eepp/physics/cshapepoly.cpp @@ -3,7 +3,7 @@ #include #ifdef PHYSICS_RENDERER_ENABLED -#include +#include using namespace EE::Graphics; #endif @@ -57,7 +57,7 @@ void cShapePoly::Draw( cSpace * space ) { #ifdef PHYSICS_RENDERER_ENABLED cpPolyShape * poly = (cpPolyShape*)mShape; - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); BR->SetTexture( NULL ); @@ -89,7 +89,7 @@ void cShapePoly::DrawBorder( cSpace *space ) { #ifdef PHYSICS_RENDERER_ENABLED cpPolyShape * poly = (cpPolyShape*)mShape; - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); ColorA Col = ColorForShape( (cpShape *)poly, space->Space() ); diff --git a/src/eepp/physics/cshapepolysprite.cpp b/src/eepp/physics/cshapepolysprite.cpp index e14b0ab43..6d0b0b835 100644 --- a/src/eepp/physics/cshapepolysprite.cpp +++ b/src/eepp/physics/cshapepolysprite.cpp @@ -2,19 +2,19 @@ #ifdef PHYSICS_RENDERER_ENABLED -#include +#include CP_NAMESPACE_BEGIN -cShapePolySprite * cShapePolySprite::New( cBody * body, int numVerts, cVect *verts, cVect offset, cSprite * Sprite, bool AutoDeleteSprite ) { +cShapePolySprite * cShapePolySprite::New( cBody * body, int numVerts, cVect *verts, cVect offset, Sprite * Sprite, bool AutoDeleteSprite ) { return cpNew( cShapePolySprite, ( body, numVerts, verts, offset, Sprite, AutoDeleteSprite ) ); } -cShapePolySprite * cShapePolySprite::New( cBody * body, cpFloat width, cpFloat height, cSprite * Sprite, bool AutoDeleteSprite ) { +cShapePolySprite * cShapePolySprite::New( cBody * body, cpFloat width, cpFloat height, Sprite * Sprite, bool AutoDeleteSprite ) { return cpNew( cShapePolySprite, ( body, width, height, Sprite, AutoDeleteSprite ) ); } -cShapePolySprite::cShapePolySprite( cBody * body, int numVerts, cVect *verts, cVect offset, cSprite * Sprite, bool AutoDeleteSprite ) : +cShapePolySprite::cShapePolySprite( cBody * body, int numVerts, cVect *verts, cVect offset, Sprite * Sprite, bool AutoDeleteSprite ) : cShapePoly( body, numVerts, verts, offset ), mSprite( Sprite ), mSpriteAutoDelete( AutoDeleteSprite ) @@ -22,7 +22,7 @@ cShapePolySprite::cShapePolySprite( cBody * body, int numVerts, cVect *verts, cV OffsetSet( Centroid( numVerts, verts ) ); } -cShapePolySprite::cShapePolySprite( cBody * body, cpFloat width, cpFloat height, cSprite * Sprite, bool AutoDeleteSprite ) : +cShapePolySprite::cShapePolySprite( cBody * body, cpFloat width, cpFloat height, Sprite * Sprite, bool AutoDeleteSprite ) : cShapePoly( body, width, height ), mSprite( Sprite ), mSpriteAutoDelete( AutoDeleteSprite ) @@ -51,7 +51,7 @@ void cShapePolySprite::OffsetSet( cVect center ) { mOffset = Vector2i( (Int32)( -myCenter.x + ( center.x - myCenter.x ) ) , (Int32)( -myCenter.y + ( center.y - myCenter.y ) ) ); } -cSprite * cShapePolySprite::GetSprite() const { +Sprite * cShapePolySprite::GetSprite() const { return mSprite; } diff --git a/src/eepp/physics/cshapesegment.cpp b/src/eepp/physics/cshapesegment.cpp index 3a09cd696..ea07a4bd9 100644 --- a/src/eepp/physics/cshapesegment.cpp +++ b/src/eepp/physics/cshapesegment.cpp @@ -4,8 +4,8 @@ #ifdef PHYSICS_RENDERER_ENABLED #include -#include -#include +#include +#include using namespace EE::Graphics; #endif @@ -136,7 +136,7 @@ void cShapeSegment::Draw( cSpace * space ) { GLi->Enable( GL_TEXTURE_2D ); GLi->EnableClientState( GL_TEXTURE_COORD_ARRAY ); } else { - cPrimitives p; + Primitives p; p.DrawLine( Line2f( Vector2f( a.x, a.y ), Vector2f( b.x, b.y ) ) ); } #endif diff --git a/src/eepp/physics/cspace.cpp b/src/eepp/physics/cspace.cpp index e6ddde641..db81f1480 100644 --- a/src/eepp/physics/cspace.cpp +++ b/src/eepp/physics/cspace.cpp @@ -3,7 +3,7 @@ #ifdef PHYSICS_RENDERER_ENABLED #include -#include +#include using namespace EE::Graphics; #endif @@ -287,7 +287,7 @@ static void drawConstraint( cpConstraint *constraint ) { void cSpace::Draw() { #ifdef PHYSICS_RENDERER_ENABLED - cBatchRenderer * BR = cGlobalBatchRenderer::instance(); + BatchRenderer * BR = GlobalBatchRenderer::instance(); BR->SetBlendMode( ALPHA_NORMAL ); cPhysicsManager::cDrawSpaceOptions * options = cPhysicsManager::instance()->GetDrawOptions(); diff --git a/src/eepp/ui/cuicheckbox.cpp b/src/eepp/ui/cuicheckbox.cpp index d23b9315c..b28cae57b 100644 --- a/src/eepp/ui/cuicheckbox.cpp +++ b/src/eepp/ui/cuicheckbox.cpp @@ -1,7 +1,7 @@ #include #include -#include -#include +#include +#include namespace EE { namespace UI { @@ -49,7 +49,7 @@ void cUICheckBox::SetTheme( cUITheme * Theme ) { } void cUICheckBox::DoAfterSetTheme() { - cSubTexture * tSubTexture = NULL; + SubTexture * tSubTexture = NULL; cUISkin * tSkin = mActiveButton->GetSkin(); if ( tSkin ) { diff --git a/src/eepp/ui/cuicombobox.cpp b/src/eepp/ui/cuicombobox.cpp index 7fd110800..2af2c84bd 100644 --- a/src/eepp/ui/cuicombobox.cpp +++ b/src/eepp/ui/cuicombobox.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace EE { namespace UI { @@ -44,7 +44,7 @@ void cUIComboBox::CreateButton() { if ( mSkinState->GetSkin()->GetType() == cUISkin::UISkinComplex ) { cUISkinComplex * tComplex = reinterpret_cast ( mSkinState->GetSkin() ); - cSubTexture * tSubTexture = tComplex->GetSubTextureSide( cUISkinState::StateNormal, cUISkinComplex::Right ); + SubTexture * tSubTexture = tComplex->GetSubTextureSide( cUISkinState::StateNormal, cUISkinComplex::Right ); if ( NULL != tSubTexture ) btnWidth = tSubTexture->RealSize().Width(); diff --git a/src/eepp/ui/cuicommondialog.cpp b/src/eepp/ui/cuicommondialog.cpp index 5b70222d2..05fdf3749 100644 --- a/src/eepp/ui/cuicommondialog.cpp +++ b/src/eepp/ui/cuicommondialog.cpp @@ -161,7 +161,7 @@ bool cUICommonDialog::IsType( const Uint32& type ) const { void cUICommonDialog::SetTheme( cUITheme * Theme ) { cUIWindow::SetTheme( Theme ); - cSubTexture * Icon = Theme->GetIconByName( "go-up" ); + SubTexture * Icon = Theme->GetIconByName( "go-up" ); if ( NULL != Icon ) { mButtonUp->Text( "" ); diff --git a/src/eepp/ui/cuicontrol.cpp b/src/eepp/ui/cuicontrol.cpp index 5d47e759a..4b3433d6b 100644 --- a/src/eepp/ui/cuicontrol.cpp +++ b/src/eepp/ui/cuicontrol.cpp @@ -1,9 +1,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include namespace EE { namespace UI { @@ -253,7 +253,7 @@ void cUIControl::Draw() { mSkinState->Draw( (Float)mScreenPos.x, (Float)mScreenPos.y, (Float)mSize.Width(), (Float)mSize.Height(), 255 ); if ( cUIManager::instance()->HighlightFocus() && cUIManager::instance()->FocusControl() == this ) { - cPrimitives P; + Primitives P; P.FillMode( DRAW_LINE ); P.BlendMode( Blend() ); P.SetColor( cUIManager::instance()->HighlightFocusColor() ); @@ -261,7 +261,7 @@ void cUIControl::Draw() { } if ( cUIManager::instance()->HighlightOver() && cUIManager::instance()->OverControl() == this ) { - cPrimitives P; + Primitives P; P.FillMode( DRAW_LINE ); P.BlendMode( Blend() ); P.SetColor( cUIManager::instance()->HighlightOverColor() ); @@ -522,7 +522,7 @@ Rectf cUIControl::GetRectf() { } void cUIControl::BackgroundDraw() { - cPrimitives P; + Primitives P; Rectf R = GetRectf(); P.BlendMode( mBackground->Blend() ); P.SetColor( mBackground->Color() ); @@ -543,7 +543,7 @@ void cUIControl::BackgroundDraw() { } void cUIControl::BorderDraw() { - cPrimitives P; + Primitives P; P.FillMode( DRAW_LINE ); P.BlendMode( Blend() ); P.LineWidth( (Float)mBorder->Width() ); @@ -1069,7 +1069,7 @@ Recti cUIControl::MakePadding( bool PadLeft, bool PadRight, bool PadTop, bool Pa if ( mSkinState->GetSkin()->GetType() == cUISkin::UISkinComplex ) { cUISkinComplex * tComplex = reinterpret_cast ( mSkinState->GetSkin() ); - cSubTexture * tSubTexture = NULL; + SubTexture * tSubTexture = NULL; if ( PadLeft ) { tSubTexture = tComplex->GetSubTextureSide( cUISkinState::StateNormal, cUISkinComplex::Left ); @@ -1128,7 +1128,7 @@ Sizei cUIControl::GetSkinSize( cUISkin * Skin, const Uint32& State ) { Sizei tSize; if ( NULL != Skin ) { - cSubTexture * tSubTexture = Skin->GetSubTexture( State ); + SubTexture * tSubTexture = Skin->GetSubTexture( State ); if ( NULL != tSubTexture ) { tSize = tSubTexture->RealSize(); diff --git a/src/eepp/ui/cuicontrolanim.cpp b/src/eepp/ui/cuicontrolanim.cpp index db5435bba..f42a08b3b 100644 --- a/src/eepp/ui/cuicontrolanim.cpp +++ b/src/eepp/ui/cuicontrolanim.cpp @@ -1,8 +1,8 @@ #include #include -#include -#include -#include +#include +#include +#include namespace EE { namespace UI { @@ -46,7 +46,7 @@ void cUIControlAnim::Draw() { mSkinState->Draw( (Float)mScreenPos.x, (Float)mScreenPos.y, (Float)mSize.Width(), (Float)mSize.Height(), (Uint32)mAlpha ); if ( cUIManager::instance()->HighlightFocus() && cUIManager::instance()->FocusControl() == this ) { - cPrimitives P; + Primitives P; P.FillMode( DRAW_LINE ); P.BlendMode( Blend() ); P.SetColor( cUIManager::instance()->HighlightFocusColor() ); @@ -54,7 +54,7 @@ void cUIControlAnim::Draw() { } if ( cUIManager::instance()->HighlightOver() && cUIManager::instance()->OverControl() == this ) { - cPrimitives P; + Primitives P; P.FillMode( DRAW_LINE ); P.BlendMode( Blend() ); P.SetColor( cUIManager::instance()->HighlightOverColor() ); @@ -112,7 +112,7 @@ void cUIControlAnim::AlphaChilds( const Float &alpha ) { void cUIControlAnim::MatrixSet() { if ( mScale != 1.f || mAngle != 0.f ) { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->PushMatrix(); Vector2f Center( mScreenPos.x + mSize.Width() * 0.5f, mScreenPos.y + mSize.Height() * 0.5f ); GLi->Translatef( Center.x , Center.y, 0.f ); @@ -124,7 +124,7 @@ void cUIControlAnim::MatrixSet() { void cUIControlAnim::MatrixUnset() { if ( mScale != 1.f || mAngle != 0.f ) { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->PopMatrix(); } } @@ -280,7 +280,7 @@ void cUIControlAnim::DisableFadeOut( const Time& Time, const bool& AlphaChilds, } void cUIControlAnim::BackgroundDraw() { - cPrimitives P; + Primitives P; Rectf R = GetRectf(); P.BlendMode( mBackground->Blend() ); P.SetColor( GetColor( mBackground->Color() ) ); @@ -301,7 +301,7 @@ void cUIControlAnim::BackgroundDraw() { } void cUIControlAnim::BorderDraw() { - cPrimitives P; + Primitives P; P.FillMode( DRAW_LINE ); P.BlendMode( Blend() ); P.LineWidth( (Float)mBorder->Width() ); diff --git a/src/eepp/ui/cuidefaulttheme.cpp b/src/eepp/ui/cuidefaulttheme.cpp index a8335b2f2..a881da699 100644 --- a/src/eepp/ui/cuidefaulttheme.cpp +++ b/src/eepp/ui/cuidefaulttheme.cpp @@ -9,7 +9,7 @@ namespace EE { namespace UI { -cUIDefaultTheme::cUIDefaultTheme( const std::string& Name, const std::string& Abbr, cFont * DefaultFont ) : +cUIDefaultTheme::cUIDefaultTheme( const std::string& Name, const std::string& Abbr, Graphics::Font * DefaultFont ) : cUITheme( Name, Abbr, DefaultFont ) { FontColor( ColorA( 230, 230, 230, 255 ) ); diff --git a/src/eepp/ui/cuigfx.cpp b/src/eepp/ui/cuigfx.cpp index 9c5659f01..2c3ef618f 100644 --- a/src/eepp/ui/cuigfx.cpp +++ b/src/eepp/ui/cuigfx.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace EE { namespace UI { @@ -29,7 +29,7 @@ bool cUIGfx::IsType( const Uint32& type ) const { return cUIGfx::Type() == type ? true : cUIComplexControl::IsType( type ); } -void cUIGfx::SubTexture( cSubTexture * subTexture ) { +void cUIGfx::SubTexture( Graphics::SubTexture * subTexture ) { mSubTexture = subTexture; AutoSize(); @@ -104,7 +104,7 @@ void cUIGfx::Alpha( const Float& alpha ) { mColor.Alpha = (Uint8)alpha; } -cSubTexture * cUIGfx::SubTexture() const { +Graphics::SubTexture * cUIGfx::SubTexture() const { return mSubTexture; } diff --git a/src/eepp/ui/cuilistbox.cpp b/src/eepp/ui/cuilistbox.cpp index 467a28b05..57fbb5d07 100644 --- a/src/eepp/ui/cuilistbox.cpp +++ b/src/eepp/ui/cuilistbox.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include namespace EE { namespace UI { @@ -696,7 +696,7 @@ const ColorA& cUIListBox::FontSelectedColor() const { return mFontSelectedColor; } -void cUIListBox::Font( cFont * Font ) { +void cUIListBox::Font( Graphics::Font * Font ) { mFont = Font; for ( Uint32 i = 0; i < mItems.size(); i++ ) @@ -707,7 +707,7 @@ void cUIListBox::Font( cFont * Font ) { UpdateScroll(); } -cFont * cUIListBox::Font() const { +Graphics::Font * cUIListBox::Font() const { return mFont; } diff --git a/src/eepp/ui/cuimanager.cpp b/src/eepp/ui/cuimanager.cpp index c7b61936d..1aef82eaa 100644 --- a/src/eepp/ui/cuimanager.cpp +++ b/src/eepp/ui/cuimanager.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include namespace EE { namespace UI { @@ -256,9 +256,9 @@ cUIControl * cUIManager::DownControl() const { } void cUIManager::Draw() { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); mControl->InternalDraw(); - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); } cUIWindow * cUIManager::MainControl() const { diff --git a/src/eepp/ui/cuimenu.cpp b/src/eepp/ui/cuimenu.cpp index 355170a57..781e666d7 100644 --- a/src/eepp/ui/cuimenu.cpp +++ b/src/eepp/ui/cuimenu.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include namespace EE { namespace UI { @@ -51,7 +51,7 @@ void cUIMenu::DoAfterSetTheme() { OnSizeChange(); } -cUIMenuItem * cUIMenu::CreateMenuItem( const String& Text, cSubTexture * Icon ) { +cUIMenuItem * cUIMenu::CreateMenuItem( const String& Text, SubTexture * Icon ) { cUIMenuItem::CreateParams Params; Params.Parent( this ); Params.Font = mFont; @@ -80,7 +80,7 @@ cUIMenuItem * cUIMenu::CreateMenuItem( const String& Text, cSubTexture * Icon ) return tCtrl; } -Uint32 cUIMenu::Add( const String& Text, cSubTexture * Icon ) { +Uint32 cUIMenu::Add( const String& Text, SubTexture * Icon ) { return Add( CreateMenuItem( Text, Icon ) ); } @@ -120,7 +120,7 @@ Uint32 cUIMenu::AddCheckBox( const String& Text, const bool& Active ) { return Add( CreateMenuCheckBox( Text, Active ) ); } -cUIMenuSubMenu * cUIMenu::CreateSubMenu( const String& Text, cSubTexture * Icon, cUIMenu * SubMenu ) { +cUIMenuSubMenu * cUIMenu::CreateSubMenu( const String& Text, SubTexture * Icon, cUIMenu * SubMenu ) { cUIMenuSubMenu::CreateParams Params; Params.Parent( this ); Params.Font = mFont; @@ -150,7 +150,7 @@ cUIMenuSubMenu * cUIMenu::CreateSubMenu( const String& Text, cSubTexture * Icon, return tCtrl; } -Uint32 cUIMenu::AddSubMenu( const String& Text, cSubTexture * Icon, cUIMenu * SubMenu ) { +Uint32 cUIMenu::AddSubMenu( const String& Text, SubTexture * Icon, cUIMenu * SubMenu ) { return Add( CreateSubMenu( Text, Icon, SubMenu ) ); } @@ -303,7 +303,7 @@ void cUIMenu::RemoveAll() { ResizeMe(); } -void cUIMenu::Insert( const String& Text, cSubTexture * Icon, const Uint32& Index ) { +void cUIMenu::Insert( const String& Text, SubTexture * Icon, const Uint32& Index ) { Insert( CreateMenuItem( Text, Icon ), Index ); } diff --git a/src/eepp/ui/cuimessagebox.cpp b/src/eepp/ui/cuimessagebox.cpp index 1c8f292fd..07c79cfed 100644 --- a/src/eepp/ui/cuimessagebox.cpp +++ b/src/eepp/ui/cuimessagebox.cpp @@ -92,8 +92,8 @@ void cUIMessageBox::SetTheme( cUITheme * Theme ) { cUIWindow::SetTheme( Theme ); if ( "Retry" != mButtonOK->Text() ) { - cSubTexture * OKIcon = Theme->GetIconByName( "ok" ); - cSubTexture * CancelIcon = Theme->GetIconByName( "cancel" ); + SubTexture * OKIcon = Theme->GetIconByName( "ok" ); + SubTexture * CancelIcon = Theme->GetIconByName( "cancel" ); if ( NULL != OKIcon ) { mButtonOK->Icon( OKIcon ); diff --git a/src/eepp/ui/cuiprogressbar.cpp b/src/eepp/ui/cuiprogressbar.cpp index bd6ad8e23..b1a16406f 100644 --- a/src/eepp/ui/cuiprogressbar.cpp +++ b/src/eepp/ui/cuiprogressbar.cpp @@ -61,7 +61,7 @@ void cUIProgressBar::SetTheme( cUITheme * Theme ) { cUISkin * tSkin = Theme->GetByName( Theme->Abbr() + "_progressbar_filler" ); if ( tSkin ) { - cSubTexture * tSubTexture = tSkin->GetSubTexture( cUISkinState::StateNormal ); + SubTexture * tSubTexture = tSkin->GetSubTexture( cUISkinState::StateNormal ); if ( NULL != tSubTexture ) { eeSAFE_DELETE( mParallax ); @@ -74,7 +74,7 @@ void cUIProgressBar::SetTheme( cUITheme * Theme ) { if ( Height > mSize.Height() ) Height = mSize.Height(); - mParallax = eeNew( cScrollParallax, ( tSubTexture, Vector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ), Sizef( ( ( mSize.Width() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ), mSpeed ) ); + mParallax = eeNew( ScrollParallax, ( tSubTexture, Vector2f( mScreenPos.x + mFillerMargin.Left, mScreenPos.y + mFillerMargin.Top ), Sizef( ( ( mSize.Width() - mFillerMargin.Left - mFillerMargin.Right ) * mProgress ) / mTotalSteps, Height - mFillerMargin.Top - mFillerMargin.Bottom ), mSpeed ) ); } } } diff --git a/src/eepp/ui/cuipushbutton.cpp b/src/eepp/ui/cuipushbutton.cpp index 3bc26b522..8365162f8 100644 --- a/src/eepp/ui/cuipushbutton.cpp +++ b/src/eepp/ui/cuipushbutton.cpp @@ -151,7 +151,7 @@ void cUIPushButton::AutoPadding() { } } -void cUIPushButton::Icon( cSubTexture * Icon ) { +void cUIPushButton::Icon( SubTexture * Icon ) { mIcon->SubTexture( Icon ); OnSizeChange(); } diff --git a/src/eepp/ui/cuiradiobutton.cpp b/src/eepp/ui/cuiradiobutton.cpp index 7328dc6cb..a4896f8f7 100644 --- a/src/eepp/ui/cuiradiobutton.cpp +++ b/src/eepp/ui/cuiradiobutton.cpp @@ -1,7 +1,7 @@ #include #include -#include -#include +#include +#include namespace EE { namespace UI { @@ -49,7 +49,7 @@ void cUIRadioButton::SetTheme( cUITheme * Theme ) { mActiveButton->SetThemeControl ( Theme, "radiobutton_active" ); mInactiveButton->SetThemeControl( Theme, "radiobutton_inactive" ); - cSubTexture * tSubTexture = NULL; + SubTexture * tSubTexture = NULL; cUISkin * tSkin = mActiveButton->GetSkin(); if ( tSkin ) { diff --git a/src/eepp/ui/cuiscrollbar.cpp b/src/eepp/ui/cuiscrollbar.cpp index 9d9885b33..316a58537 100644 --- a/src/eepp/ui/cuiscrollbar.cpp +++ b/src/eepp/ui/cuiscrollbar.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include namespace EE { namespace UI { @@ -70,7 +70,7 @@ void cUIScrollBar::SetTheme( cUITheme * Theme ) { mBtnDown->SetThemeControl( Theme, "vscrollbar_btndown" ); } - cSubTexture * tSubTexture = NULL; + SubTexture * tSubTexture = NULL; cUISkin * tSkin = NULL; tSkin = mBtnUp->GetSkin(); diff --git a/src/eepp/ui/cuiseparator.cpp b/src/eepp/ui/cuiseparator.cpp index 5a38e4f15..614533e4b 100644 --- a/src/eepp/ui/cuiseparator.cpp +++ b/src/eepp/ui/cuiseparator.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace EE { namespace UI { diff --git a/src/eepp/ui/cuiskin.cpp b/src/eepp/ui/cuiskin.cpp index 143008d8f..58ac3d26c 100644 --- a/src/eepp/ui/cuiskin.cpp +++ b/src/eepp/ui/cuiskin.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace EE { namespace UI { diff --git a/src/eepp/ui/cuiskincomplex.cpp b/src/eepp/ui/cuiskincomplex.cpp index 7e165ae76..3a5023138 100644 --- a/src/eepp/ui/cuiskincomplex.cpp +++ b/src/eepp/ui/cuiskincomplex.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace EE { namespace UI { @@ -31,7 +31,7 @@ void cUISkinComplex::Draw( const Float& X, const Float& Y, const Float& Width, c if ( 0 == Alpha ) return; - cSubTexture * tSubTexture = mSubTexture[ State ][ UpLeft ]; + SubTexture * tSubTexture = mSubTexture[ State ][ UpLeft ]; mTempColor = mColor[ State ]; if ( mTempColor.Alpha != Alpha ) { @@ -147,20 +147,20 @@ void cUISkinComplex::SetSkin( const Uint32& State ) { for ( Uint32 Side = 0; Side < SideCount; Side++ ) { - cSubTexture * SubTexture = cTextureAtlasManager::instance()->GetSubTextureByName( std::string( mName + "_" + cUISkin::GetSkinStateName( State ) + "_" + SideSuffix[ Side ] ) ); + SubTexture * SubTexture = TextureAtlasManager::instance()->GetSubTextureByName( std::string( mName + "_" + cUISkin::GetSkinStateName( State ) + "_" + SideSuffix[ Side ] ) ); if ( NULL != SubTexture ) mSubTexture[ State ][ Side ] = SubTexture; } } -cSubTexture * cUISkinComplex::GetSubTexture( const Uint32& State ) const { +SubTexture * cUISkinComplex::GetSubTexture( const Uint32& State ) const { eeASSERT ( State < cUISkinState::StateCount ); return mSubTexture[ State ][ Center ]; } -cSubTexture * cUISkinComplex::GetSubTextureSide( const Uint32& State, const Uint32& Side ) { +SubTexture * cUISkinComplex::GetSubTextureSide( const Uint32& State, const Uint32& Side ) { eeASSERT ( State < cUISkinState::StateCount && Side < cUISkinComplex::SideCount ); return mSubTexture[ State ][ Side ]; @@ -183,7 +183,7 @@ cUISkinComplex * cUISkinComplex::Copy( const std::string& NewName, const bool& C memcpy( &SkinC->mColor[0], &mColor[0], cUISkinState::StateCount * sizeof(ColorA) ); } - memcpy( &SkinC->mSubTexture[0], &mSubTexture[0], cUISkinState::StateCount * SideCount * sizeof(cSubTexture*) ); + memcpy( &SkinC->mSubTexture[0], &mSubTexture[0], cUISkinState::StateCount * SideCount * sizeof(SubTexture*) ); return SkinC; } diff --git a/src/eepp/ui/cuiskinsimple.cpp b/src/eepp/ui/cuiskinsimple.cpp index c8a992041..40d2d9b02 100644 --- a/src/eepp/ui/cuiskinsimple.cpp +++ b/src/eepp/ui/cuiskinsimple.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace EE { namespace UI { @@ -19,7 +19,7 @@ void cUISkinSimple::Draw( const Float& X, const Float& Y, const Float& Width, co if ( 0 == Alpha ) return; - cSubTexture * tSubTexture = mSubTexture[ State ]; + SubTexture * tSubTexture = mSubTexture[ State ]; mTempColor = mColor[ State ]; if ( NULL != tSubTexture ) { @@ -40,10 +40,10 @@ void cUISkinSimple::SetSkin( const Uint32& State ) { std::string Name( mName + "_" + cUISkin::GetSkinStateName( State ) ); - mSubTexture[ State ] = cTextureAtlasManager::instance()->GetSubTextureByName( Name ); + mSubTexture[ State ] = TextureAtlasManager::instance()->GetSubTextureByName( Name ); } -cSubTexture * cUISkinSimple::GetSubTexture( const Uint32& State ) const { +SubTexture * cUISkinSimple::GetSubTexture( const Uint32& State ) const { eeASSERT ( State < cUISkinState::StateCount ); return mSubTexture[ State ]; @@ -63,7 +63,7 @@ cUISkinSimple * cUISkinSimple::Copy( const std::string& NewName, const bool& Cop memcpy( &SkinS->mColor[0], &mColor[0], cUISkinState::StateCount * sizeof(ColorA) ); } - memcpy( &SkinS->mSubTexture[0], &mSubTexture[0], cUISkinState::StateCount * sizeof(cSubTexture*) ); + memcpy( &SkinS->mSubTexture[0], &mSubTexture[0], cUISkinState::StateCount * sizeof(SubTexture*) ); return SkinS; } diff --git a/src/eepp/ui/cuislider.cpp b/src/eepp/ui/cuislider.cpp index 66253ff9a..b2434e386 100644 --- a/src/eepp/ui/cuislider.cpp +++ b/src/eepp/ui/cuislider.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include namespace EE { namespace UI { @@ -83,7 +83,7 @@ void cUISlider::OnSizeChange() { } void cUISlider::AdjustChilds() { - cSubTexture * tSubTexture = NULL; + SubTexture * tSubTexture = NULL; cUISkin * tSkin = NULL; tSkin = mSlider->GetSkin(); diff --git a/src/eepp/ui/cuispinbox.cpp b/src/eepp/ui/cuispinbox.cpp index b35319f45..0176b9792 100644 --- a/src/eepp/ui/cuispinbox.cpp +++ b/src/eepp/ui/cuispinbox.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace EE { namespace UI { @@ -68,7 +68,7 @@ void cUISpinBox::SetTheme( cUITheme * Theme ) { mPushUp->SetThemeControl ( Theme, "spinbox_btnup" ); mPushDown->SetThemeControl ( Theme, "spinbox_btndown" ); - cSubTexture * tSubTexture = NULL; + SubTexture * tSubTexture = NULL; cUISkin * tSkin = NULL; tSkin = mPushUp->GetSkin(); diff --git a/src/eepp/ui/cuisprite.cpp b/src/eepp/ui/cuisprite.cpp index a033b4c6c..20a0fbdbd 100644 --- a/src/eepp/ui/cuisprite.cpp +++ b/src/eepp/ui/cuisprite.cpp @@ -1,5 +1,5 @@ #include -#include +#include namespace EE { namespace UI { @@ -10,7 +10,7 @@ cUISprite::cUISprite( const cUISprite::CreateParams& Params ) : mAlignOffset(0,0), mSubTextureLast(NULL) { - if ( Params.DeallocSprite ) + if ( Params.DealloSprite ) mControlFlags |= UI_CTRL_FLAG_FREE_USE; if ( ( Flags() & UI_AUTO_SIZE ) || ( Params.Size.x == -1 && Params.Size.y == -1 ) ) { @@ -21,7 +21,7 @@ cUISprite::cUISprite( const cUISprite::CreateParams& Params ) : } cUISprite::~cUISprite() { - if ( DeallocSprite() ) + if ( DealloSprite() ) eeSAFE_DELETE( mSprite ); } @@ -33,12 +33,12 @@ bool cUISprite::IsType( const Uint32& type ) const { return cUISprite::Type() == type ? true : cUIComplexControl::IsType( type ); } -Uint32 cUISprite::DeallocSprite() { +Uint32 cUISprite::DealloSprite() { return mControlFlags & UI_CTRL_FLAG_FREE_USE; } -void cUISprite::Sprite( cSprite * sprite ) { - if ( DeallocSprite() ) +void cUISprite::Sprite( Graphics::Sprite * sprite ) { + if ( DealloSprite() ) eeSAFE_DELETE( mSprite ); mSprite = sprite; @@ -73,7 +73,7 @@ void cUISprite::Alpha( const Float& alpha ) { mSprite->Alpha( alpha ); } -cSprite * cUISprite::Sprite() const { +Graphics::Sprite * cUISprite::Sprite() const { return mSprite; } @@ -112,7 +112,7 @@ void cUISprite::AutoAlign() { if ( NULL == mSprite || NULL == mSprite->GetCurrentSubTexture() ) return; - cSubTexture * tSubTexture = mSprite->GetCurrentSubTexture(); + SubTexture * tSubTexture = mSprite->GetCurrentSubTexture(); if ( HAlignGet( mFlags ) == UI_HALIGN_CENTER ) { mAlignOffset.x = mSize.Width() / 2 - tSubTexture->Size().Width() / 2; diff --git a/src/eepp/ui/cuitabwidget.cpp b/src/eepp/ui/cuitabwidget.cpp index d42fcff7b..2ec04843c 100644 --- a/src/eepp/ui/cuitabwidget.cpp +++ b/src/eepp/ui/cuitabwidget.cpp @@ -1,7 +1,7 @@ #include #include -#include -#include +#include +#include namespace EE { namespace UI { @@ -96,7 +96,7 @@ void cUITabWidget::Draw() { bool smooth = GLi->IsLineSmooth(); if ( smooth ) GLi->LineSmooth( false ); - cPrimitives P; + Primitives P; Vector2i p1( mPos.x, mPos.y + mTabContainer->Size().Height() + mLineBewowTabsYOffset ); Vector2i p2( mPos.x + mTabContainer->Pos().x, p1.y ); @@ -191,7 +191,7 @@ void cUITabWidget::OrderTabs() { PosTabs(); } -cUITab * cUITabWidget::CreateTab( const String& Text, cUIControl * CtrlOwned, cSubTexture * Icon ) { +cUITab * cUITabWidget::CreateTab( const String& Text, cUIControl * CtrlOwned, SubTexture * Icon ) { cUITab::CreateParams Params; Params.Parent( mTabContainer ); Params.Font = mFont; @@ -214,7 +214,7 @@ cUITab * cUITabWidget::CreateTab( const String& Text, cUIControl * CtrlOwned, cS return tCtrl; } -Uint32 cUITabWidget::Add( const String& Text, cUIControl * CtrlOwned, cSubTexture * Icon ) { +Uint32 cUITabWidget::Add( const String& Text, cUIControl * CtrlOwned, SubTexture * Icon ) { return Add( CreateTab( Text, CtrlOwned, Icon ) ); } @@ -313,7 +313,7 @@ void cUITabWidget::RemoveAll() { OrderTabs(); } -void cUITabWidget::Insert( const String& Text, cUIControl * CtrlOwned, cSubTexture * Icon, const Uint32& Index ) { +void cUITabWidget::Insert( const String& Text, cUIControl * CtrlOwned, SubTexture * Icon, const Uint32& Index ) { Insert( CreateTab( Text, CtrlOwned, Icon ), Index ); } diff --git a/src/eepp/ui/cuitextbox.cpp b/src/eepp/ui/cuitextbox.cpp index aeb88b5fe..d722feefe 100644 --- a/src/eepp/ui/cuitextbox.cpp +++ b/src/eepp/ui/cuitextbox.cpp @@ -1,9 +1,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include namespace EE { namespace UI { @@ -17,7 +17,7 @@ cUITextBox::cUITextBox( const cUITextBox::CreateParams& Params ) : mSelCurInit( -1 ), mSelCurEnd( -1 ) { - mTextCache = eeNew( cTextCache, () ); + mTextCache = eeNew( TextCache, () ); mTextCache->Font( Params.Font ); mTextCache->Color( mFontColor ); mTextCache->ShadowColor( mFontShadowColor ); @@ -70,11 +70,11 @@ void cUITextBox::Draw() { } } -cFont * cUITextBox::Font() const { +Graphics::Font * cUITextBox::Font() const { return mTextCache->Font(); } -void cUITextBox::Font( cFont * font ) { +void cUITextBox::Font( Graphics::Font * font ) { if ( mTextCache->Font() != font ) { mTextCache->Font( font ); AutoShrink(); @@ -229,7 +229,7 @@ void cUITextBox::SetTheme( cUITheme * Theme ) { } } -cTextCache * cUITextBox::GetTextCache() { +TextCache * cUITextBox::GetTextCache() { return mTextCache; } @@ -318,7 +318,7 @@ void cUITextBox::DrawSelection() { Int32 lastEnd; Vector2i initPos, endPos; - cPrimitives P; + Primitives P; P.SetColor( mFontSelectionBackColor ); do { diff --git a/src/eepp/ui/cuitextedit.cpp b/src/eepp/ui/cuitextedit.cpp index 02c4144a4..b557d5040 100644 --- a/src/eepp/ui/cuitextedit.cpp +++ b/src/eepp/ui/cuitextedit.cpp @@ -1,7 +1,7 @@ #include #include -#include -#include +#include +#include namespace EE { namespace UI { diff --git a/src/eepp/ui/cuitextinput.cpp b/src/eepp/ui/cuitextinput.cpp index 4bd05c879..b244d81b0 100644 --- a/src/eepp/ui/cuitextinput.cpp +++ b/src/eepp/ui/cuitextinput.cpp @@ -1,10 +1,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace EE { namespace UI { @@ -83,7 +83,7 @@ void cUITextInput::DrawWaitingCursor() { if ( disableSmooth ) GLi->LineSmooth( false ); - cPrimitives P; + Primitives P; P.SetColor( mFontColor ); Float CurPosX = mScreenPos.x + mAlignOffset.x + mCurPos.x + 1 + mPadding.Left; diff --git a/src/eepp/ui/cuitextinputpassword.cpp b/src/eepp/ui/cuitextinputpassword.cpp index 227c66d48..f334ddc46 100644 --- a/src/eepp/ui/cuitextinputpassword.cpp +++ b/src/eepp/ui/cuitextinputpassword.cpp @@ -1,15 +1,15 @@ #include #include #include -#include -#include +#include +#include namespace EE { namespace UI { cUITextInputPassword::cUITextInputPassword( const cUITextInput::CreateParams& Params ) : cUITextInput( Params ) { - mPassCache = eeNew( cTextCache, () ); + mPassCache = eeNew( TextCache, () ); mPassCache->Font( Params.Font ); mPassCache->Color( mFontColor ); mPassCache->ShadowColor( mFontShadowColor ); @@ -126,7 +126,7 @@ void cUITextInputPassword::Text( const String& text ) { UpdatePass( text ); } -cTextCache *cUITextInputPassword::GetPassCache() const { +TextCache *cUITextInputPassword::GetPassCache() const { return mPassCache; } diff --git a/src/eepp/ui/cuitheme.cpp b/src/eepp/ui/cuitheme.cpp index e873b94b5..abc14daf9 100644 --- a/src/eepp/ui/cuitheme.cpp +++ b/src/eepp/ui/cuitheme.cpp @@ -1,11 +1,11 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -122,7 +122,7 @@ void cUITheme::AddThemeIcon( const std::string& Icon ) { mUIIcons.push_back( Icon ); } -cUITheme * cUITheme::LoadFromTextureAtlas( cUITheme * tTheme, cTextureAtlas * TextureAtlas ) { +cUITheme * cUITheme::LoadFromTextureAtlas( cUITheme * tTheme, Graphics::TextureAtlas * TextureAtlas ) { eeASSERT( NULL != tTheme && NULL != TextureAtlas ); /** Themes use nearest filter by default, force the filter to the textures. */ @@ -186,7 +186,7 @@ cUITheme * cUITheme::LoadFromPath( cUITheme * tTheme, const std::string& Path, c std::vector ElemFound; std::vector ElemType; - cTextureAtlas * tSG = eeNew( cTextureAtlas, ( tTheme->Abbr() ) ); + Graphics::TextureAtlas * tSG = eeNew( Graphics::TextureAtlas, ( tTheme->Abbr() ) ); tTheme->TextureAtlas( tSG ); @@ -209,12 +209,12 @@ cUITheme * cUITheme::LoadFromPath( cUITheme * tTheme, const std::string& Path, c Element = RPath + ElemName + "." + ImgExt; if ( FileSystem::FileExists( Element ) ) { - tSG->Add( eeNew( cSubTexture, ( cTextureFactory::instance()->Load( Element ), ElemName ) ) ); + tSG->Add( eeNew( SubTexture, ( TextureFactory::instance()->Load( Element ), ElemName ) ) ); } } if ( tSG->Count() ) - cTextureAtlasManager::instance()->Add( tSG ); + TextureAtlasManager::instance()->Add( tSG ); else eeSAFE_DELETE( tSG ); @@ -234,11 +234,11 @@ cUITheme * cUITheme::LoadFromPath( const std::string& Path, const std::string& N return LoadFromPath( eeNew( cUITheme, ( Name, NameAbbr ) ), Path, ImgExt ); } -cUITheme * cUITheme::LoadFromTextureAtlas( cTextureAtlas * TextureAtlas, const std::string& Name, const std::string NameAbbr ) { +cUITheme * cUITheme::LoadFromTextureAtlas( Graphics::TextureAtlas * TextureAtlas, const std::string& Name, const std::string NameAbbr ) { return LoadFromTextureAtlas( eeNew( cUITheme, ( Name, NameAbbr ) ), TextureAtlas ); } -bool cUITheme::SearchFilesInAtlas( cTextureAtlas * SG, std::string Element, Uint32& IsComplex ) { +bool cUITheme::SearchFilesInAtlas( Graphics::TextureAtlas * SG, std::string Element, Uint32& IsComplex ) { bool Found = false; Uint32 i = 0, s = 0; std::string ElemName; @@ -276,7 +276,7 @@ bool cUITheme::SearchFilesInAtlas( cTextureAtlas * SG, std::string Element, Uint return Found; } -bool cUITheme::SearchFilesOfElement( cTextureAtlas * SG, const std::string& Path, std::string Element, Uint32& IsComplex, const std::string ImgExt ) { +bool cUITheme::SearchFilesOfElement( Graphics::TextureAtlas * SG, const std::string& Path, std::string Element, Uint32& IsComplex, const std::string ImgExt ) { bool Found = false; Uint32 i = 0, s = 0; std::string ElemPath; @@ -292,7 +292,7 @@ bool cUITheme::SearchFilesOfElement( cTextureAtlas * SG, const std::string& Path ElemFullPath = ElemPath + "." + ImgExt; if ( FileSystem::FileExists( ElemFullPath ) ) { - SG->Add( eeNew( cSubTexture, ( cTextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); + SG->Add( eeNew( SubTexture, ( TextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); IsComplex = 1; Found = true; @@ -309,7 +309,7 @@ bool cUITheme::SearchFilesOfElement( cTextureAtlas * SG, const std::string& Path ElemFullPath = ElemPath + "." + ImgExt; if ( FileSystem::FileExists( ElemFullPath ) ) { - SG->Add( eeNew( cSubTexture, ( cTextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); + SG->Add( eeNew( SubTexture, ( TextureFactory::instance()->Load( ElemFullPath ), ElemName ) ) ); Found = true; } @@ -319,7 +319,7 @@ bool cUITheme::SearchFilesOfElement( cTextureAtlas * SG, const std::string& Path return Found; } -cUITheme::cUITheme( const std::string& Name, const std::string& Abbr, cFont * DefaultFont ) : +cUITheme::cUITheme( const std::string& Name, const std::string& Abbr, Graphics::Font * DefaultFont ) : ResourceManager ( false ), mName( Name ), mNameHash( String::Hash( mName ) ), @@ -361,11 +361,11 @@ cUISkin * cUITheme::Add( cUISkin * Resource ) { return ResourceManager::Add( Resource ); } -void cUITheme::Font( cFont * Font ) { +void cUITheme::Font( Graphics::Font * Font ) { mFont = Font; } -cFont * cUITheme::Font() const { +Graphics::Font * cUITheme::Font() const { return mFont; } @@ -409,22 +409,22 @@ const bool& cUITheme::UseDefaultThemeValues() const { return mUseDefaultThemeValues; } -cTextureAtlas * cUITheme::TextureAtlas() const { +Graphics::TextureAtlas * cUITheme::TextureAtlas() const { return mTextureAtlas; } -void cUITheme::TextureAtlas( cTextureAtlas * SG ) { +void cUITheme::TextureAtlas( Graphics::TextureAtlas * SG ) { mTextureAtlas = SG; } -cSubTexture * cUITheme::GetIconByName( const std::string& name ) { +SubTexture * cUITheme::GetIconByName( const std::string& name ) { if ( NULL != mTextureAtlas ) return mTextureAtlas->GetByName( mAbbr + "_icon_" + name ); return NULL; } -cUIGfx * cUITheme::CreateGfx( cSubTexture * SubTexture, cUIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, ColorA SubTextureColor, EE_RENDER_MODE SubTextureRender ) { +cUIGfx * cUITheme::CreateGfx( SubTexture * SubTexture, cUIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, ColorA SubTextureColor, EE_RENDER_MODE SubTextureRender ) { cUIGfx::CreateParams GfxParams; GfxParams.Parent( Parent ); GfxParams.PosSet( Pos ); @@ -439,7 +439,7 @@ cUIGfx * cUITheme::CreateGfx( cSubTexture * SubTexture, cUIControl * Parent, con return Gfx; } -cUISprite * cUITheme::CreateSprite( cSprite * Sprite, cUIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool DeallocSprite, EE_RENDER_MODE SpriteRender ) { +cUISprite * cUITheme::CreateSprite( Sprite * Sprite, cUIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, bool DealloSprite, EE_RENDER_MODE SpriteRender ) { cUISprite::CreateParams SpriteParams; SpriteParams.Parent( Parent ); SpriteParams.PosSet( Pos ); @@ -447,7 +447,7 @@ cUISprite * cUITheme::CreateSprite( cSprite * Sprite, cUIControl * Parent, const SpriteParams.Flags = Flags; SpriteParams.Sprite = Sprite; SpriteParams.SpriteRender = SpriteRender; - SpriteParams.DeallocSprite = DeallocSprite; + SpriteParams.DealloSprite = DealloSprite; cUISprite * Spr = eeNew( cUISprite, ( SpriteParams ) ); Spr->Visible( true ); Spr->Enabled( true ); @@ -684,7 +684,7 @@ cUIProgressBar * cUITheme::CreateProgressBar( cUIControl * Parent, const Sizei& return Ctrl; } -cUIPushButton * cUITheme::CreatePushButton( cUIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, cSubTexture * Icon, Int32 IconHorizontalMargin, bool IconAutoMargin ) { +cUIPushButton * cUITheme::CreatePushButton( cUIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, SubTexture * Icon, Int32 IconHorizontalMargin, bool IconAutoMargin ) { cUIPushButton::CreateParams ButtonParams; ButtonParams.Parent( Parent ); ButtonParams.PosSet( Pos ); @@ -703,7 +703,7 @@ cUIPushButton * cUITheme::CreatePushButton( cUIControl * Parent, const Sizei& Si return Ctrl; } -cUISelectButton * cUITheme::CreateSelectButton( cUIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, cSubTexture * Icon, Int32 IconHorizontalMargin, bool IconAutoMargin ) { +cUISelectButton * cUITheme::CreateSelectButton( cUIControl * Parent, const Sizei& Size, const Vector2i& Pos, const Uint32& Flags, SubTexture * Icon, Int32 IconHorizontalMargin, bool IconAutoMargin ) { cUIPushButton::CreateParams ButtonParams; ButtonParams.Parent( Parent ); ButtonParams.PosSet( Pos ); diff --git a/src/eepp/ui/cuithememanager.cpp b/src/eepp/ui/cuithememanager.cpp index ee48ba17c..62c5ba260 100644 --- a/src/eepp/ui/cuithememanager.cpp +++ b/src/eepp/ui/cuithememanager.cpp @@ -23,11 +23,11 @@ cUIThemeManager::cUIThemeManager() : cUIThemeManager::~cUIThemeManager() { } -void cUIThemeManager::DefaultFont( cFont * Font ) { +void cUIThemeManager::DefaultFont( Font * Font ) { mFont = Font; } -cFont * cUIThemeManager::DefaultFont() const { +Font * cUIThemeManager::DefaultFont() const { return mFont; } diff --git a/src/eepp/ui/cuitooltip.cpp b/src/eepp/ui/cuitooltip.cpp index 300099407..fb0fdeb8d 100644 --- a/src/eepp/ui/cuitooltip.cpp +++ b/src/eepp/ui/cuitooltip.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include namespace EE { namespace UI { @@ -14,7 +14,7 @@ cUITooltip::cUITooltip( cUITooltip::CreateParams& Params, cUIControl * TooltipOf mTooltipTime( Time::Zero ), mTooltipOf( TooltipOf ) { - mTextCache = eeNew( cTextCache, () ); + mTextCache = eeNew( TextCache, () ); mTextCache->Font( Params.Font ); mTextCache->Color( mFontColor ); mTextCache->ShadowColor( mFontShadowColor ); @@ -102,11 +102,11 @@ void cUITooltip::Draw() { } } -cFont * cUITooltip::Font() const { +Graphics::Font * cUITooltip::Font() const { return mTextCache->Font(); } -void cUITooltip::Font( cFont * font ) { +void cUITooltip::Font( Graphics::Font * font ) { if ( mTextCache->Font() != font ) { mTextCache->Font( font ); AutoPadding(); @@ -217,7 +217,7 @@ const Recti& cUITooltip::Padding() const { return mPadding; } -cTextCache * cUITooltip::GetTextCache() { +TextCache * cUITooltip::GetTextCache() { return mTextCache; } diff --git a/src/eepp/ui/cuiwindow.cpp b/src/eepp/ui/cuiwindow.cpp index 60166033b..10987a639 100644 --- a/src/eepp/ui/cuiwindow.cpp +++ b/src/eepp/ui/cuiwindow.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include namespace EE { namespace UI { @@ -653,7 +653,7 @@ void cUIWindow::Draw() { cUIComplexControl::Draw(); if ( mWinFlags & UI_WIN_DRAW_SHADOW ) { - cPrimitives P; + Primitives P; P.ForceDraw( false ); ColorA BeginC( 0, 0, 0, 25 * ( Alpha() / (Float)255 ) ); diff --git a/src/eepp/ui/cuiwinmenu.cpp b/src/eepp/ui/cuiwinmenu.cpp index a686aa97b..672f8fba5 100644 --- a/src/eepp/ui/cuiwinmenu.cpp +++ b/src/eepp/ui/cuiwinmenu.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include namespace EE { namespace UI { @@ -123,7 +123,7 @@ void cUIWinMenu::RefreshButtons() { Int32 h = 0, th = 0, ycenter = 0; if ( NULL != GetSkin() ) { - cSubTexture * subTexture = GetSkin()->GetSubTexture( cUISkinState::StateNormal ); + SubTexture * subTexture = GetSkin()->GetSubTexture( cUISkinState::StateNormal ); if ( NULL != subTexture ) { h = subTexture->Size().Height(); @@ -132,7 +132,7 @@ void cUIWinMenu::RefreshButtons() { cUISelectButton * tbut = mButtons.begin()->first; if ( NULL != tbut->GetSkin() ) { - cSubTexture * tSubTexture2 = tbut->GetSkin()->GetSubTexture( cUISkinState::StateSelected ); + SubTexture * tSubTexture2 = tbut->GetSkin()->GetSubTexture( cUISkinState::StateSelected ); if ( NULL != tSubTexture2 ) { th = tSubTexture2->Size().Height(); @@ -294,7 +294,7 @@ const ColorA& cUIWinMenu::FontSelectedColor() const { return mFontSelectedColor; } -cFont * cUIWinMenu::Font() const { +Graphics::Font * cUIWinMenu::Font() const { return mFont; } diff --git a/src/eepp/ui/tools/ctextureatlaseditor.cpp b/src/eepp/ui/tools/ctextureatlaseditor.cpp index e307777b7..491217f4a 100644 --- a/src/eepp/ui/tools/ctextureatlaseditor.cpp +++ b/src/eepp/ui/tools/ctextureatlaseditor.cpp @@ -10,7 +10,7 @@ namespace EE { namespace UI { namespace Tools { -cTextureAtlasEditor::cTextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorCloseCb& callback ) : +TextureAtlasEditor::TextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorCloseCb& callback ) : mUIWindow( AttatchTo ), mCloseCb( callback ), mTexturePacker( NULL ), @@ -18,7 +18,7 @@ cTextureAtlasEditor::cTextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorC mCurSubTexture( NULL ) { if ( NULL == cUIThemeManager::instance()->DefaultTheme() ) { - eePRINTL( "cTextureAtlasEditor needs a default theme assigned to work." ); + eePRINTL( "TextureAtlasEditor needs a default theme assigned to work." ); return; } @@ -43,7 +43,7 @@ cTextureAtlasEditor::cTextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorC mSubTextureList = mTheme->CreateListBox( mUIContainer, Sizei( 200, 156 ), Vector2i( mUIContainer->Size().Width() - 205, 50 ), UI_CONTROL_DEFAULT_ALIGN | UI_CLIP_ENABLE | UI_AUTO_PADDING | UI_ANCHOR_RIGHT | UI_ANCHOR_TOP ); mSubTextureList->Size( mSubTextureList->Size().Width(), mSubTextureList->RowHeight() * 9 + mSubTextureList->PaddingContainer().Top + mSubTextureList->PaddingContainer().Bottom ); - mSubTextureList->AddEventListener( cUIEvent::EventOnItemSelected, cb::Make1( this, &cTextureAtlasEditor::OnSubTextureChange ) ); + mSubTextureList->AddEventListener( cUIEvent::EventOnItemSelected, cb::Make1( this, &TextureAtlasEditor::OnSubTextureChange ) ); CreateTxtBox( Vector2i( mUIContainer->Size().Width() - 205, InitY ), "Current SubTexture:" ); @@ -53,7 +53,7 @@ cTextureAtlasEditor::cTextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorC mSpinOffX->MinValue( -32000 ); mSpinOffX->MaxValue( 32000 ); mSpinOffX->Pos( mUIContainer->Size().Width() - mSpinOffX->Size().Width() - 10, InitY ); - mSpinOffX->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &cTextureAtlasEditor::OnOffXChange ) ); + mSpinOffX->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::OnOffXChange ) ); TxtBox = CreateTxtBox( Vector2i(), "Offset X:" ); TxtBox->Pos( mSpinOffX->Pos().x - 10 - TxtBox->Size().Width(), InitY ); @@ -64,7 +64,7 @@ cTextureAtlasEditor::cTextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorC mSpinOffY->MinValue( -32000 ); mSpinOffY->MaxValue( 32000 ); mSpinOffY->Pos( mUIContainer->Size().Width() - mSpinOffY->Size().Width() - 10, InitY ); - mSpinOffY->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &cTextureAtlasEditor::OnOffYChange ) ); + mSpinOffY->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::OnOffYChange ) ); TxtBox = CreateTxtBox( Vector2i(), "Offset Y:" ); TxtBox->Pos( mSpinOffY->Pos().x - 10 - TxtBox->Size().Width(), InitY ); @@ -73,7 +73,7 @@ cTextureAtlasEditor::cTextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorC mSpinDestW = mTheme->CreateSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinDestW->MaxValue( 32000 ); mSpinDestW->Pos( mUIContainer->Size().Width() - mSpinDestW->Size().Width() - 10, InitY ); - mSpinDestW->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &cTextureAtlasEditor::OnDestWChange ) ); + mSpinDestW->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::OnDestWChange ) ); TxtBox = CreateTxtBox( Vector2i(), "Dest. Width:" ); TxtBox->Pos( mSpinDestW->Pos().x - 10 - TxtBox->Size().Width(), InitY ); @@ -82,7 +82,7 @@ cTextureAtlasEditor::cTextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorC mSpinDestH = mTheme->CreateSpinBox( mUIContainer, Sizei( 100, 22 ), Vector2i(), Flags, 0, false ); mSpinDestH->MaxValue( 32000 ); mSpinDestH->Pos( mUIContainer->Size().Width() - mSpinDestH->Size().Width() - 10, InitY ); - mSpinDestH->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &cTextureAtlasEditor::OnDestHChange ) ); + mSpinDestH->AddEventListener( cUIEvent::EventOnValueChange, cb::Make1( this, &TextureAtlasEditor::OnDestHChange ) ); TxtBox = CreateTxtBox( Vector2i(), "Dest. Height:" ); TxtBox->Pos( mSpinDestH->Pos().x - 10 - TxtBox->Size().Width(), InitY ); @@ -90,22 +90,22 @@ cTextureAtlasEditor::cTextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorC cUIPushButton * ResetButton = mTheme->CreatePushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( mUIContainer->Size().Width() - 120 - 5 , mSpinDestH->Pos().y + mSpinDestH->Size().Height() + 8 ), ButFlags ); ResetButton->Text( "Reset Dest. Size" ); - ResetButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cTextureAtlasEditor::OnResetDestSize ) ); + ResetButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::OnResetDestSize ) ); cUIPushButton * ResetOffsetButton = mTheme->CreatePushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetButton->Pos().x, ResetButton->Pos().y + ResetButton->Size().Height() + 8 ), ButFlags ); - ResetOffsetButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cTextureAtlasEditor::OnResetOffset ) ); + ResetOffsetButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::OnResetOffset ) ); ResetOffsetButton->Text( "Reset Offset" ); cUIPushButton * CenterOffsetButton = mTheme->CreatePushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( ResetOffsetButton->Pos().x, ResetOffsetButton->Pos().y + ResetOffsetButton->Size().Height() + 8 ), ButFlags ); - CenterOffsetButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cTextureAtlasEditor::OnCenterOffset ) ); + CenterOffsetButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::OnCenterOffset ) ); CenterOffsetButton->Text( "Centered Offset" ); cUIPushButton * HBOffsetButton = mTheme->CreatePushButton( mUIContainer, Sizei( 120, 22 ), Vector2i( CenterOffsetButton->Pos().x, CenterOffsetButton->Pos().y + CenterOffsetButton->Size().Height() + 8 ), ButFlags ); - HBOffsetButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cTextureAtlasEditor::OnHBOffset ) ); + HBOffsetButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasEditor::OnHBOffset ) ); HBOffsetButton->Text( "Half-Bottom Offset" ); mUIWindow->Title( "Texture Atlas Editor" ); - mUIWindow->AddEventListener( cUIEvent::EventOnWindowClose, cb::Make1( this, &cTextureAtlasEditor::WindowClose ) ); + mUIWindow->AddEventListener( cUIEvent::EventOnWindowClose, cb::Make1( this, &TextureAtlasEditor::WindowClose ) ); CreateTGEditor(); @@ -115,14 +115,14 @@ cTextureAtlasEditor::cTextureAtlasEditor( cUIWindow * AttatchTo, const TGEditorC Params.SizeSet( 800, 600 ); Params.Background.Color( ColorA( 0, 0, 0, 50 ) ); Params.Flags |= UI_ANCHOR_BOTTOM | UI_ANCHOR_RIGHT | UI_CLIP_ENABLE | UI_BORDER | UI_FILL_BACKGROUND; - mSubTextureEditor = eeNew( cTextureAtlasSubTextureEditor, ( Params, this ) ); + mSubTextureEditor = eeNew( TextureAtlasSubTextureEditor, ( Params, this ) ); mSubTextureEditor->Visible( true ); mSubTextureEditor->Enabled( true ); mTGEU = eeNew( cUITGEUpdater, ( cUITGEUpdater::CreateParams(), this ) ); } -cTextureAtlasEditor::~cTextureAtlasEditor() { +TextureAtlasEditor::~TextureAtlasEditor() { eeSAFE_DELETE( mTexturePacker ); eeSAFE_DELETE( mTextureAtlasLoader ); @@ -131,7 +131,7 @@ cTextureAtlasEditor::~cTextureAtlasEditor() { } } -void cTextureAtlasEditor::OnResetDestSize( const cUIEvent * Event ) { +void TextureAtlasEditor::OnResetDestSize( const cUIEvent * Event ) { const cUIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->Flags() & EE_BUTTON_LMASK ) { @@ -144,7 +144,7 @@ void cTextureAtlasEditor::OnResetDestSize( const cUIEvent * Event ) { } } -void cTextureAtlasEditor::OnResetOffset( const cUIEvent * Event ) { +void TextureAtlasEditor::OnResetOffset( const cUIEvent * Event ) { const cUIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->Flags() & EE_BUTTON_LMASK ) { @@ -153,7 +153,7 @@ void cTextureAtlasEditor::OnResetOffset( const cUIEvent * Event ) { } } -void cTextureAtlasEditor::OnCenterOffset( const cUIEvent * Event ) { +void TextureAtlasEditor::OnCenterOffset( const cUIEvent * Event ) { const cUIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->Flags() & EE_BUTTON_LMASK ) { @@ -164,7 +164,7 @@ void cTextureAtlasEditor::OnCenterOffset( const cUIEvent * Event ) { } } -void cTextureAtlasEditor::OnHBOffset( const cUIEvent * Event ) { +void TextureAtlasEditor::OnHBOffset( const cUIEvent * Event ) { const cUIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->Flags() & EE_BUTTON_LMASK ) { @@ -175,46 +175,46 @@ void cTextureAtlasEditor::OnHBOffset( const cUIEvent * Event ) { } } -void cTextureAtlasEditor::OnOffXChange( const cUIEvent * Event ) { +void TextureAtlasEditor::OnOffXChange( const cUIEvent * Event ) { if ( NULL != mCurSubTexture ) { mCurSubTexture->Offset( Vector2i( (Int32)mSpinOffX->Value(), mCurSubTexture->Offset().y ) ); } } -void cTextureAtlasEditor::OnOffYChange( const cUIEvent * Event ) { +void TextureAtlasEditor::OnOffYChange( const cUIEvent * Event ) { if ( NULL != mCurSubTexture ) { mCurSubTexture->Offset( Vector2i( mCurSubTexture->Offset().x, (Int32)mSpinOffY->Value() ) ); } } -void cTextureAtlasEditor::OnDestWChange( const cUIEvent * Event ) { +void TextureAtlasEditor::OnDestWChange( const cUIEvent * Event ) { if ( NULL != mCurSubTexture ) { mCurSubTexture->DestSize( Sizef( (Int32)mSpinDestW->Value(), mCurSubTexture->DestSize().y ) ); } } -void cTextureAtlasEditor::OnDestHChange( const cUIEvent * Event ) { +void TextureAtlasEditor::OnDestHChange( const cUIEvent * Event ) { if ( NULL != mCurSubTexture ) { mCurSubTexture->DestSize( Sizef( mCurSubTexture->DestSize().x, (Int32)mSpinDestH->Value() ) ); } } -cUITextBox * cTextureAtlasEditor::CreateTxtBox( Vector2i Pos, const String& Text ) { +cUITextBox * TextureAtlasEditor::CreateTxtBox( Vector2i Pos, const String& Text ) { return mTheme->CreateTextBox( Text, mUIContainer, Sizei(), Pos, UI_CONTROL_DEFAULT_ALIGN | UI_ANCHOR_TOP | UI_ANCHOR_RIGHT | UI_DRAW_SHADOW | UI_AUTO_SIZE ); } -void cTextureAtlasEditor::WindowClose( const cUIEvent * Event ) { +void TextureAtlasEditor::WindowClose( const cUIEvent * Event ) { if ( mCloseCb.IsSet() ) mCloseCb(); eeDelete( this ); } -void cTextureAtlasEditor::CreateTGEditor() { +void TextureAtlasEditor::CreateTGEditor() { CreateWinMenu(); } -void cTextureAtlasEditor::CreateWinMenu() { +void TextureAtlasEditor::CreateWinMenu() { mWinMenu = mTheme->CreateWinMenu( mUIContainer ); cUIPopUpMenu * PU = mTheme->CreatePopUpMenu(); @@ -227,23 +227,23 @@ void cTextureAtlasEditor::CreateWinMenu() { PU->AddSeparator(); PU->Add( "Quit", mTheme->GetIconByName( "quit" ) ); - PU->AddEventListener( cUIEvent::EventOnItemClicked, cb::Make1( this, &cTextureAtlasEditor::FileMenuClick ) ); + PU->AddEventListener( cUIEvent::EventOnItemClicked, cb::Make1( this, &TextureAtlasEditor::FileMenuClick ) ); mWinMenu->AddMenuButton( "File", PU ); } -void cTextureAtlasEditor::FileMenuClick( const cUIEvent * Event ) { +void TextureAtlasEditor::FileMenuClick( const cUIEvent * Event ) { if ( !Event->Ctrl()->IsType( UI_TYPE_MENUITEM ) ) return; const String& txt = reinterpret_cast ( Event->Ctrl() )->Text(); if ( "New..." == txt ) { - eeNew( cTextureAtlasNew, ( cb::Make1( this, &cTextureAtlasEditor::OnTextureAtlasCreate ) ) ); + eeNew( TextureAtlasNew, ( cb::Make1( this, &TextureAtlasEditor::OnTextureAtlasCreate ) ) ); } else if ( "Open..." == txt ) { cUICommonDialog * TGDialog = mTheme->CreateCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS, std::string( "*" ) + EE_TEXTURE_ATLAS_EXTENSION ); TGDialog->Title( "Open Texture Atlas" ); - TGDialog->AddEventListener( cUIEvent::EventOpenFile, cb::Make1( this, &cTextureAtlasEditor::OpenTextureAtlas ) ); + TGDialog->AddEventListener( cUIEvent::EventOpenFile, cb::Make1( this, &TextureAtlasEditor::OpenTextureAtlas ) ); TGDialog->Center(); TGDialog->Show(); } else if ( "Save" == txt ) { @@ -253,7 +253,7 @@ void cTextureAtlasEditor::FileMenuClick( const cUIEvent * Event ) { } else if ( "Close" == txt ) { if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->IsLoaded() ) { cUIMessageBox * MsgBox = mTheme->CreateMessageBox( MSGBOX_OKCANCEL, "Do you really want to close the current texture atlas?\nAll changes will be lost." ); - MsgBox->AddEventListener( cUIEvent::EventMsgBoxConfirmClick, cb::Make1( this, &cTextureAtlasEditor::OnTextureAtlasClose ) ); + MsgBox->AddEventListener( cUIEvent::EventMsgBoxConfirmClick, cb::Make1( this, &TextureAtlasEditor::OnTextureAtlasClose ) ); MsgBox->Title( "Close Texture Atlas?" ); MsgBox->Center(); MsgBox->Show(); @@ -269,7 +269,7 @@ void cTextureAtlasEditor::FileMenuClick( const cUIEvent * Event ) { } } -void cTextureAtlasEditor::OnTextureAtlasCreate( cTexturePacker * TexPacker ) { +void TextureAtlasEditor::OnTextureAtlasCreate( TexturePacker * TexPacker ) { eeSAFE_DELETE( mTexturePacker ); mTexturePacker = TexPacker; @@ -277,26 +277,26 @@ void cTextureAtlasEditor::OnTextureAtlasCreate( cTexturePacker * TexPacker ) { std::string FPath( FileSystem::FileRemoveExtension( mTexturePacker->GetFilepath() + EE_TEXTURE_ATLAS_EXTENSION ) ); - mTextureAtlasLoader = eeNew( cTextureAtlasLoader, ( FPath, true, cb::Make1( this, &cTextureAtlasEditor::OnTextureAtlasLoaded ) ) ); + mTextureAtlasLoader = eeNew( TextureAtlasLoader, ( FPath, true, cb::Make1( this, &TextureAtlasEditor::OnTextureAtlasLoaded ) ) ); } -void cTextureAtlasEditor::UpdateControls() { +void TextureAtlasEditor::UpdateControls() { if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->IsLoaded() ) { FillSubTextureList(); } } -void cTextureAtlasEditor::FillSubTextureList() { +void TextureAtlasEditor::FillSubTextureList() { if ( NULL == mTextureAtlasLoader || NULL == mTextureAtlasLoader->GetTextureAtlas() || !mTextureAtlasLoader->IsLoaded() ) return; - std::list& Res = mTextureAtlasLoader->GetTextureAtlas()->GetResources(); + std::list& Res = mTextureAtlasLoader->GetTextureAtlas()->GetResources(); mSubTextureList->Clear(); std::vector items; - for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { + for ( std::list::iterator it = Res.begin(); it != Res.end(); it++ ) { items.push_back( (*it)->Name() ); } @@ -310,7 +310,7 @@ void cTextureAtlasEditor::FillSubTextureList() { mSubTextureList->VerticalScrollBar()->ClickStep( 8.f / (Float)mSubTextureList->Count() ); } -void cTextureAtlasEditor::OnSubTextureChange( const cUIEvent * Event ) { +void TextureAtlasEditor::OnSubTextureChange( const cUIEvent * Event ) { if ( NULL != mTextureAtlasLoader && NULL != mTextureAtlasLoader->GetTextureAtlas() ) { mCurSubTexture = mTextureAtlasLoader->GetTextureAtlas()->GetByName( mSubTextureList->GetItemSelectedText() ); @@ -324,13 +324,13 @@ void cTextureAtlasEditor::OnSubTextureChange( const cUIEvent * Event ) { } } -void cTextureAtlasEditor::Update() { +void TextureAtlasEditor::Update() { if ( NULL != mTextureAtlasLoader && !mTextureAtlasLoader->IsLoaded() ) { mTextureAtlasLoader->Update(); } } -void cTextureAtlasEditor::OpenTextureAtlas( const cUIEvent * Event ) { +void TextureAtlasEditor::OpenTextureAtlas( const cUIEvent * Event ) { cUICommonDialog * CDL = reinterpret_cast ( Event->Ctrl() ); eeSAFE_DELETE( mTextureAtlasLoader ); @@ -339,22 +339,22 @@ void cTextureAtlasEditor::OpenTextureAtlas( const cUIEvent * Event ) { threaded = false; #endif - mTextureAtlasLoader = eeNew( cTextureAtlasLoader, ( CDL->GetFullPath(), threaded, cb::Make1( this, &cTextureAtlasEditor::OnTextureAtlasLoaded ) ) ); + mTextureAtlasLoader = eeNew( TextureAtlasLoader, ( CDL->GetFullPath(), threaded, cb::Make1( this, &TextureAtlasEditor::OnTextureAtlasLoaded ) ) ); } -void cTextureAtlasEditor::OnTextureAtlasLoaded( cTextureAtlasLoader * TGLoader ) { +void TextureAtlasEditor::OnTextureAtlasLoaded( TextureAtlasLoader * TGLoader ) { if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->IsLoaded() ) { UpdateControls(); } } -void cTextureAtlasEditor::SaveTextureAtlas( const cUIEvent * Event ) { +void TextureAtlasEditor::SaveTextureAtlas( const cUIEvent * Event ) { if ( NULL != mTextureAtlasLoader && mTextureAtlasLoader->IsLoaded() ) { mTextureAtlasLoader->UpdateTextureAtlas(); } } -void cTextureAtlasEditor::OnTextureAtlasClose( const cUIEvent * Event ) { +void TextureAtlasEditor::OnTextureAtlasClose( const cUIEvent * Event ) { eeSAFE_DELETE( mTextureAtlasLoader ); mSubTextureList->Clear(); mSpinOffX->Value( 0 ); diff --git a/src/eepp/ui/tools/ctextureatlasnew.cpp b/src/eepp/ui/tools/ctextureatlasnew.cpp index af0f8f307..3a501a015 100644 --- a/src/eepp/ui/tools/ctextureatlasnew.cpp +++ b/src/eepp/ui/tools/ctextureatlasnew.cpp @@ -6,7 +6,7 @@ namespace EE { namespace UI { namespace Tools { -cTextureAtlasNew::cTextureAtlasNew( TGCreateCb NewTGCb ) : +TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) : mTheme( NULL ), mUIWindow( NULL ), mNewTGCb( NewTGCb ) @@ -17,7 +17,7 @@ cTextureAtlasNew::cTextureAtlasNew( TGCreateCb NewTGCb ) : return; mUIWindow = mTheme->CreateWindow( NULL, Sizei( 378, 244 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MODAL ); - mUIWindow->AddEventListener( cUIEvent::EventOnWindowClose, cb::Make1( this, &cTextureAtlasNew::WindowClose ) ); + mUIWindow->AddEventListener( cUIEvent::EventOnWindowClose, cb::Make1( this, &TextureAtlasNew::WindowClose ) ); mUIWindow->Title( "New Texture Atlas" ); Int32 PosX = mUIWindow->Container()->Size().Width() - 110; @@ -62,29 +62,29 @@ cTextureAtlasNew::cTextureAtlasNew( TGCreateCb NewTGCb ) : mSetPathButton = mTheme->CreatePushButton( mUIWindow->Container(), Sizei( 32, 32 ), Vector2i( mUIWindow->Container()->Size().Width() - 10 - 32, 160 ) ); mSetPathButton->Text( "..." ); - mSetPathButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cTextureAtlasNew::OnDialogFolderSelect ) ); + mSetPathButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::OnDialogFolderSelect ) ); cUIPushButton * OKButton = mTheme->CreatePushButton( mUIWindow->Container(), Sizei( 80, 22 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "ok" ) ); OKButton->Pos( mUIWindow->Container()->Size().Width() - OKButton->Size().Width() - 4, mUIWindow->Container()->Size().Height() - OKButton->Size().Height() - 4 ); - OKButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cTextureAtlasNew::OKClick ) ); + OKButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::OKClick ) ); OKButton->Text( "OK" ); cUIPushButton * CancelButton = mTheme->CreatePushButton( mUIWindow->Container(), OKButton->Size(), Vector2i( OKButton->Pos().x - OKButton->Size().Width() - 4, OKButton->Pos().y ), UI_CONTROL_DEFAULT_FLAGS_CENTERED | UI_AUTO_SIZE, mTheme->GetIconByName( "cancel" ) ); - CancelButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &cTextureAtlasNew::CancelClick ) ); + CancelButton->AddEventListener( cUIEvent::EventMouseClick, cb::Make1( this, &TextureAtlasNew::CancelClick ) ); CancelButton->Text( "Cancel" ); mUIWindow->Center(); mUIWindow->Show(); } -cTextureAtlasNew::~cTextureAtlasNew() { +TextureAtlasNew::~TextureAtlasNew() { } -cUITextBox * cTextureAtlasNew::CreateTxtBox( Vector2i Pos, const String& Text ) { +cUITextBox * TextureAtlasNew::CreateTxtBox( Vector2i Pos, const String& Text ) { return mTheme->CreateTextBox( Text, mUIWindow->Container(), Sizei(), Pos, UI_CONTROL_DEFAULT_FLAGS | UI_DRAW_SHADOW | UI_AUTO_SIZE ); } -void cTextureAtlasNew::OKClick( const cUIEvent * Event ) { +void TextureAtlasNew::OKClick( const cUIEvent * Event ) { const cUIEventMouse * MouseEvent = reinterpret_cast( Event ); if ( MouseEvent->Flags() & EE_BUTTON_LMASK ) { @@ -94,13 +94,13 @@ void cTextureAtlasNew::OKClick( const cUIEvent * Event ) { cUICommonDialog * TGDialog = mTheme->CreateCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS | CDL_FLAG_SAVE_DIALOG, "*." + ext ); TGDialog->Title( "Save Texture Atlas" ); - TGDialog->AddEventListener( cUIEvent::EventSaveFile, cb::Make1( this, &cTextureAtlasNew::TextureAtlasSave ) ); + TGDialog->AddEventListener( cUIEvent::EventSaveFile, cb::Make1( this, &TextureAtlasNew::TextureAtlasSave ) ); TGDialog->Center(); TGDialog->Show(); } } -void cTextureAtlasNew::CancelClick( const cUIEvent * Event ) { +void TextureAtlasNew::CancelClick( const cUIEvent * Event ) { const cUIEventMouse * MouseEvent = reinterpret_cast( Event ); if ( MouseEvent->Flags() & EE_BUTTON_LMASK ) { @@ -108,7 +108,7 @@ void cTextureAtlasNew::CancelClick( const cUIEvent * Event ) { } } -void cTextureAtlasNew::WindowClose( const cUIEvent * Event ) { +void TextureAtlasNew::WindowClose( const cUIEvent * Event ) { eeDelete( this ); } @@ -116,7 +116,7 @@ static bool IsValidExtension( const std::string& ext ) { return ext == "png" || ext == "bmp" || ext == "dds" || ext == "tga"; } -void cTextureAtlasNew::TextureAtlasSave( const cUIEvent * Event ) { +void TextureAtlasNew::TextureAtlasSave( const cUIEvent * Event ) { cUICommonDialog * CDL = reinterpret_cast ( Event->Ctrl() ); std::string FPath( CDL->GetFullPath() ); @@ -127,7 +127,7 @@ void cTextureAtlasNew::TextureAtlasSave( const cUIEvent * Event ) { b = static_cast( mPixelSpace->Value() ); if ( Res1 && Res2 ) { - cTexturePacker * TexturePacker = eeNew( cTexturePacker, ( w, h, false, b ) ); + Graphics::TexturePacker * TexturePacker = eeNew( Graphics::TexturePacker, ( w, h, false, b ) ); TexturePacker->AddTexturesPath( mTGPath->Text() ); @@ -155,20 +155,20 @@ void cTextureAtlasNew::TextureAtlasSave( const cUIEvent * Event ) { } } -void cTextureAtlasNew::OnDialogFolderSelect( const cUIEvent * Event ) { +void TextureAtlasNew::OnDialogFolderSelect( const cUIEvent * Event ) { const cUIEventMouse * MouseEvent = reinterpret_cast( Event ); if ( MouseEvent->Flags() & EE_BUTTON_LMASK ) { cUICommonDialog * TGDialog = mTheme->CreateCommonDialog( NULL, Sizei(), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_MODAL, Sizei(), 255, UI_CDL_DEFAULT_FLAGS | CDL_FLAG_ALLOW_FOLDER_SELECT, "*" ); TGDialog->Title( "Create Texture Atlas ( Select Folder Containing Textures )" ); - TGDialog->AddEventListener( cUIEvent::EventOpenFile, cb::Make1( this, &cTextureAtlasNew::OnSelectFolder ) ); + TGDialog->AddEventListener( cUIEvent::EventOpenFile, cb::Make1( this, &TextureAtlasNew::OnSelectFolder ) ); TGDialog->Center(); TGDialog->Show(); } } -void cTextureAtlasNew::OnSelectFolder( const cUIEvent * Event ) { +void TextureAtlasNew::OnSelectFolder( const cUIEvent * Event ) { cUICommonDialog * CDL = reinterpret_cast ( Event->Ctrl() ); cUIMessageBox * MsgBox; std::string FPath( CDL->GetFullPath() ); diff --git a/src/eepp/ui/tools/ctextureatlasnew.hpp b/src/eepp/ui/tools/ctextureatlasnew.hpp index 1567b3f18..0092c12b2 100644 --- a/src/eepp/ui/tools/ctextureatlasnew.hpp +++ b/src/eepp/ui/tools/ctextureatlasnew.hpp @@ -6,17 +6,17 @@ #include #include #include -#include +#include namespace EE { namespace UI { namespace Tools { -class EE_API cTextureAtlasNew { +class EE_API TextureAtlasNew { public: - typedef cb::Callback1 TGCreateCb; + typedef cb::Callback1 TGCreateCb; - cTextureAtlasNew( TGCreateCb NewTGCb = TGCreateCb() ); + TextureAtlasNew( TGCreateCb NewTGCb = TGCreateCb() ); - virtual ~cTextureAtlasNew(); + virtual ~TextureAtlasNew(); protected: cUITheme * mTheme; cUIWindow * mUIWindow; diff --git a/src/eepp/ui/tools/ctextureatlassubtextureeditor.cpp b/src/eepp/ui/tools/ctextureatlassubtextureeditor.cpp index f3cf0d591..31b3ba736 100644 --- a/src/eepp/ui/tools/ctextureatlassubtextureeditor.cpp +++ b/src/eepp/ui/tools/ctextureatlassubtextureeditor.cpp @@ -1,11 +1,11 @@ #include #include -#include +#include #include namespace EE { namespace UI { namespace Tools { -cTextureAtlasSubTextureEditor::cTextureAtlasSubTextureEditor( const cUIComplexControl::CreateParams& Params, cTextureAtlasEditor * Editor ) : +TextureAtlasSubTextureEditor::TextureAtlasSubTextureEditor( const cUIComplexControl::CreateParams& Params, TextureAtlasEditor * Editor ) : cUIComplexControl( Params ), mGfx( NULL ), mEditor( Editor ) @@ -29,11 +29,11 @@ cTextureAtlasSubTextureEditor::cTextureAtlasSubTextureEditor( const cUIComplexCo GetCenter(); } -cTextureAtlasSubTextureEditor::~cTextureAtlasSubTextureEditor() { +TextureAtlasSubTextureEditor::~TextureAtlasSubTextureEditor() { } -void cTextureAtlasSubTextureEditor::Draw() { - cPrimitives P; +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() ) ) ); @@ -41,7 +41,7 @@ void cTextureAtlasSubTextureEditor::Draw() { cUIComplexControl::Draw(); } -void cTextureAtlasSubTextureEditor::Update() { +void TextureAtlasSubTextureEditor::Update() { Vector2i Pos = mDrag->Pos(); cUIComplexControl::Update(); @@ -58,23 +58,23 @@ void cTextureAtlasSubTextureEditor::Update() { mGfx->Pos( mUICenter ); } -void cTextureAtlasSubTextureEditor::OnSizeChange() { +void TextureAtlasSubTextureEditor::OnSizeChange() { GetCenter(); } -cSubTexture * cTextureAtlasSubTextureEditor::SubTexture() const { +Graphics::SubTexture * TextureAtlasSubTextureEditor::SubTexture() const { return mGfx->SubTexture(); } -void cTextureAtlasSubTextureEditor::SubTexture( cSubTexture * subTexture ) { +void TextureAtlasSubTextureEditor::SubTexture( Graphics::SubTexture * subTexture ) { mGfx->SubTexture( subTexture ); } -cUIGfx * cTextureAtlasSubTextureEditor::Gfx() const { +cUIGfx * TextureAtlasSubTextureEditor::Gfx() const { return mGfx; } -void cTextureAtlasSubTextureEditor::GetCenter() { +void TextureAtlasSubTextureEditor::GetCenter() { mUICenter = Vector2i( mSize.Width() / 2, mSize.Height() / 2 ); } diff --git a/src/eepp/ui/tools/ctextureatlassubtextureeditor.hpp b/src/eepp/ui/tools/ctextureatlassubtextureeditor.hpp index 93e3a83ac..f98d3b4a4 100644 --- a/src/eepp/ui/tools/ctextureatlassubtextureeditor.hpp +++ b/src/eepp/ui/tools/ctextureatlassubtextureeditor.hpp @@ -3,26 +3,26 @@ #include #include -#include +#include #include namespace EE { namespace UI { namespace Tools { -class cTextureAtlasEditor; +class TextureAtlasEditor; -class EE_API cTextureAtlasSubTextureEditor : public cUIComplexControl { +class EE_API TextureAtlasSubTextureEditor : public cUIComplexControl { public: - cTextureAtlasSubTextureEditor( const cUIComplexControl::CreateParams& Params, cTextureAtlasEditor * Editor ); + TextureAtlasSubTextureEditor( const cUIComplexControl::CreateParams& Params, TextureAtlasEditor * Editor ); - virtual ~cTextureAtlasSubTextureEditor(); + virtual ~TextureAtlasSubTextureEditor(); virtual void Draw(); virtual void Update(); - cSubTexture * SubTexture() const; + Graphics::SubTexture * SubTexture() const; - void SubTexture( cSubTexture * subTexture ); + void SubTexture( Graphics::SubTexture * subTexture ); cUIGfx * Gfx() const; protected: @@ -30,7 +30,7 @@ class EE_API cTextureAtlasSubTextureEditor : public cUIComplexControl { cUIGfx * mGfx; cUIDragable * mDrag; Vector2i mUICenter; - cTextureAtlasEditor * mEditor; + TextureAtlasEditor * mEditor; virtual void OnSizeChange(); diff --git a/src/eepp/window/backend/SDL/cursormanagersdl.cpp b/src/eepp/window/backend/SDL/cursormanagersdl.cpp index 95f2cac1f..a8fa613b6 100644 --- a/src/eepp/window/backend/SDL/cursormanagersdl.cpp +++ b/src/eepp/window/backend/SDL/cursormanagersdl.cpp @@ -18,7 +18,7 @@ CursorManagerSDL::CursorManagerSDL( EE::Window::Window * window ) : { } -Cursor * CursorManagerSDL::Create( cTexture * tex, const Vector2i& hotspot, const std::string& name ) { +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 @@ -26,7 +26,7 @@ Cursor * CursorManagerSDL::Create( cTexture * tex, const Vector2i& hotspot, cons #endif } -Cursor * CursorManagerSDL::Create( cImage * img, const Vector2i& hotspot, const std::string& name ) { +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 diff --git a/src/eepp/window/backend/SDL/cursormanagersdl.hpp b/src/eepp/window/backend/SDL/cursormanagersdl.hpp index 0c0ae4d71..a464d9040 100644 --- a/src/eepp/window/backend/SDL/cursormanagersdl.hpp +++ b/src/eepp/window/backend/SDL/cursormanagersdl.hpp @@ -14,9 +14,9 @@ class CursorManagerSDL : public CursorManager { public: CursorManagerSDL( EE::Window::Window * window ); - Cursor * Create( cTexture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( cImage * 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 ); diff --git a/src/eepp/window/backend/SDL/cursorsdl.cpp b/src/eepp/window/backend/SDL/cursorsdl.cpp index aba25e4df..954f8a39e 100644 --- a/src/eepp/window/backend/SDL/cursorsdl.cpp +++ b/src/eepp/window/backend/SDL/cursorsdl.cpp @@ -4,12 +4,12 @@ namespace EE { namespace Window { namespace Backend { namespace SDL { -CursorSDL::CursorSDL( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorSDL::CursorSDL( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( tex, hotspot, name, window ) { } -CursorSDL::CursorSDL( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorSDL::CursorSDL( Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ) { } diff --git a/src/eepp/window/backend/SDL/cursorsdl.hpp b/src/eepp/window/backend/SDL/cursorsdl.hpp index bfe84aafd..225530c9a 100644 --- a/src/eepp/window/backend/SDL/cursorsdl.hpp +++ b/src/eepp/window/backend/SDL/cursorsdl.hpp @@ -14,9 +14,9 @@ class CursorSDL : public Cursor { protected: friend class CursorManagerSDL; - CursorSDL( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorSDL( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - CursorSDL( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorSDL( 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 ); diff --git a/src/eepp/window/backend/SDL/windowsdl.cpp b/src/eepp/window/backend/SDL/windowsdl.cpp index 8be31875a..69c308d79 100644 --- a/src/eepp/window/backend/SDL/windowsdl.cpp +++ b/src/eepp/window/backend/SDL/windowsdl.cpp @@ -23,12 +23,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace EE { namespace Window { namespace Backend { namespace SDL { @@ -233,7 +233,7 @@ bool WindowSDL::Icon( const std::string& Path ) { return false; } - cImage Img( Path ); + Image Img( Path ); if ( NULL != Img.GetPixelsPtr() ) { const Uint8 * Ptr = Img.GetPixelsPtr(); @@ -304,7 +304,7 @@ void WindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { #endif if ( Reload ) - Graphics::cTextureFactory::instance()->GrabTextures(); + Graphics::TextureFactory::instance()->GrabTextures(); #endif Uint32 oldWidth = mWindow.WindowConfig.Width; @@ -335,10 +335,10 @@ void WindowSDL::Size( Uint32 Width, Uint32 Height, bool Windowed ) { if ( Reload ) { cGL::instance()->Init(); - Graphics::cTextureFactory::instance()->UngrabTextures(); // Reload all textures - Graphics::cShaderProgramManager::instance()->Reload(); // Reload all shaders - Graphics::Private::cFrameBufferManager::instance()->Reload(); // Reload all frame buffers - Graphics::Private::cVertexBufferManager::instance()->Reload(); // Reload all vertex buffers + 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(); } diff --git a/src/eepp/window/backend/SDL2/cursormanagersdl2.cpp b/src/eepp/window/backend/SDL2/cursormanagersdl2.cpp index a85f13624..d76461927 100644 --- a/src/eepp/window/backend/SDL2/cursormanagersdl2.cpp +++ b/src/eepp/window/backend/SDL2/cursormanagersdl2.cpp @@ -21,11 +21,11 @@ CursorManagerSDL::CursorManagerSDL( EE::Window::Window * window ) : { } -Cursor * CursorManagerSDL::Create( cTexture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSDL::Create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorSDL, ( tex, hotspot, name, mWindow ) ); } -Cursor * CursorManagerSDL::Create( cImage * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerSDL::Create( Image * img, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorSDL, ( img, hotspot, name, mWindow ) ); } diff --git a/src/eepp/window/backend/SDL2/cursormanagersdl2.hpp b/src/eepp/window/backend/SDL2/cursormanagersdl2.hpp index e1d7d1de2..e07a02fef 100644 --- a/src/eepp/window/backend/SDL2/cursormanagersdl2.hpp +++ b/src/eepp/window/backend/SDL2/cursormanagersdl2.hpp @@ -14,9 +14,9 @@ class CursorManagerSDL : public CursorManager { public: CursorManagerSDL( EE::Window::Window * window ); - Cursor * Create( cTexture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( cImage * 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 ); diff --git a/src/eepp/window/backend/SDL2/cursorsdl2.cpp b/src/eepp/window/backend/SDL2/cursorsdl2.cpp index c17b1b0fb..855cf8f6b 100644 --- a/src/eepp/window/backend/SDL2/cursorsdl2.cpp +++ b/src/eepp/window/backend/SDL2/cursorsdl2.cpp @@ -4,14 +4,14 @@ namespace EE { namespace Window { namespace Backend { namespace SDL2 { -CursorSDL::CursorSDL( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorSDL::CursorSDL( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( tex, hotspot, name, window ), mCursor( NULL ) { Create(); } -CursorSDL::CursorSDL( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorSDL::CursorSDL( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ), mCursor( NULL ) { diff --git a/src/eepp/window/backend/SDL2/cursorsdl2.hpp b/src/eepp/window/backend/SDL2/cursorsdl2.hpp index 723fcba78..203503277 100644 --- a/src/eepp/window/backend/SDL2/cursorsdl2.hpp +++ b/src/eepp/window/backend/SDL2/cursorsdl2.hpp @@ -18,9 +18,9 @@ class CursorSDL : public Cursor { SDL_Cursor * mCursor; - CursorSDL( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorSDL( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - CursorSDL( cImage * img, 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 ); diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 432973f59..0cd6569d1 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -11,12 +11,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #if EE_PLATFORM == EE_PLATFORM_ANDROID #include @@ -502,7 +502,7 @@ bool WindowSDL::Icon( const std::string& Path ) { return false; } - cImage Img( Path ); + Image Img( Path ); if ( NULL != Img.GetPixelsPtr() ) { const Uint8 * Ptr = Img.GetPixelsPtr(); diff --git a/src/eepp/window/backend/SFML/cursormanagersfml.cpp b/src/eepp/window/backend/SFML/cursormanagersfml.cpp index 58abb23db..6faeae5e9 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( cTexture * 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( cTexture * tex, const Vector2i& hotspot, con #endif } -Cursor * CursorManagerSFML::Create( cImage * 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 diff --git a/src/eepp/window/backend/SFML/cursormanagersfml.hpp b/src/eepp/window/backend/SFML/cursormanagersfml.hpp index 3bfa0e281..ce3e18ec9 100644 --- a/src/eepp/window/backend/SFML/cursormanagersfml.hpp +++ b/src/eepp/window/backend/SFML/cursormanagersfml.hpp @@ -13,9 +13,9 @@ class CursorManagerSFML : public CursorManager { public: CursorManagerSFML( EE::Window::Window * window ); - Cursor * Create( cTexture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( cImage * 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 ); diff --git a/src/eepp/window/backend/SFML/cursorsfml.cpp b/src/eepp/window/backend/SFML/cursorsfml.cpp index 11e9fe13a..a3dfbcbe5 100644 --- a/src/eepp/window/backend/SFML/cursorsfml.cpp +++ b/src/eepp/window/backend/SFML/cursorsfml.cpp @@ -4,12 +4,12 @@ namespace EE { namespace Window { namespace Backend { namespace SFML { -CursorSFML::CursorSFML( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorSFML::CursorSFML( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( tex, hotspot, name, window ) { } -CursorSFML::CursorSFML( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorSFML::CursorSFML( Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ) { } diff --git a/src/eepp/window/backend/SFML/cursorsfml.hpp b/src/eepp/window/backend/SFML/cursorsfml.hpp index 904a49896..15536bd42 100644 --- a/src/eepp/window/backend/SFML/cursorsfml.hpp +++ b/src/eepp/window/backend/SFML/cursorsfml.hpp @@ -13,9 +13,9 @@ class CursorSFML : public Cursor { protected: friend class CursorManagerSFML; - CursorSFML( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorSFML( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - CursorSFML( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorSFML( Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); CursorSFML( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); diff --git a/src/eepp/window/backend/SFML/windowsfml.cpp b/src/eepp/window/backend/SFML/windowsfml.cpp index ec5988616..23196ae11 100644 --- a/src/eepp/window/backend/SFML/windowsfml.cpp +++ b/src/eepp/window/backend/SFML/windowsfml.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include namespace EE { namespace Window { namespace Backend { namespace SFML { @@ -124,7 +124,7 @@ void WindowSFML::Caption( const std::string& Caption ) { bool WindowSFML::Icon( const std::string& Path ) { mWindow.WindowConfig.Icon = Path; - cImage Img( Path ); + Image Img( Path ); mSFMLWindow.setIcon( Img.Width(), Img.Height(), Img.GetPixelsPtr() ); diff --git a/src/eepp/window/backend/null/cursormanagernull.cpp b/src/eepp/window/backend/null/cursormanagernull.cpp index c356f149a..9074ee4e5 100644 --- a/src/eepp/window/backend/null/cursormanagernull.cpp +++ b/src/eepp/window/backend/null/cursormanagernull.cpp @@ -8,11 +8,11 @@ CursorManagerNull::CursorManagerNull( EE::Window::Window * window ) : { } -Cursor * CursorManagerNull::Create( cTexture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerNull::Create( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorNull, ( tex, hotspot, name, mWindow ) ); } -Cursor * CursorManagerNull::Create( cImage * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * CursorManagerNull::Create( Image * img, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorNull, ( img, hotspot, name, mWindow ) ); } diff --git a/src/eepp/window/backend/null/cursormanagernull.hpp b/src/eepp/window/backend/null/cursormanagernull.hpp index ae1f7b358..115cdacfd 100644 --- a/src/eepp/window/backend/null/cursormanagernull.hpp +++ b/src/eepp/window/backend/null/cursormanagernull.hpp @@ -11,9 +11,9 @@ class CursorManagerNull : public CursorManager { public: CursorManagerNull( EE::Window::Window * window ); - Cursor * Create( cTexture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * Create( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * Create( cImage * 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 ); diff --git a/src/eepp/window/backend/null/cursornull.cpp b/src/eepp/window/backend/null/cursornull.cpp index d3b7e2738..c5a613984 100644 --- a/src/eepp/window/backend/null/cursornull.cpp +++ b/src/eepp/window/backend/null/cursornull.cpp @@ -2,12 +2,12 @@ namespace EE { namespace Window { namespace Backend { namespace Null { -CursorNull::CursorNull( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorNull::CursorNull( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( tex, hotspot, name, window ) { } -CursorNull::CursorNull( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorNull::CursorNull( Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ) { } diff --git a/src/eepp/window/backend/null/cursornull.hpp b/src/eepp/window/backend/null/cursornull.hpp index f0958fea6..4ef6e347e 100644 --- a/src/eepp/window/backend/null/cursornull.hpp +++ b/src/eepp/window/backend/null/cursornull.hpp @@ -11,9 +11,9 @@ class CursorNull : public Cursor { protected: friend class CursorManagerNull; - CursorNull( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorNull( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - CursorNull( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorNull( Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); CursorNull( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); diff --git a/src/eepp/window/cursor.cpp b/src/eepp/window/cursor.cpp index f2bcd3b7a..253006c53 100644 --- a/src/eepp/window/cursor.cpp +++ b/src/eepp/window/cursor.cpp @@ -2,7 +2,7 @@ namespace EE { namespace Window { -Cursor::Cursor( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +Cursor::Cursor( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : mId( String::Hash( name ) ), mName( name ), mImage( NULL ), @@ -10,15 +10,15 @@ Cursor::Cursor( cTexture * tex, const Vector2i& hotspot, const std::string& name mWindow( window ) { if ( NULL != tex && tex->Lock() ) { - mImage = eeNew( cImage, ( tex->GetPixelsPtr(), tex->Width(), tex->Height(), tex->Channels() ) ); + mImage = eeNew( Graphics::Image, ( tex->GetPixelsPtr(), tex->Width(), tex->Height(), tex->Channels() ) ); tex->Unlock(); } else { - eePRINTL( "Cursor::Cursor: Error creating cursor from cTexture." ); + eePRINTL( "Cursor::Cursor: Error creating cursor from Texture." ); } } -Cursor::Cursor( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +Cursor::Cursor( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : mId( String::Hash( name ) ), mName( name ), mImage( NULL ), @@ -26,9 +26,9 @@ Cursor::Cursor( cImage * img, const Vector2i& hotspot, const std::string& name, mWindow( window ) { if ( img->MemSize() ) { - mImage = eeNew( cImage, ( img->GetPixelsPtr(), img->Width(), img->Height(), img->Channels() ) ); + mImage = eeNew( Graphics::Image, ( img->GetPixelsPtr(), img->Width(), img->Height(), img->Channels() ) ); } else { - eePRINTL( "Cursor::Cursor: Error creating cursor from cImage." ); + eePRINTL( "Cursor::Cursor: Error creating cursor from Image." ); } } @@ -39,7 +39,7 @@ Cursor::Cursor( const std::string& path, const Vector2i& hotspot, const std::str mHotSpot( hotspot ), mWindow( window ) { - mImage = eeNew( cImage, ( path ) ); + mImage = eeNew( Graphics::Image, ( path ) ); if ( NULL == mImage->GetPixels() ) { eePRINTL( "Cursor::Cursor: Error creating cursor from path." ); @@ -62,7 +62,7 @@ const std::string& Cursor::Name() const { return mName; } -cImage * Cursor::Image() const { +Graphics::Image * Cursor::Image() const { return mImage; } diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index 766457b06..b32be50bd 100755 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -1,13 +1,13 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -17,7 +17,7 @@ #include #include #include -#include +#include #define BACKEND_SDL 1 #define BACKEND_SDL2 2 @@ -45,29 +45,29 @@ Engine::Engine() : mSharedGLContext( false ), mMainThreadId( 0 ) { - cTextureAtlasManager::CreateSingleton(); + TextureAtlasManager::CreateSingleton(); } Engine::~Engine() { Physics::cPhysicsManager::DestroySingleton(); - Graphics::Private::cFrameBufferManager::DestroySingleton(); + Graphics::Private::FrameBufferManager::DestroySingleton(); - Graphics::Private::cVertexBufferManager::DestroySingleton(); + Graphics::Private::VertexBufferManager::DestroySingleton(); - cGlobalBatchRenderer::DestroySingleton(); + GlobalBatchRenderer::DestroySingleton(); - cTextureFactory::DestroySingleton(); + TextureFactory::DestroySingleton(); - cTextureAtlasManager::DestroySingleton(); + TextureAtlasManager::DestroySingleton(); - cFontManager::DestroySingleton(); + FontManager::DestroySingleton(); UI::cUIManager::DestroySingleton(); Graphics::cGL::DestroySingleton(); - cShaderProgramManager::DestroySingleton(); + ShaderProgramManager::DestroySingleton(); PackManager::DestroySingleton(); diff --git a/src/eepp/window/platform/null/nullimpl.cpp b/src/eepp/window/platform/null/nullimpl.cpp index 9a73f4fbe..698fe47e2 100644 --- a/src/eepp/window/platform/null/nullimpl.cpp +++ b/src/eepp/window/platform/null/nullimpl.cpp @@ -45,11 +45,11 @@ void cNullImpl::ShowMouseCursor() { void cNullImpl::HideMouseCursor() { } -Cursor * cNullImpl::CreateMouseCursor( cTexture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * cNullImpl::CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return NULL; } -Cursor * cNullImpl::CreateMouseCursor( cImage * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * cNullImpl::CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { return NULL; } diff --git a/src/eepp/window/platform/null/nullimpl.hpp b/src/eepp/window/platform/null/nullimpl.hpp index a85ec9bad..f4eb60811 100644 --- a/src/eepp/window/platform/null/nullimpl.hpp +++ b/src/eepp/window/platform/null/nullimpl.hpp @@ -36,9 +36,9 @@ class cNullImpl : public PlatformImpl { void HideMouseCursor(); - Cursor * CreateMouseCursor( cTexture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( cImage * img, const Vector2i& hotspot, const std::string& name ); + Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); Cursor * CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); diff --git a/src/eepp/window/platform/osx/osximpl.cpp b/src/eepp/window/platform/osx/osximpl.cpp index 9d252cd59..3c84a3542 100644 --- a/src/eepp/window/platform/osx/osximpl.cpp +++ b/src/eepp/window/platform/osx/osximpl.cpp @@ -50,11 +50,11 @@ void cOSXImpl::ShowMouseCursor() { void cOSXImpl::HideMouseCursor() { } -Cursor * cOSXImpl::CreateMouseCursor( cTexture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * cOSXImpl::CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return NULL; } -Cursor * cOSXImpl::CreateMouseCursor( cImage * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * cOSXImpl::CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { return NULL; } diff --git a/src/eepp/window/platform/osx/osximpl.hpp b/src/eepp/window/platform/osx/osximpl.hpp index 2129454e0..92fa9aa18 100644 --- a/src/eepp/window/platform/osx/osximpl.hpp +++ b/src/eepp/window/platform/osx/osximpl.hpp @@ -39,9 +39,9 @@ class cOSXImpl : public PlatformImpl { void HideMouseCursor(); - Cursor * CreateMouseCursor( cTexture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( cImage * img, const Vector2i& hotspot, const std::string& name ); + Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); Cursor * CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); diff --git a/src/eepp/window/platform/win/cursorwin.cpp b/src/eepp/window/platform/win/cursorwin.cpp index e22022672..1803ff412 100644 --- a/src/eepp/window/platform/win/cursorwin.cpp +++ b/src/eepp/window/platform/win/cursorwin.cpp @@ -14,13 +14,13 @@ namespace EE { namespace Window { namespace Platform { -CursorWin::CursorWin( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorWin::CursorWin( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( tex, hotspot, name, window ) { Create(); } -CursorWin::CursorWin( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorWin::CursorWin( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ) { Create(); @@ -37,7 +37,7 @@ CursorWin::~CursorWin() { DestroyIcon( (HCURSOR)mCursor ); } -static BITMAPINFO *get_bitmap_info( cImage * bitmap ) { +static BITMAPINFO *get_bitmap_info( Image * bitmap ) { BITMAPINFO *bi; int i; @@ -63,7 +63,7 @@ static BITMAPINFO *get_bitmap_info( cImage * bitmap ) { return bi; } -static BYTE *get_dib_from_bitmap_32(cImage *bitmap) { +static BYTE *get_dib_from_bitmap_32(Image *bitmap) { int w, h; int x, y; int pitch; @@ -97,7 +97,7 @@ static BYTE *get_dib_from_bitmap_32(cImage *bitmap) { return pixels; } -static void local_stretch_blit_to_hdc( cImage *bitmap, HDC dc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h) { +static void local_stretch_blit_to_hdc( Image *bitmap, HDC dc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h) { const int bitmap_h = (const int)bitmap->Height(); const int bottom_up_src_y = bitmap_h - src_y - src_h; BYTE *pixels; @@ -122,7 +122,7 @@ static void local_stretch_blit_to_hdc( cImage *bitmap, HDC dc, int src_x, int sr eeFree(bi); } -static void local_draw_to_hdc( HDC dc, cImage * bitmap, int x, int y ) { +static void local_draw_to_hdc( HDC dc, Image * bitmap, int x, int y ) { int w = bitmap->Width(); int h = bitmap->Height(); local_stretch_blit_to_hdc(bitmap, dc, 0, 0, w, h, x, y, w, h); diff --git a/src/eepp/window/platform/win/cursorwin.hpp b/src/eepp/window/platform/win/cursorwin.hpp index 3accaaea6..daab08127 100644 --- a/src/eepp/window/platform/win/cursorwin.hpp +++ b/src/eepp/window/platform/win/cursorwin.hpp @@ -12,16 +12,16 @@ namespace EE { namespace Window { namespace Platform { class cWinImpl; class CursorWin : public Cursor { - public: + public: void * GetCursor() const; protected: friend class cWinImpl; void * mCursor; - CursorWin( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorWin( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - CursorWin( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorWin( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); CursorWin( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); diff --git a/src/eepp/window/platform/win/winimpl.cpp b/src/eepp/window/platform/win/winimpl.cpp index dda6c9d75..75d505277 100644 --- a/src/eepp/window/platform/win/winimpl.cpp +++ b/src/eepp/window/platform/win/winimpl.cpp @@ -111,11 +111,11 @@ void cWinImpl::HideMouseCursor() { PostMessage( mHandler, WM_SETCURSOR, 0, 0 ); } -Cursor * cWinImpl::CreateMouseCursor( cTexture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * cWinImpl::CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorWin, ( tex, hotspot, name, mWindow ) ); } -Cursor * cWinImpl::CreateMouseCursor( cImage * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * cWinImpl::CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorWin, ( img, hotspot, name, mWindow ) ); } diff --git a/src/eepp/window/platform/win/winimpl.hpp b/src/eepp/window/platform/win/winimpl.hpp index beafdacd0..158027818 100644 --- a/src/eepp/window/platform/win/winimpl.hpp +++ b/src/eepp/window/platform/win/winimpl.hpp @@ -39,9 +39,9 @@ class cWinImpl : public PlatformImpl { void HideMouseCursor(); - Cursor * CreateMouseCursor( cTexture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( cImage * img, const Vector2i& hotspot, const std::string& name ); + Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); Cursor * CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); diff --git a/src/eepp/window/platform/x11/cursorx11.cpp b/src/eepp/window/platform/x11/cursorx11.cpp index ccccaf9ee..4fa3fdc2c 100644 --- a/src/eepp/window/platform/x11/cursorx11.cpp +++ b/src/eepp/window/platform/x11/cursorx11.cpp @@ -15,14 +15,14 @@ namespace EE { namespace Window { namespace Platform { -CursorX11::CursorX11( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorX11::CursorX11( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( tex, hotspot, name, window ), mCursor( None ) { Create(); } -CursorX11::CursorX11( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : +CursorX11::CursorX11( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ) : Cursor( img, hotspot, name, window ), mCursor( None ) { diff --git a/src/eepp/window/platform/x11/cursorx11.hpp b/src/eepp/window/platform/x11/cursorx11.hpp index a6ff8a9b6..48d94ff7a 100644 --- a/src/eepp/window/platform/x11/cursorx11.hpp +++ b/src/eepp/window/platform/x11/cursorx11.hpp @@ -19,9 +19,9 @@ class CursorX11 : public Cursor { X11Cursor mCursor; - CursorX11( cTexture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorX11( Texture * tex, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); - CursorX11( cImage * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); + CursorX11( Graphics::Image * img, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); CursorX11( const std::string& path, const Vector2i& hotspot, const std::string& name, EE::Window::Window * window ); diff --git a/src/eepp/window/platform/x11/x11impl.cpp b/src/eepp/window/platform/x11/x11impl.cpp index 2428e9582..0ae42ba13 100644 --- a/src/eepp/window/platform/x11/x11impl.cpp +++ b/src/eepp/window/platform/x11/x11impl.cpp @@ -227,11 +227,11 @@ void cX11Impl::HideMouseCursor() { Unlock(); } -Cursor * cX11Impl::CreateMouseCursor( cTexture * tex, const Vector2i& hotspot, const std::string& name ) { +Cursor * cX11Impl::CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorX11, ( tex, hotspot, name, mWindow ) ); } -Cursor * cX11Impl::CreateMouseCursor( cImage * img, const Vector2i& hotspot, const std::string& name ) { +Cursor * cX11Impl::CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ) { return eeNew( CursorX11, ( img, hotspot, name, mWindow ) ); } diff --git a/src/eepp/window/platform/x11/x11impl.hpp b/src/eepp/window/platform/x11/x11impl.hpp index c59a7dba3..413711316 100644 --- a/src/eepp/window/platform/x11/x11impl.hpp +++ b/src/eepp/window/platform/x11/x11impl.hpp @@ -42,9 +42,9 @@ class cX11Impl : public PlatformImpl { void HideMouseCursor(); - Cursor * CreateMouseCursor( cTexture * tex, const Vector2i& hotspot, const std::string& name ); + Cursor * CreateMouseCursor( Texture * tex, const Vector2i& hotspot, const std::string& name ); - Cursor * CreateMouseCursor( cImage * img, const Vector2i& hotspot, const std::string& name ); + Cursor * CreateMouseCursor( Image * img, const Vector2i& hotspot, const std::string& name ); Cursor * CreateMouseCursor( const std::string& path, const Vector2i& hotspot, const std::string& name ); diff --git a/src/eepp/window/window.cpp b/src/eepp/window/window.cpp index 8433e8602..d1d7de06e 100644 --- a/src/eepp/window/window.cpp +++ b/src/eepp/window/window.cpp @@ -6,9 +6,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -179,7 +179,7 @@ const RGB& Window::BackColor() const { } bool Window::TakeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) { - cGlobalBatchRenderer::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 = "." + cImage::SaveTypeToExtension( Format ); + Ext = "." + Image::SaveTypeToExtension( Format ); while ( !find && FileNum < 10000 ) { TmpPath = String::StrFormated( "%s%05d%s", filepath.c_str(), FileNum, Ext.c_str() ); @@ -307,7 +307,7 @@ void Window::Clear() { } void Window::Display( bool clear ) { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); if ( mCurrentView->NeedUpdate() ) SetView( *mCurrentView ); @@ -327,23 +327,23 @@ void Window::Display( bool clear ) { } void Window::ClipEnable( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height ) { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->Scissor( x, GetHeight() - ( y + Height ), Width, Height ); GLi->Enable( GL_SCISSOR_TEST ); } void Window::ClipDisable() { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->Disable( GL_SCISSOR_TEST ); } void Window::ClipPlaneEnable( const Int32& x, const Int32& y, const Int32& Width, const Int32& Height ) { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->Clip2DPlaneEnable( x, y, Width, Height ); } void Window::ClipPlaneDisable() { - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); GLi->Clip2DPlaneDisable(); } diff --git a/src/examples/empty_window/empty_window.cpp b/src/examples/empty_window/empty_window.cpp index 2256f9150..6e3d9e890 100644 --- a/src/examples/empty_window/empty_window.cpp +++ b/src/examples/empty_window/empty_window.cpp @@ -8,7 +8,7 @@ void MainLoop() win->Clear(); // Create an instance of the primitive renderer - cPrimitives p; + Primitives p; // Change the color p.SetColor( ColorA( 0, 255, 0, 150 ) ); diff --git a/src/examples/external_shader/external_shader.cpp b/src/examples/external_shader/external_shader.cpp index 0169385f7..fe0caf8c3 100644 --- a/src/examples/external_shader/external_shader.cpp +++ b/src/examples/external_shader/external_shader.cpp @@ -12,7 +12,7 @@ Uint32 ParticlesNum = 30000; EE::Window::Window * win = NULL; Input * imp = NULL; -cShaderProgram * ShaderProgram = NULL; +ShaderProgram * shaderProgram = NULL; bool ShadersSupported = false; Float tw; Float th; @@ -66,24 +66,24 @@ void videoResize( EE::Window::Window * w ) { BlendMode::SetMode( ALPHA_BLENDONE ); /// Set the line width - cGlobalBatchRenderer::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 ); + 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 ); - ShaderProgram->SetUniformMatrix( "dgl_ModelViewMatrix", modelMatrix ); + shaderProgram->SetUniformMatrix( "dgl_ModelViewMatrix", modelMatrix ); } } } @@ -217,7 +217,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) /// 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 - cShader::Ensure( false ); + Shader::Ensure( false ); std::string fs( "#ifdef GL_ES\n\ precision highp float;\n\ @@ -245,7 +245,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) } /// Create the new shader program - ShaderProgram = cShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); + shaderProgram = ShaderProgram::New( vs.c_str(), vs.size(), fs.c_str(), fs.size() ); } /// Set the projection diff --git a/src/examples/fonts/fonts.cpp b/src/examples/fonts/fonts.cpp index 8841d6466..a947ed989 100644 --- a/src/examples/fonts/fonts.cpp +++ b/src/examples/fonts/fonts.cpp @@ -1,12 +1,12 @@ #include EE::Window::Window * win = NULL; -cTTFFont * TTF = NULL; -cTTFFont * TTFO = NULL; -cTTFFont * TTF2 = NULL; -cTextureFont * TexF = NULL; -cTextureFont * TexF2 = NULL; -cTextCache * TxtCache = NULL; +TTFFont * TTF = NULL; +TTFFont * TTFO = NULL; +TTFFont * TTF2 = NULL; +TextureFont * TexF = NULL; +TextureFont * TexF2 = NULL; +TextCache * TxtCache = NULL; void MainLoop() { @@ -59,33 +59,33 @@ EE_MAIN_FUNC int main (int argc, char * argv []) std::string AppPath = Sys::GetProcessPath(); // Create a new True Type Font - TTF = cTTFFont::New( "DejaVuSansMonoOutline" ); - TTFO = cTTFFont::New( "DejaVuSansMonoOutlineFreetype" ); - TTF2 = cTTFFont::New( "DejaVuSansMono" ); - TexF = cTextureFont::New( "ProggySquareSZ" ); - TexF2 = cTextureFont::New( "conchars" ); + TTF = TTFFont::New( "DejaVuSansMonoOutline" ); + TTFO = TTFFont::New( "DejaVuSansMonoOutlineFreetype" ); + TTF2 = TTFFont::New( "DejaVuSansMono" ); + TexF = TextureFont::New( "ProggySquareSZ" ); + 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 ); // Change the default method to use for outlining the font glyphs - cTTFFont::OutlineMethod = cTTFFont::OutlineFreetype; + 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 ); 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 cTextureFont + // 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" ); // Load the texture font, previusly generated from a True Type Font // First load the texture - Uint32 TexFid = cTextureFactory::instance()->Load( AppPath + "assets/fonts/ProggySquareSZ.png" ); + 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 ) - cTextureLoader TexLoader( AppPath + "assets/fonts/conchars.png" ); + TextureLoader TexLoader( AppPath + "assets/fonts/conchars.png" ); TexLoader.SetColorKey( RGB(0,0,0) ); TexLoader.Load();; TexF2->Load( TexLoader.Id(), 32 ); @@ -109,7 +109,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Create a new text cache to draw on screen // The cached text will - TxtCache = eeNew( cTextCache, ( TTF2, Txt, ColorA(0,0,0,255) ) ); + TxtCache = eeNew( TextCache, ( TTF2, Txt, ColorA(0,0,0,255) ) ); // Set the text cache to be centered TxtCache->Flags( FONT_DRAW_CENTER ); diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index 4543b349c..f016b1a96 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -8,18 +8,18 @@ Interpolation RockAngle; Interpolation PlanetAngle; // Create a primitive drawer instance to draw the AABB of the Rock -cPrimitives P; -cSprite * Rock = NULL; -cSprite * Planet = NULL; -cSprite * Blindy = NULL; +Primitives P; +Sprite * Rock = NULL; +Sprite * Planet = NULL; +Sprite * Blindy = NULL; // Define a user sprite event -static const Uint32 USER_SPRITE_EVENT = cSprite::SPRITE_EVENT_USER + 1; +static const Uint32 USER_SPRITE_EVENT = Sprite::SPRITE_EVENT_USER + 1; // Get the sprite event callback -void spriteCallback( Uint32 Event, cSprite * Sprite, void * UserData ) { +void spriteCallback( Uint32 Event, Sprite * Sprite, void * UserData ) { // Sprite Animation entered the first frame? - if ( Event == cSprite::SPRITE_EVENT_FIRST_FRAME ) { + if ( Event == Sprite::SPRITE_EVENT_FIRST_FRAME ) { // Fire a user Event Sprite->FireEvent( USER_SPRITE_EVENT ); } else if ( Event == USER_SPRITE_EVENT ) { @@ -99,14 +99,14 @@ EE_MAIN_FUNC int main (int argc, char * argv []) std::string AppPath = Sys::GetProcessPath(); // Load the rock texture - Uint32 PlanetId = cTextureFactory::instance()->Load( AppPath + "assets/sprites/7.png" ); - Uint32 RockId = cTextureFactory::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 - cTextureAtlasLoader Blindies( AppPath + "assets/atlases/bnb.eta" ); + TextureAtlasLoader Blindies( AppPath + "assets/atlases/bnb.eta" ); // Create the animated rock spriteR - Rock = eeNew( cSprite, () ); + Rock = eeNew( Sprite, () ); // Load the rock frames from the texture, adding the frames manually for ( Int32 my = 0; my < 4; my++ ) { @@ -117,14 +117,14 @@ EE_MAIN_FUNC int main (int argc, char * argv []) } // Create a static sprite - Planet = eeNew( cSprite, ( PlanetId ) ); + Planet = eeNew( Sprite, ( PlanetId ) ); // This constructor is the same that creating sprite and calling Sprite.AddFramesByPattern. // It will look for a SubTexture ( in any Texture Atlas loaded, or the GlobalTextureAtlas ) animation by its name, it will search // for "gn00" to "gnXX" to create a new animation - // see cTextureAtlasManager::GetSubTexturesByPattern for more information. + // see TextureAtlasManager::GetSubTexturesByPattern for more information. // This is the easiest way to load animated sprites. - Blindy = eeNew( cSprite, ( "gn" ) ); + Blindy = eeNew( Sprite, ( "gn" ) ); // Set the sprite animation speed, set in Frames per Second // Sprites are auto-animated by default. diff --git a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp index dba4723fe..d0cc6741c 100644 --- a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +++ b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp @@ -1,15 +1,15 @@ #include EE::Window::Window * win = NULL; -cVertexBuffer * VBO = NULL; -cVertexBuffer * VBO2 = NULL; -cFrameBuffer * FBO = NULL; +VertexBuffer * VBO = NULL; +VertexBuffer * VBO2 = NULL; +FrameBuffer * FBO = NULL; // The batch renderer class is designed to take control of almost all the rendering needed by the engine. // Controls that the rendering is only done when is needed, preventing redundant OpenGL API calls // Usually the user will not need to use this class manually, since eepp controls this internally. -// The engine uses the singleton class cGlobalBatchRenderer instance to render textures and primitives. -cBatchRenderer * Batch = eeNew( cBatchRenderer, () ); +// The engine uses the singleton class GlobalBatchRenderer instance to render textures and primitives. +BatchRenderer * Batch = eeNew( BatchRenderer, () ); Float ang = 0, scale = 1; bool side = false; @@ -124,8 +124,8 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Create the Vertex Buffer, the vertex buffer stores the vertex data in the GPU, making the rendering much faster // In the case that Vertex Buffer Object is not supported by the GPU, it will fallback to a inmediate-mode vertex buffer - VBO = cVertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); - VBO2 = cVertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); + VBO = VertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); + VBO2 = VertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); // Add the vertex and vertex colors to the Vertex Buffer if ( NULL != VBO && NULL != VBO2 ) { @@ -147,7 +147,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) } // Create a new frame buffer. It will use Framebuffer Objects if available, otherwise it will try to fallback to PBuffers. - FBO = cFrameBuffer::New( 200, 200 ); + FBO = FrameBuffer::New( 200, 200 ); // Application loop win->RunMainLoop( &MainLoop ); diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index c1b90dc62..249790c51 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -63,7 +63,7 @@ void cEETest::Init() { mWindow->Caption( "eepp - Test Application" ); mWindow->PushResizeCallback( cb::Make1( this, &cEETest::OnWindowResize ) ); - TF = cTextureFactory::instance(); + TF = TextureFactory::instance(); TF->Allocate(40); Log = Log::instance(); @@ -114,14 +114,14 @@ void cEETest::Init() { Batch.AllocVertexs( 2048 ); Batch.SetBlendMode( ALPHA_BLENDONE ); - mFBO = cFrameBuffer::New( 256, 256, false ); + mFBO = FrameBuffer::New( 256, 256, false ); if ( NULL != mFBO ) mFBO->ClearColor( ColorAf( 0, 0, 0, 0.5f ) ); Polygon2f Poly = Polygon2f::CreateRoundedRectangle( 0, 0, 256, 50 ); - mVBO = cVertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); + mVBO = VertexBuffer::New( VERTEX_FLAGS_PRIMITIVE, DM_TRIANGLE_FAN ); if ( NULL != mVBO ) { for ( Uint32 i = 0; i < Poly.Size(); i++ ) { @@ -154,12 +154,12 @@ void cEETest::CreateUIThemeTextureAtlas() { std::string Path( MyPath + "ui/uitheme" ); if ( !FileSystem::FileExists( tgpath + EE_TEXTURE_ATLAS_EXTENSION ) ) { - cTexturePacker tp( 256, 256, true, 2 ); + TexturePacker tp( 256, 256, true, 2 ); tp.AddTexturesPath( Path ); tp.PackTextures(); tp.Save( tgpath + ".png", SAVE_TYPE_PNG ); } else { - cTextureAtlasLoader tgl; + TextureAtlasLoader tgl; tgl.UpdateTextureAtlas( tgpath + EE_TEXTURE_ATLAS_EXTENSION, Path ); } } @@ -167,22 +167,22 @@ void cEETest::CreateUIThemeTextureAtlas() { void cEETest::LoadFonts() { mFTE.Restart(); - cTextureLoader * tl = eeNew( cTextureLoader, ( MyPath + "fonts/conchars.png" ) ); + TextureLoader * tl = eeNew( TextureLoader, ( MyPath + "fonts/conchars.png" ) ); tl->SetColorKey( RGB(0,0,0) ); - mFontLoader.Add( eeNew( cTextureFontLoader, ( "conchars", tl, (unsigned int)32 ) ) ); - mFontLoader.Add( eeNew( cTextureFontLoader, ( "ProggySquareSZ", eeNew( cTextureLoader, ( MyPath + "fonts/ProggySquareSZ.png" ) ), MyPath + "fonts/ProggySquareSZ.dat" ) ) ); - mFontLoader.Add( eeNew( cTTFFontLoader, ( "arial", MyPath + "fonts/arial.ttf", 12, TTF_STYLE_NORMAL, 256, RGB(255,255,255) ) ) ); - mFontLoader.Add( eeNew( cTTFFontLoader, ( "arialb", MyPath + "fonts/arial.ttf", 12, TTF_STYLE_NORMAL, 256, RGB(255,255,255), 1, RGB(0,0,0), true ) ) ); + mFontLoader.Add( eeNew( TextureFontLoader, ( "conchars", tl, (unsigned int)32 ) ) ); + mFontLoader.Add( eeNew( TextureFontLoader, ( "ProggySquareSZ", eeNew( TextureLoader, ( MyPath + "fonts/ProggySquareSZ.png" ) ), MyPath + "fonts/ProggySquareSZ.dat" ) ) ); + mFontLoader.Add( eeNew( TTFFontLoader, ( "arial", MyPath + "fonts/arial.ttf", 12, TTF_STYLE_NORMAL, 256, RGB(255,255,255) ) ) ); + mFontLoader.Add( eeNew( TTFFontLoader, ( "arialb", MyPath + "fonts/arial.ttf", 12, TTF_STYLE_NORMAL, 256, RGB(255,255,255), 1, RGB(0,0,0), true ) ) ); mFontLoader.Load( cb::Make1( this, &cEETest::OnFontLoaded ) ); } void cEETest::OnFontLoaded( ResourceLoader * ObjLoaded ) { - FF = cFontManager::instance()->GetByName( "conchars" ); - FF2 = cFontManager::instance()->GetByName( "ProggySquareSZ" ); - TTF = cFontManager::instance()->GetByName( "arial" ); - TTFB = cFontManager::instance()->GetByName( "arialb" ); + FF = FontManager::instance()->GetByName( "conchars" ); + FF2 = FontManager::instance()->GetByName( "ProggySquareSZ" ); + TTF = FontManager::instance()->GetByName( "arial" ); + TTFB = FontManager::instance()->GetByName( "arialb" ); eePRINTL( "Fonts loading time: %4.3f ms.", mFTE.Elapsed().AsMilliseconds() ); @@ -211,7 +211,7 @@ void cEETest::CreateShaders() { if ( mUseShaders ) { mBlurFactor = 0.01f; - mShaderProgram = cShaderProgram::New( MyPath + "shaders/blur.vert", MyPath + "shaders/blur.frag" ); + mShaderProgram = ShaderProgram::New( MyPath + "shaders/blur.vert", MyPath + "shaders/blur.frag" ); } } @@ -258,9 +258,9 @@ void cEETest::CreateUI() { //mTheme = cUITheme::LoadFromPath( eeNew( cUIDefaultTheme, ( "uitheme", "uitheme" ) ), MyPath + "uitheme/" ); - cTextureAtlasLoader tgl( MyPath + "ui/uitheme" + EE_TEXTURE_ATLAS_EXTENSION ); + TextureAtlasLoader tgl( MyPath + "ui/uitheme" + EE_TEXTURE_ATLAS_EXTENSION ); - mTheme = cUITheme::LoadFromTextureAtlas( eeNew( cUIDefaultTheme, ( "uitheme", "uitheme" ) ), cTextureAtlasManager::instance()->GetByName( "uitheme" ) ); + mTheme = cUITheme::LoadFromTextureAtlas( eeNew( cUIDefaultTheme, ( "uitheme", "uitheme" ) ), TextureAtlasManager::instance()->GetByName( "uitheme" ) ); cUIThemeManager::instance()->Add( mTheme ); cUIThemeManager::instance()->DefaultEffectsEnabled( true ); @@ -303,7 +303,7 @@ void cEETest::CreateUI() { Child2->StartRotation( 0.f, 360.f, Milliseconds( 5000.f ) ); Child2->RotationInterpolation()->Loop( true ); - mTheme->CreateSprite( eeNew( cSprite, ( "gn" ) ), C, Sizei(), Vector2i( 160, 100 ) ); + mTheme->CreateSprite( eeNew( Sprite, ( "gn" ) ), C, Sizei(), Vector2i( 160, 100 ) ); cUITextBox::CreateParams TextParams; TextParams.Parent( C ); @@ -576,7 +576,7 @@ void cEETest::OnMapEditorClose() { void cEETest::CreateETGEditor() { cUIWindow * tWin = mTheme->CreateWindow( NULL, Sizei( 1024, 768 ), Vector2i(), UI_CONTROL_DEFAULT_FLAGS_CENTERED, UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_DRAGABLE_CONTAINER, Sizei( 1024, 768 ) ); - mETGEditor = eeNew ( Tools::cTextureAtlasEditor, ( tWin, cb::Make0( this, &cEETest::OnETGEditorClose ) ) ); + mETGEditor = eeNew ( Tools::TextureAtlasEditor, ( tWin, cb::Make0( this, &cEETest::OnETGEditorClose ) ) ); tWin->Center(); tWin->Show(); } @@ -813,7 +813,7 @@ void cEETest::LoadTextures() { std::string name( files[i] ); if ( "jpg" == FileSystem::FileExtension( name ) ) { - mResLoad.Add( eeNew( cTextureLoader, ( PakTest, name ) ) ); + mResLoad.Add( eeNew( TextureLoader, ( PakTest, name ) ) ); } } #endif @@ -832,8 +832,8 @@ void cEETest::LoadTextures() { Tiles.resize(10); - cTextureAtlasLoader tgl( MyPath + "atlases/tiles.eta" ); - cTextureAtlas * SG = cTextureAtlasManager::instance()->GetByName( "tiles" ); + TextureAtlasLoader tgl( MyPath + "atlases/tiles.eta" ); + TextureAtlas * SG = TextureAtlasManager::instance()->GetByName( "tiles" ); if ( NULL != SG ) { for ( i = 0; i < 6; i++ ) { @@ -843,7 +843,7 @@ void cEETest::LoadTextures() { Tiles[6] = SG->Add( TF->Load( MyPath + "sprites/objects/1.png" ), "7" ); #ifdef EE_GLES - cImage tImg( MyPath + "sprites/objects/2.png", 4 ); + Image tImg( MyPath + "sprites/objects/2.png", 4 ); tImg.CreateMaskFromColor( ColorA(0,0,0,255), 0 ); Tiles[7] = SG->Add( TF->LoadFromPixels( tImg.GetPixelsPtr(), tImg.Width(), tImg.Height(), tImg.Channels() ), "8" ); #else @@ -867,7 +867,7 @@ void cEETest::LoadTextures() { Con.AddCommand( "setparticlesnum", cb::Make1( this, &cEETest::CmdSetPartsNum ) ); - cTexture * Tex = TNP[2]; + Texture * Tex = TNP[2]; if ( NULL != Tex && Tex->Lock() ) { w = (int)Tex->Width(); @@ -904,13 +904,13 @@ void cEETest::LoadTextures() { CL2.AddFrame(TN[0], Sizef(96, 96) ); CL2.Color( ColorA( 255, 255, 255, 255 ) ); - mTGL = eeNew( cTextureAtlasLoader, ( MyPath + "atlases/bnb" + EE_TEXTURE_ATLAS_EXTENSION ) ); + mTGL = eeNew( TextureAtlasLoader, ( MyPath + "atlases/bnb" + EE_TEXTURE_ATLAS_EXTENSION ) ); mBlindy.AddFramesByPattern( "rn" ); mBlindy.Position( 320.f, 0.f ); - mBoxSprite = eeNew( cSprite, ( cGlobalTextureAtlas::instance()->Add( eeNew( cSubTexture, ( TN[3], "ilmare" ) ) ) ) ); - mCircleSprite = eeNew( cSprite, ( cGlobalTextureAtlas::instance()->Add( eeNew( cSubTexture, ( TN[1], "thecircle" ) ) ) ) ); + mBoxSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->Add( eeNew( SubTexture, ( TN[3], "ilmare" ) ) ) ) ); + mCircleSprite = eeNew( Sprite, ( GlobalTextureAtlas::instance()->Add( eeNew( SubTexture, ( TN[1], "thecircle" ) ) ) ) ); eePRINTL( "Textures loading time: %4.3f ms.", TE.Elapsed().AsMilliseconds() ); @@ -950,7 +950,7 @@ void cEETest::Screen1() { void cEETest::Screen2() { if ( mResLoad.IsLoaded() ) { - cTexture * TexLoaded = TF->GetByName( "1.jpg" ); + Texture * TexLoaded = TF->GetByName( "1.jpg" ); if ( NULL != TexLoaded ) TexLoaded->Draw( 0, 0 ); @@ -1158,7 +1158,7 @@ void cEETest::Screen4() { 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 ); - cGlobalBatchRenderer::instance()->Draw(); + GlobalBatchRenderer::instance()->Draw(); } } } @@ -1277,7 +1277,7 @@ void cEETest::Input() { Mousef = Vector2f( (Float)Mouse.x, (Float)Mouse.y ); if ( KM->IsKeyUp( KEY_F1 ) ) - Graphics::cShaderProgramManager::instance()->Reload(); + Graphics::ShaderProgramManager::instance()->Reload(); if ( !mWindow->Visible() ) { mWasMinimized = true; @@ -1518,7 +1518,7 @@ void cEETest::Process() { End(); } -void cEETest::ParticlesCallback( cParticle * P, cParticleSystem * Me ) { +void cEETest::ParticlesCallback( Particle * P, ParticleSystem * Me ) { Float x, y, radio; Vector2f MePos( Me->Position() ); diff --git a/src/test/eetest.hpp b/src/test/eetest.hpp index c59230a88..b54d35a75 100644 --- a/src/test/eetest.hpp +++ b/src/test/eetest.hpp @@ -77,7 +77,7 @@ class cEETest : private Thread { void Process(); void Render(); void Input(); - void ParticlesCallback(cParticle* P, cParticleSystem* Me); + void ParticlesCallback(Particle* P, ParticleSystem* Me); void ParticlesThread(); void Particles(); @@ -90,7 +90,7 @@ class cEETest : private Thread { private: Engine * EE; EE::Window::Window * mWindow; - cTextureFactory* TF; + TextureFactory* TF; System::Log* Log; Window::Input* KM; InputTextBuffer InBuf; @@ -102,22 +102,22 @@ class cEETest : private Thread { Uint32 lasttick; std::vector TN; - std::vector TNP; + std::vector TNP; - std::vector Tiles; - std::vector PS; + std::vector Tiles; + std::vector PS; Vector2i Mouse; Vector2f Mousef; - cSprite SP; - cSprite CL1, CL2; - cFont * FF; - cFont * FF2; - cFont * TTF; - cFont * TTFB; + Sprite SP; + Sprite CL1, CL2; + Font * FF; + Font * FF2; + Font * TTF; + Font * TTFB; - cPrimitives PR; + Primitives PR; bool iL1, iL2; Float HWidth, HHeight; @@ -126,7 +126,7 @@ class cEETest : private Thread { bool DrawBack; - cConsole Con; + Console Con; virtual void Run(); Vector2f Point; @@ -152,18 +152,18 @@ class cEETest : private Thread { Waypoints WP; Int32 PartsNum; Uint32 Cursor[1]; - cTexture * CursorP[1]; + Texture * CursorP[1]; std::string mInfo; bool MultiViewportMode; - cBatchRenderer Batch; + BatchRenderer Batch; Float AnimVal; bool AnimSide; View Views[2]; - cShaderProgram * mShaderProgram; + ShaderProgram * mShaderProgram; Float mBlurFactor; bool mUseShaders; @@ -190,11 +190,11 @@ class cEETest : private Thread { Float mAxisX; Float mAxisY; - cTextureAtlasLoader * mTGL; - cSprite mBlindy; + TextureAtlasLoader * mTGL; + Sprite mBlindy; - cFrameBuffer * mFBO; - cVertexBuffer * mVBO; + FrameBuffer * mFBO; + VertexBuffer * mVBO; Clock mFTE; @@ -220,11 +220,11 @@ class cEETest : private Thread { cUIPopUpMenu * Menu; cUIWindow * mUIWindow; cMapEditor * mMapEditor; - cTextureAtlasEditor * mETGEditor; + TextureAtlasEditor * mETGEditor; - cTextCache mEEText; - cTextCache mFBOText; - cTextCache mInfoText; + TextCache mEEText; + TextCache mFBOText; + TextCache mInfoText; cSpace * mSpace; @@ -273,8 +273,8 @@ class cEETest : private Thread { std::vector mDemo; Uint32 mCurDemo; - cSprite * mBoxSprite; - cSprite * mCircleSprite; + Sprite * mBoxSprite; + Sprite * mCircleSprite; cUITheme * mTheme;