infoconsole.h

来自「这是整套横扫千军3D版游戏的源码」· C头文件 代码 · 共 71 行

H
71
字号
#ifndef INFOCONSOLE_H
#define INFOCONSOLE_H
// InfoConsole.h: interface for the CInfoConsole class.
//
//////////////////////////////////////////////////////////////////////

#include <deque>
#include <vector>
#include <string>
#include <boost/thread/recursive_mutex.hpp>
#include <SDL_types.h>
#include "float3.h"
#include "InputReceiver.h"
#include "LogOutput.h"

class CInfoConsole : public CInputReceiver, public ILogSubscriber
{
public:
	CInfoConsole();
	virtual ~CInfoConsole();

	void Update();
	void Draw();

	// ILogSubscriber interface implementation
	void NotifyLogMsg(int zone, const char* txt);
	void SetLastMsgPos(const float3& pos);


	int lifetime;
	float xpos;
	float ypos;
	float width;
	float height;
	int numLines;
	bool disabled;

	float3 lastMsgPos;

public:
	static const int maxRawLines;
	struct RawLine {
		std::string text;
		int zone;
		int id;
		Uint32 time;
	};
	int  GetRawLines(std::deque<RawLine>& copy);
	void GetNewRawLines(std::vector<RawLine>& copy);

private:
	std::deque<RawLine> rawData;
	int newLines;
	int rawId;

	struct InfoLine {
		std::string text;
		int time;
	};
	int lastTime;
	std::deque<InfoLine> data;

	std::string tempstring;
	int verboseLevel;

	void AddLineHelper (int zone, const char *text);
	mutable boost::recursive_mutex infoConsoleMutex;
};

#endif /* INFOCONSOLE_H */

⌨️ 快捷键说明

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