1950 end; |
1951 end; |
1951 |
1952 |
1952 procedure SetAmmoTexts(ammoType: TAmmoType; name: ansistring; caption: ansistring; description: ansistring); |
1953 procedure SetAmmoTexts(ammoType: TAmmoType; name: ansistring; caption: ansistring; description: ansistring); |
1953 var |
1954 var |
1954 ammoStrId: TAmmoStrId; |
1955 ammoStrId: TAmmoStrId; |
|
1956 ammoStr: ansistring; |
|
1957 tmpsurf: PSDL_Surface; |
1955 begin |
1958 begin |
1956 ammoStrId := Ammoz[ammoType].NameId; |
1959 ammoStrId := Ammoz[ammoType].NameId; |
|
1960 |
1957 trluaammo[ammoStrId] := name; |
1961 trluaammo[ammoStrId] := name; |
|
1962 if length(trluaammo[ammoStrId]) > 0 then |
|
1963 ammoStr:= trluaammo[ammoStrId] |
|
1964 else |
|
1965 ammoStr:= trammo[ammoStrId]; |
|
1966 |
|
1967 if checkFails(length(ammoStr) > 0,'No default text/translation found for ammo type #' + intToStr(ord(ammoType)) + '!',true) then exit; |
|
1968 |
|
1969 tmpsurf:= TTF_RenderUTF8_Blended(Fontz[CheckCJKFont(ammoStr,fnt16)].Handle, PChar(ammoStr), cWhiteColorChannels); |
|
1970 if checkFails(tmpsurf <> nil,'Name-texture creation for ammo type #' + intToStr(ord(ammoType)) + ' failed!',true) then exit; |
|
1971 tmpsurf:= doSurfaceConversion(tmpsurf); |
|
1972 FreeAndNilTexture(Ammoz[ammoType].NameTex); |
|
1973 Ammoz[ammoType].NameTex:= Surface2Tex(tmpsurf, false); |
|
1974 SDL_FreeSurface(tmpsurf); |
|
1975 |
1958 trluaammoc[ammoStrId] := caption; |
1976 trluaammoc[ammoStrId] := caption; |
1959 trluaammod[ammoStrId] := description; |
1977 trluaammod[ammoStrId] := description; |
1960 end; |
1978 end; |
1961 |
1979 |
1962 procedure ShakeCamera(amount: LongInt); |
1980 procedure ShakeCamera(amount: LongInt); |