diff --git a/include/eepp/window/engine.hpp b/include/eepp/window/engine.hpp index 5eb88f062..e8a363ae4 100755 --- a/include/eepp/window/engine.hpp +++ b/include/eepp/window/engine.hpp @@ -40,7 +40,7 @@ class EE_API Engine { bool isRunning() const; /** @return The current window elapsed time. */ - Time elapsed() const; + Time getElapsed() const; /** @return The current window width. */ const Uint32& getWidth() const; diff --git a/include/eepp/window/input.hpp b/include/eepp/window/input.hpp index 80693a56b..c5b5e55e7 100644 --- a/include/eepp/window/input.hpp +++ b/include/eepp/window/input.hpp @@ -54,49 +54,49 @@ class EE_API Input { void injectButtonRelease( const Uint32& Button ); /** @return If the Control Key is pressed */ - bool controlPressed() const; + bool isControlPressed() const; /** @return If the Shift Key is pressed */ - bool shiftPressed() const; + bool isShiftPressed() const; /** @return If the Alt Key is pressed */ - bool altPressed() const; + bool isAltPressed() const; /** @return If the Meta Key is pressed */ - bool metaPressed() const; + bool isMetaPressed() const; /** @return If mouse left button it's pressed */ - bool mouseLeftPressed() const; + bool isMouseLeftPressed() const; /** @return If mouse right button it's pressed */ - bool mouseRightPressed() const; + bool isMouseRightPressed() const; /** @return If mouse middle button it's pressed */ - bool mouseMiddlePressed() const; + bool isMouseMiddlePressed() const; /** @return If mouse left click was clicked */ - bool mouseLeftClick() const; + bool mouseLeftClicked() const; /** @return If mouse right click was clicked */ - bool mouseRightClick() const; + bool mouseRightClicked() const; /** @return If mouse middle button (scroll button) was clicked. */ - bool mouseMiddleClick() const; + bool mouseMiddleClicked() const; /** @return If mouse left click was double clicked */ - bool mouseLeftDoubleClick() const; + bool mouseLeftDoubleClicked() const; /** @return If mouse right click was double clicked */ - bool mouseRightDoubleClick() const; + bool mouseRightDoubleClicked() const; /** @return If mouse middle button (scroll button) was double clicked. */ - bool mouseMiddleDoubleClick() const; + bool mouseMiddleDoubleClicked() const; /** @return If mouse wheel up scrolled */ - bool mouseWheelUp() const; + bool mouseWheelScrolledUp() const; /** @return If mouse wheel down scrolled */ - bool mouseWheelDown() const; + bool mouseWheelScrolledDown() const; /** Push a new input callback. * @return The Callback Id @@ -118,20 +118,14 @@ class EE_API Input { /** @return The mouse position over the current view */ Vector2i getMousePosFromView( const View& View ); - /** @return The Mouse X axis position */ - Uint16 mouseX() const; - - /** @return The Mouse Y axis position */ - Uint16 mouseY() const; - /** Set the mouse speed ( only affects grabed windows ) */ - void mouseSpeed( const Float& Speed ); + void setMouseSpeed( const Float& Speed ); /** @return The Mouse Speed */ - const Float& mouseSpeed() const; + const Float& getMouseSpeed() const; /** @return The bitflags of the last pressed trigger (before the current state of press trigger) */ - const Uint32& lastPressTrigger() const; + const Uint32& getLastPressTrigger() const; /** @return The current state as flags of the mouse press trigger @brief Triggers are used mostly for the UI components. They are simple to manage. @@ -139,22 +133,22 @@ class EE_API Input { For Example The usage is simple, to know if the left mouse click is pressed you need to check against the left mouse flag mask if ( myInput->PressTrigger() & EE_BUTTON_LMASK ) ... */ - const Uint32& pressTrigger() const; + const Uint32& getPressTrigger() const; /** @return The current state as flags of the mouse release trigger */ - const Uint32& releaseTrigger() const; + const Uint32& getReleaseTrigger() const; /** @return The current state as flags of the mouse click trigger */ - const Uint32& clickTrigger() const; + const Uint32& getClickTrigger() const; /** @return The current state as flags of the mouse double click trigger */ - const Uint32& doubleClickTrigger() const; + const Uint32& getDoubleClickTrigger() const; /** @return The double click interval in milliseconds ( default 500 ms ) */ - const Uint32& doubleClickInterval() const; + const Uint32& getDoubleClickInterval() const; /** Set the double click interval in milliseconds */ - void doubleClickInterval( const Uint32& Interval ); + void setDoubleClickInterval( const Uint32& Interval ); /** Clean the keyboard and mouse states */ void cleanStates(); diff --git a/include/eepp/window/inputfinger.hpp b/include/eepp/window/inputfinger.hpp index ec81f1871..09acfa8c3 100644 --- a/include/eepp/window/inputfinger.hpp +++ b/include/eepp/window/inputfinger.hpp @@ -31,7 +31,7 @@ class InputFinger { bool wasDown(); /** @return The current position of the finger */ - Vector2i pos(); + Vector2i getPos(); protected: friend class Input; diff --git a/include/eepp/window/inputhelper.hpp b/include/eepp/window/inputhelper.hpp index 41e5acf26..0ebfd8579 100644 --- a/include/eepp/window/inputhelper.hpp +++ b/include/eepp/window/inputhelper.hpp @@ -4,11 +4,14 @@ #include namespace EE { namespace Window { - + #define EE_KEYS_NUM (336) #define EE_KEYS_SPACE (EE_KEYS_NUM/8) -Uint32 EE_API eeConvertKeyCharacter( const Uint32& KeyCode, const Uint16& Unicode, const Uint32& Modifiers ); +class InputHelper { + public: + static Uint32 EE_API convertKeyCharacter( const Uint32& KeyCode, const Uint16& Unicode, const Uint32& Modifiers ); +}; }} diff --git a/include/eepp/window/inputtextbuffer.hpp b/include/eepp/window/inputtextbuffer.hpp index 5b6419fb3..f554a7e2e 100755 --- a/include/eepp/window/inputtextbuffer.hpp +++ b/include/eepp/window/inputtextbuffer.hpp @@ -26,50 +26,50 @@ class EE_API InputTextBuffer { public: typedef cb::Callback0 EnterCallback; - InputTextBuffer( const bool& active, const bool& supportNewLine, const bool& supportFreeEditing, EE::Window::Window * window = NULL, const Uint32& maxLength = INPUT_LENGHT_MAX ); + InputTextBuffer( const bool& active, const bool& newLineEnabled, const bool& freeEditing, EE::Window::Window * window = NULL, const Uint32& maxLength = INPUT_LENGHT_MAX ); InputTextBuffer( EE::Window::Window * window = NULL ); ~InputTextBuffer(); /** @return The current buffer */ - String buffer() const; + String getBuffer() const; /** Set a new current buffer */ - void buffer( const String& str ); + void setBuffer( const String& str ); /** @return If input buffer is active */ - bool active() const; + bool isActive() const; /** Set the state of the input buffer */ - void active( const bool& active ); + void setActive( const bool& active ); /** @return If new line is supported */ - bool supportNewLine(); + bool setSupportNewLine(); /** Support new line consist of allowing to add a new line when key return is pressed. */ - void supportNewLine( const bool& supportNewLine ); + void isNewLineEnabled( const bool& enabled ); /** @return If Free Editing is enabled */ - bool supportFreeEditing() const; + bool isFreeEditingEnabled() const; /** Free editing consist on the capability of moving the cursor position over the buffer, to write over the buffer, and not only after the last character. */ - void supportFreeEditing( const bool& Support); + void setFreeEditing( const bool& enabled ); /** Block all the inserts, allow only numeric characters. */ - void allowOnlyNumbers( const bool& onlynums, const bool& allowdots = false ); + void setAllowOnlyNumbers( const bool& onlynums, const bool& allowdots = false ); /** @return If is only allowing numbers */ - bool allowOnlyNumbers(); + bool onlyNumbersAllowed(); /** @return If is only allowing numbers, it allow floating point numbers? */ - bool allowDotsInNumbers(); + bool dotsInNumbersAllowed(); /** @return If text selection feature is enabled */ - bool textSelectionEnabled(); + bool isTextSelectionEnabled(); /** Enable text selection */ - void textSelectionEnabled( const bool& enabled ); + void setTextSelectionEnabled( const bool& enabled ); /** Start the input buffer */ void start(); @@ -87,13 +87,13 @@ class EE_API InputTextBuffer { bool changedSinceLastUpdate(); /** Set if changed since last update */ - void changedSinceLastUpdate( const bool& Changed ); + void setChangedSinceLastUpdate( const bool& Changed ); /** @return The Cursor Position (where is the cursor editing) */ - int curPos() const; + int getCursorPos() const; /** Set the cursor position */ - void curPos( const Uint32& pos ); + void setCursorPos( const Uint32& pos ); /** 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 @@ -131,16 +131,16 @@ class EE_API InputTextBuffer { /** @return The selection cursor final position */ const Int32& selCurEnd() const; protected: - EE::Window::Window * mWindow; - String mText; - Uint32 mFlags; - Uint32 mCallback; - int mPromptPos; - EnterCallback mEnterCall; - Uint32 mMaxLength; + EE::Window::Window * mWindow; + String mText; + Uint32 mFlags; + Uint32 mCallback; + int mPromptPos; + EnterCallback mEnterCall; + Uint32 mMaxLength; std::vector mIgnoredChars; - Int32 mSelCurInit; - Int32 mSelCurEnd; + Int32 mSelCurInit; + Int32 mSelCurEnd; void autoPrompt( const bool& set ); diff --git a/include/eepp/window/view.hpp b/include/eepp/window/view.hpp index 6d0d06897..e0072d92c 100755 --- a/include/eepp/window/view.hpp +++ b/include/eepp/window/view.hpp @@ -29,10 +29,10 @@ class EE_API View { void scale( const Vector2f& Factor ); /** @return The center position of the view */ - Vector2i center() const; + Vector2i getCenter() const; /** Set the center position of the view ( will move it if is needed ) */ - void center( const Vector2i& center ); + void setCenter( const Vector2i& center ); /** @return The current view ( Left = X, Right = Width, Top = Y, Bottom = Height ) */ Recti getView() const { return mView; } diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index 912fe5f44..258c5c709 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -160,10 +160,13 @@ class EE_API Window { virtual void toggleFullscreen() = 0; /** Set the window caption */ - virtual void caption( const std::string& caption ) = 0; - + virtual void setCaption( const std::string& setCaption ) = 0; + + /** @return The caption of the titlebar */ + virtual std::string getCaption(); + /** Set the Window icon */ - virtual bool icon( const std::string& Path ) = 0; + virtual bool setIcon( const std::string& Path ) = 0; /** This will attempt to iconify/minimize the window. */ virtual void minimize(); @@ -184,32 +187,32 @@ class EE_API Window { virtual void show(); /** This will attemp to move the window over the desktop to the position */ - virtual void position( Int16 Left, Int16 Top ); + virtual void setPosition( Int16 Left, Int16 Top ); /** @return The Current Window Position */ - virtual Vector2i position(); + virtual Vector2i getPosition(); /** Set as current context the default context ( the context used for the window creation ) */ virtual void setDefaultContext(); /** @return If the current window is active */ - virtual bool active() = 0; + virtual bool isActive() = 0; /** @return If the current window is visible */ - virtual bool visible() = 0; + virtual bool isVisible() = 0; /** Set the size of the window for a windowed window */ - virtual void size( Uint32 Width, Uint32 Height ); - - /** @return The caption of the titlebar */ - virtual std::string caption(); + virtual void setSize( Uint32 Width, Uint32 Height ); /** Change the window size or the screen resolution * @param Width New screen width * @param Height New screen height * @param Windowed Windowed or Fullscreen */ - virtual void size( Uint32 Width, Uint32 Height, bool isWindowed ) = 0; + virtual void setSize( Uint32 Width, Uint32 Height, bool isWindowed ) = 0; + + /** @return The window size */ + virtual Sizei getSize(); /** @return The resolutions that support the video card */ virtual std::vector getDisplayModes() const = 0; @@ -237,10 +240,10 @@ class EE_API Window { virtual void display( bool clear = false ); /** @return The elapsed time for the last frame rendered */ - virtual System::Time elapsed() const; + virtual System::Time getElapsed() const; /** @return The current frames per second of the screen */ - virtual Uint32 FPS() const; + virtual Uint32 getFPS() const; /** @return If the screen is windowed */ virtual bool isWindowed() const; @@ -248,9 +251,6 @@ class EE_API Window { /** @return If the main window is resizeable */ virtual bool isResizeable() const; - /** @return The window size */ - virtual Sizei size(); - /** @return The Window Width */ virtual const Uint32& getWidth() const; @@ -261,13 +261,13 @@ class EE_API Window { virtual const Sizei& getDesktopResolution(); /** Center the window to the desktop ( if windowed ) */ - virtual void center(); + virtual void centerToScreen(); /** @return If the aplication is running returns true ( If you Init correctly the window and is running ). */ bool isRunning() const; /** @return If the window was created */ - bool created() const; + bool isOpen() const; /** Close the window if is running */ virtual void close(); @@ -293,10 +293,10 @@ class EE_API Window { void setViewport( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height, const bool& UpdateProjectionMatrix = true ); /** Set the window background color */ - void backColor( const RGB& Color ); + void setBackColor( const RGB& Color ); /** @return The background clear color */ - const RGB& backColor() const; + const RGB& getBackColor() const; /** Captures the window front buffer and saves it to disk. \n * You have to call it before Display, and after render all the objects. \n @@ -310,10 +310,10 @@ class EE_API Window { const WindowInfo * getWindowInfo() const; /** Set a frame per second limit. It's not 100 % accurate. */ - void frameRateLimit( const Uint32& frameRateLimit ); + void setFrameRateLimit( const Uint32& setFrameRateLimit ); /** Get a frame per second limit. */ - Uint32 frameRateLimit(); + Uint32 getFrameRateLimit(); /** Set the current Clipping area ( default the entire window, SCISSOR TEST ). */ void clipEnable( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height ); @@ -450,14 +450,14 @@ class EE_API Window { protected: friend class Engine; - WindowInfo mWindow; - Clipboard * mClipboard; - Input * mInput; - CursorManager * mCursorManager; - Platform::PlatformImpl * mPlatform; - View mDefaultView; - const View * mCurrentView; - Uint32 mNumCallBacks; + WindowInfo mWindow; + Clipboard * mClipboard; + Input * mInput; + CursorManager * mCursorManager; + Platform::PlatformImpl * mPlatform; + View mDefaultView; + const View * mCurrentView; + Uint32 mNumCallBacks; std::map mCallbacks; class FrameData { diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index efc2bf26d..63657d226 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,10 +1,10 @@ - + EnvironmentId - {b6114084-39c2-4cd0-b9e2-d8803dc6b446} + {d43f4693-30c1-436c-b1d1-498aab2c2f8c} ProjectExplorer.Project.ActiveTarget @@ -63,7 +63,7 @@ Desktop Desktop - {388e5431-b31b-42b3-b9ad-9002d279d75d} + {6d057187-158a-4883-8d5b-d470a6b6b025} 10 0 0 @@ -957,12 +957,12 @@ 0 Deploy - Deploy + ProjectExplorer.BuildSteps.Deploy 1 - No deployment - No deployment + Deploy locally + ProjectExplorer.DefaultDeployConfiguration 1 @@ -1698,124 +1698,9 @@ 13 - - ProjectExplorer.Project.Target.1 - - Android ARM - Android ARM - {c56c34f8-2eb8-43f6-b2b6-c1a99b989f1a} - 0 - -1 - 0 - - /home/programming/eepp/projects/linux - - - - all - - false - - - true - Make - - GenericProjectManager.GenericMakeStep - - 1 - Build - - ProjectExplorer.BuildSteps.Build - - - - - clean - - true - - - true - Make - - GenericProjectManager.GenericMakeStep - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Default - Default - GenericProjectManager.GenericBuildConfiguration - - 1 - 0 - - - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - -1 - - - - %{buildDir} - Custom Executable - - ProjectExplorer.CustomExecutableRunConfiguration - 3768 - false - true - false - false - true - - 1 - - ProjectExplorer.Project.TargetCount - 2 + 1 ProjectExplorer.Project.Updater.FileVersion diff --git a/src/eepp/gaming/mapeditor/uimap.cpp b/src/eepp/gaming/mapeditor/uimap.cpp index a813338c3..2be45f271 100644 --- a/src/eepp/gaming/mapeditor/uimap.cpp +++ b/src/eepp/gaming/mapeditor/uimap.cpp @@ -99,7 +99,7 @@ void UIMap::update() { mMap->Update(); if ( mEnabled && mVisible && isMouseOver() ) { - Uint32 Flags = UIManager::instance()->getInput()->clickTrigger(); + Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); if ( EDITING_LIGHT == mEditingMode ) { if ( NULL != mSelLight ) { @@ -134,7 +134,7 @@ void UIMap::update() { } } - Flags = UIManager::instance()->getInput()->pressTrigger(); + Flags = UIManager::instance()->getInput()->getPressTrigger(); if ( Flags & EE_BUTTON_MMASK ) { mSelLight->Position( mMap->GetMouseMapPosf() ); @@ -220,8 +220,8 @@ void UIMap::DragPoly( Uint32 Flags, Uint32 PFlags ) { } void UIMap::ManageObject( Uint32 Flags ) { - Uint32 PFlags = UIManager::instance()->getInput()->pressTrigger(); - Uint32 LPFlags = UIManager::instance()->getInput()->lastPressTrigger(); + Uint32 PFlags = UIManager::instance()->getInput()->getPressTrigger(); + Uint32 LPFlags = UIManager::instance()->getInput()->getLastPressTrigger(); switch ( mEditingObjMode ) { diff --git a/src/eepp/graphics/console.cpp b/src/eepp/graphics/console.cpp index 712d2398a..bea54f059 100755 --- a/src/eepp/graphics/console.cpp +++ b/src/eepp/graphics/console.cpp @@ -135,8 +135,8 @@ void Console::create( Font* Font, const bool& MakeDefaultCommands, const bool& A mTBuf->setReturnCallback( cb::Make0( this, &Console::processLine ) ); mTBuf->start(); - mTBuf->supportNewLine( false ); - mTBuf->active( false ); + mTBuf->isNewLineEnabled( false ); + mTBuf->setActive( false ); ignoreCharOnPrompt( KEY_TAB ); mCon.ConModif = 0; @@ -203,15 +203,15 @@ void Console::draw() { CurY = mTempY + mY + mCurHeight - mFontSize - 1; mFont->color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mA) ) ); - mFont->setText( "> " + mTBuf->buffer() ); + mFont->setText( "> " + mTBuf->getBuffer() ); mFont->draw( mFontSize, CurY ); mFont->color( ColorA ( mFontLineColor.r(), mFontLineColor.g(), mFontLineColor.b(), static_cast(mCurAlpha) ) ); - if ( (unsigned int)mTBuf->curPos() == mTBuf->buffer().size() ) { + if ( (unsigned int)mTBuf->getCursorPos() == mTBuf->getBuffer().size() ) { mFont->draw( "_", mFontSize + mFont->getTextWidth() , CurY ); } else { - mFont->setText( "> " + mTBuf->buffer().substr( 0, mTBuf->curPos() ) ); + mFont->setText( "> " + mTBuf->getBuffer().substr( 0, mTBuf->getCursorPos() ) ); mFont->draw( "_", mFontSize + mFont->getTextWidth() , CurY ); } @@ -222,7 +222,7 @@ void Console::draw() { if ( mShowFps && NULL != mFont ) { ColorA OldColor1( mFont->color() ); mFont->color( ColorA () ); - mFont->setText( "FPS: " + String::toStr( mWindow->FPS() ) ); + mFont->setText( "FPS: " + String::toStr( mWindow->getFPS() ) ); mFont->draw( mWindow->getWidth() - mFont->getTextWidth() - 15, 6 ); mFont->color( OldColor1 ); } @@ -234,7 +234,7 @@ void Console::fadeIn() { mFadeIn = true; mVisible = true; mY = 0.0f; - mTBuf->active( true ); + mTBuf->setActive( true ); } } @@ -243,7 +243,7 @@ void Console::fadeOut() { mFading = true; mFadeOut = true; mVisible = false; - mTBuf->active( false ); + mTBuf->setActive( false ); } } @@ -280,7 +280,7 @@ static std::vector< String > SplitCommandParams( String str ) { } void Console::processLine() { - String str = mTBuf->buffer(); + String str = mTBuf->getBuffer(); std::vector < String > params = SplitCommandParams( str ); mLastCommands.push_back( str ); @@ -359,13 +359,13 @@ void Console::toggle() { void Console::fade() { if (mCurSide) { - mCurAlpha -= 255.f * mWindow->elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); + mCurAlpha -= 255.f * mWindow->getElapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); if ( mCurAlpha <= 0.0f ) { mCurAlpha = 0.0f; mCurSide = !mCurSide; } } else { - mCurAlpha += 255.f * mWindow->elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); + mCurAlpha += 255.f * mWindow->getElapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); if ( mCurAlpha >= 255.f ) { mCurAlpha = 255.f; mCurSide = !mCurSide; @@ -379,7 +379,7 @@ void Console::fade() { if ( mFadeIn ) { mFadeOut = false; - mY += mCurHeight * mWindow->elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); + mY += mCurHeight * mWindow->getElapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); mA = ( mY * mMaxAlpha / mCurHeight ) ; if ( mY > mCurHeight ) { @@ -391,7 +391,7 @@ void Console::fade() { if ( mFadeOut ) { mFadeIn = false; - mY -= mCurHeight * mWindow->elapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); + mY -= mCurHeight * mWindow->getElapsed().asMilliseconds() / mFadeSpeed.asMilliseconds(); mA = ( mY * mMaxAlpha / mCurHeight ) ; if ( mY <= 0.0f ) { @@ -406,7 +406,7 @@ void Console::fade() { } String Console::getLastCommonSubStr( std::list& cmds ) { - String lastCommon( mTBuf->buffer() ); + String lastCommon( mTBuf->getBuffer() ); String strTry( lastCommon ); std::list::iterator ite; @@ -453,7 +453,7 @@ void Console::printCommandsStartingWith( const String& start ) { } if ( cmds.size() > 1 ) { - privPushText( "> " + mTBuf->buffer() ); + privPushText( "> " + mTBuf->getBuffer() ); std::list::iterator ite; @@ -462,12 +462,12 @@ void Console::printCommandsStartingWith( const String& start ) { String newStr( getLastCommonSubStr( cmds ) ); - if ( newStr != mTBuf->buffer() ) { - mTBuf->buffer( newStr ); + if ( newStr != mTBuf->getBuffer() ) { + mTBuf->setBuffer( newStr ); mTBuf->cursorToEnd(); } } else if ( cmds.size() ) { - mTBuf->buffer( cmds.front() ); + mTBuf->setBuffer( cmds.front() ); mTBuf->cursorToEnd(); } } @@ -558,13 +558,13 @@ void Console::getFilesFrom( std::string txt, const Uint32& curPos ) { slash = FileSystem::getOSlash(); } - mTBuf->buffer( mTBuf->buffer().substr( 0, pos + 1 ) + files[lasti] + slash ); + mTBuf->setBuffer( mTBuf->getBuffer().substr( 0, pos + 1 ) + files[lasti] + slash ); mTBuf->cursorToEnd(); } else if ( count > 1 ) { privPushText( "Directory file list:" ); pushText( res ); - mTBuf->buffer( mTBuf->buffer().substr( 0, pos + 1 ) + file ); + mTBuf->setBuffer( mTBuf->getBuffer().substr( 0, pos + 1 ) + file ); mTBuf->cursorToEnd(); } } @@ -584,9 +584,9 @@ void Console::privInputCallback( InputEvent * Event ) { Uint32 Button = Event->button.button; if ( InputEvent::KeyDown == etype ) { - if ( ( KeyCode == KEY_TAB ) && (unsigned int)mTBuf->curPos() == mTBuf->buffer().size() ) { - printCommandsStartingWith( mTBuf->buffer() ); - getFilesFrom( mTBuf->buffer().toUtf8(), mTBuf->curPos() ); + if ( ( KeyCode == KEY_TAB ) && (unsigned int)mTBuf->getCursorPos() == mTBuf->getBuffer().size() ) { + printCommandsStartingWith( mTBuf->getBuffer() ); + getFilesFrom( mTBuf->getBuffer().toUtf8(), mTBuf->getCursorPos() ); } if ( KeyMod & KEYMOD_SHIFT ) { @@ -634,9 +634,9 @@ void Console::privInputCallback( InputEvent * Event ) { if ( KeyCode == KEY_UP || KeyCode == KEY_DOWN ) { if ( mLastLogPos == static_cast( mLastCommands.size() ) ) { - mTBuf->buffer( "" ); + mTBuf->setBuffer( "" ); } else { - mTBuf->buffer( mLastCommands[mLastLogPos] ); + mTBuf->setBuffer( mLastCommands[mLastLogPos] ); mTBuf->cursorToEnd(); } } @@ -748,7 +748,7 @@ void Console::cmdFrameLimit ( const std::vector < String >& params ) { bool Res = String::fromString( tInt, params[1] ); if ( Res && ( tInt >= 0 && tInt <= 10000 ) ) { - mWindow->frameRateLimit( tInt ); + mWindow->setFrameRateLimit( tInt ); return; } } diff --git a/src/eepp/graphics/framebuffer.cpp b/src/eepp/graphics/framebuffer.cpp index 66c15829c..d46abecb2 100644 --- a/src/eepp/graphics/framebuffer.cpp +++ b/src/eepp/graphics/framebuffer.cpp @@ -55,7 +55,7 @@ ColorAf FrameBuffer::clearColor() const { 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() ); + mWindow->setBackColor( mWindow->getBackColor() ); } void FrameBuffer::setBufferView() { diff --git a/src/eepp/graphics/particlesystem.cpp b/src/eepp/graphics/particlesystem.cpp index 8314ccf4d..b40ad6006 100755 --- a/src/eepp/graphics/particlesystem.cpp +++ b/src/eepp/graphics/particlesystem.cpp @@ -363,7 +363,7 @@ void ParticleSystem::draw() { } void ParticleSystem::update() { - update( Engine::instance()->elapsed() ); + update( Engine::instance()->getElapsed() ); } void ParticleSystem::update( const System::Time& time ) { diff --git a/src/eepp/graphics/sprite.cpp b/src/eepp/graphics/sprite.cpp index 6dcc6b91b..7bf5c899c 100755 --- a/src/eepp/graphics/sprite.cpp +++ b/src/eepp/graphics/sprite.cpp @@ -481,7 +481,7 @@ bool Sprite::addSubFrame(const Uint32& TexId, const unsigned int& NumFrame, cons } void Sprite::update() { - update( Engine::instance()->elapsed() ); + update( Engine::instance()->getElapsed() ); } void Sprite::update( const Time& ElapsedTime ) { diff --git a/src/eepp/physics/space.cpp b/src/eepp/physics/space.cpp index 4b44ab973..6ff16e159 100644 --- a/src/eepp/physics/space.cpp +++ b/src/eepp/physics/space.cpp @@ -64,7 +64,7 @@ void Space::step( const cpFloat& dt ) { void Space::update() { #ifdef PHYSICS_RENDERER_ENABLED - step( Window::Engine::instance()->elapsed().asSeconds() ); + step( Window::Engine::instance()->getElapsed().asSeconds() ); #else Step( 1 / 60 ); #endif diff --git a/src/eepp/ui/tools/textureatlasnew.cpp b/src/eepp/ui/tools/textureatlasnew.cpp index fe6725f25..829716e21 100644 --- a/src/eepp/ui/tools/textureatlasnew.cpp +++ b/src/eepp/ui/tools/textureatlasnew.cpp @@ -48,8 +48,8 @@ TextureAtlasNew::TextureAtlasNew( TGCreateCb NewTGCb ) : mComboWidth->getListBox()->addListBoxItems( Sizes ); mComboHeight->getListBox()->addListBoxItems( Sizes ); - mComboWidth->getInputTextBuffer()->allowOnlyNumbers( true ); - mComboHeight->getInputTextBuffer()->allowOnlyNumbers( true ); + mComboWidth->getInputTextBuffer()->setAllowOnlyNumbers( true ); + mComboHeight->getInputTextBuffer()->setAllowOnlyNumbers( true ); mComboWidth->getListBox()->setSelected( "512" ); mComboHeight->getListBox()->setSelected( "512" ); diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp index 755f5e9c7..d19620a40 100644 --- a/src/eepp/ui/uidropdownlist.cpp +++ b/src/eepp/ui/uidropdownlist.cpp @@ -200,7 +200,7 @@ void UIDropDownList::hide() { void UIDropDownList::update() { if ( mEnabled && mVisible ) { if ( isMouseOver() ) { - Uint32 Flags = UIManager::instance()->getInput()->clickTrigger(); + Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); if ( Flags & EE_BUTTONS_WUWD ) { if ( Flags & EE_BUTTON_WUMASK ) { diff --git a/src/eepp/ui/uigridcell.cpp b/src/eepp/ui/uigridcell.cpp index bf241902e..fc21beb70 100644 --- a/src/eepp/ui/uigridcell.cpp +++ b/src/eepp/ui/uigridcell.cpp @@ -65,7 +65,7 @@ void UIGridCell::fixCell() { void UIGridCell::update() { if ( mEnabled && mVisible ) { UIGenericGrid * MyParent = reinterpret_cast ( parent()->parent() ); - Uint32 Flags = UIManager::instance()->getInput()->clickTrigger(); + Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); if ( NULL != MyParent && MyParent->alpha() != mAlpha ) { alpha( MyParent->alpha() ); diff --git a/src/eepp/ui/uilistboxitem.cpp b/src/eepp/ui/uilistboxitem.cpp index e870dd182..62fd97c09 100644 --- a/src/eepp/ui/uilistboxitem.cpp +++ b/src/eepp/ui/uilistboxitem.cpp @@ -78,7 +78,7 @@ void UIListBoxItem::update() { if ( mEnabled && mVisible ) { UIListBox * LBParent = reinterpret_cast ( parent()->parent() ); - Uint32 Flags = UIManager::instance()->getInput()->clickTrigger(); + Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); if ( isMouseOver() ) { if ( Flags & EE_BUTTONS_WUWD && LBParent->verticalScrollBar()->visible() ) { diff --git a/src/eepp/ui/uimanager.cpp b/src/eepp/ui/uimanager.cpp index 842a114f4..863467bfc 100644 --- a/src/eepp/ui/uimanager.cpp +++ b/src/eepp/ui/uimanager.cpp @@ -182,7 +182,7 @@ void UIManager::sendMsg( UIControl * Ctrl, const Uint32& Msg, const Uint32& Flag } void UIManager::update() { - mElapsed = mWindow->elapsed(); + mElapsed = mWindow->getElapsed(); bool wasDraggingControl = isControlDragging(); @@ -204,16 +204,16 @@ void UIManager::update() { } } else { if ( NULL != mOverControl ) - mOverControl->onMouseMove( mKM->getMousePos(), mKM->pressTrigger() ); + mOverControl->onMouseMove( mKM->getMousePos(), mKM->getPressTrigger() ); } - if ( mKM->pressTrigger() ) { + if ( mKM->getPressTrigger() ) { /*if ( !wasDraggingControl && mOverControl != mFocusControl ) FocusControl( mOverControl );*/ if ( NULL != mOverControl ) { - mOverControl->onMouseDown( mKM->getMousePos(), mKM->pressTrigger() ); - sendMsg( mOverControl, UIMessage::MsgMouseDown, mKM->pressTrigger() ); + mOverControl->onMouseDown( mKM->getMousePos(), mKM->getPressTrigger() ); + sendMsg( mOverControl, UIMessage::MsgMouseDown, mKM->getPressTrigger() ); } if ( !mFirstPress ) { @@ -224,22 +224,22 @@ void UIManager::update() { } } - if ( mKM->releaseTrigger() ) { + if ( mKM->getReleaseTrigger() ) { if ( NULL != mFocusControl ) { if ( !wasDraggingControl ) { if ( mOverControl != mFocusControl ) focusControl( mOverControl ); - mFocusControl->onMouseUp( mKM->getMousePos(), mKM->releaseTrigger() ); - sendMsg( mFocusControl, UIMessage::MsgMouseUp, mKM->releaseTrigger() ); + mFocusControl->onMouseUp( mKM->getMousePos(), mKM->getReleaseTrigger() ); + sendMsg( mFocusControl, UIMessage::MsgMouseUp, mKM->getReleaseTrigger() ); - if ( mKM->clickTrigger() ) { // mDownControl == mOverControl && - sendMsg( mFocusControl, UIMessage::MsgClick, mKM->clickTrigger() ); - mFocusControl->onMouseClick( mKM->getMousePos(), mKM->clickTrigger() ); + if ( mKM->getClickTrigger() ) { // mDownControl == mOverControl && + sendMsg( mFocusControl, UIMessage::MsgClick, mKM->getClickTrigger() ); + mFocusControl->onMouseClick( mKM->getMousePos(), mKM->getClickTrigger() ); - if ( mKM->doubleClickTrigger() ) { - sendMsg( mFocusControl, UIMessage::MsgDoubleClick, mKM->doubleClickTrigger() ); - mFocusControl->onMouseDoubleClick( mKM->getMousePos(), mKM->doubleClickTrigger() ); + if ( mKM->getDoubleClickTrigger() ) { + sendMsg( mFocusControl, UIMessage::MsgDoubleClick, mKM->getDoubleClickTrigger() ); + mFocusControl->onMouseDoubleClick( mKM->getMousePos(), mKM->getDoubleClickTrigger() ); } } } @@ -278,11 +278,11 @@ Input * UIManager::getInput() const { } const Uint32& UIManager::pressTrigger() const { - return mKM->pressTrigger(); + return mKM->getPressTrigger(); } const Uint32& UIManager::lastPressTrigger() const { - return mKM->lastPressTrigger(); + return mKM->getLastPressTrigger(); } void UIManager::clipEnable( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height ) { diff --git a/src/eepp/ui/uiscrollbar.cpp b/src/eepp/ui/uiscrollbar.cpp index 180890a97..76d031d16 100644 --- a/src/eepp/ui/uiscrollbar.cpp +++ b/src/eepp/ui/uiscrollbar.cpp @@ -150,7 +150,7 @@ void UIScrollBar::update() { UIControlAnim::update(); if ( mBtnUp->isMouseOver() || mBtnDown->isMouseOver() ) { - manageClick( UIManager::instance()->getInput()->clickTrigger() ); + manageClick( UIManager::instance()->getInput()->getClickTrigger() ); } } diff --git a/src/eepp/ui/uislider.cpp b/src/eepp/ui/uislider.cpp index fbff0d846..f9623cce7 100644 --- a/src/eepp/ui/uislider.cpp +++ b/src/eepp/ui/uislider.cpp @@ -265,7 +265,7 @@ void UISlider::update() { UIControlAnim::update(); if ( isMouseOver() || mBackSlider->isMouseOver() || mSlider->isMouseOver() ) { - manageClick( UIManager::instance()->getInput()->clickTrigger() ); + manageClick( UIManager::instance()->getInput()->getClickTrigger() ); } } diff --git a/src/eepp/ui/uispinbox.cpp b/src/eepp/ui/uispinbox.cpp index 5915b7d05..c600f894a 100644 --- a/src/eepp/ui/uispinbox.cpp +++ b/src/eepp/ui/uispinbox.cpp @@ -41,7 +41,7 @@ UISpinBox::UISpinBox( const UISpinBox::CreateParams& Params ) : mPushDown->visible ( true ); mPushDown->enabled ( true ); - mInput->getInputTextBuffer()->allowOnlyNumbers( true, Params.AllowDotsInNumbers ); + mInput->getInputTextBuffer()->setAllowOnlyNumbers( true, Params.AllowDotsInNumbers ); internalValue( mValue, true ); diff --git a/src/eepp/ui/uitab.cpp b/src/eepp/ui/uitab.cpp index 29f5acaf6..d62d785bc 100644 --- a/src/eepp/ui/uitab.cpp +++ b/src/eepp/ui/uitab.cpp @@ -131,7 +131,7 @@ void UITab::update() { UITabWidget * tTabW = getTabWidget(); if ( NULL != tTabW ) { - Uint32 Flags = UIManager::instance()->getInput()->clickTrigger(); + Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); if ( Flags & EE_BUTTONS_WUWD ) { if ( Flags & EE_BUTTON_WUMASK ) { diff --git a/src/eepp/ui/uitextedit.cpp b/src/eepp/ui/uitextedit.cpp index f3129c41b..2b73eb17d 100644 --- a/src/eepp/ui/uitextedit.cpp +++ b/src/eepp/ui/uitextedit.cpp @@ -41,7 +41,7 @@ UITextEdit::UITextEdit( UITextEdit::CreateParams& Params ) : mFlags |= UI_AUTO_SHRINK_TEXT; mTextInput = eeNew( UITextInput, ( TIParams ) ); - mTextInput->getInputTextBuffer()->supportNewLine( true ); + mTextInput->getInputTextBuffer()->isNewLineEnabled( true ); mTextInput->visible( true ); mTextInput->enabled( true ); mTextInput->addEventListener( UIEvent::EventOnSizeChange , cb::Make1( this, &UITextEdit::onInputSizeChange ) ); @@ -342,8 +342,8 @@ void UITextEdit::fixScrollToCursor() { Uint32 LineNum = mTextInput->getInputTextBuffer()->getCurPosLinePos( NLPos ); mTextInput->getTextCache()->font()->setText( - mTextInput->getInputTextBuffer()->buffer().substr( - NLPos, mTextInput->getInputTextBuffer()->curPos() - NLPos + mTextInput->getInputTextBuffer()->getBuffer().substr( + NLPos, mTextInput->getInputTextBuffer()->getCursorPos() - NLPos ) ); @@ -381,7 +381,7 @@ void UITextEdit::update() { UIControlAnim::update(); if ( mTextInput->enabled() && mTextInput->visible() && mTextInput->isMouseOver() && mVScrollBar->visible() ) { - Uint32 Flags = UIManager::instance()->getInput()->clickTrigger(); + Uint32 Flags = UIManager::instance()->getInput()->getClickTrigger(); if ( Flags & EE_BUTTONS_WUWD ) mVScrollBar->getSlider()->manageClick( Flags ); diff --git a/src/eepp/ui/uitextinput.cpp b/src/eepp/ui/uitextinput.cpp index bffbe4291..4218954ea 100644 --- a/src/eepp/ui/uitextinput.cpp +++ b/src/eepp/ui/uitextinput.cpp @@ -15,9 +15,9 @@ UITextInput::UITextInput( const UITextInput::CreateParams& Params ) : mShowingWait( true ) { mTextBuffer.start(); - mTextBuffer.active( false ); - mTextBuffer.supportFreeEditing( Params.SupportFreeEditing ); - mTextBuffer.textSelectionEnabled( isTextSelectionEnabled() ); + mTextBuffer.setActive( false ); + mTextBuffer.setFreeEditing( Params.SupportFreeEditing ); + mTextBuffer.setTextSelectionEnabled( isTextSelectionEnabled() ); mTextBuffer.maxLength( Params.MaxLength ); mTextBuffer.setReturnCallback( cb::Make0( this, &UITextInput::privOnPressEnter ) ); @@ -45,7 +45,7 @@ void UITextInput::update() { if ( mTextBuffer.changedSinceLastUpdate() ) { Vector2f offSet = mAlignOffset; - UITextBox::text( mTextBuffer.buffer() ); + UITextBox::text( mTextBuffer.getBuffer() ); updateText(); @@ -55,16 +55,16 @@ void UITextInput::update() { alignFix(); - mCursorPos = mTextBuffer.curPos(); + mCursorPos = mTextBuffer.getCursorPos(); - mTextBuffer.changedSinceLastUpdate( false ); + mTextBuffer.setChangedSinceLastUpdate( false ); return; } - if ( mCursorPos != mTextBuffer.curPos() ) { + if ( mCursorPos != mTextBuffer.getCursorPos() ) { alignFix(); - mCursorPos = mTextBuffer.curPos(); + mCursorPos = mTextBuffer.getCursorPos(); onCursorPosChange(); } } @@ -74,7 +74,7 @@ void UITextInput::onCursorPosChange() { } void UITextInput::drawWaitingCursor() { - if ( mVisible && mTextBuffer.active() && mTextBuffer.supportFreeEditing() ) { + if ( mVisible && mTextBuffer.isActive() && mTextBuffer.isFreeEditingEnabled() ) { mWaitCursorTime += UIManager::instance()->elapsed().asMilliseconds(); if ( mShowingWait ) { @@ -115,7 +115,7 @@ Uint32 UITextInput::onFocus() { UIControlAnim::onFocus(); if ( mAllowEditing ) { - mTextBuffer.active( true ); + mTextBuffer.setActive( true ); resetWaitCursor(); } @@ -124,7 +124,7 @@ Uint32 UITextInput::onFocus() { } Uint32 UITextInput::onFocusLoss() { - mTextBuffer.active( false ); + mTextBuffer.setActive( false ); return UITextBox::onFocusLoss(); } @@ -151,7 +151,7 @@ void UITextInput::alignFix() { Uint32 NLPos = 0; Uint32 LineNum = mTextBuffer.getCurPosLinePos( NLPos ); - mTextCache->font()->setText( mTextBuffer.buffer().substr( NLPos, mTextBuffer.curPos() - NLPos ) ); + mTextCache->font()->setText( mTextBuffer.getBuffer().substr( NLPos, mTextBuffer.getCursorPos() - NLPos ) ); Float tW = mTextCache->font()->getTextWidth(); Float tX = mAlignOffset.x + tW; @@ -159,7 +159,7 @@ void UITextInput::alignFix() { mCurPos.x = tW; mCurPos.y = (Float)LineNum * (Float)mTextCache->font()->getFontHeight(); - if ( !mTextBuffer.supportNewLine() ) { + if ( !mTextBuffer.setSupportNewLine() ) { if ( tX < 0.f ) mAlignOffset.x = -( mAlignOffset.x + ( tW - mAlignOffset.x ) ); else if ( tX > mSize.width() - mPadding.Left - mPadding.Right ) @@ -194,8 +194,8 @@ InputTextBuffer * UITextInput::getInputTextBuffer() { void UITextInput::allowEditing( const bool& allow ) { mAllowEditing = allow; - if ( !mAllowEditing && mTextBuffer.active() ) - mTextBuffer.active( false ); + if ( !mAllowEditing && mTextBuffer.isActive() ) + mTextBuffer.setActive( false ); } const bool& UITextInput::allowEditing() const { @@ -205,7 +205,7 @@ const bool& UITextInput::allowEditing() const { void UITextInput::text( const String& text ) { UITextBox::text( text ); - mTextBuffer.buffer( text ); + mTextBuffer.setBuffer( text ); mTextBuffer.cursorToEnd(); } @@ -215,11 +215,11 @@ const String& UITextInput::text() { } void UITextInput::shrinkText( const Uint32& MaxWidth ) { - mTextCache->text( mTextBuffer.buffer() ); + mTextCache->text( mTextBuffer.getBuffer() ); UITextBox::shrinkText( MaxWidth ); - mTextBuffer.buffer( mTextCache->text() ); + mTextBuffer.setBuffer( mTextCache->text() ); alignFix(); } @@ -235,7 +235,7 @@ Uint32 UITextInput::onMouseClick( const Vector2i& Pos, const Uint32 Flags ) { Int32 curPos = mTextCache->font()->findClosestCursorPosFromPoint( mTextCache->text(), controlPos ); if ( -1 != curPos ) { - mTextBuffer.curPos( curPos ); + mTextBuffer.setCursorPos( curPos ); resetWaitCursor(); } } @@ -247,7 +247,7 @@ Uint32 UITextInput::onMouseDoubleClick( const Vector2i& Pos, const Uint32 Flags UITextBox::onMouseDoubleClick( Pos, Flags ); if ( isTextSelectionEnabled() && ( Flags & EE_BUTTON_LMASK ) && selCurEnd() != -1 ) { - mTextBuffer.curPos( selCurEnd() ); + mTextBuffer.setCursorPos( selCurEnd() ); resetWaitCursor(); } @@ -270,7 +270,7 @@ void UITextInput::selCurEnd( const Int32& end ) { mTextBuffer.selCurEnd( end ); if ( mTextBuffer.selCurEnd() != mTextBuffer.selCurInit() ) { - mTextBuffer.curPos( end ); + mTextBuffer.setCursorPos( end ); } } diff --git a/src/eepp/ui/uitextinputpassword.cpp b/src/eepp/ui/uitextinputpassword.cpp index 9de76f714..e2c33b796 100644 --- a/src/eepp/ui/uitextinputpassword.cpp +++ b/src/eepp/ui/uitextinputpassword.cpp @@ -55,7 +55,7 @@ void UITextInputPassword::alignFix() { Uint32 NLPos = 0; Uint32 LineNum = mTextBuffer.getCurPosLinePos( NLPos ); - String curStr( mTextBuffer.buffer().substr( NLPos, mTextBuffer.curPos() - NLPos ) ); + String curStr( mTextBuffer.getBuffer().substr( NLPos, mTextBuffer.getCursorPos() - NLPos ) ); String pasStr; for ( size_t i = 0; i < curStr.size(); i++ ) @@ -69,7 +69,7 @@ void UITextInputPassword::alignFix() { mCurPos.x = tW; mCurPos.y = (Float)LineNum * (Float)mPassCache->font()->getFontHeight(); - if ( !mTextBuffer.supportNewLine() ) { + if ( !mTextBuffer.setSupportNewLine() ) { if ( tX < 0.f ) mAlignOffset.x = -( mAlignOffset.x + ( tW - mAlignOffset.x ) ); else if ( tX > mSize.width() - mPadding.Left - mPadding.Right ) diff --git a/src/eepp/window/backend/SDL2/windowsdl2.cpp b/src/eepp/window/backend/SDL2/windowsdl2.cpp index 3488ee67c..3c1fc8eb3 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.cpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.cpp @@ -236,7 +236,7 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { getMainContext(); - caption( mWindow.WindowConfig.Caption ); + setCaption( mWindow.WindowConfig.Caption ); createView(); @@ -245,7 +245,7 @@ bool WindowSDL::create( WindowSettings Settings, ContextSettings Context ) { mWindow.Created = true; if ( "" != mWindow.WindowConfig.Icon ) { - icon( mWindow.WindowConfig.Icon ); + setIcon( mWindow.WindowConfig.Icon ); } /// Init the clipboard after the window creation @@ -338,9 +338,9 @@ void WindowSDL::toggleFullscreen() { bool WasMaximized = mWindow.Maximized; if ( isWindowed() ) { - size( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, !isWindowed() ); + setSize( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height, !isWindowed() ); } else { - size( mWindow.WindowSize.width(), mWindow.WindowSize.height(), !isWindowed() ); + setSize( mWindow.WindowSize.width(), mWindow.WindowSize.height(), !isWindowed() ); } if ( WasMaximized ) { @@ -350,13 +350,13 @@ void WindowSDL::toggleFullscreen() { getCursorManager()->reload(); } -void WindowSDL::caption( const std::string& Caption ) { +void WindowSDL::setCaption( const std::string& Caption ) { mWindow.WindowConfig.Caption = Caption; SDL_SetWindowTitle( mSDLWindow, Caption.c_str() ); } -bool WindowSDL::active() { +bool WindowSDL::isActive() { Uint32 flags = 0; flags = SDL_GetWindowFlags( mSDLWindow ); @@ -364,7 +364,7 @@ bool WindowSDL::active() { return 0 != ( ( flags & SDL_WINDOW_INPUT_FOCUS ) && ( flags & SDL_WINDOW_MOUSE_FOCUS ) ); } -bool WindowSDL::visible() { +bool WindowSDL::isVisible() { Uint32 flags = 0; flags = SDL_GetWindowFlags( mSDLWindow ); @@ -372,7 +372,7 @@ bool WindowSDL::visible() { return 0 != ( ( flags & SDL_WINDOW_SHOWN ) && !( flags & SDL_WINDOW_MINIMIZED ) ); } -void WindowSDL::size( Uint32 Width, Uint32 Height, bool Windowed ) { +void WindowSDL::setSize( Uint32 Width, Uint32 Height, bool Windowed ) { if ( ( !Width || !Height ) ) { Width = mWindow.DesktopResolution.width(); Height = mWindow.DesktopResolution.height(); @@ -396,7 +396,7 @@ void WindowSDL::size( Uint32 Width, Uint32 Height, bool Windowed ) { } if ( this->isWindowed() && !Windowed ) { - mWinPos = position(); + mWinPos = getPosition(); } else { SDL_SetWindowFullscreen( mSDLWindow, Windowed ? 0 : SDL_WINDOW_FULLSCREEN ); } @@ -404,7 +404,7 @@ void WindowSDL::size( Uint32 Width, Uint32 Height, bool Windowed ) { SDL_SetWindowSize( mSDLWindow, Width, Height ); if ( this->isWindowed() && !Windowed ) { - mWinPos = position(); + mWinPos = getPosition(); SetGLConfig(); @@ -412,7 +412,7 @@ void WindowSDL::size( Uint32 Width, Uint32 Height, bool Windowed ) { } if ( !this->isWindowed() && Windowed ) { - position( mWinPos.x, mWinPos.y ); + setPosition( mWinPos.x, mWinPos.y ); } BitOp::setBitFlagValue( &mWindow.WindowConfig.Style, WindowStyle::Fullscreen, !Windowed ); @@ -489,7 +489,7 @@ eeWindowHandle WindowSDL::getWindowHandler() { return 0; } -bool WindowSDL::icon( const std::string& Path ) { +bool WindowSDL::setIcon( const std::string& Path ) { int x, y, c; if ( !mWindow.Created ) { @@ -566,11 +566,11 @@ void WindowSDL::show() { SDL_ShowWindow( mSDLWindow ); } -void WindowSDL::position( Int16 Left, Int16 Top ) { +void WindowSDL::setPosition( Int16 Left, Int16 Top ) { SDL_SetWindowPosition( mSDLWindow, Left, Top ); } -Vector2i WindowSDL::position() { +Vector2i WindowSDL::getPosition() { Vector2i p; SDL_GetWindowPosition( mSDLWindow, &p.x, &p.y ); diff --git a/src/eepp/window/backend/SDL2/windowsdl2.hpp b/src/eepp/window/backend/SDL2/windowsdl2.hpp index f65637b9e..9561905e3 100644 --- a/src/eepp/window/backend/SDL2/windowsdl2.hpp +++ b/src/eepp/window/backend/SDL2/windowsdl2.hpp @@ -27,15 +27,15 @@ class EE_API WindowSDL : public Window { void toggleFullscreen(); - void caption( const std::string& caption ); + void setCaption( const std::string& setCaption ); - bool icon( const std::string& Path ); + bool setIcon( const std::string& Path ); - bool active(); + bool isActive(); - bool visible(); + bool isVisible(); - void size( Uint32 Width, Uint32 Height, bool isWindowed ); + void setSize( Uint32 Width, Uint32 Height, bool isWindowed ); std::vector getDisplayModes() const; @@ -53,9 +53,9 @@ class EE_API WindowSDL : public Window { virtual void show(); - virtual void position( Int16 Left, Int16 Top ); + virtual void setPosition( Int16 Left, Int16 Top ); - virtual Vector2i position(); + virtual Vector2i getPosition(); const Sizei& getDesktopResolution(); diff --git a/src/eepp/window/backend/SFML/windowsfml.cpp b/src/eepp/window/backend/SFML/windowsfml.cpp index d8c193b50..f58ac1571 100644 --- a/src/eepp/window/backend/SFML/windowsfml.cpp +++ b/src/eepp/window/backend/SFML/windowsfml.cpp @@ -85,7 +85,7 @@ bool WindowSFML::create( WindowSettings Settings, ContextSettings Context ) { mVisible = true; if ( "" != mWindow.WindowConfig.Icon ) { - icon( mWindow.WindowConfig.Icon ); + setIcon( mWindow.WindowConfig.Icon ); } /// Init the clipboard after the window creation @@ -122,13 +122,13 @@ void WindowSFML::createPlatform() { void WindowSFML::toggleFullscreen() { } -void WindowSFML::caption( const std::string& Caption ) { +void WindowSFML::setCaption( const std::string& Caption ) { mWindow.WindowConfig.Caption = Caption; mSFMLWindow.setTitle( Caption ); } -bool WindowSFML::icon( const std::string& Path ) { +bool WindowSFML::setIcon( const std::string& Path ) { mWindow.WindowConfig.Icon = Path; Image Img( Path ); @@ -148,24 +148,24 @@ void WindowSFML::show() { mVisible = true; } -void WindowSFML::position( Int16 Left, Int16 Top ) { +void WindowSFML::setPosition( Int16 Left, Int16 Top ) { mSFMLWindow.setPosition( sf::Vector2i( Left, Top ) ); } -bool WindowSFML::active() { +bool WindowSFML::isActive() { return reinterpret_cast ( mInput )->mWinActive; } -bool WindowSFML::visible() { +bool WindowSFML::isVisible() { return mVisible; } -Vector2i WindowSFML::position() { +Vector2i WindowSFML::getPosition() { sf::Vector2i v( mSFMLWindow.getPosition() ); return Vector2i( v.x, v.y ); } -void WindowSFML::size( Uint32 Width, Uint32 Height, bool Windowed ) { +void WindowSFML::setSize( Uint32 Width, Uint32 Height, bool Windowed ) { if ( ( !Width || !Height ) ) { Width = mWindow.DesktopResolution.width(); Height = mWindow.DesktopResolution.height(); diff --git a/src/eepp/window/backend/SFML/windowsfml.hpp b/src/eepp/window/backend/SFML/windowsfml.hpp index 8c96bd4f2..11358332d 100644 --- a/src/eepp/window/backend/SFML/windowsfml.hpp +++ b/src/eepp/window/backend/SFML/windowsfml.hpp @@ -22,23 +22,23 @@ class EE_API WindowSFML : public Window { void toggleFullscreen(); - void caption( const std::string& caption ); + void setCaption( const std::string& setCaption ); - bool icon( const std::string& Path ); + bool setIcon( const std::string& Path ); void hide(); void show(); - void position( Int16 Left, Int16 Top ); + void setPosition( Int16 Left, Int16 Top ); - bool active(); + bool isActive(); - bool visible(); + bool isVisible(); - Vector2i position(); + Vector2i getPosition(); - void size( Uint32 Width, Uint32 Height, bool Windowed ); + void setSize( Uint32 Width, Uint32 Height, bool Windowed ); std::vector getDisplayModes() const; diff --git a/src/eepp/window/backend/null/windownull.cpp b/src/eepp/window/backend/null/windownull.cpp index 09f713837..b95788e1c 100644 --- a/src/eepp/window/backend/null/windownull.cpp +++ b/src/eepp/window/backend/null/windownull.cpp @@ -21,14 +21,14 @@ bool WindowNull::create( WindowSettings Settings, ContextSettings Context ) { void WindowNull::toggleFullscreen() { } -void WindowNull::caption( const std::string& Caption ) { +void WindowNull::setCaption( const std::string& Caption ) { } -std::string WindowNull::caption() { +std::string WindowNull::setCaption() { return std::string(); } -bool WindowNull::icon( const std::string& Path ) { +bool WindowNull::setIcon( const std::string& Path ) { return false; } @@ -47,22 +47,22 @@ void WindowNull::raise() { void WindowNull::show() { } -void WindowNull::position( Int16 Left, Int16 Top ) { +void WindowNull::setPosition( Int16 Left, Int16 Top ) { } -bool WindowNull::active() { +bool WindowNull::isActive() { return true; } -bool WindowNull::visible() { +bool WindowNull::isVisible() { return true; } -Vector2i WindowNull::position() { +Vector2i WindowNull::getPosition() { return Vector2i(); } -void WindowNull::size( Uint32 Width, Uint32 Height, bool Windowed ) { +void WindowNull::setSize( Uint32 Width, Uint32 Height, bool Windowed ) { } void WindowNull::swapBuffers() { diff --git a/src/eepp/window/backend/null/windownull.hpp b/src/eepp/window/backend/null/windownull.hpp index 7f20862db..3321a130f 100644 --- a/src/eepp/window/backend/null/windownull.hpp +++ b/src/eepp/window/backend/null/windownull.hpp @@ -15,11 +15,11 @@ class EE_API WindowNull : public Window { void toggleFullscreen(); - void caption( const std::string& caption ); + void setCaption( const std::string& setCaption ); - std::string caption(); + std::string setCaption(); - bool icon( const std::string& Path ); + bool setIcon( const std::string& Path ); void minimize(); @@ -31,15 +31,15 @@ class EE_API WindowNull : public Window { void show(); - void position( Int16 Left, Int16 Top ); + void setPosition( Int16 Left, Int16 Top ); - bool active(); + bool isActive(); - bool visible(); + bool isVisible(); - Vector2i position(); + Vector2i getPosition(); - void size( Uint32 Width, Uint32 Height, bool isWindowed ); + void setSize( Uint32 Width, Uint32 Height, bool isWindowed ); std::vector getDisplayModes() const; diff --git a/src/eepp/window/engine.cpp b/src/eepp/window/engine.cpp index 7577d78b4..542a90127 100755 --- a/src/eepp/window/engine.cpp +++ b/src/eepp/window/engine.cpp @@ -213,10 +213,10 @@ bool Engine::isRunning() const { return NULL != mWindow; } -Time Engine::elapsed() const { +Time Engine::getElapsed() const { eeASSERT( isRunning() ); - return mWindow->elapsed(); + return mWindow->getElapsed(); } const Uint32& Engine::getWidth() const { diff --git a/src/eepp/window/input.cpp b/src/eepp/window/input.cpp index d3d569ebe..6e0dcf876 100644 --- a/src/eepp/window/input.cpp +++ b/src/eepp/window/input.cpp @@ -179,7 +179,7 @@ void Input::processEvent( InputEvent * Event ) { } case InputEvent::VideoResize: { - mWindow->size( Event->resize.w, Event->resize.h, mWindow->isWindowed() ); + mWindow->setSize( Event->resize.w, Event->resize.h, mWindow->isWindowed() ); break; } case InputEvent::Quit: @@ -279,14 +279,6 @@ Vector2i Input::getMousePosFromView( const View& View ) { return Vector2i( RealMousePos.x - RView.Left, RealMousePos.y - RView.Top ); } -Uint16 Input::mouseX() const { - return mMousePos.x; -} - -Uint16 Input::mouseY() const { - return mMousePos.y; -} - Uint32 Input::pushCallback( const InputCallback& cb ) { mNumCallBacks++; mCallbacks[ mNumCallBacks ] = cb; @@ -302,99 +294,99 @@ void Input::injectMousePos( const Vector2i& Pos ) { injectMousePos( Pos.x, Pos.y ); } -bool Input::controlPressed() const { +bool Input::isControlPressed() const { return ( mInputMod & KEYMOD_CTRL ) != 0; } -bool Input::shiftPressed() const { +bool Input::isShiftPressed() const { return ( mInputMod & KEYMOD_SHIFT ) != 0; } -bool Input::altPressed() const { +bool Input::isAltPressed() const { return ( mInputMod & KEYMOD_ALT ) != 0; } -bool Input::metaPressed() const { +bool Input::isMetaPressed() const { return ( mInputMod & KEYMOD_META ) != 0; } -bool Input::mouseLeftPressed() const { +bool Input::isMouseLeftPressed() const { return ( mPressTrigger & EE_BUTTON_LMASK ) != 0; } -bool Input::mouseRightPressed() const { +bool Input::isMouseRightPressed() const { return ( mPressTrigger & EE_BUTTON_RMASK ) != 0; } -bool Input::mouseMiddlePressed() const { +bool Input::isMouseMiddlePressed() const { return ( mPressTrigger & EE_BUTTON_MMASK ) != 0; } -bool Input::mouseLeftClick() const { +bool Input::mouseLeftClicked() const { return ( mClickTrigger & EE_BUTTON_LMASK ) != 0; } -bool Input::mouseRightClick() const { +bool Input::mouseRightClicked() const { return ( mClickTrigger & EE_BUTTON_RMASK ) != 0; } -bool Input::mouseMiddleClick() const { +bool Input::mouseMiddleClicked() const { return ( mClickTrigger & EE_BUTTON_MMASK ) != 0; } -bool Input::mouseLeftDoubleClick() const { +bool Input::mouseLeftDoubleClicked() const { return ( mDoubleClickTrigger & EE_BUTTON_LMASK ) != 0; } -bool Input::mouseRightDoubleClick() const { +bool Input::mouseRightDoubleClicked() const { return ( mDoubleClickTrigger & EE_BUTTON_RMASK ) != 0; } -bool Input::mouseMiddleDoubleClick() const { +bool Input::mouseMiddleDoubleClicked() const { return ( mDoubleClickTrigger & EE_BUTTON_MMASK ) != 0; } -bool Input::mouseWheelUp() const { +bool Input::mouseWheelScrolledUp() const { return ( mReleaseTrigger & EE_BUTTON_WUMASK ) != 0; } -bool Input::mouseWheelDown() const { +bool Input::mouseWheelScrolledDown() const { return ( mReleaseTrigger & EE_BUTTON_WDMASK ) != 0; } -void Input::mouseSpeed( const Float& Speed ) { +void Input::setMouseSpeed( const Float& Speed ) { mMouseSpeed = Speed; } -const Float& Input::mouseSpeed() const { +const Float& Input::getMouseSpeed() const { return mMouseSpeed; } -const Uint32& Input::lastPressTrigger() const { +const Uint32& Input::getLastPressTrigger() const { return mLastPressTrigger; } -const Uint32& Input::pressTrigger() const { +const Uint32& Input::getPressTrigger() const { return mPressTrigger; } -const Uint32& Input::releaseTrigger() const { +const Uint32& Input::getReleaseTrigger() const { return mReleaseTrigger; } -const Uint32& Input::clickTrigger() const { +const Uint32& Input::getClickTrigger() const { return mClickTrigger; } -const Uint32& Input::doubleClickTrigger() const { +const Uint32& Input::getDoubleClickTrigger() const { return mDoubleClickTrigger; } -const Uint32& Input::doubleClickInterval() const { +const Uint32& Input::getDoubleClickInterval() const { return mDoubleClickInterval; } -void Input::doubleClickInterval( const Uint32& Interval ) { +void Input::setDoubleClickInterval( const Uint32& Interval ) { mDoubleClickInterval = Interval; } diff --git a/src/eepp/window/inputfinger.cpp b/src/eepp/window/inputfinger.cpp index 4c0b23ab1..98052259e 100644 --- a/src/eepp/window/inputfinger.cpp +++ b/src/eepp/window/inputfinger.cpp @@ -25,7 +25,7 @@ bool InputFinger::wasDown() { return was_down; } -Vector2i InputFinger::pos() { +Vector2i InputFinger::getPos() { return Vector2i( x, y ); } diff --git a/src/eepp/window/inputhelper.cpp b/src/eepp/window/inputhelper.cpp index af59e32d2..f43c3b536 100644 --- a/src/eepp/window/inputhelper.cpp +++ b/src/eepp/window/inputhelper.cpp @@ -2,7 +2,7 @@ namespace EE { namespace Window { -Uint32 eeConvertKeyCharacter( const Uint32& KeyCode, const Uint16& Unicode, const Uint32& Modifiers ) { +Uint32 InputHelper::convertKeyCharacter( const Uint32& KeyCode, const Uint16& Unicode, const Uint32& Modifiers ) { Uint32 value = 0; if ( Unicode < 255 ) { diff --git a/src/eepp/window/inputtextbuffer.cpp b/src/eepp/window/inputtextbuffer.cpp index 418a54367..b33c38ea4 100755 --- a/src/eepp/window/inputtextbuffer.cpp +++ b/src/eepp/window/inputtextbuffer.cpp @@ -4,7 +4,7 @@ namespace EE { namespace Window { -InputTextBuffer::InputTextBuffer( const bool& active, const bool& supportNewLine, const bool& supportFreeEditing, EE::Window::Window * window, const Uint32& maxLength ) : +InputTextBuffer::InputTextBuffer( const bool& active, const bool& newLineEnabled, const bool& freeEditing, EE::Window::Window * window, const Uint32& maxLength ) : mWindow( window ), mFlags(0), mCallback(0), @@ -17,11 +17,11 @@ InputTextBuffer::InputTextBuffer( const bool& active, const bool& supportNewLine mWindow = Engine::instance()->getCurrentWindow(); } - this->active( active ); + this->setActive( active ); - this->supportFreeEditing( supportFreeEditing ); + this->setFreeEditing( freeEditing ); - this->supportNewLine( supportNewLine ); + this->isNewLineEnabled( newLineEnabled ); autoPrompt( true ); @@ -43,15 +43,15 @@ InputTextBuffer::InputTextBuffer( EE::Window::Window * window ) : mWindow = Engine::instance()->getCurrentWindow(); } - active( true ); + setActive( true ); - supportFreeEditing( true ); + setFreeEditing( true ); - supportNewLine( false ); + isNewLineEnabled( false ); autoPrompt( true ); - textSelectionEnabled( false ); + setTextSelectionEnabled( false ); supportCopyPaste( true ); } @@ -117,7 +117,7 @@ void InputTextBuffer::promptToRightFirstNoChar() { } void InputTextBuffer::resetSelection() { - if ( textSelectionEnabled() ) { + if ( isTextSelectionEnabled() ) { selCurInit( -1 ); selCurEnd( -1 ); } @@ -148,7 +148,7 @@ void InputTextBuffer::eraseToPrevNoChar() { resetSelection(); - changedSinceLastUpdate( true ); + setChangedSinceLastUpdate( true ); } void InputTextBuffer::eraseToNextNoChar() { @@ -173,7 +173,7 @@ void InputTextBuffer::eraseToNextNoChar() { String iniStr( mText.substr( 0, mPromptPos ) ); String endStr( mText.substr( tPromptPos ) ); - buffer( iniStr + endStr ); + setBuffer( iniStr + endStr ); resetSelection(); } @@ -194,7 +194,7 @@ bool InputTextBuffer::validChar( const Uint32& c ) { if ( canAdd() && String::isCharacter( c ) ) { bool Ignored = false; - if ( allowOnlyNumbers() && !String::isNumber( c, allowDotsInNumbers() ) ) { + if ( onlyNumbersAllowed() && !String::isNumber( c, dotsInNumbersAllowed() ) ) { Ignored = true; } @@ -211,11 +211,11 @@ bool InputTextBuffer::validChar( const Uint32& c ) { } void InputTextBuffer::tryAddChar( const Uint32& c ) { - if ( supportFreeEditing() ) { + if ( isFreeEditingEnabled() ) { if ( validChar( c ) ) { removeSelection(); - changedSinceLastUpdate( true ); + setChangedSinceLastUpdate( true ); if ( autoPrompt() ) { mText += c; @@ -229,8 +229,8 @@ void InputTextBuffer::tryAddChar( const Uint32& c ) { if ( canAdd() && String::isCharacter(c) ) { Input * Input = mWindow->getInput(); - if ( !Input->metaPressed() && !Input->altPressed() && !Input->controlPressed() ) { - if ( !( allowOnlyNumbers() && !String::isNumber( c, allowDotsInNumbers() ) ) ) { + if ( !Input->isMetaPressed() && !Input->isAltPressed() && !Input->isControlPressed() ) { + if ( !( onlyNumbersAllowed() && !String::isNumber( c, dotsInNumbersAllowed() ) ) ) { mText += c; } } @@ -239,7 +239,7 @@ void InputTextBuffer::tryAddChar( const Uint32& c ) { } void InputTextBuffer::removeSelection() { - if ( textSelectionEnabled() && -1 != mSelCurInit && -1 != mSelCurEnd ) { + if ( isTextSelectionEnabled() && -1 != mSelCurInit && -1 != mSelCurEnd ) { Int32 size = (Int32)mText.size(); if ( mSelCurInit <= size && mSelCurInit <= size ) { @@ -248,9 +248,9 @@ void InputTextBuffer::removeSelection() { String iniStr( mText.substr( 0, init ) ); String endStr( mText.substr( end ) ); - buffer( iniStr + endStr ); + setBuffer( iniStr + endStr ); - curPos( init ); + setCursorPos( init ); resetSelection(); } else { @@ -260,12 +260,12 @@ void InputTextBuffer::removeSelection() { } void InputTextBuffer::update( InputEvent* Event ) { - if ( active() ) { + if ( isActive() ) { Input * Input = mWindow->getInput(); - Uint32 c = eeConvertKeyCharacter( Event->key.keysym.sym, Event->key.keysym.unicode, Event->key.keysym.mod ); + Uint32 c = InputHelper::convertKeyCharacter( Event->key.keysym.sym, Event->key.keysym.unicode, Event->key.keysym.mod ); - if ( supportFreeEditing() ) { + if ( isFreeEditingEnabled() ) { switch ( Event->Type ) { case InputEvent::TextInput: { @@ -274,7 +274,7 @@ void InputTextBuffer::update( InputEvent* Event ) { } case InputEvent::KeyDown: { - if ( textSelectionEnabled() ) { + if ( isTextSelectionEnabled() ) { if ( mSelCurInit >= 0 && mSelCurInit != mSelCurEnd ) { if ( ( Event->key.keysym.mod & KEYMOD_CTRL ) && ( Event->key.keysym.sym == KEY_C || Event->key.keysym.sym == KEY_X ) ) { Int32 init = eemin( mSelCurInit, mSelCurEnd ); @@ -284,7 +284,7 @@ void InputTextBuffer::update( InputEvent* Event ) { } else if ( ( Event->key.keysym.sym >= KEY_UP && Event->key.keysym.sym <= KEY_END ) && !( Event->key.keysym.sym >= KEY_NUMLOCK && Event->key.keysym.sym <= KEY_COMPOSE ) ) { - if ( ! ( Input->shiftPressed() && ( Event->key.keysym.sym >= KEY_UP && Event->key.keysym.sym <= KEY_END ) ) ) { + if ( ! ( Input->isShiftPressed() && ( Event->key.keysym.sym >= KEY_UP && Event->key.keysym.sym <= KEY_END ) ) ) { resetSelection(); } } @@ -300,19 +300,19 @@ void InputTextBuffer::update( InputEvent* Event ) { if ( ( Event->key.keysym.mod & KEYMOD_CTRL ) && Event->key.keysym.sym == KEY_A ) { selCurInit( 0 ); selCurEnd( mText.size() ); - curPos( mSelCurEnd ); + setCursorPos( mSelCurEnd ); } } - if ( Input->shiftPressed() || Input->controlPressed() ) { - if ( !allowOnlyNumbers() && + if ( Input->isShiftPressed() || Input->isControlPressed() ) { + if ( !onlyNumbersAllowed() && ( ( ( Event->key.keysym.mod & KEYMOD_SHIFT ) && c == KEY_INSERT ) || ( ( Event->key.keysym.mod & KEYMOD_CTRL ) && Event->key.keysym.sym == KEY_V ) ) ) { String txt = mWindow->getClipboard()->getWideText(); - if ( !supportNewLine() ) { + if ( !setSupportNewLine() ) { size_t pos = txt.find_first_of( '\n' ); if ( pos != std::string::npos ) @@ -320,7 +320,7 @@ void InputTextBuffer::update( InputEvent* Event ) { } if ( txt.size() ) { - changedSinceLastUpdate( true ); + setChangedSinceLastUpdate( true ); if ( mText.size() + txt.size() < mMaxLength ) { if ( autoPrompt() ) { @@ -336,7 +336,7 @@ void InputTextBuffer::update( InputEvent* Event ) { } } - if ( Input->controlPressed() ) { + if ( Input->isControlPressed() ) { if ( c == KEY_LEFT ) { promptToLeftFirstNoChar(); break; @@ -355,7 +355,7 @@ void InputTextBuffer::update( InputEvent* Event ) { if ( ( c == KEY_BACKSPACE || c == KEY_DELETE ) ) { if ( mText.size() ) { - changedSinceLastUpdate( true ); + setChangedSinceLastUpdate( true ); if ( mPromptPos < (int)mText.size() ) { if ( c == KEY_BACKSPACE ) { @@ -374,14 +374,14 @@ void InputTextBuffer::update( InputEvent* Event ) { resetSelection(); } } else if ( ( c == KEY_RETURN || c == KEY_KP_ENTER ) ) { - if ( supportNewLine() && canAdd() ) { + if ( setSupportNewLine() && canAdd() ) { String::insertChar( mText, mPromptPos, '\n' ); mPromptPos++; resetSelection(); - changedSinceLastUpdate( true ); + setChangedSinceLastUpdate( true ); } if ( mEnterCall.IsSet() ) @@ -417,7 +417,7 @@ void InputTextBuffer::update( InputEvent* Event ) { } case InputEvent::KeyUp: { - if ( supportNewLine() ) { + if ( setSupportNewLine() ) { int lPromtpPos = mPromptPos; if ( c == KEY_END ) { @@ -480,12 +480,12 @@ void InputTextBuffer::update( InputEvent* Event ) { if ( Event->Type == InputEvent::TextInput ) { tryAddChar( Event->text.text ); } else if ( Event->Type == InputEvent::KeyDown ) { - changedSinceLastUpdate( true ); + setChangedSinceLastUpdate( true ); if ( c == KEY_BACKSPACE && mText.size() > 0 ) { mText.resize( mText.size() - 1 ); - } else if ( ( c == KEY_RETURN || c == KEY_KP_ENTER ) && !Input->metaPressed() && !Input->altPressed() && !Input->controlPressed() ) { - if ( supportNewLine() && canAdd() ) + } else if ( ( c == KEY_RETURN || c == KEY_KP_ENTER ) && !Input->isMetaPressed() && !Input->isAltPressed() && !Input->isControlPressed() ) { + if ( setSupportNewLine() && canAdd() ) mText += '\n'; if ( mEnterCall.IsSet() ) @@ -497,17 +497,17 @@ void InputTextBuffer::update( InputEvent* Event ) { } void InputTextBuffer::shiftSelection( const int& lastPromtpPos ) { - if ( !textSelectionEnabled() ) + if ( !isTextSelectionEnabled() ) return; Input * Input = mWindow->getInput(); - if ( Input->shiftPressed() && !Input->controlPressed() ) { - if ( selCurInit() != curPos() ) { - selCurEnd( curPos() ); + if ( Input->isShiftPressed() && !Input->isControlPressed() ) { + if ( selCurInit() != getCursorPos() ) { + selCurEnd( getCursorPos() ); } else { - if ( selCurInit() != curPos() ) { - selCurInit( curPos() ); + if ( selCurInit() != getCursorPos() ) { + selCurInit( getCursorPos() ); } else { resetSelection(); return; @@ -525,7 +525,7 @@ void InputTextBuffer::shiftSelection( const int& lastPromtpPos ) { } void InputTextBuffer::movePromptRowDown( const bool& breakit ) { - if ( supportFreeEditing() && supportNewLine() ) { + if ( isFreeEditingEnabled() && setSupportNewLine() ) { int lPromtpPos = mPromptPos; Uint32 dNLPos = 0; @@ -570,7 +570,7 @@ void InputTextBuffer::movePromptRowDown( const bool& breakit ) { } void InputTextBuffer::movePromptRowUp( const bool& breakit ) { - if ( supportFreeEditing() && supportNewLine() ) { + if ( isFreeEditingEnabled() && setSupportNewLine() ) { int lPromtpPos = mPromptPos; Uint32 uNLPos = 0; @@ -618,19 +618,19 @@ void InputTextBuffer::setReturnCallback( EnterCallback EC ) { mEnterCall = EC; } -void InputTextBuffer::buffer( const String& str ) { +void InputTextBuffer::setBuffer( const String& str ) { if ( mText != str ) { mText = str; - changedSinceLastUpdate( true ); + setChangedSinceLastUpdate( true ); } } -int InputTextBuffer::curPos() const { +int InputTextBuffer::getCursorPos() const { return mPromptPos; } -void InputTextBuffer::curPos( const Uint32& pos ) { - if ( supportFreeEditing() ) { +void InputTextBuffer::setCursorPos( const Uint32& pos ) { + if ( isFreeEditingEnabled() ) { if ( pos < mText.size() ) { mPromptPos = pos; autoPrompt( false ); @@ -641,7 +641,7 @@ void InputTextBuffer::curPos( const Uint32& pos ) { } Uint32 InputTextBuffer::getCurPosLinePos( Uint32& LastNewLinePos ) { - if ( supportFreeEditing() ) { + if ( isFreeEditingEnabled() ) { Uint32 nl = 0; LastNewLinePos = 0; for ( int i = 0; i < mPromptPos; i++ ) { @@ -674,7 +674,7 @@ const Uint32& InputTextBuffer::maxLength() const { return mMaxLength; } -String InputTextBuffer::buffer() const { +String InputTextBuffer::getBuffer() const { return mText; } @@ -682,7 +682,7 @@ bool InputTextBuffer::changedSinceLastUpdate() { return 0 != ( mFlags & ( 1 << INPUT_TB_CHANGE_SINCE_LAST_UPDATE ) ); } -void InputTextBuffer::changedSinceLastUpdate( const bool& Changed ) { +void InputTextBuffer::setChangedSinceLastUpdate( const bool& Changed ) { BitOp::writeBitKey( &mFlags, INPUT_TB_CHANGE_SINCE_LAST_UPDATE, Changed == true ); } @@ -698,41 +698,41 @@ bool InputTextBuffer::autoPrompt() { return 0 != ( mFlags & ( 1 << INPUT_TB_PROMPT_AUTO_POS ) ); } -bool InputTextBuffer::active() const { +bool InputTextBuffer::isActive() const { return 0 != ( mFlags & ( 1 << INPUT_TB_ACTIVE ) ); } -void InputTextBuffer::active( const bool& Active ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_ACTIVE, Active == true ); +void InputTextBuffer::setActive( const bool& active ) { + BitOp::writeBitKey( &mFlags, INPUT_TB_ACTIVE, active == true ); } -bool InputTextBuffer::supportNewLine() { +bool InputTextBuffer::setSupportNewLine() { return 0 != ( mFlags & ( 1 << INPUT_TB_SUPPORT_NEW_LINE ) ); } -void InputTextBuffer::supportNewLine( const bool& SupportNewLine ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_SUPPORT_NEW_LINE, SupportNewLine == true ); +void InputTextBuffer::isNewLineEnabled( const bool& enabled ) { + BitOp::writeBitKey( &mFlags, INPUT_TB_SUPPORT_NEW_LINE, enabled == true ); } -void InputTextBuffer::allowOnlyNumbers( const bool& onlynums, const bool& allowdots ) { +void InputTextBuffer::setAllowOnlyNumbers( const bool& onlynums, const bool& allowdots ) { BitOp::writeBitKey( &mFlags, INPUT_TB_ALLOW_ONLY_NUMBERS, onlynums == true ); BitOp::writeBitKey( &mFlags, INPUT_TB_ALLOW_DOT_IN_NUMBERS, allowdots == true ); } -bool InputTextBuffer::allowOnlyNumbers() { +bool InputTextBuffer::onlyNumbersAllowed() { return 0 != ( mFlags & ( 1 << INPUT_TB_ALLOW_ONLY_NUMBERS ) ); } -bool InputTextBuffer::allowDotsInNumbers() { +bool InputTextBuffer::dotsInNumbersAllowed() { return 0 != ( mFlags & ( 1 << INPUT_TB_ALLOW_DOT_IN_NUMBERS ) ); } -bool InputTextBuffer::supportFreeEditing() const { +bool InputTextBuffer::isFreeEditingEnabled() const { return 0 != ( mFlags & ( 1 << INPUT_TB_FREE_EDITING ) ); } -void InputTextBuffer::supportFreeEditing( const bool& Support ) { - BitOp::writeBitKey( &mFlags, INPUT_TB_FREE_EDITING, Support == true ); +void InputTextBuffer::setFreeEditing( const bool& enabled ) { + BitOp::writeBitKey( &mFlags, INPUT_TB_FREE_EDITING, enabled == true ); } void InputTextBuffer::supportCopyPaste( const bool& support ) { @@ -743,11 +743,11 @@ bool InputTextBuffer::supportCopyPaste() { return 0 != ( mFlags & ( 1 << INPUT_TB_SUPPORT_COPY_PASTE ) ); } -bool InputTextBuffer::textSelectionEnabled() { +bool InputTextBuffer::isTextSelectionEnabled() { return 0 != ( mFlags & ( 1 << INPUT_TB_TEXT_SELECTION_ENABLED ) ); } -void InputTextBuffer::textSelectionEnabled( const bool& enabled ) { +void InputTextBuffer::setTextSelectionEnabled( const bool& enabled ) { BitOp::writeBitKey( &mFlags, INPUT_TB_TEXT_SELECTION_ENABLED, enabled == true ); } diff --git a/src/eepp/window/view.cpp b/src/eepp/window/view.cpp index e14afdad6..d0fcbca77 100755 --- a/src/eepp/window/view.cpp +++ b/src/eepp/window/view.cpp @@ -38,11 +38,11 @@ void View::calcCenter() { mCenter.y = ( ( mView.Top + mView.Bottom ) - mView.Top ) * 0.5f; } -Vector2i View::center() const { +Vector2i View::getCenter() const { return Vector2i( (int)mCenter.x, (Int32)mCenter.y ); } -void View::center( const Vector2i& Center ) { +void View::setCenter( const Vector2i& Center ) { mCenter.x = (Float)Center.x; mCenter.y = (Float)Center.y; mView.Left = static_cast ( mCenter.x - (Float)mView.Right * 0.5f ); diff --git a/src/eepp/window/window.cpp b/src/eepp/window/window.cpp index 9a7267c5b..6e6e5b83c 100644 --- a/src/eepp/window/window.cpp +++ b/src/eepp/window/window.cpp @@ -62,7 +62,7 @@ Window::~Window() { eeSAFE_DELETE( mPlatform ); } -Sizei Window::size() { +Sizei Window::getSize() { return Sizei( mWindow.WindowConfig.Width, mWindow.WindowConfig.Height ); } @@ -78,8 +78,8 @@ const Sizei& Window::getDesktopResolution() { return mWindow.DesktopResolution; } -void Window::size( Uint32 Width, Uint32 Height ) { - size( Width, Height, isWindowed() ); +void Window::setSize( Uint32 Width, Uint32 Height ) { + setSize( Width, Height, isWindowed() ); } bool Window::isWindowed() const { @@ -132,7 +132,7 @@ void Window::setup2D( const bool& KeepView ) { GLi->pixelStorei( GL_UNPACK_ALIGNMENT, 1 ); GLi->pixelStorei( GL_PACK_ALIGNMENT, 1 ); - backColor( mWindow.BackgroundColor ); + setBackColor( mWindow.BackgroundColor ); GLi->lineSmooth(); @@ -169,12 +169,12 @@ const WindowInfo * Window::getWindowInfo() const { return &mWindow; } -void Window::backColor( const RGB& Color ) { +void Window::setBackColor( const RGB& Color ) { mWindow.BackgroundColor = Color; GLi->clearColor( static_cast( mWindow.BackgroundColor.r() ) / 255.0f, static_cast( mWindow.BackgroundColor.g() ) / 255.0f, static_cast( mWindow.BackgroundColor.b() ) / 255.0f, 255.0f ); } -const RGB& Window::backColor() const { +const RGB& Window::getBackColor() const { return mWindow.BackgroundColor; } @@ -232,7 +232,7 @@ bool Window::isRunning() const { return mWindow.Created; } -bool Window::created() const { +bool Window::isOpen() const { return mWindow.Created; } @@ -240,19 +240,19 @@ void Window::close() { mWindow.Created = false; } -void Window::frameRateLimit( const Uint32& FrameRateLimit ) { +void Window::setFrameRateLimit( const Uint32& FrameRateLimit ) { mFrameData.FPS.Limit = (Float)FrameRateLimit; } -Uint32 Window::frameRateLimit() { +Uint32 Window::getFrameRateLimit() { return static_cast( mFrameData.FPS.Limit ); } -Uint32 Window::FPS() const { +Uint32 Window::getFPS() const { return mFrameData.FPS.Current; } -Time Window::elapsed() const { +Time Window::getElapsed() const { return mFrameData.ElapsedTime; } @@ -405,7 +405,7 @@ void Window::logFailureInit( const std::string& ClassName, const std::string& Ba eePRINTL( "Error on %s::Init. Backend %s failed to start.", ClassName.c_str(), BackendName.c_str() ); } -std::string Window::caption() { +std::string Window::getCaption() { return mWindow.WindowConfig.Caption; } @@ -462,12 +462,12 @@ void Window::show() { mPlatform->showWindow(); } -void Window::position( Int16 Left, Int16 Top ) { +void Window::setPosition( Int16 Left, Int16 Top ) { if ( NULL != mPlatform ) mPlatform->moveWindow( Left, Top ); } -Vector2i Window::position() { +Vector2i Window::getPosition() { if ( NULL != mPlatform ) return mPlatform->getPosition(); @@ -487,9 +487,9 @@ void Window::createPlatform() { void Window::setCurrent() { } -void Window::center() { +void Window::centerToScreen() { if ( isWindowed() ) { - position( mWindow.DesktopResolution.width() / 2 - mWindow.WindowConfig.Width / 2, mWindow.DesktopResolution.height() / 2 - mWindow.WindowConfig.Height / 2 ); + setPosition( mWindow.DesktopResolution.width() / 2 - mWindow.WindowConfig.Width / 2, mWindow.DesktopResolution.height() / 2 - mWindow.WindowConfig.Height / 2 ); } } @@ -533,7 +533,7 @@ void Window::runMainLoop( void (*func)(), int fps ) { #if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN emscripten_set_main_loop(func, fps, 1); #else - frameRateLimit( fps ); + setFrameRateLimit( fps ); while ( isRunning() ) { func(); diff --git a/src/examples/empty_window/empty_window.cpp b/src/examples/empty_window/empty_window.cpp index cee33e92d..973f6a3d6 100644 --- a/src/examples/empty_window/empty_window.cpp +++ b/src/examples/empty_window/empty_window.cpp @@ -30,8 +30,8 @@ void MainLoop() win->close(); } - circ += win->elapsed().asMilliseconds() * 0.5f * op; - circ2 += win->elapsed().asMilliseconds() * 0.75f; + circ += win->getElapsed().asMilliseconds() * 0.5f * op; + circ2 += win->getElapsed().asMilliseconds() * 0.75f; if ( op == 1 && circ > 340 ) { @@ -91,9 +91,9 @@ EE_MAIN_FUNC int main (int argc, char * argv []) win = Engine::instance()->createWindow( WindowSettings( 960, 640, "eepp - Empty Window" ), ContextSettings( true ) ); // Check if created - if ( win->created() ) { + if ( win->isOpen() ) { // Set window background color - win->backColor( RGB( 50, 50, 50 ) ); + win->setBackColor( RGB( 50, 50, 50 ) ); GLi->polygonMode( ); diff --git a/src/examples/external_shader/external_shader.cpp b/src/examples/external_shader/external_shader.cpp index b0fc1f127..bf09802fb 100644 --- a/src/examples/external_shader/external_shader.cpp +++ b/src/examples/external_shader/external_shader.cpp @@ -105,10 +105,10 @@ void MainLoop() if ( imp->isKeyUp( KEY_F ) ) { if ( win->isWindowed() ) { - win->size( win->getDesktopResolution().width(), win->getDesktopResolution().height(), false ); + win->setSize( win->getDesktopResolution().width(), win->getDesktopResolution().height(), false ); } else { - win->size( 960, 640, true ); - win->center(); + win->setSize( 960, 640, true ); + win->centerToScreen(); } } @@ -117,7 +117,7 @@ void MainLoop() Float tratio = tw / th; Float touchX = ( mf.x / tw - 1 ) * tratio; Float touchY = -( mf.y / th - 1 ); - bool touch = imp->mouseLeftPressed(); + bool touch = imp->isMouseLeftPressed(); for( Uint32 i = 0; i < ParticlesNum; i+=2 ) { @@ -195,7 +195,7 @@ void MainLoop() GLi->drawArrays( DM_LINES, 0, ParticlesNum ); /// Stop the simulation if the window is not visible - while ( !win->visible() ) { + while ( !win->isVisible() ) { imp->update(); /// To get the real state of the window you need to update the window input Sys::sleep( 100 ); /// Sleep 100 ms } @@ -207,7 +207,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { win = Engine::instance()->createWindow( WindowSettings( 960, 640, "eepp - External Shaders" ), ContextSettings( true ) ); - if ( win->created() ) + if ( win->isOpen() ) { /// This will work without shaders too ShadersSupported = GLi->shadersSupported(); diff --git a/src/examples/fonts/fonts.cpp b/src/examples/fonts/fonts.cpp index 01df92d39..ba9df56fc 100644 --- a/src/examples/fonts/fonts.cpp +++ b/src/examples/fonts/fonts.cpp @@ -51,10 +51,10 @@ EE_MAIN_FUNC int main (int argc, char * argv []) win = Engine::instance()->createWindow( WindowSettings( 960, 640, "eepp - Fonts" ), ContextSettings( true ) ); // Set window background color - win->backColor( RGB(255,255,255) ); + win->setBackColor( RGB(255,255,255) ); // Check if created - if ( win->created() ) { + if ( win->isOpen() ) { // Get the application path std::string AppPath = Sys::getProcessPath(); diff --git a/src/examples/physics/physics.cpp b/src/examples/physics/physics.cpp index d7a5ed1b2..ce40b6d28 100644 --- a/src/examples/physics/physics.cpp +++ b/src/examples/physics/physics.cpp @@ -113,7 +113,7 @@ void Demo1Create() { CreateJointAndBody(); - mWindow->caption( "eepp - Physics - Logo Smash" ); + mWindow->setCaption( "eepp - Physics - Logo Smash" ); mSpace = Physics::Space::New(); mSpace->iterations( 1 ); @@ -168,7 +168,7 @@ void Demo2Create() { CreateJointAndBody(); - mWindow->caption( "eepp - Physics - Pyramid Stack" ); + mWindow->setCaption( "eepp - Physics - Pyramid Stack" ); Shape::resetShapeIdCounter(); @@ -294,7 +294,7 @@ void Demo3Create() { CreateJointAndBody(); - mWindow->caption( "eepp - Physics - Sensor" ); + mWindow->setCaption( "eepp - Physics - Sensor" ); Shape::resetShapeIdCounter(); @@ -460,7 +460,7 @@ void Demo4Create() { CreateJointAndBody(); - mWindow->caption( "eepp - Physics - Sticky collisions using the Arbiter data pointer." ); + mWindow->setCaption( "eepp - Physics - Sticky collisions using the Arbiter data pointer." ); mSpace = Space::New(); mSpace->iterations( 10 ); @@ -575,10 +575,10 @@ void PhysicsUpdate() { mMousePoint = cVectNew( KM->getMousePosf().x, KM->getMousePosf().y ); cVect newPoint = tovect( cpvlerp( tocpv( mMousePoint_last ), tocpv( mMousePoint ), 0.25 ) ); mMouseBody->pos( newPoint ); - mMouseBody->vel( ( newPoint - mMousePoint_last ) * (cpFloat)mWindow->FPS() ); + mMouseBody->vel( ( newPoint - mMousePoint_last ) * (cpFloat)mWindow->getFPS() ); mMousePoint_last = newPoint; - if ( KM->mouseLeftPressed() ) { + if ( KM->isMouseLeftPressed() ) { if ( NULL == mMouseJoint ) { cVect point = cVectNew( KM->getMousePosf().x, KM->getMousePosf().y ); @@ -630,10 +630,10 @@ EE_MAIN_FUNC int main (int argc, char * argv []) { mWindow = Engine::instance()->createWindow( WindowSettings( 1024, 768, "eepp - Physics" ), ContextSettings( true ) ); - if ( mWindow->created() ) { + if ( mWindow->isOpen() ) { KM = mWindow->getInput(); - mWindow->backColor( RGB( 255, 255, 255 ) ); + mWindow->setBackColor( RGB( 255, 255, 255 ) ); PhysicsCreate(); diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index 2790b4f22..85d93665a 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -60,8 +60,8 @@ void MainLoop() } // Update the angle interpolation - PlanetAngle.update( win->elapsed() ); - RockAngle.update( win->elapsed() ); + PlanetAngle.update( win->getElapsed() ); + RockAngle.update( win->getElapsed() ); // Set the Planet and Rock angle from the interpolation Planet->angle( PlanetAngle.getPos() ); @@ -94,7 +94,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) win = Engine::instance()->createWindow( WindowSettings( 640, 480, "eepp - Sprites" ), ContextSettings( true ) ); // Check if created - if ( win->created() ) { + if ( win->isOpen() ) { // Get the application path std::string AppPath = Sys::getProcessPath(); diff --git a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp index b9a5efb5b..bb950270e 100644 --- a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +++ b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp @@ -93,7 +93,7 @@ void MainLoop() Batch->draw(); // Add the rotation angle - ang+=win->elapsed().asMilliseconds() * 0.1f; + ang+=win->getElapsed().asMilliseconds() * 0.1f; ang = (ang>=360) ? 0 : ang; // Change the scale value @@ -104,7 +104,7 @@ void MainLoop() side = false; scale = 0.5f; } - scale = (!side) ? scale+win->elapsed().asMilliseconds() * 0.00025f : scale-win->elapsed().asMilliseconds() * 0.00025f; + scale = (!side) ? scale+win->getElapsed().asMilliseconds() * 0.00025f : scale-win->getElapsed().asMilliseconds() * 0.00025f; // Draw frame win->display(); @@ -116,10 +116,10 @@ EE_MAIN_FUNC int main (int argc, char * argv []) win = Engine::instance()->createWindow( WindowSettings( 1024, 768, "eepp - VBO - FBO and Batch Rendering" ), ContextSettings( true ) ); // Set window background color - win->backColor( RGB( 50, 50, 50 ) ); + win->setBackColor( RGB( 50, 50, 50 ) ); // Check if created - if ( win->created() ) { + if ( win->isOpen() ) { Polygon2f Poly( Polygon2f::createRoundedRectangle( 0, 0, 200, 50 ) ); // Create the Vertex Buffer, the vertex buffer stores the vertex data in the GPU, making the rendering much faster diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index a82d1870a..4779a486d 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -57,10 +57,10 @@ void EETest::Init() { mWindow = EE->createWindow( WinSettings, ConSettings ); - if ( NULL != mWindow && mWindow->created() ) { + if ( NULL != mWindow && mWindow->isOpen() ) { SetScreen( StartScreen ); - mWindow->caption( "eepp - Test Application" ); + mWindow->setCaption( "eepp - Test Application" ); mWindow->pushResizeCallback( cb::Make1( this, &EETest::OnWindowResize ) ); TF = TextureFactory::instance(); @@ -80,7 +80,7 @@ void EETest::Init() { Scenes[5] = cb::Make0( this, &EETest::Screen5 ); //InBuf.Start(); - InBuf.supportNewLine( true ); + InBuf.isNewLineEnabled( true ); setRandomSeed( static_cast( Sys::getSystemTime() * 1000 ) ); @@ -244,7 +244,7 @@ void EETest::OnShowMenu( const UIEvent * Event ) { } void EETest::OnWindowResize(EE::Window::Window * win) { - Map.ViewSize( win->size() ); + Map.ViewSize( win->getSize() ); } void EETest::CreateUI() { @@ -679,7 +679,7 @@ void EETest::ItemClick( const UIEvent * Event ) { SetScreen( 5 ); } else if ( "Show Console" == txt ) { Con.toggle(); - InBuf.active( !Con.active() ); + InBuf.setActive( !Con.active() ); if ( Con.active() ) { mWindow->startTextInput(); @@ -782,9 +782,9 @@ void EETest::SetScreen( Uint32 num ) { if ( NULL != mTerrainBut ) mTerrainBut->visible( 1 == num ); if ( 0 == num || 5 == num ) - mWindow->backColor( RGB( 240, 240, 240 ) ); + mWindow->setBackColor( RGB( 240, 240, 240 ) ); else - mWindow->backColor( RGB( 0, 0, 0 ) ); + mWindow->setBackColor( RGB( 0, 0, 0 ) ); if ( num < 6 ) Screen = num; @@ -934,7 +934,7 @@ void EETest::LoadTextures() { Map.DrawGrid( false ); Map.ClipedArea( false ); Map.DrawBackground( false ); - Map.ViewSize( mWindow->size() ); + Map.ViewSize( mWindow->getSize() ); eePRINTL( "Map creation time: %4.3f ms.", TE.elapsed().asMilliseconds() ); } @@ -972,7 +972,7 @@ void EETest::Screen2() { TexLoaded->draw( 0, 0 ); } - if ( KM->mouseLeftPressed() ) + if ( KM->isMouseLeftPressed() ) TNP[3]->drawEx( 0.f, 0.f, (Float)mWindow->getWidth(), (Float)mWindow->getHeight() ); Batch.setTexture( TNP[2] ); @@ -1084,7 +1084,7 @@ void EETest::Screen2() { PR.drawQuad( CL1.getQuad() ); #endif - Ang = Ang + mWindow->elapsed().asMilliseconds() * 0.1f; + Ang = Ang + mWindow->getElapsed().asMilliseconds() * 0.1f; if (Ang > 360.f) Ang = 1.f; if ( ShowParticles ) @@ -1191,7 +1191,7 @@ void EETest::Render() { lasttick = Sys::getTicks(); #ifdef EE_DEBUG mInfo = String::strFormated( "EE - FPS: %d Elapsed Time: %4.2f\nMouse X: %d Mouse Y: %d\nTexture Memory Usage: %s\nApp Memory Usage: %s\nApp Peak Memory Usage: %s", - mWindow->FPS(), + mWindow->getFPS(), et.asMilliseconds(), (Int32)Mouse.x, (Int32)Mouse.y, @@ -1261,20 +1261,20 @@ void EETest::Render() { mInfoText.draw( 6.f, 6.f ); - if ( InBuf.active() ) { + if ( InBuf.isActive() ) { Uint32 NLPos = 0; Uint32 LineNum = InBuf.getCurPosLinePos( NLPos ); - if ( InBuf.curPos() == (int)InBuf.buffer().size() && !LineNum ) { + if ( InBuf.getCursorPos() == (int)InBuf.getBuffer().size() && !LineNum ) { FF2->draw( "_", 6.f + FF2->getTextWidth(), 180.f ); } else { - FF2->setText( InBuf.buffer().substr( NLPos, InBuf.curPos() - NLPos ) ); + FF2->setText( InBuf.getBuffer().substr( NLPos, InBuf.getCursorPos() - NLPos ) ); FF2->draw( "_", 6.f + FF2->getTextWidth(), 180.f + (Float)LineNum * (Float)FF2->getFontHeight() ); } - FF2->setText( "FPS: " + String::toStr( mWindow->FPS() ) ); + FF2->setText( "FPS: " + String::toStr( mWindow->getFPS() ) ); FF2->draw( mWindow->getWidth() - FF2->getTextWidth() - 15, 0 ); - FF2->setText( InBuf.buffer() ); + FF2->setText( InBuf.getBuffer() ); FF2->draw( 6, 180, FONT_DRAW_SHADOW ); } @@ -1295,17 +1295,17 @@ void EETest::Input() { if ( KM->isKeyUp( KEY_F1 ) ) Graphics::ShaderProgramManager::instance()->reload(); - if ( !mWindow->visible() ) { + if ( !mWindow->isVisible() ) { mWasMinimized = true; - mWindow->frameRateLimit( 10 ); + mWindow->setFrameRateLimit( 10 ); if ( mMusEnabled && Mus->state() == Sound::Playing ) Mus->pause(); } else { - if ( mLastFPSLimit != mWindow->frameRateLimit() && !mWasMinimized ) - mLastFPSLimit = mWindow->frameRateLimit(); + if ( mLastFPSLimit != mWindow->getFrameRateLimit() && !mWasMinimized ) + mLastFPSLimit = mWindow->getFrameRateLimit(); if ( mWasMinimized ) { mWasMinimized = false; @@ -1314,7 +1314,7 @@ void EETest::Input() { KM->grabInput( true ); } - mWindow->frameRateLimit( mLastFPSLimit ); + mWindow->setFrameRateLimit( mLastFPSLimit ); if ( mMusEnabled && Mus->state() == Sound::Paused ) Mus->play(); @@ -1326,10 +1326,10 @@ void EETest::Input() { if ( KM->isKeyUp( KEY_F1 ) ) MultiViewportMode = !MultiViewportMode; - if ( KM->altPressed() && KM->isKeyUp( KEY_C ) ) - mWindow->center(); + if ( KM->isAltPressed() && KM->isKeyUp( KEY_C ) ) + mWindow->centerToScreen(); - if ( KM->altPressed() && KM->isKeyUp( KEY_M ) && !Con.active() ) { + if ( KM->isAltPressed() && KM->isKeyUp( KEY_M ) && !Con.active() ) { if ( !mWindow->isMaximized() ) mWindow->maximize(); } @@ -1337,16 +1337,16 @@ void EETest::Input() { if ( KM->isKeyUp(KEY_F4) ) TF->reloadAllTextures(); - if ( KM->altPressed() && KM->isKeyUp( KEY_RETURN ) ) { + if ( KM->isAltPressed() && KM->isKeyUp( KEY_RETURN ) ) { if ( mWindow->isWindowed() ) { - mWindow->size( mWindow->getDesktopResolution().width(), mWindow->getDesktopResolution().height(), false ); + mWindow->setSize( mWindow->getDesktopResolution().width(), mWindow->getDesktopResolution().height(), false ); } else { mWindow->toggleFullscreen(); } } if ( KM->grabInput() ) { - if ( KM->altPressed() && KM->isKeyDown( KEY_TAB ) ) { + if ( KM->isAltPressed() && KM->isKeyDown( KEY_TAB ) ) { mWindow->minimize(); if ( KM->grabInput() ) @@ -1354,30 +1354,30 @@ void EETest::Input() { } } - if ( KM->controlPressed() && KM->isKeyUp(KEY_G) ) + if ( KM->isControlPressed() && KM->isKeyUp(KEY_G) ) KM->grabInput( !KM->grabInput() ); if ( KM->isKeyUp( KEY_F3 ) || KM->isKeyUp( KEY_WORLD_26 ) || KM->isKeyUp( KEY_BACKSLASH ) ) { Con.toggle(); - InBuf.active( !Con.active() ); + InBuf.setActive( !Con.active() ); } - if ( KM->isKeyUp(KEY_1) && KM->controlPressed() ) + if ( KM->isKeyUp(KEY_1) && KM->isControlPressed() ) SetScreen( 0 ); - if ( KM->isKeyUp(KEY_2) && KM->controlPressed() ) + if ( KM->isKeyUp(KEY_2) && KM->isControlPressed() ) SetScreen( 1 ); - if ( KM->isKeyUp(KEY_3) && KM->controlPressed() ) + if ( KM->isKeyUp(KEY_3) && KM->isControlPressed() ) SetScreen( 2 ); - if ( KM->isKeyUp(KEY_4) && KM->controlPressed() ) + if ( KM->isKeyUp(KEY_4) && KM->isControlPressed() ) SetScreen( 3 ); - if ( KM->isKeyUp(KEY_5) && KM->controlPressed() ) + if ( KM->isKeyUp(KEY_5) && KM->isControlPressed() ) SetScreen( 4 ); - if ( KM->isKeyUp(KEY_6) && KM->controlPressed() ) + if ( KM->isKeyUp(KEY_6) && KM->isControlPressed() ) SetScreen( 5 ); Joystick * Joy = JM->getJoystick(0); @@ -1399,7 +1399,7 @@ void EETest::Input() { Float aY = Joy->getAxis( AXIS_Y ); if ( 0 != aX || 0 != aY ) { - double rE = mWindow->elapsed().asMilliseconds(); + double rE = mWindow->getElapsed().asMilliseconds(); mAxisX += aX * rE; mAxisY += aY * rE; } @@ -1440,32 +1440,32 @@ void EETest::Input() { Uint8 hat = Joy->getHat(); if ( HAT_LEFT == hat || HAT_LEFTDOWN == hat || HAT_LEFTUP == hat ) - Map.Move( (mWindow->elapsed().asMilliseconds() * 0.2f), 0 ); + Map.Move( (mWindow->getElapsed().asMilliseconds() * 0.2f), 0 ); if ( HAT_RIGHT == hat || HAT_RIGHTDOWN == hat || HAT_RIGHTUP == hat ) - Map.Move( -mWindow->elapsed().asMilliseconds() * 0.2f, 0 ); + Map.Move( -mWindow->getElapsed().asMilliseconds() * 0.2f, 0 ); if ( HAT_UP == hat || HAT_LEFTUP == hat || HAT_RIGHTUP == hat ) - Map.Move( 0, (mWindow->elapsed().asMilliseconds() * 0.2f) ); + Map.Move( 0, (mWindow->getElapsed().asMilliseconds() * 0.2f) ); if ( HAT_DOWN == hat || HAT_LEFTDOWN == hat || HAT_RIGHTDOWN == hat ) - Map.Move( 0, -mWindow->elapsed().asMilliseconds() * 0.2f ); + Map.Move( 0, -mWindow->getElapsed().asMilliseconds() * 0.2f ); } if ( KM->isKeyDown(KEY_LEFT) ) { - Map.Move( mWindow->elapsed().asMilliseconds() * 0.2f, 0 ); + Map.Move( mWindow->getElapsed().asMilliseconds() * 0.2f, 0 ); } if ( KM->isKeyDown(KEY_RIGHT) ) { - Map.Move( -mWindow->elapsed().asMilliseconds() * 0.2f, 0 ); + Map.Move( -mWindow->getElapsed().asMilliseconds() * 0.2f, 0 ); } if ( KM->isKeyDown(KEY_UP) ) { - Map.Move( 0, mWindow->elapsed().asMilliseconds() * 0.2f ); + Map.Move( 0, mWindow->getElapsed().asMilliseconds() * 0.2f ); } if ( KM->isKeyDown(KEY_DOWN) ) { - Map.Move( 0, -mWindow->elapsed().asMilliseconds() * 0.2f ); + Map.Move( 0, -mWindow->getElapsed().asMilliseconds() * 0.2f ); } if ( KM->isKeyUp(KEY_F8) ) @@ -1482,7 +1482,7 @@ void EETest::Input() { if ( KM->isKeyUp(KEY_D) ) SP.reverseAnim( !SP.reverseAnim() ); - if ( KM->mouseRightPressed() ) + if ( KM->isMouseRightPressed() ) DrawBack = true; else DrawBack = false; @@ -1490,7 +1490,7 @@ void EETest::Input() { if ( KM->isKeyUp( KEY_P ) ) SndMng.play( "mysound" ); - if ( KM->controlPressed() && KM->isKeyUp(KEY_P) ) { + if ( KM->isControlPressed() && KM->isKeyUp(KEY_P) ) { ShowParticles = !ShowParticles; } @@ -1501,7 +1501,7 @@ void EETest::Input() { void EETest::Update() { mWindow->clear(); - et = mWindow->elapsed(); + et = mWindow->getElapsed(); Input(); @@ -1525,7 +1525,7 @@ void EETest::Update() { void EETest::Process() { Init(); - if ( NULL != mWindow && mWindow->created() ) { + if ( NULL != mWindow && mWindow->isOpen() ) { TestInstance = this; mWindow->runMainLoop( &MainLoop ); @@ -1810,10 +1810,10 @@ void EETest::PhysicsUpdate() { mMousePoint = cVectNew( KM->getMousePosf().x, KM->getMousePosf().y ); cVect newPoint = tovect( cpvlerp( tocpv( mMousePoint_last ), tocpv( mMousePoint ), 0.25 ) ); mMouseBody->pos( newPoint ); - mMouseBody->vel( ( newPoint - mMousePoint_last ) * (cpFloat)mWindow->FPS() ); + mMouseBody->vel( ( newPoint - mMousePoint_last ) * (cpFloat)mWindow->getFPS() ); mMousePoint_last = newPoint; - if ( KM->mouseLeftPressed() ) { + if ( KM->isMouseLeftPressed() ) { if ( NULL == mMouseJoint ) { cVect point = cVectNew( KM->getMousePosf().x, KM->getMousePosf().y ); diff --git a/src/test/eetest.hpp b/src/test/eetest.hpp index 9c6c01cd0..f9a93c7f2 100644 --- a/src/test/eetest.hpp +++ b/src/test/eetest.hpp @@ -36,9 +36,9 @@ class UITest : public UIControlAnim { virtual Uint32 onMouseUp( const Vector2i& Pos, const Uint32 Flags ) { UIDragable::onMouseUp( Pos, Flags ); - if ( Engine::instance()->getCurrentWindow()->getInput()->mouseWheelUp() ) + if ( Engine::instance()->getCurrentWindow()->getInput()->mouseWheelScrolledUp() ) scale( scale() + 0.1f ); - else if ( Engine::instance()->getCurrentWindow()->getInput()->mouseWheelDown() ) + else if ( Engine::instance()->getCurrentWindow()->getInput()->mouseWheelScrolledDown() ) scale( scale() - 0.1f ); return 1;