Compared files  

Left
C:\SDK\wxWidgets-2.6.2\contrib\src\animate\animate.cpp
Last modified2005-05-31 22:46:42.001 +0200
Size16.3 Kb (676 Lines)
EncodingLatin 1 - ANSI (CP1252) default
Right
C:\SDK\wxWidgets-2.6.3\contrib\src\animate\animate.cpp
Last modified2006-01-24 14:43:36.001 +0100
Size16 Kb (666 Lines)
EncodingLatin 1 - ANSI (CP1252) default


   Comparison Statistics  

Detailed Statistics

All Changes
 BlocksLines
Unchanged25600
Inserted48
Deleted55
Ignored00
Changed15129



   Comparison Details  

3 skipped lines
4 4 // Author:      Julian Smart and Guillermo Rodriguez Garcia
5 5 // Modified by:
6 6 // Created:     13/8/99
7 // RCS-ID:      $Id: animate.cpp,v 1.11 2005/05/23 23:51:06 RD Exp $ 7 // RCS-ID:      $Id: animate.cpp,v 1.11.2.1 2006/01/23 07:19:35 vell Exp $
8 8 // Copyright:   (c) Julian Smart and Guillermo Rodriguez Garcia
9 9 // Licence:     wxWindows licence
10 10 ///////////////////////////////////////////////////////////////////////////////
8 skipped lines
19 19   #pragma hdrstop
20 20 #endif  //__BORLANDC__
21 21  
  22 #include "wx/log.h"
22 23 #include "wx/wfstream.h"
23 24 #include "wx/image.h"
24 25 #include "wx/gifdecod.h"
25 #include "wx/log.h"  
26 26 #include "wx/dcmemory.h"
27 #include "wx/animate/animate.h"  
28 27 #include "wx/dc.h"
29 28 #include "wx/dcclient.h"
  29 #include "wx/animate/animate.h"
