[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/draw/opengl pgglcore.cpp,1.1.2.9,1.1.2.10
From: |
Teunis Peters <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/draw/opengl pgglcore.cpp,1.1.2.9,1.1.2.10 pgglsurf.cpp,1.1.2.12,1.1.2.13 |
Date: |
Mon, 14 Apr 2003 05:11:53 -0400 |
Update of /cvsroot/paragui/paragui/src/draw/opengl
In directory subversions:/tmp/cvs-serv31546/src/draw/opengl
Modified Files:
Tag: devel-opengl
pgglcore.cpp pgglsurf.cpp
Log Message:
various fixes and some new ideas that look to be useful
Index: pgglcore.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglcore.cpp,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -C2 -r1.1.2.9 -r1.1.2.10
*** pgglcore.cpp 3 Feb 2003 16:40:00 -0000 1.1.2.9
--- pgglcore.cpp 14 Apr 2003 09:11:50 -0000 1.1.2.10
***************
*** 207,211 ****
for(x = 0; x < surface->w; ++x)
if(px[x] == ckey)
! px[x] = 0x00ff00ff /*0x00000000*/;
}
break;
--- 207,211 ----
for(x = 0; x < surface->w; ++x)
if(px[x] == ckey)
! px[x] = /* 0x00ff00ff */ 0x00000000;
}
break;
***************
*** 373,384 ****
int use_rgba = (src->flags & SDL_SRCCOLORKEY) ||
((src->flags & SDL_SRCALPHA) && src->format->Amask);
if (use_rgba || hasalpha)
! tmp = SDL_ConvertSurface(src, &_RGBAfmt, SDL_SWSURFACE);
else
! tmp = SDL_ConvertSurface(src, &_RGBfmt, SDL_SWSURFACE);
if (tmp == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
GLSDL_FIX_SURFACE(tmp);
SDL_SetAlpha(tmp, 0, 0);
!
if (src->flags & SDL_SRCCOLORKEY) {
/*
--- 373,386 ----
int use_rgba = (src->flags & SDL_SRCCOLORKEY) ||
((src->flags & SDL_SRCALPHA) && src->format->Amask);
+ int flags;
+ flags = SDL_SWSURFACE | SDL_SRCALPHA | SDL_RLEACCELOK | SDL_SRCCOLORKEY;
if (use_rgba || hasalpha)
! tmp = SDL_ConvertSurface(src, &_RGBAfmt, flags);
else
! tmp = SDL_ConvertSurface(src, &_RGBfmt, flags);
if (tmp == NULL) { PG_LogERR("SDL: %s", SDL_GetError()); exit(-1); }
GLSDL_FIX_SURFACE(tmp);
SDL_SetAlpha(tmp, 0, 0);
!
if (src->flags & SDL_SRCCOLORKEY) {
/*
***************
*** 412,415 ****
--- 414,422 ----
// DBG5(DBGLINE());
surf->BlitSurface(tmp, PG_Rect(), PG_Rect());
+ #if 0 /* useful testcode */
+ SDL_Color cr;
+ cr.unused = 0x7f; cr.r=0xff; cr.g=0x7f; cr.b=0x7f;
+ surf->DrawLine(0, 0, surf->GetWidth(), surf->GetHeight(), cr, 2);
+ #endif
SDL_FreeSurface(tmp); // _FreeSurface(tmp);
***************
*** 418,422 ****
/* GLSDL_FIX_SURFACE(s); */
! // PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x",
__FUNCTION__, __FILE__, __LINE__, surf->GetFormat()->BytesPerPixel,
surf->GetFormat()->Rmask, surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
DBG5(DBGFUNCEND());
return surf;
--- 425,429 ----
/* GLSDL_FIX_SURFACE(s); */
! PG_LogMSG("%s[%s:%i]: bpp %i rmask %x gmask %x bmask %x", __FUNCTION__,
__FILE__, __LINE__, surf->GetFormat()->BytesPerPixel, surf->GetFormat()->Rmask,
surf->GetFormat()->Gmask, surf->GetFormat()->Bmask);
DBG5(DBGFUNCEND());
return surf;
***************
*** 460,463 ****
--- 467,471 ----
};
#endif
+ #if 1 /* create accel surface by default? */
#if 1
PG_LogMSG("create accelerated surface from SDL(alpha=%s)",
talph?"true":"false");
***************
*** 468,471 ****
--- 476,480 ----
surf = ts;
};
+ #endif
// PG_LogDBG("ParaGUI[%s]: %s:%i accelerated surface %p", __FILE__,
__FUNCTION__, __LINE__, surface->SDL());
Index: pgglsurf.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/opengl/Attic/pgglsurf.cpp,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -C2 -r1.1.2.12 -r1.1.2.13
*** pgglsurf.cpp 27 Feb 2003 20:42:44 -0000 1.1.2.12
--- pgglsurf.cpp 14 Apr 2003 09:11:50 -0000 1.1.2.13
***************
*** 379,382 ****
--- 379,383 ----
int PG_GLDrawableSurface::SetAlpha(Uint32 flag, Uint8 alpha) {
// PG_LogDBG("opengl DrawableSurface: %s", __FUNCTION__);
+ alpha=true;
return PG_DrawableSurface::SetAlpha(flag,alpha);
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/draw/opengl pgglcore.cpp,1.1.2.9,1.1.2.10 pgglsurf.cpp,1.1.2.12,1.1.2.13,
Teunis Peters <address@hidden> <=
- Prev by Date:
[paragui-cvs] CVS: paragui TODO,1.1.1.1.2.12,1.1.1.1.2.13
- Next by Date:
[paragui-cvs] CVS: paragui/test event_bug.cpp,NONE,1.1.2.1 Makefile.am,1.2.6.12,1.2.6.13 array.cpp,1.1.2.2,1.1.2.3
- Previous by thread:
[paragui-cvs] CVS: paragui TODO,1.1.1.1.2.12,1.1.1.1.2.13
- Next by thread:
[paragui-cvs] CVS: paragui/test event_bug.cpp,NONE,1.1.2.1 Makefile.am,1.2.6.12,1.2.6.13 array.cpp,1.1.2.2,1.1.2.3
- Index(es):