basictreedrawer.h

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

H
52
字号
// TreeDrawer.h: interface for the CTreeDrawer class.
//
//////////////////////////////////////////////////////////////////////

#ifndef __BASIC_TREE_DRAWER_H__
#define __BASIC_TREE_DRAWER_H__

#include <map>
#include "BaseTreeDrawer.h"
#include "Rendering/GL/myGL.h"

#define MAX_TREE_HEIGHT 60

class CBasicTreeDrawer : public CBaseTreeDrawer
{
public:
	CBasicTreeDrawer();
	virtual ~CBasicTreeDrawer();

	void Draw(float treeDistance,bool drawReflection);
	void Update();
	void CreateTreeTex(GLuint& texnum,unsigned char* data,int xsize,int ysize);
	void AddTree(int type, float3 pos, float size);
	void DeleteTree(float3 pos);

	GLuint treetex;
	int lastListClean;

	struct TreeStruct{
		float3 pos;
		int type;
	};

	struct TreeSquareStruct {
		unsigned int displist;
		unsigned int farDisplist;
		int lastSeen;
		int lastSeenFar;
		float3 viewVector;
		std::map<int,TreeStruct> trees;
		TreeSquareStruct() : displist(0), farDisplist(0), lastSeen(0), lastSeenFar(0) {}
	};

	TreeSquareStruct* trees;
	int treesX;
	int treesY;

	void ResetPos(const float3& pos);
};

#endif // __BASIC_TREE_DRAWER_H__

⌨️ 快捷键说明

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