Okay, still some bugs, but everything builds again...

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402629
This commit is contained in:
Sam Lantinga 2007-08-18 05:39:09 +00:00
parent 2e91636dda
commit cf548d0a6b
23 changed files with 604 additions and 676 deletions

View file

@ -253,7 +253,7 @@ void
MoveSprite(SDL_Surface * screen, SDL_Surface * light)
{
SDL_Rect updates[2];
int alpha;
Uint8 alpha;
/* Erase the sprite if it was visible */
if (sprite_visible) {
@ -290,10 +290,10 @@ MoveSprite(SDL_Surface * screen, SDL_Surface * light)
}
/* Update transparency (fade in and out) */
alpha = sprite->format->alpha;
if ((alpha + alpha_vel) < 0) {
SDL_GetSurfaceAlphaMod(sprite, &alpha);
if (((int) alpha + alpha_vel) < 0) {
alpha_vel = -alpha_vel;
} else if ((alpha + alpha_vel) > 255) {
} else if (((int) alpha + alpha_vel) > 255) {
alpha_vel = -alpha_vel;
}
SDL_SetAlpha(sprite, SDL_SRCALPHA, (Uint8) (alpha + alpha_vel));

View file

@ -91,9 +91,6 @@ output_surface_details(const char *name, SDL_Surface * surface)
printf(" depth : %d bits per pixel\n",
surface->format->BitsPerPixel);
printf(" pitch : %d\n", (int) surface->pitch);
printf(" alpha : %d\n", (int) surface->format->alpha);
printf(" colorkey : 0x%X\n",
(unsigned int) surface->format->colorkey);
printf(" red bits : 0x%08X mask, %d shift, %d loss\n",
(int) surface->format->Rmask,
@ -216,8 +213,10 @@ setup_test(int argc, char **argv)
Uint32 origdstalphaflags = 0;
Uint32 srcalphaflags = 0;
Uint32 dstalphaflags = 0;
int srcalpha = 255;
int dstalpha = 255;
Uint8 origsrcalpha = 255;
Uint8 origdstalpha = 255;
Uint8 srcalpha = 255;
Uint8 dstalpha = 255;
int screenSurface = 0;
int i = 0;
@ -313,8 +312,10 @@ setup_test(int argc, char **argv)
(dest->flags & SDL_SRCALPHA) | (dest->flags & SDL_RLEACCEL);
origsrcalphaflags = srcalphaflags;
origdstalphaflags = dstalphaflags;
srcalpha = src->format->alpha;
dstalpha = dest->format->alpha;
SDL_GetSurfaceAlphaMod(src, &srcalpha);
SDL_GetSurfaceAlphaMod(dest, &dstalpha);
origsrcalpha = srcalpha;
origdstalpha = dstalpha;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
@ -339,12 +340,10 @@ setup_test(int argc, char **argv)
else if (strcmp(arg, "--dstnorleaccel") == 0)
dstalphaflags &= ~SDL_RLEACCEL;
}
if ((dstalphaflags != origdstalphaflags)
|| (dstalpha != dest->format->alpha))
SDL_SetAlpha(dest, dstalphaflags, (Uint8) dstalpha);
if ((srcalphaflags != origsrcalphaflags)
|| (srcalpha != src->format->alpha))
SDL_SetAlpha(src, srcalphaflags, (Uint8) srcalpha);
if ((dstalphaflags != origdstalphaflags) || (origdstalpha != dstalpha))
SDL_SetAlpha(dest, dstalphaflags, dstalpha);
if ((srcalphaflags != origsrcalphaflags) || (origsrcalpha != srcalpha))
SDL_SetAlpha(src, srcalphaflags, srcalpha);
/* set some sane defaults so we can see if the blit code is broken... */
SDL_FillRect(dest, NULL, SDL_MapRGB(dest->format, 0, 0, 0));

View file

@ -201,7 +201,7 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord)
/* Save the alpha blending attributes */
saved_flags = surface->flags & (SDL_SRCALPHA | SDL_RLEACCELOK);
saved_alpha = surface->format->alpha;
SDL_GetSurfaceAlphaMod(surface, &saved_alpha);
if ((saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA) {
SDL_SetAlpha(surface, 0, 0);
}

View file

@ -487,8 +487,6 @@ main(int argc, char **argv)
format.Gloss = 0;
format.Bloss = 0;
format.Aloss = 8;
format.colorkey = 0;
format.alpha = 0;
newsurf = SDL_ConvertSurface(pic, &format, SDL_SWSURFACE);
if (!newsurf) {

View file

@ -521,8 +521,6 @@ main(int argc, char **argv)
format.Gloss = 0;
format.Bloss = 0;
format.Aloss = 8;
format.colorkey = 0;
format.alpha = 0;
newsurf =
SDL_ConvertSurface(MooseFrame[i], &format, SDL_SWSURFACE);