From: Laszlo T. <ave...@us...> - 2005-04-09 19:13:53
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/SDLVideo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18718/plugins/SDLVideo Modified Files: SDLVideoDriver.cpp SDLVideoDriver.h Log Message: Added ENABLEOFFSCREENAI stat (at the right slot) Rewritten actor queueing (for scripting/display) Added new animation type for AHRS/ACOW Added Video::SetFadeColor (not yet useful) Added SetDoorLocked, SetGlobalTint actions, fixed Extra proficiency related actions in PST, fixed item handling when it enters inventory (ACQUIRED bit) Fixed area rendering when FogOfWar=0 Index: SDLVideoDriver.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/SDLVideo/SDLVideoDriver.h,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** SDLVideoDriver.h 1 Apr 2005 18:48:25 -0000 1.45 --- SDLVideoDriver.h 9 Apr 2005 19:13:44 -0000 1.46 *************** *** 39,42 **** --- 39,43 ---- short mouseAdjustX[3], mouseAdjustY[3]; unsigned short CursorIndex; + Color fadeColor; int fadePercent; unsigned long lastTime; *************** *** 116,119 **** --- 117,121 ---- //Point* points, int count, Color& color, Region& BBox); + void SetFadeColor(int r, int g, int b); void SetFadePercent(int percent); Index: SDLVideoDriver.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/SDLVideo/SDLVideoDriver.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** SDLVideoDriver.cpp 3 Apr 2005 21:00:07 -0000 1.101 --- SDLVideoDriver.cpp 9 Apr 2005 19:13:43 -0000 1.102 *************** *** 292,297 **** SDL_BlitSurface( backBuf, NULL, disp, NULL ); if (fadePercent) { ! //printf("Fade Percent = %d%%\n", fadePercent); ! SDL_SetAlpha( extra, SDL_SRCALPHA, ( 255 * fadePercent ) / 100 ); SDL_Rect src = { 0, 0, Viewport.w, Viewport.h --- 292,296 ---- SDL_BlitSurface( backBuf, NULL, disp, NULL ); if (fadePercent) { ! SDL_SetAlpha( extra, SDL_SRCALPHA, fadePercent ); SDL_Rect src = { 0, 0, Viewport.w, Viewport.h *************** *** 376,385 **** spr->Width = w; spr->Height = h; - /* - if (bpp == 8) { - spr->palette = ( Color * ) malloc( 256 * sizeof( Color ) ); - memcpy( spr->palette, palette, 256 * sizeof( Color ) ); - } - */ return spr; } --- 375,378 ---- *************** *** 395,403 **** free( spr->pixels ); } - /* - if (spr->palette) { - free( spr->palette ); - } - */ delete( spr ); spr = NULL; --- 388,391 ---- *************** *** 706,734 **** void SDLVideoDriver::DrawRect(Region& rgn, Color& color, bool fill, bool clipped) { - /*SDL_Surface * rectsurf = SDL_CreateRGBSurface(SDL_HWSURFACE, rgn.w, rgn.h, 8, 0,0,0,0); - SDL_Color pal[2]; - pal[0].r = color.r; - pal[0].g = color.g; - pal[0].b = color.b; - pal[0].unused = color.a; - pal[1].r = 0; - pal[1].g = 0; - pal[1].b = 0; - pal[1].unused = 0; - SDL_SetPalette(rectsurf, SDL_LOGPAL, pal, 0, 2); - SDL_Rect drect = {0,0,rgn.w, rgn.h}; - SDL_FillRect(rectsurf, &drect, 1); - drect.x = rgn.x; - drect.y = rgn.y; - if(color.a != 0) - SDL_SetAlpha(rectsurf, SDL_SRCALPHA | SDL_RLEACCEL, 128); - SDL_BlitSurface(rectsurf, NULL, disp, &drect); - SDL_FreeSurface(rectsurf);*/ SDL_Rect drect = { rgn.x, rgn.y, rgn.w, rgn.h }; if (fill) { - // long val = SDL_MapRGBA( backBuf->format, color.r, color.g, color.b, color.a ); - // SDL_FillRect( backBuf, &drect, val ); if ( SDL_ALPHA_TRANSPARENT == color.a ) { return; --- 694,701 ---- *************** *** 1175,1193 **** } Color* pal = ( Color* ) malloc( 256 * sizeof( Color ) ); ! /* ! if (spr->palette) { ! for (int i = 0; i < 256; i++) { ! pal[i].r = spr->palette[i].r; ! pal[i].g = spr->palette[i].g; ! pal[i].b = spr->palette[i].b; ! } ! } else { ! */ ! for (int i = 0; i < s->format->palette->ncolors; i++) { ! pal[i].r = s->format->palette->colors[i].r; ! pal[i].g = s->format->palette->colors[i].g; ! pal[i].b = s->format->palette->colors[i].b; ! } ! // } return pal; } --- 1142,1150 ---- } Color* pal = ( Color* ) malloc( 256 * sizeof( Color ) ); ! for (int i = 0; i < s->format->palette->ncolors; i++) { ! pal[i].r = s->format->palette->colors[i].r; ! pal[i].g = s->format->palette->colors[i].g; ! pal[i].b = s->format->palette->colors[i].b; ! } return pal; } *************** *** 1296,1305 **** } sprite->pixels = pixels; - /* - if ( sprite->palette) { - free (sprite->palette); - } - sprite->palette = NULL; - */ SDL_UnlockSurface (surf); SDL_FreeSurface (surf); --- 1253,1256 ---- *************** *** 1308,1314 **** } void SDLVideoDriver::SetFadePercent(int percent) { ! fadePercent = percent; } --- 1259,1280 ---- } + void SDLVideoDriver::SetFadeColor(int r, int g, int b) + { + if (r>255) r=255; + else if(r<0) r=0; + fadeColor.r=r; + if (g>255) g=255; + else if(g<0) g=0; + fadeColor.g=g; + if (b>255) b=255; + else if(b<0) b=0; + fadeColor.b=b; + } + void SDLVideoDriver::SetFadePercent(int percent) { ! if (percent>100) percent = 100; ! else if (percent<0) percent = 0; ! fadePercent = (255 * percent ) / 100; } |