hedgewars/uStore.pas
changeset 12591 7bae1fab444b
parent 12462 4cc83b26b35c
child 12592 00b539e6115d
equal deleted inserted replaced
12590:b4b5484be651 12591:7bae1fab444b
   150     rr.w:= w;
   150     rr.w:= w;
   151     rr.h:= h;
   151     rr.h:= h;
   152 
   152 
   153     texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, RMask, GMask, BMask, AMask);
   153     texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, RMask, GMask, BMask, AMask);
   154     if not checkFails(texsurf <> nil, errmsgCreateSurface, true) then
   154     if not checkFails(texsurf <> nil, errmsgCreateSurface, true) then
   155         checkFails(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
   155         checkFails(SDL_SetColorKey(texsurf, SDL_TRUE, 0) = 0, errmsgTransparentSet, true);
   156 
   156 
   157     if not allOK then exit(nil);
   157     if not allOK then exit(nil);
   158 
   158 
   159     DrawRoundRect(@rr, cWhiteColor, cNearBlackColor, texsurf, true);
   159     DrawRoundRect(@rr, cWhiteColor, cNearBlackColor, texsurf, true);
   160 
   160 
   199         r.y:= 0;
   199         r.y:= 0;
   200         r.w:= 32;
   200         r.w:= 32;
   201         r.h:= 32;
   201         r.h:= 32;
   202         texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, r.w, r.h, 32, RMask, GMask, BMask, AMask);
   202         texsurf:= SDL_CreateRGBSurface(SDL_SWSURFACE, r.w, r.h, 32, RMask, GMask, BMask, AMask);
   203         if not checkFails(texsurf <> nil, errmsgCreateSurface, true) then
   203         if not checkFails(texsurf <> nil, errmsgCreateSurface, true) then
   204             checkFails(SDL_SetColorKey(texsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
   204             checkFails(SDL_SetColorKey(texsurf, SDL_TRUE, 0) = 0, errmsgTransparentSet, true);
   205         if not allOK then exit;
   205         if not allOK then exit;
   206 
   206 
   207         r.w:= 26;
   207         r.w:= 26;
   208         r.h:= 19;
   208         r.h:= 19;
   209 
   209 
   662         end;
   662         end;
   663 
   663 
   664     tmpsurf:= doSurfaceConversion(tmpsurf);
   664     tmpsurf:= doSurfaceConversion(tmpsurf);
   665 
   665 
   666     if (imageFlags and ifTransparent) <> 0 then
   666     if (imageFlags and ifTransparent) <> 0 then
   667         if checkFails(SDL_SetColorKey(tmpsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true) then exit;
   667         if checkFails(SDL_SetColorKey(tmpsurf, SDL_TRUE, 0) = 0, errmsgTransparentSet, true) then exit;
   668 
   668 
   669     WriteLnToConsole(msgOK + ' (' + inttostr(tmpsurf^.w) + 'x' + inttostr(tmpsurf^.h) + ')');
   669     WriteLnToConsole(msgOK + ' (' + inttostr(tmpsurf^.w) + 'x' + inttostr(tmpsurf^.h) + ')');
   670 
   670 
   671     LoadImage:= tmpsurf //Result
   671     LoadImage:= tmpsurf //Result
   672 end;
   672 end;