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 {$INCLUDE a_modes.inc}
17 {.$MODE OBJFPC}
20 interface
35 // get last line
37 // move one line up; `sp` and `ep` MUST be valid values from previous call to `cbufLastLine()`
42 var
46 implementation
49 // ////////////////////////////////////////////////////////////////////////// //
50 //const ConBufSize = 64;
53 // each line in buffer ends with '\n'; we don't keep offsets or lengthes, as
54 // it's fairly easy to search in buffer, and drawing console is not a common
55 // thing, so it doesn't have to be superfast.
56 var
66 // ////////////////////////////////////////////////////////////////////////// //
67 var
71 var
74 begin
76 begin
78 begin
80 begin
89 begin
95 begin
96 // we have to make some room; delete top line for this
98 begin
112 begin
117 // ////////////////////////////////////////////////////////////////////////// //
118 // warning! don't modify conbuf while the range is active!
127 // ////////////////////////////////////////////////////////////////////////// //
129 var
131 begin
133 begin
136 exit;
141 begin
151 var
153 begin
156 if (pos = cbufhead) or (cbuf[pos] <> #10) then begin sp := cbufhead; ep := cbufhead+1; result := false; exit; end;
159 begin
170 begin
179 begin