00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GUIROTATOR_H
00023 #define GUIROTATOR_H
00024
00025 #include "guielement.h"
00026
00033 class SdlSurface;
00034
00040 class DECLSPEC GuiRotator : public GuiElement
00041 {
00042 public:
00043 DECLSPEC GuiRotator( const SDL_Rect &r, GuiElement *p, const char *name, SdlSurface *bmp, double angle = 0 );
00050 DECLSPEC GuiRotator(TiXmlElement *el, GuiElement *p);
00051 virtual DECLSPEC ~GuiRotator();
00052
00053 virtual const char *getClassName() { return "GuiRotator"; }
00054
00055 DECLSPEC void setAngleSpeed( double a, double speed );
00056 DECLSPEC void setAngle( double a );
00057 DECLSPEC void setSpeed( double speed );
00058 void setBmp( SdlSurface *s ) { sBmp = s; }
00059
00060 double dZoom;
00061 bool bSmooth;
00062
00063 static void newguiobject(void *presult, BasicObject *o, void *xmldata)
00064 {
00065 GuiElement *r = new GuiRotator((TiXmlElement*)xmldata, (GuiElement*)o);
00066 *(GuiElement**)presult = r;
00067 }
00068 protected:
00069 virtual DECLSPEC Uint32 onFrame( SdlSurface *dst );
00070 virtual DECLSPEC void paintBg( SdlSurface *dst );
00071 virtual DECLSPEC void onInit();
00072
00073 private:
00074 SdlSurface *sBmp;
00075 double dAngle;
00076 double dSpeed;
00077 Uint32 nTime;
00078 };
00079
00080 #endif