SDK Question DeltaGlider sample bitmap issue

Russ_H

Addon Developer
Addon Developer
Joined
Apr 15, 2008
Messages
118
Reaction score
0
Points
0
Location
louisville, Ky
I found that the bitmaps for the sample DeltaGlider code are incomplete.

Thanks
Russ H
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
What bitmaps are missing and which version of Orbiter?

Last time I compiled DeltaGlider, it worked fine, but I didn't check all the 2D panels if they are being displayed properly.

If it's a bug report, it should be rather posted at Orbiter 2010 Project.
 

Russ_H

Addon Developer
Addon Developer
Joined
Apr 15, 2008
Messages
118
Reaction score
0
Points
0
Location
louisville, Ky
What bitmaps are missing and which version of Orbiter?

Last time I compiled DeltaGlider, it worked fine, but I didn't check all the 2D panels if they are being displayed properly.

If it's a bug report, it should be rather posted at Orbiter 2010 Project.

Well I may not understand what's going on in the code yet. Disregard this post. I see from going through the code the panels are loaded in a new way so I guess the bitmaps are not used.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
But bitmap resources are still being used in the code:
Code:
// --------------------------------------------------------------
// Load panel animation bitmaps and initialise panel state
// --------------------------------------------------------------
void DeltaGlider::InitPanel (int panel)
{
	DWORD i;

	switch (panel) {
	case 0: // main panel
		// load bitmaps used by the panel
		srf[0] = oapiCreateSurface (LOADBMP (IDB_SWITCH1));
		srf[1] = oapiCreateSurface (LOADBMP (IDB_NAVBUTTON));
		srf[2] = oapiCreateSurface (LOADBMP (IDB_LIGHT1));
		srf[4] = oapiCreateSurface (LOADBMP (IDB_SLIDER1));
		srf[5] = oapiCreateSurface (LOADBMP (IDB_LIGHT2));
		srf[6] = oapiCreateSurface (LOADBMP (IDB_SWITCH4));
		srf[7] = oapiCreateSurface (LOADBMP (IDB_SWITCH4R));
		srf[8] = oapiCreateSurface (LOADBMP (IDB_INDICATOR2));  oapiSetSurfaceColourKey (srf[8], 0);
		srf[9] = oapiCreateSurface (LOADBMP (IDB_DIAL1));
		srf[10] = oapiCreateSurface (LOADBMP (IDB_FONT2));
		srf[11] = oapiCreateSurface (LOADBMP (IDB_WARN));

		// reset state flags for panel instruments
		for (i = 0; i < ninstr; i++) instr[i]->Reset2D();

		for (i = 0; i < 5; i++) engsliderpos[i] = (UINT)-1;
		for (i = 0; i < 2; i++)
			mainflowidx[i] = retroflowidx[i] = scTSFCidx[i] = scflowidx[i] =
			mainpropidx[i] = rcspropidx[i] = scrampropidx[i] = -1;
		mainpropmass = rcspropmass = scrampropmass = -1;
		hoverflowidx = mainTSFCidx = -1;

		memset (&p_prpdisp, 0, sizeof(p_prpdisp));
		memset (&p_engdisp, 0, sizeof(p_engdisp));
		memset (&p_rngdisp, 0, sizeof(p_rngdisp));
		break;
	case 1: // overhead panel
		srf[0] = oapiCreateSurface (LOADBMP (IDB_SWITCH1));
		srf[1] = oapiCreateSurface (LOADBMP (IDB_INDICATOR));
		srf[4] = oapiCreateSurface (LOADBMP (IDB_VPITCH));
		srf[5] = oapiCreateSurface (LOADBMP (IDB_VBANK));
		srf[6] = oapiCreateSurface (LOADBMP (IDB_VYAW));
		break;
	case 2: // bottom panel
		srf[0] = oapiCreateSurface (LOADBMP (IDB_SWITCH2));
		srf[1] = oapiCreateSurface (LOADBMP (IDB_LEVER1));
		srf[2] = oapiCreateSurface (LOADBMP (IDB_SWITCH3));
		srf[9] = oapiCreateSurface (LOADBMP (IDB_INDICATOR));
		for (i = 0; i < 2; i++) wbrake_pos[i] = (UINT)-1;
		//dockreleasedown = false;
		break;
	}
}

// --------------------------------------------------------------
// Load VC animation bitmaps and initialise VC state
// --------------------------------------------------------------
void DeltaGlider::InitVC (int vc)
{
	int i;

	switch (vc) {
	case 0:
		srf[2] = oapiCreateSurface (LOADBMP (IDB_LIGHT1));
		srf[4] = oapiCreateSurface (LOADBMP (IDB_VPITCH));
		srf[5] = oapiCreateSurface (LOADBMP (IDB_VBANK));
		srf[6] = oapiCreateSurface (LOADBMP (IDB_VYAW));
		srf[8] = oapiCreateSurface (LOADBMP (IDB_INDICATOR2));  oapiSetSurfaceColourKey (srf[8], 0);
		srf[9] = oapiCreateSurface (LOADBMP (IDB_INDICATOR));
		srf[10] = oapiCreateSurface (LOADBMP (IDB_FONT2));

		// reset state flags for panel instruments
		for (i = 0; i < 5; i++) engsliderpos[i] = (UINT)-1;
		for (i = 0; i < 2; i++)
			mainflowidx[i] = retroflowidx[i] = scTSFCidx[i] = scflowidx[i] =
			mainpropidx[i] = rcspropidx[i] = scrampropidx[i] = -1;
		hoverflowidx = mainTSFCidx = -1;
		mainpropmass = rcspropmass = scrampropmass = -1;

		memset (&p_prpdisp, 0, sizeof(p_prpdisp));
		memset (&p_engdisp, 0, sizeof(p_engdisp));
		memset (&p_rngdisp, 0, sizeof(p_rngdisp));
		break;
	}
}
 

Russ_H

Addon Developer
Addon Developer
Joined
Apr 15, 2008
Messages
118
Reaction score
0
Points
0
Location
louisville, Ky
I am not sure but I think everything is being loaded from 1 DDS file because it is a mesh that it is being loaded onto. dg_panel.dds is it. Every switch and gauge is being loaded form this one image.

Very cool way to be able to scale the 2d panel.

Sorry for all the trouble
Russ H
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Ah. You thought the panel background texture was missing. And I thought that you're talking about some bitmap for a switch or something. In this case I think everything is solved now.
 

Russ_H

Addon Developer
Addon Developer
Joined
Apr 15, 2008
Messages
118
Reaction score
0
Points
0
Location
louisville, Ky
DeltaGlider::InitPanel (int panel)

That's just part of the old way of loading the panel buttons.
Its not called at all. I think.
 
Top