ifdef some code that will never work under AmigaOS <4.0

This commit is contained in:
Chris Young 2013-01-30 18:23:48 +00:00
parent 663191791e
commit 89856f5592
5 changed files with 26 additions and 5 deletions

View File

@ -402,6 +402,7 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1) if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1)
{ {
#ifdef __amigaos4__
uint32 comptype = COMPOSITE_Src; uint32 comptype = COMPOSITE_Src;
uint32 flags = 0; uint32 flags = 0;
@ -420,9 +421,9 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
COMPTAG_OffsetY,0, COMPTAG_OffsetY,0,
COMPTAG_FriendBitMap,friendbm, COMPTAG_FriendBitMap,friendbm,
TAG_DONE); TAG_DONE);
#endif
} }
else /* do it the old-fashioned way. This is pretty slow, but probably else /* Do it the old-fashioned way. This is pretty slow, even on OS4.1 */
uses Composite() on OS4.1 anyway, so we're only saving a blit really. */
{ {
bsa.bsa_SrcX = 0; bsa.bsa_SrcX = 0;
bsa.bsa_SrcY = 0; bsa.bsa_SrcY = 0;

View File

@ -477,15 +477,19 @@ void ami_set_options(void)
tree_set_icon_dir(strdup("ENV:Sys")); tree_set_icon_dir(strdup("ENV:Sys"));
nsoption_setnull_charp(arexx_dir, (char *)strdup("Rexx")); nsoption_setnull_charp(arexx_dir, (char *)strdup("Rexx"));
nsoption_setnull_charp(arexx_startup, (char *)strdup("Startup.nsrx")); nsoption_setnull_charp(arexx_startup, (char *)strdup("Startup.nsrx"));
nsoption_setnull_charp(arexx_shutdown, (char *)strdup("Shutdown.nsrx")); nsoption_setnull_charp(arexx_shutdown, (char *)strdup("Shutdown.nsrx"));
if(!nsoption_int(window_width)) nsoption_set_int(window_width, 800); if(!nsoption_int(window_width)) nsoption_set_int(window_width, 800);
if(!nsoption_int(window_height)) nsoption_set_int(window_height, 600); if(!nsoption_int(window_height)) nsoption_set_int(window_height, 600);
#ifndef __amigaos4__
nsoption_set_bool(download_notify, false);
nsoption_set_bool(context_menu, false);
nsoption_set_bool(font_antialiasing, false);
nsoption_set_bool(truecolour_mouse_pointers, false);
#endif
} }
void ami_amiupdate(void) void ami_amiupdate(void)

View File

