Originally Posted by Javelin
There is also an overlay MFD section in _mfd.c, not quite sure what that's for yet.
This one is interesting because it renders directly to a transparent quad on the screen, not through a separate 3D MFD object.
If I can figure out how to convert the coordinates to a location on the cockpit model, this might be a direct way to add the engine gauges.


As far as I remember, in textname.h, you have to list the names of the textures in the scene. So in there, you put the name of the texture that the MFD should be drawn, preceded by TEXTURE_INDEX_ (just for info, 3dmodels.h is a store of all the objects, you probably already know)

Then in ha_ebars.c I had these sections, which references the texture.

Code
void initialise_havoc_engine_bars (void)
{

	eng_trq_texture_screen = create_system_texture_screen (256, 256, TEXTURE_INDEX_HAVOC_TRQ_GAUGE, TEXTURE_TYPE_SINGLEALPHA);

	set_rgb_colour (ENG_BAR_COLOUR_WHITE,  255, 255, 255, 0);
}


void draw_havoc_eng_trq_bar_on_texture (void)
{
	set_active_screen (eng_trq_texture_screen);

	if (lock_screen (eng_trq_texture_screen))
	{
		draw_havoc_engine_torque_indicator();

		unlock_screen (eng_trq_texture_screen);
	}

	set_active_screen (video_screen);
}


So I thought that was what was needed to get an MFD to draw to a texture, but it doesn't work in the code I added. I could create new MFDs in the blackhawk on a new texture by re-using code, and setting a new texture name. But for the havoc, it wouldn't work.

I hope you manage to work it out further than I could. It would be really useful, as then it would open possibilities for other displays. Especially in my blackhawk cockpit, as I wanted to add displays for the digit readouts on some of the gauges.