#pragma once
#include "global.h"
//前置声明
struct MyView;
struct MyMapLayer;
class GameMap;
class GamePxa;
//地图绘制器
class MapDrawer
{
public:
	virtual ~MapDrawer();
	void Init(MyDX11Renderer* pRenderer, MyView* pView, GamePxa* gamePxa);
	void DrawLayerBack(MyMapLayer* pLayer, float windAniIndex, float windAniIndex2);//绘制里层地形
	void DrawLayerFront(MyMapLayer* pLayer);//绘制表层地形
	void DrawLoopLayer(MyMapLayer* pLayer, float delteTime);//绘制循环背景层
	void DrawPxaLayer(MyMapLayer* pLayer);//绘制地形类型
	void DrawRoomName(const wchar_t* roomName);//绘制房间名
	void OnResetScale();
	void MNA();
	void Reset();
	void LoopLayerStep(MyMapLayer* pLayer, float timeCounter);
private:
	MyDX11Renderer* pRenderer = nullptr;
	MyView* pView = nullptr;
	GamePxa* gamePxa = nullptr;
	//绘制房间名
	std::wstring roomName;
	MyTextureAndSRV tas;
	const int roomName_counter_max = 180;
	const int roomName_fadespeed = 2;
	int roomName_alpha = 0;
	int roomName_counter = 0;	
	bool roomName_fadein = false;
	bool roomName_fadeWait = false;
	bool roomName_fadeout = false;
	float MyFar(float myFar);
};