@ -731,12 +731,14 @@ void ami_gui_opts_open(void)
LAYOUT_SpaceOuter, TRUE, LAYOUT_SpaceOuter, TRUE,
LAYOUT_BevelStyle, BVS_GROUP, LAYOUT_BevelStyle, BVS_GROUP,
LAYOUT_Label, gadlab[GRP_OPTS_MOUSE], LAYOUT_Label, gadlab[GRP_OPTS_MOUSE],
#ifdef __amigaos4__
LAYOUT_AddChild, gow->objects[GID_OPTS_PTRTRUE] = CheckBoxObject, LAYOUT_AddChild, gow->objects[GID_OPTS_PTRTRUE] = CheckBoxObject,
GA_ID, GID_OPTS_PTRTRUE, GA_ID, GID_OPTS_PTRTRUE,
GA_RelVerify, TRUE, GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_PTRTRUE], GA_Text, gadlab[GID_OPTS_PTRTRUE],
GA_Selected, nsoption_bool(truecolour_mouse_pointers), GA_Selected, nsoption_bool(truecolour_mouse_pointers),
CheckBoxEnd, CheckBoxEnd,
#endif
LAYOUT_AddChild, gow->objects[GID_OPTS_PTROS] = CheckBoxObject, LAYOUT_AddChild, gow->objects[GID_OPTS_PTROS] = CheckBoxObject,
GA_ID, GID_OPTS_PTROS, GA_ID, GID_OPTS_PTROS,
GA_RelVerify, TRUE, GA_RelVerify, TRUE,
@ -1072,6 +1074,7 @@ void ami_gui_opts_open(void)
LABEL_Text, gadlab[GID_OPTS_FONT_MINSIZE], LABEL_Text, gadlab[GID_OPTS_FONT_MINSIZE],
LabelEnd, LabelEnd,
LayoutEnd, LayoutEnd,
#ifdef __amigaos4__
LAYOUT_AddChild,VGroupObject, LAYOUT_AddChild,VGroupObject,
LAYOUT_SpaceOuter, TRUE, LAYOUT_SpaceOuter, TRUE,
LAYOUT_BevelStyle, BVS_GROUP, LAYOUT_BevelStyle, BVS_GROUP,
@ -1083,6 +1086,7 @@ void ami_gui_opts_open(void)
GA_Selected, nsoption_bool(font_antialiasing), GA_Selected, nsoption_bool(font_antialiasing),
CheckBoxEnd, CheckBoxEnd,
LayoutEnd, LayoutEnd,
#endif
LayoutEnd, LayoutEnd,
CHILD_WeightedHeight, 0, CHILD_WeightedHeight, 0,
LayoutEnd, // page vgroup LayoutEnd, // page vgroup
@ -1207,6 +1211,7 @@ void ami_gui_opts_open(void)
GA_Text, gadlab[GID_OPTS_OVERWRITE], GA_Text, gadlab[GID_OPTS_OVERWRITE],
GA_Selected, nsoption_bool(ask_overwrite), GA_Selected, nsoption_bool(ask_overwrite),
CheckBoxEnd, CheckBoxEnd,
#ifdef __amigaos4__
LAYOUT_AddChild, gow->objects[GID_OPTS_NOTIFY] = CheckBoxObject, LAYOUT_AddChild, gow->objects[GID_OPTS_NOTIFY] = CheckBoxObject,
GA_ID, GID_OPTS_NOTIFY, GA_ID, GID_OPTS_NOTIFY,
GA_RelVerify, TRUE, GA_RelVerify, TRUE,
@ -1214,6 +1219,7 @@ void ami_gui_opts_open(void)
GA_Text, gadlab[GID_OPTS_NOTIFY], GA_Text, gadlab[GID_OPTS_NOTIFY],
GA_Selected, nsoption_bool(download_notify), GA_Selected, nsoption_bool(download_notify),
CheckBoxEnd, CheckBoxEnd,
#endif
LayoutEnd, LayoutEnd,
LAYOUT_AddChild, gow->objects[GID_OPTS_DLDIR] = GetFileObject, LAYOUT_AddChild, gow->objects[GID_OPTS_DLDIR] = GetFileObject,
GA_ID, GID_OPTS_DLDIR, GA_ID, GID_OPTS_DLDIR,
@ -1246,12 +1252,14 @@ void ami_gui_opts_open(void)
GA_Text, gadlab[GID_OPTS_CLOSE_NO_QUIT], GA_Text, gadlab[GID_OPTS_CLOSE_NO_QUIT],
GA_Selected, nsoption_bool(close_no_quit), GA_Selected, nsoption_bool(close_no_quit),
CheckBoxEnd, CheckBoxEnd,
#ifdef __amigaos4__
LAYOUT_AddChild, gow->objects[GID_OPTS_DOCKY] = CheckBoxObject, LAYOUT_AddChild, gow->objects[GID_OPTS_DOCKY] = CheckBoxObject,
GA_ID, GID_OPTS_DOCKY, GA_ID, GID_OPTS_DOCKY,
GA_RelVerify, TRUE, GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_DOCKY], GA_Text, gadlab[GID_OPTS_DOCKY],
GA_Selected, !nsoption_bool(hide_docky_icon), GA_Selected, !nsoption_bool(hide_docky_icon),
CheckBoxEnd, CheckBoxEnd,
#endif
LayoutEnd, // behaviour LayoutEnd, // behaviour
CHILD_WeightedHeight, 0, CHILD_WeightedHeight, 0,
@ -1294,12 +1302,14 @@ void ami_gui_opts_open(void)
LAYOUT_BevelStyle, BVS_GROUP, LAYOUT_BevelStyle, BVS_GROUP,
LAYOUT_Label, gadlab[GRP_OPTS_MISC], LAYOUT_Label, gadlab[GRP_OPTS_MISC],
LAYOUT_SpaceOuter, TRUE, LAYOUT_SpaceOuter, TRUE,
#ifdef __amigaos4__
LAYOUT_AddChild, gow->objects[GID_OPTS_CONTEXTMENU] = CheckBoxObject, LAYOUT_AddChild, gow->objects[GID_OPTS_CONTEXTMENU] = CheckBoxObject,
GA_ID, GID_OPTS_CONTEXTMENU, GA_ID, GID_OPTS_CONTEXTMENU,
GA_RelVerify, TRUE, GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_CONTEXTMENU], GA_Text, gadlab[GID_OPTS_CONTEXTMENU],
GA_Selected, nsoption_bool(context_menu), GA_Selected, nsoption_bool(context_menu),
CheckBoxEnd, CheckBoxEnd,
#endif
LAYOUT_AddChild, gow->objects[GID_OPTS_FASTSCROLL] = CheckBoxObject, LAYOUT_AddChild, gow->objects[GID_OPTS_FASTSCROLL] = CheckBoxObject,
GA_ID, GID_OPTS_FASTSCROLL, GA_ID, GID_OPTS_FASTSCROLL,
GA_RelVerify, TRUE, GA_RelVerify, TRUE,

