X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_basic.pas;h=01a27b05ef21ccb9dcd247b8ce654884afce96c0;hb=f9af3a48743f80e9095082f9d8156d60b62f6b29;hp=eba4094cb147133a49a42269fc4da56cb5b63287;hpb=eaa064a99153a9a37af6ff8abe8d105d5c307c85;p=d2df-sdl.git diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas index eba4094..01a27b0 100644 --- a/src/game/g_basic.pas +++ b/src/game/g_basic.pas @@ -2,8 +2,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -89,7 +88,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 +1175,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.