File: hudbrackets.h

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (51 lines) | stat: -rw-r--r-- 1,764 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * Copyright (C) Volition, Inc. 1999.  All rights reserved.
 *
 * All source code herein is the property of Volition, Inc. You may not sell 
 * or otherwise commercially exploit the source or things you created based on the 
 * source.
 *
*/ 



#ifndef HUD_BRACKETS
#define HUD_BRACKETS

#include "hud/hud.h"
#include "graphics/line_draw_list.h"

void hud_init_brackets();

// requires that x2 > x1 and y2 > y1
void draw_brackets_square(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2, int resize_mode = GR_RESIZE_FULL);

void draw_brackets_square_quick(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2, int thick=0);
void draw_brackets_diamond_quick(graphics::line_draw_list* draw_list, int x1, int y1, int x2, int y2);

int draw_subsys_brackets(graphics::line_draw_list* draw_list, ship_subsys* subsys, int min_width, int min_height, bool draw = true, bool set_color = true, int* draw_coords = NULL);

class HudGaugeBrackets: public HudGauge3DAnchor
{
protected:
	int attacking_dot;

	int Min_target_box_width;
	int Min_target_box_height;
	int Min_subtarget_box_width;
	int Min_subtarget_box_height;

	graphics::line_draw_list line_draw_list;
public:
	HudGaugeBrackets();
	void initMinTargetBoxSizes(int w, int h);
	void initMinSubTargetBoxSizes(int w, int h);
	void initBitmaps(char *fname);
	void render(float frametime) override;
	void renderObjectBrackets(object *targetp, color *clr, int w_correction, int h_correction, int flags);
	void renderNavBrackets(vec3d* nav_pos, vertex* nav_point, color* clr, char* string);
	void renderBoundingBrackets(int x1, int y1, int x2, int y2, int w_correction, int h_correction, float distance, int target_objnum, int flags);
	void renderBoundingBracketsSubobject();
};

#endif