src/video/SDL_surface.c
changeset 7025 4eb8ac58642c
parent 7024 72cb3e205571
child 7037 3fedf1f25b94
equal deleted inserted replaced
7024:72cb3e205571 7025:4eb8ac58642c
   187     if (flag) {
   187     if (flag) {
   188         surface->map->info.flags |= SDL_COPY_COLORKEY;
   188         surface->map->info.flags |= SDL_COPY_COLORKEY;
   189         surface->map->info.colorkey = key;
   189         surface->map->info.colorkey = key;
   190         if (surface->format->palette) {
   190         if (surface->format->palette) {
   191             surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_TRANSPARENT;
   191             surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_TRANSPARENT;
       
   192             ++surface->format->palette->version;
       
   193             if (!surface->format->palette->version) {
       
   194                 surface->format->palette->version = 1;
       
   195             }
   192         }
   196         }
   193     } else {
   197     } else {
   194         if (surface->format->palette) {
   198         if (surface->format->palette) {
   195             surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_OPAQUE;
   199             surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_OPAQUE;
       
   200             ++surface->format->palette->version;
       
   201             if (!surface->format->palette->version) {
       
   202                 surface->format->palette->version = 1;
       
   203             }
   196         }
   204         }
   197         surface->map->info.flags &= ~SDL_COPY_COLORKEY;
   205         surface->map->info.flags &= ~SDL_COPY_COLORKEY;
   198     }
   206     }
   199     if (surface->map->info.flags != flags) {
   207     if (surface->map->info.flags != flags) {
   200         SDL_InvalidateMap(surface->map);
   208         SDL_InvalidateMap(surface->map);