1 (* Copyright (C) DooM 2D:Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 {$MODE OBJFPC}
19 interface
34 // get last line
36 // move one line up; `sp` and `ep` MUST be valid values from previous call to `cbufLastLine()`
41 var
45 implementation
48 // ////////////////////////////////////////////////////////////////////////// //
49 //const ConBufSize = 64;
52 // each line in buffer ends with '\n'; we don't keep offsets or lengthes, as
53 // it's fairly easy to search in buffer, and drawing console is not a common
54 // thing, so it doesn't have to be superfast.
55 var
65 // ////////////////////////////////////////////////////////////////////////// //
66 var
70 var
73 begin
75 begin
77 begin
79 begin
88 begin
94 begin
95 // we have to make some room; delete top line for this
97 begin
111 begin
116 // ////////////////////////////////////////////////////////////////////////// //
117 // warning! don't modify conbuf while the range is active!
126 // ////////////////////////////////////////////////////////////////////////// //
128 var
130 begin
132 begin
135 exit;
140 begin
150 var
152 begin
155 if (pos = cbufhead) or (cbuf[pos] <> #10) then begin sp := cbufhead; ep := cbufhead+1; result := false; exit; end;
158 begin
169 begin
178 begin