2003 var |
2003 var |
2004 ammoStrId: TAmmoStrId; |
2004 ammoStrId: TAmmoStrId; |
2005 ammoStr: ansistring; |
2005 ammoStr: ansistring; |
2006 tmpsurf: PSDL_Surface; |
2006 tmpsurf: PSDL_Surface; |
2007 begin |
2007 begin |
|
2008 if cOnlyStats then exit; |
|
2009 |
2008 ammoStrId := Ammoz[ammoType].NameId; |
2010 ammoStrId := Ammoz[ammoType].NameId; |
2009 |
2011 |
2010 trluaammo[ammoStrId] := name; |
2012 trluaammo[ammoStrId] := name; |
2011 if length(trluaammo[ammoStrId]) > 0 then |
2013 if length(trluaammo[ammoStrId]) > 0 then |
2012 ammoStr:= trluaammo[ammoStrId] |
2014 ammoStr:= trluaammo[ammoStrId] |
2013 else |
2015 else |
2014 ammoStr:= trammo[ammoStrId]; |
2016 ammoStr:= trammo[ammoStrId]; |
2015 |
2017 |
2016 if checkFails(length(ammoStr) > 0,'No default text/translation found for ammo type #' + intToStr(ord(ammoType)) + '!',true) then exit; |
2018 if checkFails(length(ammoStr) > 0,'No default text/translation found for ammo type #' + intToStr(ord(ammoType)) + '!',true) then exit; |
2017 |
2019 |
2018 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(ammoStr,fnt16)].Handle, PChar(ammoStr), cWhiteColorChannels); |
2020 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(ammoStr,fnt16)].Handle, PChar(ammoStr), cWhiteColorChannels); |
2019 if checkFails(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ammoType)) + ' failed!',true) then exit; |
2021 if checkFails(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ammoType)) + ' failed!',true) then exit; |
2020 tmpsurf:= doSurfaceConversion(tmpsurf); |
2022 tmpsurf:= doSurfaceConversion(tmpsurf); |
2021 FreeAndNilTexture(Ammoz[ammoType].NameTex); |
2023 FreeAndNilTexture(Ammoz[ammoType].NameTex); |
2022 Ammoz[ammoType].NameTex:= Surface2Tex(tmpsurf, false); |
2024 Ammoz[ammoType].NameTex:= Surface2Tex(tmpsurf, false); |