paragui-cvs
[Top][All Lists]
Advanced

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

[paragui-cvs] CVS: paragui/src/draw/opengl pgglcore.cpp,1.1.2.8,1.1.2.9


From: Teunis Peters <address@hidden>
Subject: [paragui-cvs] CVS: paragui/src/draw/opengl pgglcore.cpp,1.1.2.8,1.1.2.9 pgglmem.cpp,1.1.2.4,1.1.2.5 pgglroot.cpp,1.1.2.8,1.1.2.9 pgglsurf.cpp,1.1.2.10,1.1.2.11
Date: Mon, 03 Feb 2003 11:40:02 -0500

Update of /cvsroot/paragui/paragui/src/draw/opengl
In directory subversions:/tmp/cvs-serv7702/src/draw/opengl

Modified Files:
      Tag: devel-opengl
        pgglcore.cpp pgglmem.cpp pgglroot.cpp pgglsurf.cpp 
Log Message:
updates to handle multiframe pictures - specifically for building font 
accelerations.


Index: pgglcore.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglcore.cpp,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -r1.1.2.8 -r1.1.2.9
*** pgglcore.cpp        26 Jan 2003 21:27:20 -0000      1.1.2.8
--- pgglcore.cpp        3 Feb 2003 16:40:00 -0000       1.1.2.9
***************
*** 146,152 ****
  
    /* Colorkeying requires an alpha channel! */
!   if (surface->flags & SDL_SRCCOLORKEY)
      if (!pf->Amask) goto fail;
! 
  #if 0 /* FIXED *grin* -- add in support for alignment... */  
    /* We need pitch == (width * BytesPerPixel) for glTex[Sub]Image2D() */
--- 146,154 ----
  
    /* Colorkeying requires an alpha channel! */
!   if (surface->flags & SDL_SRCCOLORKEY) {
!     DBG4(PG_LogMSG("%s:%i colourkey requires alpha!\n", __FUNCTION__, 
__LINE__));
      if (!pf->Amask) goto fail;
!   };
!   
  #if 0 /* FIXED *grin* -- add in support for alignment... */  
    /* We need pitch == (width * BytesPerPixel) for glTex[Sub]Image2D() */
***************
*** 449,456 ****
    PG_GLDrawableSurface *ts;
    bool talph = true;
  #if 1
-   talph = ((surf->GetSDLFlags() & SDL_SRCALPHA) ||
-          (surf->GetSDLFlags() & SDL_SRCCOLORKEY) ||
-          surf->GetFormat()->Amask);
    PG_LogMSG("create accelerated surface from SDL(alpha=%s)", 
talph?"true":"false");
  #endif
--- 451,464 ----
    PG_GLDrawableSurface *ts;
    bool talph = true;
+ #if 0
+   {
+     Uint32 sflg = surf->GetSDLFlags();
+     talph = false;
+     if (sflg & SDL_SRCALPHA)      talph = true;
+     if (sflg & SDL_SRCCOLORKEY)   talph = true;
+     if (surf->GetFormat()->Amask) talph = true;
+   };
+ #endif
  #if 1
    PG_LogMSG("create accelerated surface from SDL(alpha=%s)", 
talph?"true":"false");
  #endif

Index: pgglmem.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglmem.cpp,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** pgglmem.cpp 9 Nov 2002 12:00:35 -0000       1.1.2.4
--- pgglmem.cpp 3 Feb 2003 16:40:00 -0000       1.1.2.5
***************
*** 320,323 ****
--- 320,330 ----
    
    SDL_SetClipRect(surface->SDL(), &txi->virt);
+ 
+   if (surface->GetSDLFlags() & SDL_SRCCOLORKEY) {
+     surface->alpha = true; surface->colourkey = true;
+   };
+   if (surface->GetSDLFlags() & SDL_SRCALPHA) surface->alpha = true;
+   if (surface->GetFormat()->Amask) surface->alpha = true;
+ 
    DBG5(DBGFUNCEND());
    return 0;

