adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src Makefile.am,1.80.2.31,1.80.2.32 a


From: Alexandre Courbot <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src Makefile.am,1.80.2.31,1.80.2.32 atk_border_template.cc,1.1.2.3,1.1.2.4 image.cc,1.8.2.6,1.8.2.7
Date: Fri, 28 Jun 2002 13:25:15 -0400

Update of /cvsroot/adonthell/adonthell/src
In directory subversions:/tmp/cvs-serv24252/src

Modified Files:
      Tag: Branch_road_to_0-4
        Makefile.am atk_border_template.cc image.cc 
Log Message:
FIXED bug in pnm files loading - added endianness check


Index: Makefile.am
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Makefile.am,v
retrieving revision 1.80.2.31
retrieving revision 1.80.2.32
diff -C2 -r1.80.2.31 -r1.80.2.32
*** Makefile.am 28 Jun 2002 09:17:03 -0000      1.80.2.31
--- Makefile.am 28 Jun 2002 17:25:13 -0000      1.80.2.32
***************
*** 138,144 ****
  
  # Note: .py files are also built by this target.
! py_%_wrap.cc : py_%.i *.h
        @if test "${P_SWIG}"; then \
!          ${P_SWIG} -python -shadow ${SDL_CFLAGS} -I./ -I../ -c++ 
-make_default -o py_$*_wrap.cc $<; \
        else \
           echo "You need swig >= 1.3.10 in order to re-build this file."; \
--- 138,144 ----
  
  # Note: .py files are also built by this target.
! py_%_wrap.cc : py_%.i
        @if test "${P_SWIG}"; then \
!          ${P_SWIG} -python -shadow ${SDL_CFLAGS} -I${srcdir} -c++ 
-make_default -o py_$*_wrap.cc $<; \
        else \
           echo "You need swig >= 1.3.10 in order to re-build this file."; \

Index: atk_border_template.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/atk_border_template.cc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** atk_border_template.cc      28 Jun 2002 09:17:03 -0000      1.1.2.3
--- atk_border_template.cc      28 Jun 2002 17:25:13 -0000      1.1.2.4
***************
*** 102,106 ****
  {
    image * img = new image;
!   if ( img->load_pnm (filename) < 0)
      std::cout << "Error on load image " << filename <<  " in 
atk_border_template::set \n"; 
    set (type, img); 
--- 102,106 ----
  {
    image * img = new image;
!   if ( img->load_pnm (filename) != 0)
      std::cout << "Error on load image " << filename <<  " in 
atk_border_template::set \n"; 
    set (type, img); 

Index: image.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/image.cc,v
retrieving revision 1.8.2.6
retrieving revision 1.8.2.7
diff -C2 -r1.8.2.6 -r1.8.2.7
*** image.cc    25 Jun 2002 14:11:22 -0000      1.8.2.6
--- image.cc    28 Jun 2002 17:25:13 -0000      1.8.2.7
***************
*** 23,29 ****
--- 23,42 ----
   */
   
+ #include <SDL/SDL_endian.h>
  #include "image.h"
  #include "pnm.h"
  
+ #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ #define R_MASK 0x00ff0000
+ #define G_MASK 0x0000ff00
+ #define B_MASK 0x000000ff
+ #define A_MASK 0xff000000
+ #else
+ #define R_MASK 0x000000ff
+ #define G_MASK 0x0000ff00
+ #define B_MASK 0x00ff0000
+ #define A_MASK 0xff000000
+ #endif
+ 
  using std::string; 
  
***************
*** 358,367 ****
      set_length (l);
      set_height (h);
!    
      SDL_Surface *tmp2 = SDL_CreateRGBSurfaceFrom (rawdata, length (),
                                                    height (), 24,
                                                    length () * 3,
!                                                   0x0000FF, 0x00FF00,
!                                                   0xFF0000, 0);
  
      // We have to downscale to 16bpp in order for the masking to 
--- 371,383 ----
      set_length (l);
      set_height (h);
! 
      SDL_Surface *tmp2 = SDL_CreateRGBSurfaceFrom (rawdata, length (),
                                                    height (), 24,
                                                    length () * 3,
!                                                   R_MASK, G_MASK,
!                                                   B_MASK, 0);
! 
!     draw(0, 0);
! 
  
      // We have to downscale to 16bpp in order for the masking to 
***************
*** 375,379 ****
      SDL_FreeSurface(tmp2);
  
!     raw2display(tmp4->pixels, length(), height());
      SDL_FreeSurface(tmp4);
  }
--- 391,395 ----
      SDL_FreeSurface(tmp2);
  
!     vis = SDL_DisplayFormat (tmp4);
      SDL_FreeSurface(tmp4);
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]