forked from ImortisInglorian/fbrtLib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcon_print_raw_uni.bi
28 lines (22 loc) · 899 Bytes
/
con_print_raw_uni.bi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/' print raw data - no interpretation is done '/
extern "C"
sub FB_CONPRINTRAW_( handle as fb_ConHooks ptr, pachText as FB_TCHAR ptr, textLength as size_t )
dim as fb_Rect ptr pBorder = @handle->Border
dim as fb_Coord ptr pCoord = @handle->Coord
while ( textLength <> 0 )
dim as size_t remainingWidth = pBorder->Right - pCoord->X + 1
dim as size_t copySize = iif(textLength > remainingWidth, remainingWidth, textLength)
fb_hConCheckScroll( handle )
if ( handle->FB_CON_HOOK_TWRITE( handle, cast(ubyte const ptr, pachText),copySize ) <> TRUE ) then
exit while
end if
textLength -= copySize
FB_TCHAR_ADVANCE( pachText, copySize )
pCoord->X += copySize
if ( pCoord->X = (pBorder->Right + 1) ) then
pCoord->X = pBorder->Left
pCoord->Y += 1
end if
wend
end sub
end extern