From 37af6b227de7446a5291376ef681e98a8846aad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Mon, 22 Jun 2015 00:37:54 +0000 Subject: [PATCH] rtl-console/amicommon/video: instead of disabling it for AROS, decide runtime based on the allocated bitmap's attributes, which rendering mode to use git-svn-id: trunk@31143 - --- packages/rtl-console/src/amicommon/video.pp | 49 ++++++++++++--------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/packages/rtl-console/src/amicommon/video.pp b/packages/rtl-console/src/amicommon/video.pp index 090e4b859a..32cf71c910 100644 --- a/packages/rtl-console/src/amicommon/video.pp +++ b/packages/rtl-console/src/amicommon/video.pp @@ -96,9 +96,7 @@ var WindowForReqSave: PWindow; Process: PProcess; -{$IFNDEF AROS} FontBitmap: PBitmap; -{$ENDIF} (* GetScreen: pScreen; @@ -227,6 +225,7 @@ var Counter, Counter2: LongInt; P: PWord; + flags: DWord; begin {$IFDEF MORPHOS} InitGraphicsLibrary; @@ -293,26 +292,39 @@ begin {$endif} end; -{$IFNDEF AROS} { Obtain Friend bitmap for font blitting } FontBitmap:=AllocBitMap(16,16*256,1,0,VideoWindow^.RPort^.Bitmap); - { We need to make the data word wide, otherwise the blit will fail - miserably on classics (tested on 3.1 + AGA) } - if FontBitmap <> nil then + if (FontBitmap <> nil) then begin - { Locking the bitmap would be better, but that requires CGFX/P96/etc specific calls } - Forbid(); - p:=PWord(FontBitmap^.Planes[0]); - for counter:=0 to 255 do - for counter2:=0 to 15 do + flags:=GetBitmapAttr(FontBitmap,BMA_FLAGS); + if (Flags and BMF_STANDARD) > 0 then + begin + {$ifdef VIDEODEBUG} + writeln('Using fontbitmap mode.'); + {$endif} + { Locking the bitmap would be better, but that requires CGFX/P96/etc specific calls } + Forbid(); + { We need to make the data word wide, otherwise the blit will fail + miserably on classics (tested on 3.1 + AGA) } + p:=PWord(FontBitmap^.Planes[0]); + for counter:=0 to 255 do + for counter2:=0 to 15 do begin p^:=vgafont[counter,counter2] shl 8; inc(p); end; - Permit(); + Permit(); + end + else + begin + {$ifdef VIDEODEBUG} + writeln('Using direct-from-fontdata mode.'); + {$endif} + FreeBitmap(FontBitmap); + FontBitmap:=nil; + end; end; -{$ENDIF} CursorX := 0; CursorY := 0; @@ -356,9 +368,7 @@ begin VideoWindow := nil; end; -{$IFNDEF AROS} FreeBitMap(FontBitmap); -{$ENDIF} {$ifdef WITHBUFFERING} FreeBitmap(BufRp^.Bitmap); @@ -439,11 +449,10 @@ begin SetABPenDrMd(rp, VideoPens[tmpBGColor], VideoPens[tmpFGColor], JAM2); end; -{$IFNDEF AROS} - BltTemplate(@(PWord(FontBitmap^.Planes[0])[tmpChar * 16]), 0, 2, rp, sX, sY, 8, 16); -{$ELSE} - BltTemplate(@Vgafont[tmpChar, 0], 0, 1, rp, sX, sY, 8, 16); -{$ENDIF} + if FontBitmap <> nil then + BltTemplate(@(PWord(FontBitmap^.Planes[0])[tmpChar * 16]), 0, 2, rp, sX, sY, 8, 16) + else + BltTemplate(@Vgafont[tmpChar, 0], 0, 1, rp, sX, sY, 8, 16); if crType = crUnderLine then begin