February 21, 200719 yr Anyone had any luck doing something like the following?FLOAT64 FSAPI Adf_Card_cb(PELEMENT_SPRITE pelement){ // Change RES_ID based on Day/Night & Power if (Time::IsDay()) { // Use DAY resource pelement->header.resource_id = BMP_GAUGE_ADF_CARD; } else { // NIGHT if(mainBus.PowerOn() && InstLights::IsPanelLtOn() && cbInstLt.Closed()) { // If power display instrument light switch(InstLights::GetRheoStat()) { case InstLights::BRT: pelement->header.resource_id = BMP_GAUGE_ADF_CARD_LT_BRT; break; case InstLights::ON75: pelement->header.resource_id = BMP_GAUGE_ADF_CARD_LT_75; break; case InstLights::ON50: pelement->header.resource_id = BMP_GAUGE_ADF_CARD_LT_50; break; case InstLights::ON25: pelement->header.resource_id = BMP_GAUGE_ADF_CARD_LT_25; break; default: // Should never get here OFF pelement->header.resource_id = BMP_GAUGE_ADF_CARD; break; } } } // Return Card Azimuth return pelement->source_var_0.var_value.n; // Force redraw REDRAW_IMAGE(pelement);}Seems to have no effect.
February 22, 200719 yr Well... It would seem that thispelement->header.resource_idis a cheap, imitation copy of thisLinkage.gauge_header_ptr[n]->elements_list[0]->next_element[0]->resource_idHowever, that is not the whole story, as the above noted substitution will produce a gauge that requires a switch to/from full screen/windowed mode to effect the change in bitmaps.This would seem to indicate that one also needs to trigger the INITIALIZE and GENERATE routines in order to get the new bitmap on the screen.All in all, it would probably be easier to simply declare an icon element for these things.Doug
February 22, 200719 yr Commercial Member Try SET_OFF_SCREEN() instead of REDRAW_IMAGE() Ed Wilson Mindstar AviationMy Playland - I69
February 22, 200719 yr Thanks Doug for your input. Makes sense now that I think back to the game loop.Can't use another ICON here as it is a SPRITE, and I wanted to avoid using a second one as this seemed more straight forward, avoid all the HIDE/SHOW logic.But forcing an INITIALIZE doesn't seem like a FPS saver at all, haha.So, I guess in the end it is wiser to create the 2nd dreaded SPRITE.Not sure I even know how to do that right now other than resizing a panel either.
Create an account or sign in to comment