hedgewars/uTextures.pas
changeset 10017 de822cd3df3a
parent 9998 736015b847e3
child 10040 4ac87acbaed9
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
   105     fromP4: PLongWordArray;
   105     fromP4: PLongWordArray;
   106 begin
   106 begin
   107 fromP4:= Surf^.pixels;
   107 fromP4:= Surf^.pixels;
   108 for y:= 0 to Pred(Surf^.h) do
   108 for y:= 0 to Pred(Surf^.h) do
   109     begin
   109     begin
   110     for x:= 0 to Pred(Surf^.w) do 
   110     for x:= 0 to Pred(Surf^.w) do
   111         begin
   111         begin
   112         tw:= fromP4^[x];
   112         tw:= fromP4^[x];
   113         tw:= round((tw shr RShift and $FF) * RGB_LUMINANCE_RED +  
   113         tw:= round((tw shr RShift and $FF) * RGB_LUMINANCE_RED +
   114               (tw shr GShift and $FF) * RGB_LUMINANCE_GREEN + 
   114               (tw shr GShift and $FF) * RGB_LUMINANCE_GREEN +
   115               (tw shr BShift and $FF) * RGB_LUMINANCE_BLUE);
   115               (tw shr BShift and $FF) * RGB_LUMINANCE_BLUE);
   116         if tw > 255 then tw:= 255;
   116         if tw > 255 then tw:= 255;
   117         tw:= (tw and $FF shl RShift) or (tw and $FF shl BShift) or (tw and $FF shl GShift) or (fromP4^[x] and AMask);
   117         tw:= (tw and $FF shl RShift) or (tw and $FF shl BShift) or (tw and $FF shl GShift) or (fromP4^[x] and AMask);
   118         fromP4^[x]:= tw;
   118         fromP4^[x]:= tw;
   119         end;
   119         end;
   240 
   240 
   241 procedure freeModule;
   241 procedure freeModule;
   242 begin
   242 begin
   243 if TextureList <> nil then
   243 if TextureList <> nil then
   244     WriteToConsole('FIXME FIXME FIXME. App shutdown without full cleanup of texture list; read game0.log and please report this problem');
   244     WriteToConsole('FIXME FIXME FIXME. App shutdown without full cleanup of texture list; read game0.log and please report this problem');
   245     while TextureList <> nil do 
   245     while TextureList <> nil do
   246         begin
   246         begin
   247         AddFileLog('Texture not freed: width='+inttostr(LongInt(TextureList^.w))+' height='+inttostr(LongInt(TextureList^.h))+' priority='+inttostr(round(TextureList^.priority*1000)));
   247         AddFileLog('Texture not freed: width='+inttostr(LongInt(TextureList^.w))+' height='+inttostr(LongInt(TextureList^.h))+' priority='+inttostr(round(TextureList^.priority*1000)));
   248         FreeTexture(TextureList);
   248         FreeTexture(TextureList);
   249         end
   249         end
   250 end;
   250 end;