I am trying to add the 3 boxes to show landing gear. This is from the Delta Glider.
But this is what I am using:
But I get this error:
.\MYVESSEL.CPP(2034) : error C2352: 'VESSEL3::clbkDrawHUD' : illegal call of non-static member function
c:\orbiter2010p1a\orbitersdk\include\VesselAPI.h(5915) : see declaration of 'VESSEL3::clbkDrawHUD'
Code:
bool DeltaGlider::clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, oapi::Sketchpad *skp)
{
if (oapiCockpitMode() != COCKPIT_VIRTUAL) return false;
// draw the default HUD
VESSEL3::clbkDrawHUD (mode, hps, skp);
int cx = hps->CX, cy = hps->CY;
// show gear deployment status
if (gear_status == DOOR_OPEN || (gear_status >= DOOR_CLOSING && fmod (oapiGetSimTime(), 1.0) < 0.5)) {
int d = hps->Markersize/2;
if (cx >= -d*3 && cx < hps->W+d*3 && cy >= d && cy < hps->H+d*5) {
skp->Rectangle (cx-d/2, cy-d*5, cx+d/2, cy-d*4);
skp->Rectangle (cx-d*3, cy-d*2, cx-d*2, cy-d);
skp->Rectangle (cx+d*2, cy-d*2, cx+d*3, cy-d);
}
}
But this is what I am using:
Code:
bool MYVESSEL::clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, oapi::Sketchpad *skp)
{
if(dCargHudMessageDelay>0)
{
skp->Text(5,hps->H/60*15,cCargoHudDisplay,strlen(cCargoHudDisplay));
dCargHudMessageDelay-=oapiGetSimStep();
if(dCargHudMessageDelay<0)
dCargHudMessageDelay=0;
}
if(dHudMessageDelay>0)
{
skp->Text(5,hps->H/60*15,cUmmuHudDisplay,strlen(cUmmuHudDisplay));
dHudMessageDelay-=oapiGetSimStep();
if(dHudMessageDelay<0)
dHudMessageDelay=0;
}
return true;
if (oapiCockpitMode() != COCKPIT_VIRTUAL) return false;
// draw the default HUD
VESSEL3::clbkDrawHUD (mode, hps, skp);
int cx = hps->CX, cy = hps->CY;
// show gear deployment status
if (GEAR_status == GEAR_DOWN || (GEAR_status >= GEAR_LOWERING && fmod (oapiGetSimTime(), 1.0) < 0.5)) {
int d = hps->Markersize/2;
if (cx >= -d*3 && cx < hps->W+d*3 && cy >= d && cy < hps->H+d*5) {
skp->Rectangle (cx-d/2, cy-d*5, cx+d/2, cy-d*4);
skp->Rectangle (cx-d*3, cy-d*2, cx-d*2, cy-d);
skp->Rectangle (cx+d*2, cy-d*2, cx+d*3, cy-d);
}
}
}
.\MYVESSEL.CPP(2034) : error C2352: 'VESSEL3::clbkDrawHUD' : illegal call of non-static member function
c:\orbiter2010p1a\orbitersdk\include\VesselAPI.h(5915) : see declaration of 'VESSEL3::clbkDrawHUD'