hedgewars/uWorld.pas
branch0.9.24
changeset 13779 c384117f90eb
parent 13174 061d55939e47
equal deleted inserted replaced
13690:09757d5aead3 13779:c384117f90eb
  1976 var
  1976 var
  1977     ammoStrId: TAmmoStrId;
  1977     ammoStrId: TAmmoStrId;
  1978     ammoStr: ansistring;
  1978     ammoStr: ansistring;
  1979     tmpsurf: PSDL_Surface;
  1979     tmpsurf: PSDL_Surface;
  1980 begin
  1980 begin
       
  1981     if cOnlyStats then exit;
       
  1982     
  1981     ammoStrId := Ammoz[ammoType].NameId;
  1983     ammoStrId := Ammoz[ammoType].NameId;
  1982 
  1984 
  1983     trluaammo[ammoStrId] := name;
  1985     trluaammo[ammoStrId] := name;
  1984     if length(trluaammo[ammoStrId]) > 0 then
  1986     if length(trluaammo[ammoStrId]) > 0 then
  1985         ammoStr:= trluaammo[ammoStrId]
  1987         ammoStr:= trluaammo[ammoStrId]
  1986     else
  1988     else
  1987         ammoStr:= trammo[ammoStrId];
  1989         ammoStr:= trammo[ammoStrId];
  1988 
  1990 
  1989     if checkFails(length(ammoStr) > 0,'No default text/translation found for ammo type #' + intToStr(ord(ammoType)) + '!',true) then exit;
  1991     if checkFails(length(ammoStr) > 0,'No default text/translation found for ammo type #' + intToStr(ord(ammoType)) + '!',true) then exit;
  1990         
  1992 
  1991     tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(ammoStr,fnt16)].Handle, PChar(ammoStr), cWhiteColorChannels);
  1993     tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(ammoStr,fnt16)].Handle, PChar(ammoStr), cWhiteColorChannels);
  1992     if checkFails(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ammoType)) + ' failed!',true) then exit;
  1994     if checkFails(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ammoType)) + ' failed!',true) then exit;
  1993     tmpsurf:= doSurfaceConversion(tmpsurf);
  1995     tmpsurf:= doSurfaceConversion(tmpsurf);
  1994     FreeAndNilTexture(Ammoz[ammoType].NameTex);
  1996     FreeAndNilTexture(Ammoz[ammoType].NameTex);
  1995     Ammoz[ammoType].NameTex:= Surface2Tex(tmpsurf, false);
  1997     Ammoz[ammoType].NameTex:= Surface2Tex(tmpsurf, false);