Index: pgglroot.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglroot.cpp,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -r1.1.2.8 -r1.1.2.9
*** pgglroot.cpp        26 Jan 2003 21:27:20 -0000      1.1.2.8
--- pgglroot.cpp        3 Feb 2003 16:40:00 -0000       1.1.2.9
***************
*** 158,161 ****
--- 158,162 ----
  
  int PG_GLRootDrawableSurface::SetColorKey(Uint32 flag, Uint32 key) {
+   /* at a thought - this call is entirely inappropriate here... oh well :) */
    PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
    if (ref == NULL) ref=SDL_GetVideoSurface();

Index: pgglsurf.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglsurf.cpp,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -r1.1.2.10 -r1.1.2.11
*** pgglsurf.cpp        26 Jan 2003 21:27:20 -0000      1.1.2.10
--- pgglsurf.cpp        3 Feb 2003 16:40:00 -0000       1.1.2.11
***************
*** 54,63 ****
  
  PG_GLDrawableSurface::PG_GLDrawableSurface(PG_GLDraw* refhost)
!   : PG_DrawableSurface(), scale(1), isgrey(false), texi(0) {
    host=refhost;
  };
    /* PG_GLDrawableSurface::PG_GLDrawableSurface(SDL_Surface* s) : 
PG_DrawableSurface(s), scale(1) { host=NULL; }; */
  PG_GLDrawableSurface::PG_GLDrawableSurface(PG_GLDraw* refhost, SDL_Surface* s)
!   : PG_DrawableSurface(s), scale(1), isgrey(false), texi(0) {
    ref = s;
    host = refhost;
--- 54,63 ----
  
  PG_GLDrawableSurface::PG_GLDrawableSurface(PG_GLDraw* refhost)
!   : PG_DrawableSurface(), scale(1), isgrey(false), texi(0), alpha(false), 
colourkey(false) {
    host=refhost;
  };
    /* PG_GLDrawableSurface::PG_GLDrawableSurface(SDL_Surface* s) : 
PG_DrawableSurface(s), scale(1) { host=NULL; }; */
  PG_GLDrawableSurface::PG_GLDrawableSurface(PG_GLDraw* refhost, SDL_Surface* s)
!   : PG_DrawableSurface(s), scale(1), isgrey(false), texi(0), alpha(false), 
colourkey(false) {
    ref = s;
    host = refhost;
***************
*** 229,241 ****
    /* crashes after this... */
    // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
!   return PG_DrawableSurface::UpdateRects(numrects, rects);
  }
  
  int PG_GLDrawableSurface::SetColorKey(Uint32 flag, Uint32 key) {
!   PG_LogDBG("ParaGUI[%s]: %s:%i(%x:%x)", __FILE__, __FUNCTION__, 
__LINE__,flag,key);
    // return 0; // DEBUG
  
    int res = SDL_SetColorKey(ref, flag, key);
    if (res < 0) return res;
    /*
     * If an application does this *after* SDL_DisplayFormat,
--- 229,254 ----
    /* crashes after this... */
    // PG_LogDBG("ParaGUI[%s]: %s:%i", __FILE__, __FUNCTION__, __LINE__);
!   PG_DrawableSurface::UpdateRects(numrects, rects);
!   host->DownloadSurface(this);
  }
  
  int PG_GLDrawableSurface::SetColorKey(Uint32 flag, Uint32 key) {
!   PG_LogDBG("ParaGUI[%s]: %s:%i(%x:%08x)", __FILE__, __FUNCTION__, 
__LINE__,flag,key);
    // return 0; // DEBUG
  
+ /*
+  * Sets the color key (transparent pixel) in a blittable surface.
+  * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), 
+  * 'key' will be the transparent pixel in the source image of a blit.
+  * SDL_RLEACCEL requests RLE acceleration for the surface if present,
+  * and removes RLE acceleration if absent.
+  * If 'flag' is 0, this function clears any current color key.
+  * This function returns 0, or -1 if there was an error.
+  */
+ 
    int res = SDL_SetColorKey(ref, flag, key);
    if (res < 0) return res;
+   if (flag & SDL_SRCCOLORKEY) colourkey = true;
+   if (colourkey == true) alpha = true;
    /*
     * If an application does this *after* SDL_DisplayFormat,





reply via email to

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