File: LegacyInfoTextureHandler.h

package info (click to toggle)
spring 103.0%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 43,720 kB
  • ctags: 63,685
  • sloc: cpp: 368,283; ansic: 33,988; python: 12,417; java: 12,203; awk: 5,879; sh: 1,846; xml: 655; perl: 405; php: 211; objc: 194; makefile: 77; sed: 2
file content (72 lines) | stat: -rw-r--r-- 1,807 bytes parent folder | download
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
71
72
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */

#ifndef _LEGACY_INFO_TEXTURE_HANDLER_H
#define _LEGACY_INFO_TEXTURE_HANDLER_H

#include "Rendering/Map/InfoTexture/IInfoTextureHandler.h"
#include "Rendering/Map/InfoTexture/InfoTexture.h"
#include "Rendering/GL/PBO.h"
#include <vector>



class CLegacyInfoTextureHandler : public IInfoTextureHandler
{
public:
	enum {
		COLOR_R = 2,
		COLOR_G = 1,
		COLOR_B = 0,
		COLOR_A = 3,
	};
	enum BaseGroundDrawMode {
		drawNormal   = 0,
		drawLos      = 1, // L
		drawMetal    = 2, // F4
		drawHeight   = 3, // F1
		drawPathTrav = 4, // F2
		drawPathHeat = 5, // not hotkeyed, command-only
		drawPathFlow = 6, // not hotkeyed, command-only
		drawPathCost = 7, // not hotkeyed, command-only
		NUM_INFOTEXTURES = 8,
	};

public:
	CLegacyInfoTextureHandler();
	virtual ~CLegacyInfoTextureHandler();

	void Update() override;
	bool UpdateExtraTexture(BaseGroundDrawMode texDrawMode);

public:
	bool IsEnabled() const override;
	void DisableCurrentMode() override;
	void SetMode(const std::string& name) override;
	void ToggleMode(const std::string& name) override;
	const std::string& GetMode() const override;

	GLuint GetCurrentInfoTexture() const override;
	int2 GetCurrentInfoTextureSize() const override;

public:
	const CInfoTexture* GetInfoTextureConst(const std::string& name) const override;
	      CInfoTexture* GetInfoTexture     (const std::string& name)       override;

protected:
	BaseGroundDrawMode drawMode;

	int updateTextureState;
	int extraTextureUpdateRate;

	// note: first texture ID is always 0!
	GLuint infoTextureIDs[NUM_INFOTEXTURES];
	std::vector<CInfoTexture> infoTextures;

	PBO infoTexPBO;

	bool returnToLOS;
	bool highResLosTex;
	bool highResInfoTexWanted;
};

#endif // _LEGACY_INFO_TEXTURE_HANDLER_H