File: hudlock.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 (70 lines) | stat: -rw-r--r-- 1,800 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * 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 _HUDLOCK_H
#define _HUDLOCK_H

#include "hud/hud.h"

struct lock_info;

void hud_init_missile_lock();
void hud_calculate_lock_position(float frametime);
void hud_calculate_lock_start_pos();
void hud_do_lock_indicator(float frametime);
void hud_do_lock_indicators(float frametime);
void hud_stop_looped_locking_sounds();
void hud_lock_reset(float lock_time_scale=1.0f);

class HudGaugeLock: public HudGauge3DAnchor
{
protected:
	hud_anim Lock_gauge;
	hud_anim Lock_anim;

	bool loop_locked_anim;
	bool blink_locked_anim;

	int Lock_gauge_half_w;
	int Lock_gauge_half_h;
	int Lockspin_half_w;
	int Lockspin_half_h;
	float Lock_triangle_height;
	float Lock_triangle_base;
	int Lock_target_box_width;
	int Lock_target_box_height;

	int Rotate_time_id;
	int Lock_gauge_draw_stamp;
	int Lock_gauge_draw;

	bool Last_lock_status;
public:
	HudGaugeLock();
	void initBitmaps(char *lock_gauge_fname, char *lock_anim_fname);
	void initGaugeHalfSize(int w, int h);
	void initSpinHalfSize(int w, int h);
	void initTriHeight(float h);
	void initTriBase(float length);
	void initTargetBoxSize(int w, int h);
	void initLoopLockedAnim(bool loop);
	void initBlinkLockedAnim(bool blink);

	void render(float frametime) override;
	void renderOld(float frametime);
	void renderLockTriangles(int center_x, int center_y, float frametime);
	void renderLockTrianglesNew(int center_x, int center_y, float frametime, lock_info *slot);
	void renderLockTrianglesOld(int center_x, int center_y, int radius);
	void pageIn() override;
	void initialize() override;
};

#endif