Browse Source

Ein paar methoden hinzugefügt

kolja 6 years ago
parent
commit
bb98428ec0
4 changed files with 47 additions and 10 deletions
  1. 8 0
      MausEreignis.cpp
  2. 7 0
      MausEreignis.h
  3. 19 0
      Textur2D.cpp
  4. 13 10
      Textur2D.h

+ 8 - 0
MausEreignis.cpp

@@ -1,8 +1,16 @@
 #include "MausEreignis.h"
+#include "Fenster.h"
 
 using namespace Framework;
 
 bool Framework::_ret1ME( void *param, void *obj, MausEreignis me )
 {
     return 1;
+}
+
+bool Framework::_closeFensterME( void *param, void *obj, MausEreignis me )
+{
+    if( me.id == ME_RLinks )
+        ( (Fenster*)obj )->removeStyle( Fenster::Style::Sichtbar );
+    return 1;
 }

+ 7 - 0
MausEreignis.h

@@ -65,6 +65,13 @@ namespace Framework
     //  return: (true), wenn aufrufende Zeichnung das Ereignis weiterverarbeiten soll. (false) sonnst.
     // Gibt immer (true) zurück
     __declspec( dllexport ) bool _ret1ME( void *param, void *obj, MausEreignis me );
+    // Standart Maus Ereinis Rückruffunktion
+    //  param: Ein beliebiger Parameter
+    //  obj: Die Zeichnung, welches diese Funktion aufruft
+    //  te: Das Mausereignis, welches verarbeitet werden soll
+    //  return: (true), wenn aufrufende Zeichnung das Ereignis weiterverarbeiten soll. (false) sonnst.
+    // Gibt immer (true) zurück und schlüißt das Fenster, welches es aufgerufen hat (darf nur auf Fenstern gesetzt werden)
+    __declspec( dllexport ) bool _closeFensterME( void *param, void *obj, MausEreignis me );
 }
 
 #endif

+ 19 - 0
Textur2D.cpp

@@ -51,6 +51,25 @@ void Textur2D::addAnimationZ( Animation2DData *textur )
     animData->add( new Animation{ textur, 0, 0 } );
 }
 
+// setzt die aktuelle Annimation
+//  index: Der Index der Animation
+void Textur2D::setAnimation( int index )
+{
+    if( animationIndex == index )
+        return;
+    if( animationIndex != -1 )
+    {
+        animData->get( animationIndex )->jetzt = 0;
+        animData->get( animationIndex )->ausgleich = 0;
+    }
+    animationIndex = index;
+    int anz = animData->getEintragAnzahl();
+    if( animationIndex >= anz && ( !circularAnimation || anz == 0 ) )
+        animationIndex = -1;
+    else if( animationIndex >= anz )
+        animationIndex = 0;
+}
+
 // aktiviert die nachfolgende animation
 void Textur2D::nextAnimation()
 {

+ 13 - 10
Textur2D.h

@@ -24,29 +24,32 @@ namespace Framework
 
     public:
         // Konstructor
-        Textur2D();
+        __declspec( dllexport ) Textur2D();
         // Destructor
-        ~Textur2D();
+        __declspec( dllexport ) ~Textur2D();
         // Legt fest, ob die animation sich automatisch wiederhohlen soll
         //  ca: 1, falls sich die animation automatisch wiederhohlen soll
-        void setCircularAnimation( bool ca );
+        __declspec( dllexport ) void setCircularAnimation( bool ca );
         // setzt einen Zeiger auf die Textur (fals nicht animiert)
         //  textur: Der Zeiger auf das Bild
-        void setTexturZ( Bild *textur );
+        __declspec( dllexport ) void setTexturZ( Bild *textur );
         // fügt eine Animation hinzu
         //  textur: Der Zeiger auf die Animationsdaten
-        void addAnimationZ( Animation2DData *textur );
+        __declspec( dllexport ) void addAnimationZ( Animation2DData *textur );
+        // setzt die aktuelle Annimation
+        //  index: Der Index der Animation
+        __declspec( dllexport ) void setAnimation( int index );
         // aktiviert die nachfolgende animation
-        void nextAnimation();
+        __declspec( dllexport ) void nextAnimation();
         // setzt die vergangene Zeit seit dem letzten Aufruf
         //  t: die vergangene Zeit in sekunden
-        bool tick( double t );
+        __declspec( dllexport ) bool tick( double t );
         // gibt die aktuelle Textur zurück
-        Bild *zTextur() const;
+        __declspec( dllexport ) Bild *zTextur() const;
         // erhöht den Reference Counter um 1 und gibt this zurück
-        Textur2D *getThis();
+        __declspec( dllexport ) Textur2D *getThis();
         // verringert den reference counter um 1 und löscht sich selbst, falls er 0 erreicht
         //  gibt 0 zurück
-        Textur2D *release();
+        __declspec( dllexport ) Textur2D *release();
     };
 }