Beispiel #1
0
void draw_apache_upfront_display_on_cockpit (float x_org, float y_org)
{
	if (lock_screen (active_screen))
	{
		display_messages (x_org, y_org);

		unlock_screen (active_screen);
	}
}
Beispiel #2
0
void draw_default_lamp_on_texture (void)
{
	screen
		*lamp_texture_screen;

	lamp_texture_screen = lamp1_texture_screen;

	set_system_texture_screen (lamp_texture_screen, TEXTURE_INDEX_AVCKPT_DISPLAY_LHS_MFD);

	////////////////////////////////////////
	//
	// set up MFD 2D environment
	//
	////////////////////////////////////////

	set_2d_active_environment (lamp1_env);

	//
	// window
	//

	set_2d_window (lamp1_env, LAMP1_WINDOW_X_MIN, LAMP1_WINDOW_Y_MIN, LAMP1_WINDOW_X_MAX, LAMP1_WINDOW_Y_MAX);

	//
	// viewport
	//

	lamp1_viewport_size = LAMP1_VIEWPORT_SMALL_SIZE;

	lamp1_viewport_x_org = LAMP1_VIEWPORT_TEXTURE_X_ORG;
	lamp1_viewport_y_org = LAMP1_VIEWPORT_TEXTURE_Y_ORG;
	lamp1_viewport_x_min = lamp1_viewport_x_org - (lamp1_viewport_size * 0.5);
	lamp1_viewport_y_min = lamp1_viewport_y_org - (lamp1_viewport_size * 0.5);
	lamp1_viewport_x_max = lamp1_viewport_x_org + (lamp1_viewport_size * 0.5) - 0.001;
	lamp1_viewport_y_max = lamp1_viewport_y_org + (lamp1_viewport_size * 0.5) - 0.001;

	set_2d_viewport (lamp1_env, lamp1_viewport_x_min, lamp1_viewport_y_min, lamp1_viewport_x_max, lamp1_viewport_y_max);

	set_active_screen (lamp1_texture_screen);

	if (lock_screen (lamp1_texture_screen))
	{

		draw_default_indicator_lamps_3d ();

		flush_screen_texture_graphics (lamp1_texture_screen);

		unlock_screen (lamp1_texture_screen);
	}


	set_active_screen (video_screen);
}
Beispiel #3
0
void draw_default_indicator_lamps_3d (void)
{
	unsigned char
		*sprite_data,
		*mask_data;

	int X_ORG;
	int Y_ORG;

	base_cockpit_graphics_file = GRAPHICS_COCKPITS_APACHE_LEVEL1_BASE;

	sprite_data = get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_SPRITES);

	mask_data = get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_SPRITES_MASK);


