adonthell-commits
[Top][All Lists]
Advanced

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

[Adonthell-commits] CVS: adonthell/src screen.cc,1.12.2.2,1.12.2.3 py_gf


From: Alexandre Courbot <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src screen.cc,1.12.2.2,1.12.2.3 py_gfx.i,1.1.2.1,1.1.2.2 image.cc,1.8.2.4,1.8.2.5 game.h,1.22.4.3,1.22.4.4
Date: Sat, 20 Apr 2002 12:54:12 -0400

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

Modified Files:
      Tag: Branch_road_to_0-4
        screen.cc py_gfx.i image.cc game.h 
Log Message:
Improved gfx module (fixed bug in image masking code, better 
screen::set_video_mode, and added drawing_area to the Python module).
Defines DATA_DIR to the current directory in game.h in case it's missing.


Index: screen.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/screen.cc,v
retrieving revision 1.12.2.2
retrieving revision 1.12.2.3
diff -C2 -r1.12.2.2 -r1.12.2.3
*** screen.cc   11 Apr 2002 14:21:00 -0000      1.12.2.2
--- screen.cc   20 Apr 2002 16:54:10 -0000      1.12.2.3
***************
*** 49,61 ****
      u_int8 bpp;
      u_int32 SDL_flags = SDL_HWSURFACE | SDL_DOUBLEBUF;
!     u_int8 emulated = depth; 
!     
      // Default video depth if none chosen.
!     if (!depth) depth = 16; 
!     
!     bpp = SDL_VideoModeOK (nl, nh, depth, SDL_flags);
  
-     if ((emulated) && (bpp) && (bpp != depth)) bpp = depth; 
-     
      switch (bpp)
      {
--- 49,61 ----
      u_int8 bpp;
      u_int32 SDL_flags = SDL_HWSURFACE | SDL_DOUBLEBUF;
!     bool emulated = false;
! 
!     bpp = SDL_VideoModeOK (nl, nh, 16, SDL_flags);
! 
      // Default video depth if none chosen.
!     if (!depth) depth = bpp; 
!     else if (depth != 16 && depth != 24) depth = 16;
!     else if (bpp != depth) emulated = true;
  
      switch (bpp)
      {
***************
*** 68,72 ****
              if (emulated) cout << "Emulating " << (u_int16) depth << "bpp 
depth in "
                                 << (u_int16) bpp << "bpp mode: " << nl << "x" 
<< nh << ".\n";
!             else cout << "Using " << (u_int16) bpp << "bpp depth: " << nl << 
"x" << nh << ".\n"; 
              bytes_per_pixel_ = bpp / 8; 
              break;
--- 68,72 ----
              if (emulated) cout << "Emulating " << (u_int16) depth << "bpp 
depth in "
                                 << (u_int16) bpp << "bpp mode: " << nl << "x" 
<< nh << ".\n";
!             else cout << "Using " << (u_int16) depth << "bpp depth: " << nl 
<< "x" << nh << ".\n"; 
              bytes_per_pixel_ = bpp / 8; 
              break;
***************
*** 78,82 ****
      display.not_screen = false; 
  
!     display.vis = SDL_SetVideoMode (nl, nh, bpp, SDL_flags);
      if (display.vis == NULL)
      {
--- 78,82 ----
      display.not_screen = false; 
  
!     display.vis = SDL_SetVideoMode (nl, nh, depth, SDL_flags);
      if (display.vis == NULL)
      {
***************
*** 84,90 ****
          exit (1);
      }
!     
      // Setting up transparency color
!     trans = SDL_MapRGB (display.vis->format, 0xFF, 0x00, 0xFF);
  
      // Setting up the window title
--- 84,90 ----
          exit (1);
      }
! 
      // Setting up transparency color
!     trans = SDL_MapRGB (display.vis->format, 0xF8, 0x00, 0xF8);
  
      // Setting up the window title

Index: py_gfx.i
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/py_gfx.i,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** py_gfx.i    11 Apr 2002 14:08:42 -0000      1.1.2.1
--- py_gfx.i    20 Apr 2002 16:54:10 -0000      1.1.2.2
***************
*** 10,13 ****
--- 10,14 ----
  %include "py_wrappers_base.i"
  
+ %include "drawing_area.h"
  %include "drawable.h"
  %include "surface.h"

Index: image.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/image.cc,v
retrieving revision 1.8.2.4
retrieving revision 1.8.2.5
diff -C2 -r1.8.2.4 -r1.8.2.5
*** image.cc    11 Apr 2002 14:08:42 -0000      1.8.2.4
--- image.cc    20 Apr 2002 16:54:10 -0000      1.8.2.5
***************
*** 26,30 ****
  #include "pnm.h"
  
- 
  using std::string; 
  
--- 26,29 ----
***************
*** 352,356 ****
  
      vis = SDL_DisplayFormat (tmp2);
!     SDL_FreeSurface (tmp2);
  }
  
--- 351,355 ----
  
      vis = SDL_DisplayFormat (tmp2);
!     SDL_FreeSurface (tmp2);    
  }
  
***************
*** 366,370 ****
                                                    0xFF0000, 0);
  
!     vis = SDL_DisplayFormat (tmp2);
!     SDL_FreeSurface (tmp2);
  }
--- 365,379 ----
                                                    0xFF0000, 0);
  
!     // We have to downscale to 16bpp in order for the masking to 
!     // perform properly. This is stupid, but that's the way it is!
!     SDL_Surface *tmp3 = SDL_CreateRGBSurface (0, 1, 1, 16, 
!                                               0xF800, 0x07E0,
!                                               0x001F, 0);
! 
!     SDL_Surface *tmp4 = SDL_ConvertSurface (tmp2, tmp3->format, 0);
!     SDL_FreeSurface(tmp3);
!     SDL_FreeSurface(tmp2);
! 
!     raw2display(tmp4->pixels, length(), height());
!     SDL_FreeSurface(tmp4);
  }

Index: game.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/game.h,v
retrieving revision 1.22.4.3
retrieving revision 1.22.4.4
diff -C2 -r1.22.4.3 -r1.22.4.4
*** game.h      4 Apr 2002 16:07:49 -0000       1.22.4.3
--- game.h      20 Apr 2002 16:54:10 -0000      1.22.4.4
***************
*** 30,33 ****
--- 30,36 ----
  #define GAME_H__
  
+ #ifndef DATA_DIR
+ #define DATA_DIR "."
+ #endif
  
  #include <string>




reply via email to

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