diff -abBdpuNPr --exclude='*.svn' irrlicht-svn-ss/trunk/include/IGUISkin.h Irrlicht_starsonata/include/IGUISkin.h --- irrlicht-svn-ss/trunk/include/IGUISkin.h 2007-07-26 02:11:22.000000000 +0200 +++ Irrlicht_starsonata/include/IGUISkin.h 2008-06-04 06:23:28.000000000 +0200 @@ -382,9 +450,14 @@ namespace gui implementations to find out how to draw the part exactly. \param rect: Defining area where to draw. \param clip: Clip area. */ + // Starsonata, Micha: added flashing + //! /param flashFrequency: if not zero then use flashing with the frequency set here + //! /param u32 flashTime: when flashFrequency is not zero then this is value controls the flashing. + // The value should be between 0 and flashFrequency, but will be clipped modulated otherwise also. virtual void draw3DButtonPaneStandard(IGUIElement* element, const core::rect& rect, - const core::rect* clip=0) = 0; + const core::rect* clip=0, + u32 flashFrequency=0, u32 flashTime=0 ) = 0; //! draws a pressed 3d button pane /** Used for drawing for example buttons in pressed state. @@ -395,9 +468,14 @@ namespace gui implementations to find out how to draw the part exactly. \param rect: Defining area where to draw. \param clip: Clip area. */ + // Starsonata, Micha: added flashing + //! /param flashFrequency: if not zero then use flashing with the frequency set here + //! /param u32 flashTime: when flashFrequency is not zero then this is value controls the flashing. + // The value should be between 0 and flashFrequency, but will be clipped modulated otherwise also. virtual void draw3DButtonPanePressed(IGUIElement* element, const core::rect& rect, - const core::rect* clip=0) = 0; + const core::rect* clip=0, + u32 flashFrequency=0, u32 flashTime=0 ) = 0; //! draws a sunken 3d pane /** Used for drawing the background of edit, combo or check boxes. diff -abBdpuNPr --exclude='*.svn' irrlicht-svn-ss/trunk/source/Irrlicht/CGUISkin.cpp Irrlicht_starsonata/source/Irrlicht/CGUISkin.cpp --- irrlicht-svn-ss/trunk/source/Irrlicht/CGUISkin.cpp 2007-07-26 02:11:08.000000000 +0200 +++ Irrlicht_starsonata/source/Irrlicht/CGUISkin.cpp 2008-06-04 06:50:56.000000000 +0200 @@ -263,7 +278,8 @@ is usually not used by ISkin, but can be implementations to find out how to draw the part exactly. */ void CGUISkin::draw3DButtonPaneStandard(IGUIElement* element, const core::rect& r, - const core::rect* clip) + const core::rect* clip, + u32 flashFrequency, u32 flashTime ) { if (!Driver) return; @@ -297,12 +313,26 @@ void CGUISkin::draw3DButtonPaneStandard( if (!UseGradient) { - Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip); + video::SColor col( getColor(EGDC_3D_FACE) ); + if ( flashFrequency ) + { + flashTime = (flashTime%flashFrequency)*2; + f32 d = flashTime <= flashFrequency ? (f32)flashTime / (f32)flashFrequency : 1.f - ((f32)(flashTime-flashFrequency) / (f32)flashFrequency); + col = col.getInterpolated(getColor(EGDC_FLASH_PANE), d); + } + Driver->draw2DRectangle(col, rect, clip); } else { video::SColor c1 = getColor(EGDC_3D_FACE); video::SColor c2 = c1.getInterpolated(getColor(EGDC_3D_DARK_SHADOW), 0.4f); + if ( flashFrequency ) + { + flashTime = (flashTime%flashFrequency)*2; + f32 d = flashTime <= flashFrequency ? (f32)flashTime / (f32)flashFrequency : 1.f - ((f32)(flashTime-flashFrequency) / (f32)flashFrequency); + c1 = c1.getInterpolated(getColor(EGDC_FLASH_PANE), d); + c2 = c2.getInterpolated(getColor(EGDC_FLASH_PANE), d); + } Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip); } } @@ -319,7 +349,8 @@ is usually not used by ISkin, but can be implementations to find out how to draw the part exactly. */ void CGUISkin::draw3DButtonPanePressed(IGUIElement* element, const core::rect& r, - const core::rect* clip) + const core::rect* clip, + u32 flashFrequency, u32 flashTime) { if (!Driver) return; @@ -340,12 +371,26 @@ void CGUISkin::draw3DButtonPanePressed(I if (!UseGradient) { - Driver->draw2DRectangle(getColor(EGDC_3D_FACE), rect, clip); + video::SColor col( getColor(EGDC_3D_FACE) ); + if ( flashFrequency ) + { + flashTime = (flashTime%flashFrequency)*2; + f32 d = flashTime <= flashFrequency ? (f32)flashTime / (f32)flashFrequency : 1.f - ((f32)(flashTime-flashFrequency) / (f32)flashFrequency); + col = col.getInterpolated(getColor(EGDC_FLASH_PANE), d); + } + Driver->draw2DRectangle(col, rect, clip); } else { video::SColor c1 = getColor(EGDC_3D_FACE); video::SColor c2 = c1.getInterpolated(getColor(EGDC_3D_DARK_SHADOW), 0.4f); + if ( flashFrequency ) + { + flashTime = (flashTime%flashFrequency)*2; + f32 d = flashTime <= flashFrequency ? (f32)flashTime / (f32)flashFrequency : 1.f - ((f32)(flashTime-flashFrequency) / (f32)flashFrequency); + c1 = c1.getInterpolated(getColor(EGDC_FLASH_PANE), d); + c2 = c2.getInterpolated(getColor(EGDC_FLASH_PANE), d); + } Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip); } } diff -abBdpuNPr --exclude='*.svn' irrlicht-svn-ss/trunk/source/Irrlicht/CGUISkin.h Irrlicht_starsonata/source/Irrlicht/CGUISkin.h --- irrlicht-svn-ss/trunk/source/Irrlicht/CGUISkin.h 2007-07-26 02:11:08.000000000 +0200 +++ Irrlicht_starsonata/source/Irrlicht/CGUISkin.h 2008-05-23 00:58:52.000000000 +0200 @@ -80,9 +80,15 @@ namespace gui \param element: Pointer to the element which whiches to draw this. This parameter is usually not used by ISkin, but can be used for example by more complex implementations to find out how to draw the part exactly. */ + // Starsonata, Micha: added flashing + //! /param flashFrequency: if not zero then use flashing with the frequency set here + //! /param u32 flashTime: when flashFrequency is not zero then this is value controls the flashing. + // The value should be between 0 and flashFrequency, but will be clipped modulated otherwise also. virtual void draw3DButtonPaneStandard(IGUIElement* element, const core::rect& rect, - const core::rect* clip=0); + const core::rect* clip=0, + u32 flashFrequency=0, u32 flashTime=0 ); + //! draws a pressed 3d button pane /** Used for drawing for example buttons in pressed state. @@ -93,9 +99,14 @@ namespace gui \param element: Pointer to the element which whiches to draw this. This parameter is usually not used by ISkin, but can be used for example by more complex implementations to find out how to draw the part exactly. */ + // Starsonata, Micha: added flashing + //! /param flashFrequency: if not zero then use flashing with the frequency set here + //! /param u32 flashTime: when flashFrequency is not zero then this is value controls the flashing. + // The value should be between 0 and flashFrequency, but will be clipped modulated otherwise also. virtual void draw3DButtonPanePressed(IGUIElement* element, const core::rect& rect, - const core::rect* clip=0); + const core::rect* clip=0, + u32 flashFrequency=0, u32 flashTime=0 ); //! draws a sunken 3d pane /** Used for drawing the background of edit, combo or check boxes.