Explorar el Código

Fortschrittsbalken im Editor sind jetzt optional

Kolja Strohm hace 5 años
padre
commit
fb4a7eaa1f
Se han modificado 1 ficheros con 24 adiciones y 12 borrados
  1. 24 12
      KSGNetwork/EditorClient.cpp

+ 24 - 12
KSGNetwork/EditorClient.cpp

@@ -52,7 +52,8 @@ public:
         k->getNachrichtEncrypted( (char*)&sample, 4 );
         län = 0;
         k->getNachrichtEncrypted( (char*)&län, 8 );
-        f->setAktionAnzahl( län );
+        if( f )
+            f->setAktionAnzahl( län );
     }
     int getDaten( char *buffer, int län ) override
     {
@@ -61,7 +62,8 @@ public:
             return -1;
         k->getNachricht( buffer, l );
         this->län -= l;
-        f->aktionPlus( l );
+        if( f )
+            f->aktionPlus( l );
         return l;
     }
     void close() override
@@ -2065,13 +2067,15 @@ Framework::Bild *EditorClient::deBildLaden( Framework::Text *zDatei, Framework::
                     retB->neuBild( br, hö, 0 );
                     char *buffer = (char*)retB->getBuffer();
                     __int64 län = br * hö * 4;
-                    zF->setAktionAnzahl( län );
+                    if( zF )
+                        zF->setAktionAnzahl( län );
                     for( int i = 0, l = län > 2048 ? 2048 : (int)län; län > 0; l = län > 2048 ? 2048 : (int)län )
                     {
                         k->getNachricht( &( buffer[ i ] ), l );
                         i += l;
                         län -= l;
-                        zF->aktionPlus( l );
+                        if( zF )
+                            zF->aktionPlus( l );
                     }
                 }
             }
@@ -2249,11 +2253,13 @@ bool EditorClient::deBildSpeichern( Framework::Text *zDatei, Framework::Text *zN
                     k->sendeEncrypted( (char*)&hö, 4 );
                     char *buffer = (char*)zBild->getBuffer();
                     __int64 gr = br * hö * 4;
-                    zF->setAktionAnzahl( gr );
+                    if( zF )
+                        zF->setAktionAnzahl( gr );
                     for( int i = 0, l = gr > 2048 ? 2048 : (int)gr; gr > 0; i += l, gr -= l, l = gr > 2048 ? 2048 : (int)gr )
                     {
                         k->sende( &( buffer[ i ] ), l );
-                        zF->aktionPlus( l );
+                        if( zF )
+                            zF->aktionPlus( l );
                     }
                     k->getNachrichtEncrypted( &ret, 1 );
                 }
@@ -2740,7 +2746,8 @@ Framework::Model2DData *EditorClient::deModelLaden( Framework::Text *zDatei, Fra
                     {
                         int anz = 0;
                         k->getNachrichtEncrypted( (char*)&anz, 4 );
-                        zF->setAktionAnzahl( anz );
+                        if( zF )
+                            zF->setAktionAnzahl( anz );
                         Array< Polygon2D > *pol = new Array< Polygon2D >();
                         for( int i = 0; i < anz; i++ )
                         {
@@ -2772,7 +2779,8 @@ Framework::Model2DData *EditorClient::deModelLaden( Framework::Text *zDatei, Fra
                                 p.tKordinaten->add( t );
                             }
                             pol->add( p );
-                            zF->aktionPlus();
+                            if( zF )
+                                zF->aktionPlus();
                         }
                         Model2DData *data = new Model2DData();
                         data->erstelleModell( pol );
@@ -2912,7 +2920,8 @@ bool EditorClient::deModelSpeichern( Framework::Text *zDatei, Framework::Text *z
                     if( ret == 1 )
                     {
                         int anz = zData->polygons ? zData->polygons->getEintragAnzahl() : 0;
-                        zF->setAktionAnzahl( anz );
+                        if( zF )
+                            zF->setAktionAnzahl( anz );
                         k->sendeEncrypted( (char*)&anz, 4 );
                         for( int i = 0; i < anz; i++ )
                         {
@@ -2935,7 +2944,8 @@ bool EditorClient::deModelSpeichern( Framework::Text *zDatei, Framework::Text *z
                                 k->sendeEncrypted( (char*)&p.x, 4 );
                                 k->sendeEncrypted( (char*)&p.y, 4 );
                             }
-                            zF->aktionPlus();
+                            if( zF )
+                                zF->aktionPlus();
                         }
                         k->getNachrichtEncrypted( &ret, 1 );
                     }
@@ -3007,7 +3017,8 @@ bool EditorClient::deSoundSpeichern( Framework::Text *zDatei, Framework::Text *z
                         k->sendeEncrypted( (char*)&sample, 4 );
                         __int64 slän = zData->getDatLength();
                         k->sendeEncrypted( (char*)&slän, 8 );
-                        zF->setAktionAnzahl( slän );
+                        if( zF )
+                            zF->setAktionAnzahl( slän );
                         zData->open();
                         char *buffer = new char[ 2048 ];
                         while( slän > 0 )
@@ -3016,7 +3027,8 @@ bool EditorClient::deSoundSpeichern( Framework::Text *zDatei, Framework::Text *z
                             zData->getDaten( buffer, l );
                             k->sende( buffer, l );
                             slän -= l;
-                            zF->aktionPlus( l );
+                            if( zF )
+                                zF->aktionPlus( l );
                         }
                         delete[] buffer;
                         zData->close();