30 30  
31 31 /*
32 32  * wxAnimationPlayer
70 skipped lines
103 103 bool wxAnimationPlayer::Build()
104 104 {
105 105     ClearCache();
106     if (m_animation) 106     if (!m_animation)
  107         return false;
  108  
  109     int i, n;
  110  
  111     n = GetFrameCount();
  112     for (i = 0; i < n; i++)
107 113     {
108         int n = GetFrameCount();  
109         int i;  
110         for (i = 0; i < n; i++)  
111         {  
112             wxImage* image = GetFrame(i); 114         wxImage* image = GetFrame(i);
113             if (image) 115         if (image == NULL)
114             {  
115                 // If the frame has transparency,  
116                 // set the colour so converting to a bitmap  
117                 // will create a mask  
118                 wxColour transparentColour;  
119                 if (GetTransparentColour(transparentColour))  
120                     image->SetMaskColour(transparentColour.Red(), transparentColour.Green(), transparentColour.Blue()); 116             return false;
121 117  
  118         // If the frame has transparency,
  119         // set the colour so converting to a bitmap
  120         // will create a mask
  121         wxColour transparentColour;
  122         if (GetTransparentColour(transparentColour))
  123             image->SetMaskColour(transparentColour.Red(), transparentColour.Green(), transparentColour.Blue());
  124  
122                 wxBitmap* bitmap = new wxBitmap(* image); 125         wxBitmap* bitmap = new wxBitmap(*image);
123                 delete image; 126         delete image;
124                 if (bitmap) 127         if (bitmap == NULL)
  128             return false;
  129  
125                     m_frames.Append(bitmap); 130         m_frames.Append(bitmap);
126                 else  
127                     return FALSE;  
128             }  
129             else  
130                 return FALSE;  
131         }  
132         return TRUE;  
133 131     }
134     else 132  
135         return FALSE; 133     return true;
136 134 }
137 135  
138 136 // Stop the animation
10 skipped lines
149 147     dc.DrawBitmap(m_backingStore, m_position.x, m_position.y);
150 148 }
151 149  
152    
153 150 int wxAnimationPlayer::GetFrameCount() const
154 151 {
155 152     if (m_animation)
312 skipped lines
468 465  
469 466     int i = m_decoder->GetBackgroundColour();
470 467     if (i == -1)
471         return FALSE; 468         return false;
472     else  
473     {  
474         unsigned char* pal = m_decoder->GetPalette();  
475 469  
  470     const unsigned char *pal = m_decoder->GetPalette();
476         if (pal) 471     bool result = (pal != NULL);
477         { 472  
  473     if (result)
478             col = wxColour(pal[3*i + 0], pal[3*i + 1], pal[3*i + 2]); 474         col = wxColour(pal[3*i + 0], pal[3*i + 1], pal[3*i + 2]);
479             return TRUE; 475  
480         }  
481         else  
482             return FALSE; 476     return result;
483     }  
484 477 }
485 478  
486 479 bool wxGIFAnimation::GetTransparentColour(wxColour& col) const
2 skipped lines
489 482  
490 483     int i = m_decoder->GetTransparentColour();
491 484     if (i == -1)
492         return FALSE; 485         return false;
493     else  
494     {  
495         unsigned char* pal = m_decoder->GetPalette();  
496 486  
  487     const unsigned char *pal = m_decoder->GetPalette();
497         if (pal) 488     bool result = (pal != NULL);
498         { 489  
  490     if (result)
499             col = wxColour(pal[3*i + 0], pal[3*i + 1], pal[3*i + 2]); 491         col = wxColour(pal[3*i + 0], pal[3*i + 1], pal[3*i + 2]);
500             return TRUE; 492  
501         }  
502         else  
503             return FALSE; 493     return result;
504     }  
505 494 }
506 495  
507 496 bool wxGIFAnimation::IsValid() const
3 skipped lines
511 500  
512 501 bool wxGIFAnimation::LoadFile(const wxString& filename)
513 502 {
  503     if (!wxFileExists(filename))
  504         return false;
  505  
  506     bool result = true;
  507  
514 508     if (m_decoder)
  509     {
515 510         delete m_decoder;
516     m_decoder = NULL; 511         m_decoder = NULL;
  512     }
517 513  
518     if (wxFileExists(filename))  
519 514     {
520 515         wxFileInputStream stream(filename);
521         m_decoder = new wxGIFDecoder(& stream, TRUE);  
522 516  
523         if (m_decoder->ReadGIF() != wxGIF_OK) 517         if (stream.GetLength() > 0)
524         {  
525             delete m_decoder;  
526             m_decoder = NULL; 518             m_decoder = new wxGIFDecoder(&stream, true);
527             return FALSE;  
528         }  
529 519  
530         if (!m_decoder->IsAnimation()) 520         result = ((m_decoder != NULL) && (m_decoder->ReadGIF() == wxGIF_OK));
531         { 521         if (result)
532             delete m_decoder; 522             result = m_decoder->IsAnimation();
533             m_decoder = NULL; 523     }
534 524  
535             return FALSE; 525     if (!result && (m_decoder != NULL))
536         } 526     {
537         else 527         delete m_decoder;
538             return TRUE; 528         m_decoder = NULL;
539 529     }
540     else 530  
541         return FALSE; 531     return result;
542 532 }
543 533  
544 534 /*
23 skipped lines
568 558  
569 559     m_animationPlayer.SetCustomBackgroundColour(GetBackgroundColour());
570 560  
571     // Want to give the impression of transparency by painting 561     // give the impression of transparency by painting
572     // the parent background 562     // with the parent background
573 563 //    if (parent)
574 564 //        m_animationPlayer.UseParentBackground(TRUE);
575 565     m_animationPlayer.SetWindow(this);
101 skipped lines

   Text comparison Options  

Syntax colouring language used: C / C++
Match character case: yes.
Match line endings: no.
Match spaces

At start of lines: yes,
In middle of lines: yes,
At end of lines: yes.
Blank lines as empty lines: no.
Activate comparison algorithm
At word level: yes,
At character level: no.


   Legend  

Unchanged lineExample of unchanged line
Modified lineExample of modified line
Added lineExample of added line
Removed lineExample of removed line
Ignored lineExample of ignored line

This report has been generated by Ellié Computing Merge on 2006-09-07 15:48:02.001 +0200.
© 2005-2006 Ellié Computing http://www.elliecomputing.com. All rights reserved.