View File

@ -707,6 +707,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false)) if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false))
{ {
#ifdef __amigaos4__
uint32 comptype = COMPOSITE_Src; uint32 comptype = COMPOSITE_Src;
if(!bitmap->opaque) if(!bitmap->opaque)
comptype = COMPOSITE_Src_Over_Dest; comptype = COMPOSITE_Src_Over_Dest;
@ -722,6 +723,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
COMPTAG_OffsetX,x, COMPTAG_OffsetX,x,
COMPTAG_OffsetY,y, COMPTAG_OffsetY,y,
TAG_DONE); TAG_DONE);
#endif
} }
else else
{ {
@ -871,6 +873,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba
if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false)) if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false))
{ {
#ifdef __amigaos4__
CompositeTags(COMPOSITE_Src_Over_Dest,bfbm->bm, rp->BitMap, CompositeTags(COMPOSITE_Src_Over_Dest,bfbm->bm, rp->BitMap,
COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha, COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha,
COMPTAG_DestX,bfmsg->Bounds.MinX, COMPTAG_DestX,bfmsg->Bounds.MinX,
@ -882,6 +885,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba
COMPTAG_OffsetX,xf, COMPTAG_OffsetX,xf,
COMPTAG_OffsetY,yf, COMPTAG_OffsetY,yf,
TAG_DONE); TAG_DONE);
#endif
} }
else else
{ {

View File

@ -265,6 +265,7 @@ void ami_init_mouse_pointers(void)
mouseptrobj[i] = NULL; mouseptrobj[i] = NULL;
char ptrfname[1024]; char ptrfname[1024];
#ifdef __amigaos4__
if(nsoption_bool(truecolour_mouse_pointers)) if(nsoption_bool(truecolour_mouse_pointers))
{ {
ami_get_theme_filename((char *)&ptrfname,ptrs32[i], false); ami_get_theme_filename((char *)&ptrfname,ptrs32[i], false);
@ -316,6 +317,7 @@ void ami_init_mouse_pointers(void)
} }
} }
} }
#endif
if(!mouseptrobj[i]) if(!mouseptrobj[i])
{ {