⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 color.h

📁 我对他如何控制准星、显示敌友很好奇
💻 H
字号:
#ifndef COLOR_H
#define COLOR_H
#include "stringfinder.h"
#include <vector>
#include <assert.h>
//====================================================================
struct ColorEntry 
{ 
	DWORD r,g,b,a; 
	DWORD compiled;
	float fr,fg,fb;
	float onebased_r,onebased_g,onebased_b,onebased_a;
	
	ColorEntry():r(255),g(255),b(255),a(255)
		,fr(1.0),fg(1.0),fb(1.0)
		,onebased_r(1.0),onebased_g(1.0),onebased_b(1.0),onebased_a(1.0)
		,compiled(0xFFFFFFFF){}

	// fills missing fields from the r,g,b,a int components
	void fill_missing();
};

//====================================================================
class ColorManager
{
public:
	ColorManager(){ init(); }
	void set(char* name, char* red, char* green, char* blue, char* alpha);
	
	// see init() for valid indexes
	ColorEntry* get(unsigned int index){ assert(index<list.size()); return &(list[index]); } 

private:
	StringFinder indexes;
	std::vector<ColorEntry> list;
	int insertpos;

	void add(const char* name,int r, int g, int b, int a=255);
	void init(); 
};

// Color Manager
extern ColorManager colorList;

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -