X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_basic.pas;h=01a27b05ef21ccb9dcd247b8ce654884afce96c0;hb=987c4a835a103345b59937e8e1be8524a6228712;hp=e5ef3d9c28acdff92c10e22ddf19ef8beb635e92;hpb=d3967cf39bf31bc5573af05576457ccfce96e9ea;p=d2df-sdl.git diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas index e5ef3d9..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 @@ -90,6 +89,7 @@ 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; @@ -1180,4 +1180,14 @@ 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.