X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_basic.pas;h=bd3f50e76b3f2049e0ce6d9b41d63db4da9c8cf8;hb=47930ac73c02e76e1d4ad3a577e4015f98556eb0;hp=eba4094cb147133a49a42269fc4da56cb5b63287;hpb=eaa064a99153a9a37af6ff8abe8d105d5c307c85;p=d2df-sdl.git diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas index eba4094..bd3f50e 100644 --- a/src/game/g_basic.pas +++ b/src/game/g_basic.pas @@ -89,7 +89,8 @@ function g_SetFileTime(fileName: String; time: Integer): Boolean; procedure SortSArray(var S: SSArray); function b_Text_Format(S: string): string; function b_Text_Unformat(S: string): string; - +function b_Text_Wrap(S: string; LineLen: Integer): string; +function b_Text_LineCount(S: string): Integer; var gmon_dbg_los_enabled: Boolean = true; @@ -1175,4 +1176,19 @@ begin end; end; +function b_Text_Wrap(S: string; LineLen: Integer): string; +begin + Result := WrapText(S, ''#10, [#10, ' ', '-'], LineLen); +end; + +function b_Text_LineCount(S: string): Integer; +var + I: Integer; +begin + Result := IfThen(S = '', 0, 1); + for I := 1 to High(S) do + if S[I] = #10 then + Inc(Result); +end; + end.