Sign in to follow this  
Guest Patrick_Waugh

2 MAKE_ICONs

Recommended Posts

I'm tryig to use two different MAKE_ICON functions in the same file. I'm making a vor gauge so I have two sets of icons:1-BMP_V1_NO_SIGNAL - 0x0590 BMP_V1_TO_FLAG - 0x0591 BMP_V1_FROM_FLAG - 0x05922-BMP_V1_NO_GS - 0x0600 BMP_V1_GS - 0x0601I can get each set of these to work separately, but when i combine them FS won't even start. Has anyone else tried to use 2 MAKE_ICONS before?MAKE_ICON( flags_gs_vor1_icon, BMP_V1_NO_GS, NULL, NULL, IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY, 0, 189, 131, MODULE_VAR_NONE, flag_gs_v1_cb, ICON_SWITCH_TYPE_STEP_TO, 2, 0, 0 ) PELEMENT_HEADER flags_gs_vor1_icon_list[] ={ (PELEMENT_HEADER)&flags_gs_vor1_icon, NULL};MAKE_ICON( flags_vor1_icon, BMP_V1_NO_SIGNAL, NULL, &flags_gs_vor1_icon_list, IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY, 0, 137, 206, MODULE_VAR_NONE, flag_vor1_cb, ICON_SWITCH_TYPE_STEP_TO, 3, 0, 0 ) PELEMENT_HEADER flags_vor1_icon_list[] ={ (PELEMENT_HEADER)&flags_vor1_icon, NULL};Thanks for any help.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

You have your pointer to the next element in the wrong place.it should look like this:....flags_vor1_icon,BMP_V1_NO_SIGNAL,&flags_gs_vor1_icon_list,:-waveNULL,IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY,......before NULL not after itRegardsJim

Share this post


Link to post
Share on other sites

I spent all day yesterday trying to figure that out.Jim looks at it for 30 seconds and sees the problem.That's what I love about programming.Thanks Jim

Share this post


Link to post
Share on other sites

In addition, you don't need the cast (which is old style and deprecated anyway).Here's a good template for you with comments.[PRE]#pragma region MAKE_ICONMAKE_ICON( govSwitch_icon, // Name BMP_SWITCH_GOVERNOR_CENTER, // Res_ID NULL, // Next list GovSwitch_fail, // Failure IMAGE_USE_TRANSPARENCY | IMAGE_USE_ERASE, 0, // ASI Flags 0, 0, // panel ROTOR_GOV_SWITCH_POS, GovSwitch_icb, // Sourc_var, callback ICON_SWITCH_TYPE_SET_CUR_ICON, // Switch type 3, // Number of icons 0, // Scale: 0-16384 => 0-100% 0 // Offset: icon = offset-(value/scale))PELEMENT_HEADER govSwitch_next[] = { &govSwitch_icon.header, NULL };#pragma endregion /*GOVERNOR*/[/PRE]Of course, in your case the next element in the first macro would not be NULL.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this