//find out where the lamps are in 3d, tranform with pilot viewpoint, convert to pixels depending on resolution, use center of cockpit


	lock_screen (active_screen);

	X_ORG = 225;	Y_ORG = 470;
	X_ORG = (int)((virtual_cockpit_inst3d->vp.x*0.4+0.5)*300);
					 draw_lamp (default_lamps.indicator_lamp_1, X_ORG +   7, Y_ORG +   4,   7,   4,  19,  19,   0);
	X_ORG += 20; draw_lamp (default_lamps.indicator_lamp_2, X_ORG +  27, Y_ORG +   4,  27,   4,  18,  19,  13);
	X_ORG += 20; draw_lamp (default_lamps.indicator_lamp_3, X_ORG +  47, Y_ORG +   5,  47,   5,  18,  18,  25);
	X_ORG += 20; draw_lamp (default_lamps.indicator_lamp_4, X_ORG +  66, Y_ORG +   5,  66,   5,  18,  18,  38);
	X_ORG += 20; draw_lamp (default_lamps.indicator_lamp_5, X_ORG +  86, Y_ORG +   5,  86,   5,  18,  18,  51);
	X_ORG += 20; draw_lamp (default_lamps.indicator_lamp_6, X_ORG + 106, Y_ORG +   5, 106,   5,  18,  18,  64);
	X_ORG += 20; draw_lamp (default_lamps.indicator_lamp_7, X_ORG + 125, Y_ORG +   5, 125,   5,  18,  18,  76);
	X_ORG += 20; draw_lamp (default_lamps.indicator_lamp_8, X_ORG + 144, Y_ORG +   5, 144,   5,  19,  18,  89);
	X_ORG += 20; draw_lamp (default_lamps.indicator_lamp_9, X_ORG + 164, Y_ORG +   4, 164,   4,  19,  19, 102);

	X_ORG = 164;	Y_ORG = 408;
					 draw_lamp (default_lamps.engine_1_fire	, X_ORG +  10, Y_ORG +  12,  10, 102,  26,  27,   0);
	X_ORG += 27; draw_lamp (default_lamps.apu_fire		, X_ORG +  42, Y_ORG +  12,  42, 102,  26,  27,  13);
	X_ORG += 27; draw_lamp (default_lamps.engine_2_fire	, X_ORG +  75, Y_ORG +  12,  75, 102,  26,  27,  25);

	X_ORG = 72;	Y_ORG = 375;
					 draw_lamp (default_lamps.armament_lamp_1 , X_ORG +   9, Y_ORG +   7,   9, 327,  22,  23,   0);
	X_ORG += 23; draw_lamp (default_lamps.armament_lamp_2 , X_ORG +  31, Y_ORG +   7,  31, 327,  22,  23,  13);

	X_ORG = 305;
	Y_ORG = 283;
					 draw_lamp (default_lamps.mfd_lamp_1 , X_ORG +   3, Y_ORG +   3,   3, 183,  24,  22,   0);
	Y_ORG += 23; draw_lamp (default_lamps.mfd_lamp_2 , X_ORG +   3, Y_ORG +  25,   3, 205,  24,  21,  13);

	unlock_screen (active_screen);

}
Beispiel #4
0
void draw_apache_upfront_display_on_texture (void)
{
	set_active_screen (texture_screen);

	if (lock_screen (texture_screen))
	{
		set_block (0, 0, 127, 127, clear_colour);

		display_messages (0.0, 0.0);

		flush_screen_texture_graphics (texture_screen);

		unlock_screen (texture_screen);
	}

	set_active_screen (video_screen);
}
Beispiel #5
0
void draw_apache_altitude_counter(void)
{
	set_active_screen (altitude_counter_screen);

	if (lock_screen (altitude_counter_screen))
	{
		rgb_colour
			bg_colour;
			
		set_rgb_colour(bg_colour, 20, 20, 25, 255);
		set_block (0, 0, ALTITUDE_COUNTER_WIDTH - 1, ALTITUDE_COUNTER_HEIGHT - 1, bg_colour);

		draw_altitude_counter_digits();

		flush_screen_texture_graphics(altitude_counter_screen);
		unlock_screen (altitude_counter_screen);
	}

	set_active_screen (video_screen);
}
Beispiel #6
0
static void load_skin_bitmap (char *filespec, screen *texture, int size)
{
	FILE
		*fp;

	BITMAPFILEHEADER
		bmfh;

	BITMAPINFOHEADER
		bmih;

	char
		*buffer,
		*p;

	int
		buffer_size,
		x,
		y;

	rgb_colour
		col;

	ASSERT (filespec);

	ASSERT (texture);

	fp = safe_fopen (filespec, "rb");

	//
	// file header
	//

	fread (&bmfh, sizeof (bmfh), 1, fp);

	if (bmfh.bfType != BITMAP_ID)
	{
		safe_fclose (fp);

		debug_fatal ("%s is not a BMP file!", filespec);
	}

	//
	// info header
	//

	fread (&bmih, sizeof (bmih), 1, fp);

	if (bmih.biCompression != BI_RGB)
	{
		safe_fclose (fp);

		debug_fatal ("%s is not uncompressed RGB!", filespec);
	}

	if (bmih.biBitCount != 24)
	{
		safe_fclose (fp);

		debug_fatal ("%s is not 24 bit!", filespec);
	}

	if (bmih.biWidth != size)
	{
		safe_fclose (fp);

		debug_fatal ("%s is not %d pixels wide", filespec, size);
	}

	if (bmih.biHeight != size)
	{
		safe_fclose (fp);

		debug_fatal ("%s is not %d pixels high", filespec, size);
	}

	//
	// texture
	//

	buffer_size = size * size * 3;

	buffer = safe_malloc (buffer_size);

	fread (buffer, buffer_size, 1, fp);

	set_active_screen (texture);

	if (lock_screen (texture))
	{
		p = buffer;

		for (y = size - 1; y >= 0; y--)
		{
			for (x = 0; x < size; x++)
			{
				col.b = *p++;
				col.g = *p++;
				col.r = *p++;
				col.a = 255;

				set_pixel (x, y, col);
			}
		}

		unlock_screen (texture);
	}

	set_active_screen (video_screen);

	safe_free (buffer);

	safe_fclose (fp);
}
Beispiel #7
0
static void draw_area_ui_object (ui_object *obj)
{

	float
		x,
		y,
		x1,
		y1,
		x2,
		y2;

	int
		redraw_flag = FALSE,
		masked,
		width,
		height,
		pitch;

	font_types
		font_id;

	area_ui_object
		*area;

	struct SCREEN
		*old_active_screen,
		*memory_graphic;

	unsigned short int
		*graphic;

	struct ZOOMABLE_GRAPHIC
		*zoomable_graphic;

	unsigned char
		*data;

	ui_object
		*parent;

	if (get_ui_object_redraw (obj))
	{

		area = (area_ui_object *) obj->data;

		//debug_log ("AR_DRAW: drawing area %f, %f  %f, %f", area->x, area->y, area->x_size, area->y_size);

		x1 = area->x;
		y1 = area->y;

		x2 = x1 + area->x_size;
		y2 = y1 + area->y_size;

		old_active_screen = get_active_screen ();

		if (get_ui_object_active_screen (obj))
		{
	
			set_active_screen (get_ui_object_active_screen (obj));
		}
		else
		{

			set_active_screen (video_screen);
		}

		if (lock_screen (active_screen))
		{
	
			switch (get_ui_object_graphic_type (obj))
			{
	
				case UI_OBJECT_GRAPHIC:
				{
		
					if (!get_ui_object_clear (obj))
					{
		
						graphic = get_ui_object_graphic (obj);
	
						ui_draw_graphic (x1, y1, x2, y2, graphic);
	
						redraw_flag = TRUE;
					}
					else
					{
	
						parent = get_ui_object_parent (obj);
	
						if (parent)
						{
	
							graphic = get_ui_object_graphic (parent);
	
							ui_draw_part_graphic (x1, y1, x2, y2, x1, y1, graphic);
	
							redraw_flag = TRUE;
						}
					}
	
					break;
				}
	
				case UI_OBJECT_MEMORY_GRAPHIC:
				{
	
					memory_graphic = get_ui_object_memory_graphic (obj);

					if (lock_screen (memory_graphic))
					{
		
						width = get_screen_width (memory_graphic);
		
						height = get_screen_height (memory_graphic);
		
						data = get_screen_data (memory_graphic);
		
						pitch = get_screen_pitch (memory_graphic);
		
						masked = get_ui_object_clear (obj);
		
						ui_draw_memory_graphic (obj, x1, y1, x2, y2, width, height, pitch, masked);

						unlock_screen (memory_graphic);
					}
	
					redraw_flag = TRUE;
	
					break;
				}
	
				case UI_OBJECT_ALPHA_GRAPHIC:
				{
		
					if (!get_ui_object_clear (obj))
					{
		
						graphic = get_ui_object_graphic (obj);
	
						ui_draw_alpha_graphic (x1, y1, x2, y2, graphic);
	
						redraw_flag = TRUE;
					}
					else
					{
	
						parent = get_ui_object_parent (obj);
	
						if (parent)
						{
	
							graphic = get_ui_object_graphic (parent);
	
							ui_draw_part_alpha_graphic (x1, y1, x2, y2, x1, y1, graphic);
	
							redraw_flag = TRUE;
						}
					}
	
					break;
				}
	
				case UI_OBJECT_ZOOMABLE_PALETTE_GRAPHIC:
				{
		
					if (!get_ui_object_clear (obj))
					{
	
						zoomable_graphic = get_ui_object_zoomable_palette_graphic (obj);
	
						draw_zoomable_graphic (zoomable_graphic, area->cx, area->cy, x1, y1, x2, y2, area->zoom);
	
						redraw_flag = TRUE;
					}
	
					break;
				}
	
				case UI_OBJECT_NO_GRAPHIC:
				default:
				{
	
					if (!get_ui_object_clear (obj))
					{
	
						ui_draw_area (x1, y1, x2, y2);
	
						redraw_flag = TRUE;
					}
				}
			}
	
			// text position
	
			if (get_ui_object_text (obj))
			{
	
				font_id = get_ui_font ();
	
				set_ui_font (get_ui_object_font (obj));
	
				get_text_position (&x, &y, x1, y1, x2, y2, obj);
		
				ui_display_text (get_ui_object_text (obj), x, y);
	
				set_ui_font (font_id);
	
				redraw_flag = TRUE;
			}
	
			if (redraw_flag)
			{
		
				set_ui_repaint_area (x1 + ui_x_origin, y1 + ui_y_origin, x2 + ui_x_origin + 1, y2 + ui_y_origin + 1);
			}
	
			unlock_screen (active_screen);
		}

		set_active_screen (old_active_screen);

		area->redraw --;

		call_ui_object_draw_function (obj, NULL);
	}
}
Beispiel #8
0
void draw_hind_hud_on_texture (void)
{
	//
	// set active 3D environment now else 2D clipping will be affected
	//

	set_main_3d_full_screen_params (DISPLAY_3D_TINT_CLEAR, DISPLAY_3D_LIGHT_LEVEL_HIGH, DISPLAY_3D_NOISE_LEVEL_NONE);

	set_3d_active_environment (main_3d_env);

	////////////////////////////////////////
	//
	// set up HUD 2D environment
	//
	////////////////////////////////////////

	set_2d_active_environment (hud_env);

	//
	// window
	//

	set_2d_window (hud_env, HUD_WINDOW_X_MIN, HUD_WINDOW_Y_MIN, HUD_WINDOW_X_MAX, HUD_WINDOW_Y_MAX);

	if (hud_display_model)
	{
		// move HUD coordinate system with head movements to simulate the collimation effect (focus on infinity)
		float head_offset_x = 0.0, head_offset_y = 0.0, head_offset_z = 0.0;

		if (get_view_mode() == VIEW_MODE_COCKPIT_PANEL_SPECIAL_HAVOC_HUD)
		{
			if (custom_3d_models.arneh_mi24v_cockpit)
				get_hind_3d_cockpit_hud_view_position(&head_offset_x, &head_offset_y, &head_offset_z);
		}
		else
		{
			head_offset_x = -getViewpointOffsetX(head_offset_x);
			head_offset_y = -getViewpointOffsetY(head_offset_y);
			head_offset_z = -getViewpointOffsetY(head_offset_z);

			head_offset_x += wide_cockpit_position[WIDEVIEW_HIND_PILOT].c.x;
			head_offset_y += wide_cockpit_position[WIDEVIEW_HIND_PILOT].c.y;
			head_offset_z += wide_cockpit_position[WIDEVIEW_HIND_PILOT].c.z;
		}

		{
			// move texture UV coordinates to move and scale the texture
			unsigned i;
			for (i=0; i<num_texture_coordinates; i++)
			{
				float
					scale,
					u = hud_texture_uv_coordinates[i].u,
					v = hud_texture_uv_coordinates[i].v;

				// scale hud to keep same absolute size no matter distance to hud
				u -= 0.5;
				v -= 0.5;

				hud_distance = hud_position_z - head_offset_z;
				scale = hud_position_z / hud_distance;

				u *= scale;
				v *= scale;

				u += 0.5;
				v += 0.5;

				// then displace hud to keep it directly in front of pilot's position
				u -= (scale) * head_offset_x / hud_width;
				v += (scale) * (head_offset_y - hud_position_y) / hud_height;

				hud_display_model->surface_texture_points[i].u = u;
				hud_display_model->surface_texture_points[i].v = v;
			}
		}
	}

	//
	// viewport
	//

	draw_large_hud = FALSE;

	hud_viewport_size = HUD_VIEWPORT_SMALL_SIZE;
	hud_viewport_x_org = HUD_VIEWPORT_TEXTURE_X_ORG;
	hud_viewport_y_org = HUD_VIEWPORT_TEXTURE_Y_ORG;

	hud_viewport_x_min = hud_viewport_x_org - (hud_viewport_size * 0.5);
	hud_viewport_y_min = hud_viewport_y_org - (hud_viewport_size * 0.5);
	hud_viewport_x_max = hud_viewport_x_org + (hud_viewport_size * 0.5) - 0.001;
	hud_viewport_y_max = hud_viewport_y_org + (hud_viewport_size * 0.5) - 0.001;

	set_2d_viewport (hud_env, hud_viewport_x_min, hud_viewport_y_min, hud_viewport_x_max, hud_viewport_y_max);

	//
	// get screen co-ords (vitural cockpit texture - scaling only works near screen centre)
	//

	hud_screen_x_min = full_screen_x_mid - ((HUD_VIEWPORT_SMALL_SIZE / (640.0 * 2.0)) * full_screen_width);
	hud_screen_y_min = full_screen_y_mid - ((HUD_VIEWPORT_SMALL_SIZE / (480.0 * 2.0)) * full_screen_height);

	hud_screen_x_max = full_screen_x_mid + ((HUD_VIEWPORT_SMALL_SIZE / (640.0 * 2.0)) * full_screen_width) - 0.001;
	hud_screen_y_max = full_screen_y_mid + ((HUD_VIEWPORT_SMALL_SIZE / (480.0 * 2.0)) * full_screen_height) - 0.001;

	hud_screen_x_scale = 640.0 / full_screen_width;
	hud_screen_y_scale = 480.0 / full_screen_height;

	////////////////////////////////////////
	//
	// draw HUD
	//
	////////////////////////////////////////

	set_active_screen (hud_texture_screen);

	if (lock_screen (hud_texture_screen))
	{
		rgb_colour
			clear_hud_colour;

		if (backup_sight_active)
		{
			set_rgb_colour (clear_hud_colour, backup_sight_colour.r, backup_sight_colour.g, backup_sight_colour.b, 0);
		}
		else
		{
			set_rgb_colour (clear_hud_colour, hud_colour.r, hud_colour.g, hud_colour.b, 0);
		}

		set_block (0, 0, HUD_VIEWPORT_SMALL_SIZE - 1, HUD_VIEWPORT_SMALL_SIZE - 1, clear_hud_colour);


		if (electrical_system_active())
			if (backup_sight_active)
				draw_backup_sight();
			else if (!hind_damage.head_up_display)
			{
				set_mono_font_colour (hud_colour);

				draw_layout_grid ();

				if (hud_mode == HUD_MODE_WEAPON)
					draw_weapon_mode_hud (TRUE);
			}

		// last pixel must be transparent because it's repeated when texture doesn't fill entire polygon
		draw_line(0, 0, 0, HUD_VIEWPORT_SMALL_SIZE - 1, clear_hud_colour);
		draw_line(0, 0, HUD_VIEWPORT_SMALL_SIZE - 1, 0, clear_hud_colour);
		draw_line(0, HUD_VIEWPORT_SMALL_SIZE - 1, HUD_VIEWPORT_SMALL_SIZE - 1, HUD_VIEWPORT_SMALL_SIZE - 1, clear_hud_colour);
		draw_line(HUD_VIEWPORT_SMALL_SIZE - 1, 0, HUD_VIEWPORT_SMALL_SIZE - 1, HUD_VIEWPORT_SMALL_SIZE - 1, clear_hud_colour);

		flush_screen_texture_graphics (hud_texture_screen);

		unlock_screen (hud_texture_screen);
	}

	set_active_screen (video_screen);
}
Beispiel #9
0
void save_screen_image_and_viewpoint_data (void)
{
	char
		filename[100],
		large_image_filename[100],
		small_image_filename[100],
		viewpoint_data_filename[100];

	FILE
		*fp;

	int
		x_sec,
		z_sec;

	//
	// find first screen shot index
	//

	if (!found_first_screen_shot_index)
	{
		while (TRUE)
		{
			sprintf (large_image_filename, "%sIMAGE%03d.TGA", LARGE_IMAGE_PATH, screen_shot_index);

			if (file_exist (large_image_filename))
			{
				screen_shot_index++;

				if (screen_shot_index == 1000)
				{
					break;
				}
			}
			else
			{
				found_first_screen_shot_index = TRUE;

				break;
			}
		}
	}

	//
	// write screen files and viewpoint data file
	//

	if (screen_shot_index <= MAX_SCREEN_SHOT_INDEX)
	{
		sprintf (filename, "IMAGE%03d", screen_shot_index);

		debug_log ("Saving screen image (%s)", filename);

		sprintf (large_image_filename, "%s%s.TGA", LARGE_IMAGE_PATH, filename);

		sprintf (small_image_filename, "%s%s.TGA", SMALL_IMAGE_PATH, filename);

		sprintf (viewpoint_data_filename, "%s%s.TXT", VIEWPOINT_DATA_PATH, filename);

		////////////////////////////////////////

		if (lock_screen (video_screen))
		{

			save_tga_screen_with_thumbnail (large_image_filename, small_image_filename);

			unlock_screen (video_screen);
		}

		////////////////////////////////////////

		fp = safe_fopen (viewpoint_data_filename, "w");

		fprintf (fp, "Image viewpoint data:\n\n");

		fprintf (fp, "Map           : unknown\n");

		fprintf (fp, "X             : %.2f\n", main_vp.x);
		fprintf (fp, "Y             : %.2f\n", main_vp.y);
		fprintf (fp, "Z             : %.2f\n", main_vp.z);

		get_terrain_3d_sector (main_vp.x, main_vp.z, &x_sec, &z_sec);

		fprintf (fp, "X sector (3D) : %d\n", x_sec);
		fprintf (fp, "Z sector (3D) : %d\n", z_sec);

		get_x_sector (x_sec, main_vp.x);
		get_z_sector (z_sec, main_vp.z);

		fprintf (fp, "X sector (AI) : %d\n", x_sec);
		fprintf (fp, "Z sector (AI) : %d\n", z_sec);

		fprintf (fp, "Heading (degs): %.2f\n", deg (get_heading_from_attitude_matrix (main_vp.attitude)));
		fprintf (fp, "Pitch (degs)  : %.2f\n", deg (get_pitch_from_attitude_matrix (main_vp.attitude)));
		fprintf (fp, "Roll (degs)   : %.2f\n", deg (get_roll_from_attitude_matrix (main_vp.attitude)));

		safe_fclose (fp);

		////////////////////////////////////////

		screen_shot_index++;
	}
	else
	{
		debug_colour_log (DEBUG_COLOUR_RED, "Exceeded screen image limit");
	}
}
Beispiel #10
0
void save_high_res_screen_image ( void )
{
	char
		filename[100],
		image_filename[100];

	int
		x,
		y,
		x_repeat,
		y_repeat,
		screen_width,
		screen_height,
		screen_pitch;

	unsigned short int
		*huge_screen_shot_memory;

	unsigned char
		*screen_data;

	x_repeat = 8;

	y_repeat = 8;

	screen_width = get_screen_width ( video_screen );

	screen_height = get_screen_height ( video_screen );

	huge_screen_shot_memory = ( unsigned short int * ) safe_malloc ( sizeof ( unsigned short int ) * screen_width * screen_height * x_repeat * y_repeat );

	for ( y = 0; y < y_repeat; y++ )
	{

		for ( x = 0; x < x_repeat; x++ )
		{

			unsigned short int
				*destination_ptr,
				*screen_line;

			int
				screen_y;

			//
			// Render the big views
			//

			draw_application_highres_screen ( x, y, x_repeat, y_repeat );

			if ( lock_screen ( video_screen ) )
			{
	
				screen_data = get_screen_data ( video_screen );
	
				screen_pitch = get_screen_pitch ( video_screen );
	
				destination_ptr = huge_screen_shot_memory + ( y * x_repeat * screen_width * screen_height ) + ( x * screen_width );
	
				for ( screen_y = 0; screen_y < screen_height; screen_y++ )
				{
	
					screen_line = ( unsigned short int * ) ( screen_data + ( screen_y * screen_pitch ) );
	
					memcpy ( destination_ptr, screen_line, screen_width * sizeof ( unsigned short int ) );
	
					destination_ptr += x_repeat * screen_width;
				}
	
				unlock_screen ( video_screen );
			}
		}
	}

	//
	// find first screen shot index
	//

	if (!found_first_screen_shot_index)
	{
		while (TRUE)
		{
			sprintf (image_filename, "%sIMAGE%03d.PSD", LARGE_IMAGE_PATH, screen_shot_index);

			if (file_exist (image_filename))
			{
				screen_shot_index++;

				if (screen_shot_index == 1000)
				{
					break;
				}
			}
			else
			{
				found_first_screen_shot_index = TRUE;

				break;
			}
		}
	}

	//
	// write screen files and viewpoint data file
	//

	if (screen_shot_index <= MAX_SCREEN_SHOT_INDEX)
	{
		sprintf (filename, "IMAGE%03d", screen_shot_index);

		debug_log ("Saving screen image (%s)", filename);

		sprintf (image_filename, "%s%s.PSD", LARGE_IMAGE_PATH, filename);

		write_psd_screen_file ( image_filename,
												screen_width * x_repeat,
												screen_height * y_repeat,
												screen_width * x_repeat * sizeof ( unsigned short int ),
												( unsigned char * ) huge_screen_shot_memory );

		screen_shot_index++;
	}
	else
	{
		debug_colour_log (DEBUG_COLOUR_RED, "Exceeded screen image limit");
	}

	safe_free ( huge_screen_shot_memory );
}
Beispiel #11
0
void draw_blackhawk_external_virtual_cockpit (unsigned int flags, unsigned char *wiper_rle_graphic)
{
	viewpoint
		vp;

	object_3d_sub_object_search_data
		search;

	float
		theta;

	object_3d_instance
		*inst3d;

	////////////////////////////////////////
	//
	// virtual cockpit viewpoint is placed at the main object origin
	//
	////////////////////////////////////////

	if (get_view_mode () == VIEW_MODE_COCKPIT_PANEL_SPECIAL_APACHE_LHS_MFD)
	{
		get_display_viewpoint (VIEW_MODE_COCKPIT_PANEL_SPECIAL_APACHE_LHS_MFD, &vp);
	}
	else if (get_view_mode () == VIEW_MODE_COCKPIT_PANEL_SPECIAL_APACHE_RHS_MFD)
	{
		get_display_viewpoint (VIEW_MODE_COCKPIT_PANEL_SPECIAL_APACHE_RHS_MFD, &vp);
	}
	else
	{
		vp.x = 0.0;
		vp.y = 0.0;
		vp.z = 0.0;

		if (get_global_wide_cockpit ())
		{
			vp.y = wide_cockpit_position[wide_cockpit_nr].c.y;
			vp.z = wide_cockpit_position[wide_cockpit_nr].c.z;
		}

		get_local_entity_attitude_matrix (get_gunship_entity (), vp.attitude);
	}

	////////////////////////////////////////
	//
	// draw 3D scene without lighting
	//
	////////////////////////////////////////

	if (flags & (VIRTUAL_COCKPIT_MAIN_ROTOR | VIRTUAL_COCKPIT_STOWED_WIPER | VIRTUAL_COCKPIT_MOVING_WIPER))
	{
		set_3d_active_environment (main_3d_env);

//VJ 050108 wideview x coord used to clip apache cockpit
		set_3d_view_distances (main_3d_env, 10.0 + clipx, 0.1, 1.0, 0.0);

		realise_3d_clip_extents (main_3d_env);

		recalculate_3d_environment_settings (main_3d_env);

		clear_zbuffer_screen ();

		if (begin_3d_scene ())
		{
			//
			// main rotor
			//

			if (flags & VIRTUAL_COCKPIT_MAIN_ROTOR)
			{
				if (!(get_helicopter_main_rotors_blurred (get_gunship_entity ()) && (!get_global_blurred_main_rotors_visible_from_cockpit ())))
				{
					if (get_local_entity_int_value (get_gunship_entity (), INT_TYPE_MAIN_ROTOR_DAMAGED))
					{
						animate_damaged_helicopter_main_rotors (get_gunship_entity (), TRUE);
					}
					else
					{
						animate_helicopter_main_rotors (get_gunship_entity (), TRUE, FALSE);
					}

					inst3d = (object_3d_instance *) get_local_entity_ptr_value (get_gunship_entity (), PTR_TYPE_INSTANCE_3D_OBJECT);

					theta = get_rotation_angle_of_helicopter_main_rotors (inst3d);

					set_rotation_angle_of_helicopter_main_rotors (virtual_cockpit_main_rotor_inst3d, theta);

					animate_helicopter_virtual_cockpit_main_rotors (get_gunship_entity (), virtual_cockpit_main_rotor_inst3d);

					memcpy (&virtual_cockpit_main_rotor_inst3d->vp, &vp, sizeof (viewpoint));

					insert_relative_object_into_3d_scene (OBJECT_3D_DRAW_TYPE_ZBUFFERED_OBJECT, &virtual_cockpit_main_rotor_inst3d->vp.position, virtual_cockpit_main_rotor_inst3d);
				}
			}

			//
			// wiper
			//

			if (wiper_mode == WIPER_MODE_STOWED)
			{
				if (flags & VIRTUAL_COCKPIT_STOWED_WIPER)
				{
					draw_blackhawk_virtual_cockpit_wiper (&vp);
				}
			}
			else
			{
				if (flags & VIRTUAL_COCKPIT_MOVING_WIPER)
				{
					draw_blackhawk_virtual_cockpit_wiper (&vp);
				}
			}

			draw_3d_scene ();

			end_3d_scene ();
		}
	}

	////////////////////////////////////////
	//
	// draw 3D scene with lighting
	//
	////////////////////////////////////////

	if (flags & (VIRTUAL_COCKPIT_COMPASS | VIRTUAL_COCKPIT_ADI | VIRTUAL_COCKPIT_LARGE_ADI))
	{
		set_cockpit_lighting (vp.attitude);

		set_3d_active_environment (main_3d_single_light_env);

		set_3d_view_distances (main_3d_single_light_env, 10.0, 0.1, 1.0, 0.0);

		realise_3d_clip_extents (main_3d_single_light_env);

		clear_zbuffer_screen ();

		if (begin_3d_scene ())
		{
			//
			// compass
			//

			if (flags & VIRTUAL_COCKPIT_COMPASS)
			{
				search.search_depth = 0;
				search.search_object = virtual_cockpit_compass_inst3d;
				search.sub_object_index = OBJECT_3D_SUB_OBJECT_APACHE_VIRTUAL_COCKPIT_COMPASS_HEADING_NULL;

				if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
				{
					search.result_sub_object->relative_heading = -current_flight_dynamics->heading.value;
				}

//VJ wideview mod, date: 18-mar-03
				if (get_global_wide_cockpit ())
					vp.y = wide_cockpit_position[wide_cockpit_nr].c.y + 0.01;

				memcpy (&virtual_cockpit_compass_inst3d->vp, &vp, sizeof (viewpoint));

//VJ wideview mod, date: 18-mar-03
				if (get_global_wide_cockpit ())
					vp.y = wide_cockpit_position[wide_cockpit_nr].c.y;

				insert_relative_object_into_3d_scene (OBJECT_3D_DRAW_TYPE_ZBUFFERED_OBJECT, &virtual_cockpit_compass_inst3d->vp.position, virtual_cockpit_compass_inst3d);
			}

			//
			// ADI
			//

			if (flags & VIRTUAL_COCKPIT_ADI)
			{
				search.search_depth = 0;
				search.search_object = virtual_cockpit_adi_inst3d;
				search.sub_object_index = OBJECT_3D_SUB_OBJECT_APACHE_VIRTUAL_COCKPIT_ADI;

				if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
				{
					float
						heading,
						pitch,
						roll;

					get_blackhawk_virtual_cockpit_adi_angles (vp.attitude, &heading, &pitch, &roll);

					search.result_sub_object->relative_heading = -heading;

					search.result_sub_object->relative_pitch = pitch;

					search.result_sub_object->relative_roll = -roll;
				}
//VJ wideview mod, date: 18-mar-03
				if (get_global_wide_cockpit ())
					vp.y = wide_cockpit_position[wide_cockpit_nr].c.y+0.02;

				memcpy (&virtual_cockpit_adi_inst3d->vp, &vp, sizeof (viewpoint));

//VJ wideview mod, date: 18-mar-03
				if (get_global_wide_cockpit ())
					vp.y = wide_cockpit_position[wide_cockpit_nr].c.y;

				insert_relative_object_into_3d_scene (OBJECT_3D_DRAW_TYPE_ZBUFFERED_OBJECT, &virtual_cockpit_adi_inst3d->vp.position, virtual_cockpit_adi_inst3d);
			}

			//
			// large ADI
			//

			if (flags & VIRTUAL_COCKPIT_LARGE_ADI)
			{
				search.search_depth = 0;
				search.search_object = virtual_cockpit_large_adi_inst3d;
				search.sub_object_index = OBJECT_3D_SUB_OBJECT_APACHE_VIRTUAL_COCKPIT_ADI;

				if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)
				{
					float
						heading,
						pitch,
						roll;

					get_blackhawk_virtual_cockpit_adi_angles (vp.attitude, &heading, &pitch, &roll);

					search.result_sub_object->relative_heading = -heading;

					search.result_sub_object->relative_pitch = pitch;

					search.result_sub_object->relative_roll = -roll;
				}

				memcpy (&virtual_cockpit_large_adi_inst3d->vp, &vp, sizeof (viewpoint));

				insert_relative_object_into_3d_scene (OBJECT_3D_DRAW_TYPE_ZBUFFERED_OBJECT, &virtual_cockpit_large_adi_inst3d->vp.position, virtual_cockpit_large_adi_inst3d);
			}

			draw_3d_scene ();

			end_3d_scene ();
		}
	}

	////////////////////////////////////////
	//
	// rendered wiper
	//
	////////////////////////////////////////

	if (flags & VIRTUAL_COCKPIT_RENDERED_WIPER)
	{
		if (wiper_mode == WIPER_MODE_STOWED)
		{
			ASSERT (wiper_rle_graphic);

			if (lock_screen (active_screen))
			{
				blit_rle_graphic (wiper_rle_graphic, ix_640_480, iy_640_480);

				unlock_screen (active_screen);
			}
		}
	}

	////////////////////////////////////////
	//
	// rain effect
	//
	////////////////////////////////////////

	if (flags & VIRTUAL_COCKPIT_RAIN_EFFECT)
	{
		if (rain_mode != RAIN_MODE_DRY)
		{
			set_3d_active_environment (main_3d_env);

			set_3d_view_distances (main_3d_env, 10.0, 0.1, 1.0, 0.0);

			realise_3d_clip_extents (main_3d_env);

			recalculate_3d_environment_settings (main_3d_env);

			clear_zbuffer_screen ();

			if (begin_3d_scene ())
			{
				draw_blackhawk_virtual_cockpit_rain_effect (&vp);

				draw_3d_scene ();

				end_3d_scene ();
			}
		}
	}

	////////////////////////////////////////
	//
	// tidy up
	//
	////////////////////////////////////////

	#if RECOGNITION_GUIDE

	set_3d_view_distances (main_3d_env, 10000.0, 100.0, 1.0, 0.0);

	#else

	set_3d_view_distances (main_3d_env, 10000.0, 1.0, 1.0, 0.0);

	#endif

	realise_3d_clip_extents (main_3d_env);
}
Beispiel #12
0
void draw_high_score_table (void)
{

	char
		buffer [256];

	int
		loop,
		length;

	screen
		*old_active_screen;

	pilot_score_type
		*item;

	old_active_screen = get_active_screen ();

	set_active_screen ( video_screen );

	if ( lock_screen ( active_screen ) )
	{
		//
		// draw leaderboard
		//
		
		for (loop = 0; loop < NUM_TABLE_ENTRIES; loop ++)
		{
			item = &pilot_high_score_table [loop];
			
			if (item->valid)
			{
				set_ui_font_type (UI_FONT_ARIAL_14);

				if (item->side == ENTITY_SIDE_BLUE_FORCE)
				{
					set_ui_font_colour (ui_colour_blue);
				}
				else
				{
					set_ui_font_colour (ui_colour_orange);
				}

				length = ui_get_string_length (item->name);
	
				sprintf (buffer, "%s : %d", item->name, item->kills);

				// print text assuming game-exit overlay is 640x480 centred in the screen whatever res.
				ui_display_text (buffer, get_integer_screen_x_mid () - length, iy_640_480 + 180 + (loop * (ui_get_font_height () + 1)));
			}
		}

		//
		// update flash timer
		//

		flash_timer += (FLASH_RATE * get_delta_time ());

		flash_timer = frac (flash_timer);

		unlock_screen ( active_screen );
	}

	set_active_screen ( old_active_screen );
}
Beispiel #13
0
void draw_hind_cockpit (cockpit_panels panel)
{
	////////////////////////////////////////
	//
	// select cockpit graphics wrt time of day
	//
	////////////////////////////////////////

	switch (get_local_entity_int_value (get_session_entity (), INT_TYPE_DAY_SEGMENT_TYPE))
	{
		case DAY_SEGMENT_TYPE_DAWN:
		{
			base_cockpit_graphics_file = GRAPHICS_COCKPITS_HAVOC_LEVEL2_BASE;

			break;
		}
		case DAY_SEGMENT_TYPE_DAY:
		{
			base_cockpit_graphics_file = GRAPHICS_COCKPITS_HAVOC_LEVEL1_BASE;

			break;
		}
		case DAY_SEGMENT_TYPE_DUSK:
		{
			base_cockpit_graphics_file = GRAPHICS_COCKPITS_HAVOC_LEVEL2_BASE;

			break;
		}
		case DAY_SEGMENT_TYPE_NIGHT:
		{
			base_cockpit_graphics_file = GRAPHICS_COCKPITS_HAVOC_LEVEL3_BASE;

			break;
		}
	}

	#if DEMO_VERSION

	base_cockpit_graphics_file = GRAPHICS_COCKPITS_HAVOC_LEVEL1_BASE;

	#endif

	set_havoc_instrument_colours ();

	////////////////////////////////////////
	//
	// draw overlaid instruments
	//
	////////////////////////////////////////

	if (!get_global_draw_cockpit_graphics ())
	{
		if (get_global_draw_overlaid_instruments ())
		{
			if (panel != COCKPIT_PANEL_SPECIAL_HAVOC_TV)
			{
				draw_overlaid_hind_mfd (68.0, 412.0, 128.0);

				draw_overlaid_hind_threat_warning_display (int_full_screen_width - 64, int_full_screen_height - 84);
			}
		}
	}

	////////////////////////////////////////
	//
	// draw cockpits
	//
	////////////////////////////////////////

	switch (panel)
	{
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_LEFT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				if (custom_3d_models.arneh_mi24v_cockpit)
					draw_hind_external_3d_cockpit(0, NULL);
				else
				{
					draw_hind_external_virtual_cockpit
					(
						VIRTUAL_COCKPIT_RAIN_EFFECT |
						VIRTUAL_COCKPIT_MAIN_ROTOR,
						NULL
					);
	
					if (lock_screen (active_screen))
					{
						blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U40_L90_RLE), ix_640_480, iy_640_480);
	
						unlock_screen (active_screen);
					}
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_LEFT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U40_L60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_LEFT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR |
					VIRTUAL_COCKPIT_COMPASS,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U40_L30_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_AHEAD:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR |
					VIRTUAL_COCKPIT_COMPASS,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_U40_AHD_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U40_AHD_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_RIGHT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_U40_R30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U40_R30_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_RIGHT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U40_R60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_RIGHT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U40_R90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_LEFT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U20_L90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_LEFT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U20_L60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_LEFT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				if (custom_3d_models.arneh_mi24v_cockpit)
				{
					draw_hind_external_3d_cockpit(0, NULL);
					draw_hind_internal_3d_cockpit(0);
				}
				else
				{
					draw_hind_external_virtual_cockpit
					(
						VIRTUAL_COCKPIT_MOVING_WIPER |
						VIRTUAL_COCKPIT_RAIN_EFFECT |
						VIRTUAL_COCKPIT_MAIN_ROTOR |
						VIRTUAL_COCKPIT_COMPASS,
						NULL
					);
	
					if (lock_screen (active_screen))
					{
						blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U20_L30_RLE), ix_640_480, iy_640_480);
	
						unlock_screen (active_screen);
					}

					draw_hind_internal_virtual_cockpit
					(
						VIRTUAL_COCKPIT_HUD_GLASS |
						VIRTUAL_COCKPIT_HUD_DISPLAY
					);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_AHEAD:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR |
					VIRTUAL_COCKPIT_COMPASS,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_U20_AHD_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U20_AHD_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}

				draw_hind_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_HUD_GLASS |
					VIRTUAL_COCKPIT_HUD_DISPLAY
				);
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_RIGHT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_U20_R30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U20_R30_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}

				draw_hind_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_HUD_GLASS |
					VIRTUAL_COCKPIT_HUD_DISPLAY
				);
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_RIGHT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U20_R60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_RIGHT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_U20_R90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_LEFT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_LVL_L90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_LEFT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_LVL_L60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_LEFT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_LVL_L30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_LVL_L30_RLE), ix_640_480, iy_640_480);

					draw_havoc_g_meter (panel);

					draw_havoc_radar_altimeter (panel);

					draw_hind_weapons_management_panel_lamps (panel);

					draw_hind_master_caution_lamp (panel);

					unlock_screen (active_screen);
				}

				draw_hind_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_HUD_GLASS |
					VIRTUAL_COCKPIT_HUD_DISPLAY
				);
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_AHEAD:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_LVL_AHD_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_LVL_AHD_RLE), ix_640_480, iy_640_480);

					draw_havoc_g_meter (panel);

					draw_havoc_radar_altimeter (panel);

					draw_havoc_weapons_management_panel_lamps (panel);

					draw_hind_threat_warning_display (panel);

					draw_hind_master_caution_lamp (panel);

					draw_hind_warning_panel_lamps (panel);

					unlock_screen (active_screen);
				}

				draw_hind_internal_virtual_cockpit (VIRTUAL_COCKPIT_HUD_GLASS);

				draw_hind_hud_on_cockpit (get_global_hud_enlarge ());
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_RIGHT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_LVL_R30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_LVL_R30_RLE), ix_640_480, iy_640_480);

					draw_hind_status_panel_lamps (panel);

					draw_hind_threat_warning_display (panel);

					draw_hind_warning_panel_lamps (panel);

					unlock_screen (active_screen);
				}

				draw_hind_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_HUD_GLASS |
					VIRTUAL_COCKPIT_HUD_DISPLAY
				);
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_RIGHT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_LVL_R60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_RIGHT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_LVL_R90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_LEFT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_D20_L90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_LEFT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_D20_L60_RLE), ix_640_480, iy_640_480);

					draw_havoc_barometric_altimeter (panel);

					draw_hind_weapons_management_panel_lamps (panel);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_LEFT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_ADI |
					VIRTUAL_COCKPIT_HSI |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_D20_L30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_D20_L30_RLE), ix_640_480, iy_640_480);

					draw_havoc_barometric_altimeter (panel);

					draw_havoc_airspeed_indicator (panel);

					draw_havoc_main_rotor_rpm_indicator (panel);

					draw_havoc_g_meter (panel);

					draw_havoc_vertical_speed_indicator (panel);

					draw_havoc_clock (panel);

					draw_havoc_radar_altimeter (panel);

					draw_hind_weapons_management_panel_lamps (panel);

					draw_hind_master_caution_lamp (panel);

					unlock_screen (active_screen);
				}

				draw_hind_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_HUD_GLASS |
					VIRTUAL_COCKPIT_HUD_DISPLAY |
					VIRTUAL_COCKPIT_CRT_DISPLAY |
					VIRTUAL_COCKPIT_INSTRUMENT_NEEDLES
				);
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_AHEAD:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_ADI |
					VIRTUAL_COCKPIT_HSI |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_D20_AHD_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_D20_AHD_RLE), ix_640_480, iy_640_480);

					draw_havoc_barometric_altimeter (panel);

					draw_havoc_airspeed_indicator (panel);

					draw_havoc_main_rotor_rpm_indicator (panel);

					draw_havoc_g_meter (panel);

					draw_havoc_engine_torque_indicator (panel);

					draw_havoc_engine_temperature_indicator (panel);

					draw_havoc_engine_rpm_indicator (panel);

					draw_havoc_engine_temperature_and_rpm_indicator_ticks (panel);

					draw_havoc_vertical_speed_indicator (panel);

					draw_havoc_clock (panel);

					draw_havoc_radar_altimeter (panel);

					draw_havoc_fuel_gauge (panel);

					draw_havoc_fixed_cockpit_hsi_waypoint_distance_digits (panel);

					draw_havoc_fixed_cockpit_hsi_waypoint_identifier (panel);

					draw_havoc_weapons_management_panel_lamps (panel);

					draw_havoc_status_panel_lamps (panel);

					draw_havoc_threat_warning_display (panel);

					draw_havoc_master_caution_lamp (panel);

					draw_havoc_warning_panel_lamps (panel);

					draw_havoc_radio_lamp (panel);

					draw_havoc_oil_gauges (panel);

					unlock_screen (active_screen);
				}

				draw_hind_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_HUD_GLASS |
					VIRTUAL_COCKPIT_HUD_DISPLAY |
					VIRTUAL_COCKPIT_INSTRUMENT_NEEDLES
				);

				draw_hind_mfd_on_cockpit (fx_640_480 + 354.0, fy_640_480 + 337.0, FALSE, FALSE);

				draw_hind_ekran_display_on_cockpit (fx_640_480 + 459.0, fy_640_480 + 310.0);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_CRT_MASK_D20_AHD_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_RIGHT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_D20_R30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_D20_R30_RLE), ix_640_480, iy_640_480);

					draw_havoc_engine_torque_indicator (panel);

					draw_havoc_engine_temperature_indicator (panel);

					draw_havoc_engine_rpm_indicator (panel);

					draw_havoc_engine_temperature_and_rpm_indicator_ticks (panel);

					draw_havoc_fuel_gauge (panel);

					draw_hind_status_panel_lamps (panel);

					draw_hind_threat_warning_display (panel);

					draw_hind_warning_panel_lamps (panel);

					draw_hind_radio_lamp (panel);

					draw_havoc_oil_gauges (panel);

					unlock_screen (active_screen);
				}

				draw_hind_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_HUD_GLASS |
					VIRTUAL_COCKPIT_HUD_DISPLAY |
					VIRTUAL_COCKPIT_CRT_DISPLAY |
					VIRTUAL_COCKPIT_EKRAN_DISPLAY
				);
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_RIGHT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_D20_R60_RLE), ix_640_480, iy_640_480);

					draw_hind_status_panel_lamps (panel);

					draw_hind_radio_lamp (panel);

					draw_havoc_oil_gauges (panel);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_RIGHT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_D20_R90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}
			else
			{
				draw_hind_hud_on_cockpit (TRUE);
			}

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_SPECIAL_HAVOC_TV:
		////////////////////////////////////////
		{
			if (lock_screen (active_screen))
			{
				blit_rgb_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_CRT_RGB), ix_640_480, iy_640_480);

				unlock_screen (active_screen);
			}

			draw_hind_mfd_on_cockpit (fx_640_480 + 321.0, fy_640_480 + 229.0, TRUE, FALSE);

			if (lock_screen (active_screen))
			{
				blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_CRT_MASK_CRT_RLE), ix_640_480, iy_640_480);

				unlock_screen (active_screen);
			}

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_SPECIAL_HAVOC_HUD:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_hind_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_LARGE_HUD |
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_WIPER_HUD)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_HAVOC_HUD_RLE), ix_640_480, iy_640_480);

					draw_hind_threat_warning_display (panel);

					draw_hind_master_caution_lamp (panel);

					draw_hind_warning_panel_lamps (panel);

					unlock_screen (active_screen);
				}

				draw_hind_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_LARGE_HUD |
					VIRTUAL_COCKPIT_HUD_GLASS
				);
			}

			draw_hind_hud_on_cockpit (TRUE);

			draw_hind_hms ();

			break;
		}
		////////////////////////////////////////
		default:
		////////////////////////////////////////
		{
			debug_fatal ("Invalid cockpit panel = %d", panel);

			break;
		}
	}
}
Beispiel #14
0
void draw_ah64a_cockpit (cockpit_panels panel)
{
	////////////////////////////////////////
	//
	// select cockpit graphics wrt time of day
	//
	////////////////////////////////////////

	switch (get_local_entity_int_value (get_session_entity (), INT_TYPE_DAY_SEGMENT_TYPE))
	{
		case DAY_SEGMENT_TYPE_DAWN:
		{
			base_cockpit_graphics_file = GRAPHICS_COCKPITS_APACHE_LEVEL2_BASE;

			break;
		}
		case DAY_SEGMENT_TYPE_DAY:
		{
			base_cockpit_graphics_file = GRAPHICS_COCKPITS_APACHE_LEVEL1_BASE;

			break;
		}
		case DAY_SEGMENT_TYPE_DUSK:
		{
			base_cockpit_graphics_file = GRAPHICS_COCKPITS_APACHE_LEVEL2_BASE;

			break;
		}
		case DAY_SEGMENT_TYPE_NIGHT:
		{
			base_cockpit_graphics_file = GRAPHICS_COCKPITS_APACHE_LEVEL3_BASE;

			break;
		}
	}

	#if DEMO_VERSION

	base_cockpit_graphics_file = GRAPHICS_COCKPITS_APACHE_LEVEL1_BASE;

	#endif

	set_ah64a_instrument_colours ();

	////////////////////////////////////////
	//
	// draw overlaid instruments
	//
	////////////////////////////////////////

	if (!get_global_draw_cockpit_graphics ())
	{
		if (get_global_draw_overlaid_instruments ())
		{
			if ((panel != COCKPIT_PANEL_SPECIAL_APACHE_LHS_MFD) && (panel != COCKPIT_PANEL_SPECIAL_APACHE_RHS_MFD))
			{
				draw_overlaid_ah64a_mfd (68.0, 412.0, 128.0, MFD_LOCATION_LHS);

				draw_overlaid_ah64a_mfd (572.0, 412.0, 128.0, MFD_LOCATION_RHS);
			}
		}
	}

	////////////////////////////////////////
	//
	// draw cockpits
	//
	////////////////////////////////////////

	switch (panel)
	{
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_LEFT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U40_L90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_LEFT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U40_L60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_LEFT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U40_L30_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_AHEAD:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U40_AHD_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_RIGHT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U40_R30_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_RIGHT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U40_R60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP40_RIGHT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U40_R90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_LEFT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U20_L90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_LEFT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U20_L60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_LEFT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_WIPER_U20_L30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U20_L30_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_AHEAD:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_WIPER_U20_AHD_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U20_AHD_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_RIGHT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U20_R30_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_RIGHT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U20_R60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_UP20_RIGHT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_U20_R90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_LEFT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_LVL_L90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_LEFT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_LVL_L60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_LEFT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_WIPER_LVL_L30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_LVL_L30_RLE), ix_640_480, iy_640_480);

					draw_ah64a_indicator_lamps (panel);

					draw_ah64a_fire_detector_lamps (panel);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_AHEAD:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_WIPER_LVL_AHD_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_LVL_AHD_RLE), ix_640_480, iy_640_480);

					draw_ah64a_indicator_lamps (panel);

					draw_ah64a_fire_detector_lamps (panel);

					unlock_screen (active_screen);
				}

				draw_ah64a_upfront_display_on_cockpit (fx_640_480 + 338.0, fy_640_480 + 428.0);
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_RIGHT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_WIPER_LVL_R30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_LVL_R30_RLE), ix_640_480, iy_640_480);

					draw_ah64a_indicator_lamps (panel);

					unlock_screen (active_screen);
				}

				draw_ah64a_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_UPFRONT_DISPLAY
				);
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_RIGHT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_LVL_R60_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_LEVEL_RIGHT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_LVL_R90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_LEFT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_D20_L90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_LEFT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_D20_L60_RLE), ix_640_480, iy_640_480);

					draw_ah64a_fixed_cockpit_clock_hands (panel);

					draw_ah64a_armament_lamps (panel);

					unlock_screen (active_screen);
				}

				draw_ah64a_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_INSTRUMENT_NEEDLES
				);
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_LEFT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_WIPER_D20_L30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_D20_L30_RLE), ix_640_480, iy_640_480);

					draw_ah64a_fixed_cockpit_clock_hands (panel);

					draw_ah64a_indicator_lamps (panel);

					draw_ah64a_fire_detector_lamps (panel);

					draw_ah64a_armament_lamps (panel);

					draw_ah64a_mfd_lamps (panel);

					unlock_screen (active_screen);
				}

				draw_ah64a_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_LHS_MFD_DISPLAY |
					VIRTUAL_COCKPIT_RHS_MFD_DISPLAY |
					VIRTUAL_COCKPIT_UPFRONT_DISPLAY |
					VIRTUAL_COCKPIT_INSTRUMENT_NEEDLES
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_MFD_MASK_D20_L30_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_AHEAD:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR |
					VIRTUAL_COCKPIT_ADI |
					VIRTUAL_COCKPIT_COMPASS,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_WIPER_D20_AHD_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_D20_AHD_RLE), ix_640_480, iy_640_480);

					draw_ah64a_fixed_cockpit_airspeed_indicator_needle (panel);

					draw_ah64a_fixed_cockpit_barometric_altimeter_digits (panel);

					draw_ah64a_fixed_cockpit_barometric_altimeter_needle (panel);

					draw_ah64a_fixed_cockpit_clock_hands (panel);

					draw_ah64a_indicator_lamps (panel);

					draw_ah64a_fire_detector_lamps (panel);

					draw_ah64a_armament_lamps (panel);

					draw_ah64a_mfd_lamps (panel);

					unlock_screen (active_screen);
				}

				draw_ah64a_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_INSTRUMENT_NEEDLES
				);

				draw_ah64a_upfront_display_on_cockpit (fx_640_480 + 334.0, fy_640_480 + 226.0);

				draw_ah64a_mfd_on_cockpit (fx_640_480 + 226.0, fy_640_480 + 367.0, FALSE, FALSE, MFD_LOCATION_LHS);

				draw_ah64a_mfd_on_cockpit (fx_640_480 + 414.0, fy_640_480 + 367.0, FALSE, FALSE, MFD_LOCATION_RHS);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_MFD_MASK_D20_AHD_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_RIGHT30:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RENDERED_WIPER |
					VIRTUAL_COCKPIT_MOVING_WIPER |
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR |
					VIRTUAL_COCKPIT_ADI |
					VIRTUAL_COCKPIT_COMPASS,
					get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_WIPER_D20_R30_RLE)
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_D20_R30_RLE), ix_640_480, iy_640_480);

					draw_ah64a_fixed_cockpit_airspeed_indicator_needle (panel);

					draw_ah64a_fixed_cockpit_barometric_altimeter_needle (panel);

					draw_ah64a_indicator_lamps (panel);

					draw_ah64a_mfd_lamps (panel);

					unlock_screen (active_screen);
				}

				draw_ah64a_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_LHS_MFD_DISPLAY |
					VIRTUAL_COCKPIT_RHS_MFD_DISPLAY |
					VIRTUAL_COCKPIT_UPFRONT_DISPLAY |
					VIRTUAL_COCKPIT_INSTRUMENT_NEEDLES
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_MFD_MASK_D20_R30_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_RIGHT60:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR |
					VIRTUAL_COCKPIT_ADI |
					VIRTUAL_COCKPIT_COMPASS,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_D20_R60_RLE), ix_640_480, iy_640_480);

					draw_ah64a_fixed_cockpit_airspeed_indicator_needle (panel);

					draw_ah64a_fixed_cockpit_barometric_altimeter_needle (panel);

					unlock_screen (active_screen);
				}

				draw_ah64a_internal_virtual_cockpit
				(
					VIRTUAL_COCKPIT_INSTRUMENT_NEEDLES
				);
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_DOWN20_RIGHT90:
		////////////////////////////////////////
		{
			if (get_global_draw_cockpit_graphics ())
			{
				draw_ah64a_external_virtual_cockpit
				(
					VIRTUAL_COCKPIT_RAIN_EFFECT |
					VIRTUAL_COCKPIT_MAIN_ROTOR,
					NULL
				);

				if (lock_screen (active_screen))
				{
					blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_D20_R90_RLE), ix_640_480, iy_640_480);

					unlock_screen (active_screen);
				}
			}

			draw_ah64a_hud ();

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_SPECIAL_APACHE_LHS_MFD:
		////////////////////////////////////////
		{
			if (lock_screen (active_screen))
			{
				blit_rgb_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_LHS_MFD_RGB), ix_640_480, iy_640_480);

				draw_ah64a_armament_lamps (panel);

				draw_ah64a_mfd_lamps (panel);

				unlock_screen (active_screen);
			}

			draw_ah64a_mfd_on_cockpit (fx_640_480 + 320.0, fy_640_480 + 235.0, TRUE, FALSE, MFD_LOCATION_LHS);

			if (lock_screen (active_screen))
			{
				blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_MFD_MASK_LHS_MFD_RLE), ix_640_480, iy_640_480);

				unlock_screen (active_screen);
			}

			break;
		}
		////////////////////////////////////////
		case COCKPIT_PANEL_SPECIAL_APACHE_RHS_MFD:
		////////////////////////////////////////
		{
			draw_ah64a_external_virtual_cockpit
			(
				VIRTUAL_COCKPIT_LARGE_ADI,
				NULL
			);

			if (lock_screen (active_screen))
			{
				blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_RHS_MFD_RLE), ix_640_480, iy_640_480);

				draw_ah64a_mfd_lamps (panel);

				unlock_screen (active_screen);
			}

			draw_ah64a_internal_virtual_cockpit
			(
				VIRTUAL_COCKPIT_INSTRUMENT_LARGE_NEEDLES
			);

			draw_ah64a_mfd_on_cockpit (fx_640_480 + 320.0, fy_640_480 + 235.0, TRUE, FALSE, MFD_LOCATION_RHS);

			if (lock_screen (active_screen))
			{
				blit_rle_graphic (get_graphics_file_data (base_cockpit_graphics_file + GRAPHICS_COCKPITS_APACHE_MFD_MASK_RHS_MFD_RLE), ix_640_480, iy_640_480);

				unlock_screen (active_screen);
			}

			break;
		}
		////////////////////////////////////////
		default:
		////////////////////////////////////////
		{
			debug_fatal ("Invalid cockpit panel = %d", panel);

			break;
		}
	}
}
Beispiel #15
0
void draw_hind_mfd_on_texture (void)
{
	if (!map_active)
		return;

	set_system_texture_screen (mfd_texture_screen, TEXTURE_INDEX_HIND_MAP_DISPLAY);

	////////////////////////////////////////
	//
	// set up MFD 2D environment
	//
	////////////////////////////////////////

	set_2d_active_environment (mfd_env);

	//
	// window
	//

	set_2d_window (mfd_env, MFD_WINDOW_X_MIN, MFD_WINDOW_Y_MIN, MFD_WINDOW_X_MAX, MFD_WINDOW_Y_MAX);

	//
	// viewport
	//

	if (custom_3d_models.arneh_mi24v_cockpit)
	{
		mfd_viewport_size = MFD_VIEWPORT_SIZE;
		mfd_texture_size = MFD_TEXTURE_SIZE;
	}
	else
	{
		mfd_viewport_size = MFD_HAVOC_VIEWPORT_SIZE;
		mfd_texture_size = MFD_HAVOC_TEXTURE_SIZE;
	}

	mfd_viewport_texture_x_org = mfd_texture_size / 2;
	mfd_viewport_texture_y_org = mfd_texture_size / 2;

	ASSERT (mfd_viewport_size <= mfd_texture_size);

	mfd_viewport_x_org = mfd_viewport_texture_x_org;
	mfd_viewport_y_org = mfd_viewport_texture_y_org;

	mfd_viewport_x_min = mfd_viewport_x_org - (mfd_viewport_size * 0.5);
	mfd_viewport_y_min = mfd_viewport_y_org - (mfd_viewport_size * 0.5);
	mfd_viewport_x_max = mfd_viewport_x_org + (mfd_viewport_size * 0.5) - 0.001;
	mfd_viewport_y_max = mfd_viewport_y_org + (mfd_viewport_size * 0.5) - 0.001;

	set_2d_viewport (mfd_env, mfd_viewport_x_min, mfd_viewport_y_min, mfd_viewport_x_max, mfd_viewport_y_max);

	////////////////////////////////////////
	//
	// draw MFD display
	//
	////////////////////////////////////////

	if (!hind_damage.navigation_computer && !map_up_to_date)
	{
		set_active_screen (mfd_texture_screen);

		if (lock_screen (mfd_texture_screen))
		{
			set_block (0, 0, mfd_viewport_size - 1, mfd_viewport_size - 1, clear_mfd_colour);

			draw_layout_grid ();

			draw_map_display ();

			flush_screen_texture_graphics (mfd_texture_screen);

			unlock_screen (mfd_texture_screen);
		}

		set_active_screen (video_screen);
	}
/*
	if(command_line_export_mfd)
	{
		export_screen=create_screen_for_system_texture (TEXTURE_INDEX_HIND_MAP_DISPLAY);
		copy_export_mfd(export_screen,NULL);
	}
*/
}