Add an option to toggle usage of a friend BitMap for our off-screen rendering buffer (OS3 only).

Defaults to OFF, which works everywhere, but can be switched on for performance benefits when using RTG.
This commit is contained in:
Chris Young 2015-08-15 16:42:52 +01:00
parent c2dd234626
commit 45171214ed
2 changed files with 15 additions and 3 deletions

View File

@ -88,4 +88,8 @@ NSOPTION_INTEGER(redraw_tile_size_y, 0)
NSOPTION_INTEGER(monitor_aspect_x, 0) NSOPTION_INTEGER(monitor_aspect_x, 0)
NSOPTION_INTEGER(monitor_aspect_y, 0) NSOPTION_INTEGER(monitor_aspect_y, 0)
NSOPTION_BOOL(accept_lang_locale, true) NSOPTION_BOOL(accept_lang_locale, true)
/* Options relevant for OS3 only */
#ifndef __amigaos4__
NSOPTION_BOOL(friend_bitmap, false)
#endif

View File

@ -122,9 +122,15 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
gg->areabuf = AllocVecTagList(AREA_SIZE, NULL); gg->areabuf = AllocVecTagList(AREA_SIZE, NULL);
gg->tmprasbuf = AllocVecTagList(width * height, NULL); gg->tmprasbuf = AllocVecTagList(width * height, NULL);
/* Friend BitMaps are weird.
* For OS4, we shouldn't use a friend BitMap here (see below).
* For OS3 AGA, we get no display blitted if we use a friend BitMap,
* however on RTG it seems to be a benefit. Hence this user-adjustable option.
*/
#ifndef __amigaos4__ #ifndef __amigaos4__
/* If you're wondering why this is #ifdeffed, see the note about OS4 friend bitmaps below */ if(nsoption_bool(friend_bitmap) == true) {
friend = scrn->RastPort.BitMap; friend = scrn->RastPort.BitMap;
}
#endif #endif
if(palette_mapped == true) { if(palette_mapped == true) {
@ -133,7 +139,9 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
#ifdef __amigaos4__ #ifdef __amigaos4__
/* Screen depth is reported as 24 even when it's actually 32-bit. /* Screen depth is reported as 24 even when it's actually 32-bit.
* We get freezes and other problems on OS4 if we befriend at any * We get freezes and other problems on OS4 if we befriend at any
* other depths, hence this check. */ * other depths, hence this check.
* Note that this is forced on, the option is only used under OS3.
*/
if(depth >= 24) friend = scrn->RastPort.BitMap; if(depth >= 24) friend = scrn->RastPort.BitMap;
#endif #endif
gg->bm = ami_rtg_allocbitmap(width, height, 32, 0, friend, RGBFB_A8R8G8B8); gg->bm = ami_rtg_allocbitmap(width, height, 32, 0, friend, RGBFB_A8R8G8B8);