#pragma once
#include "global.h"
#include "MyView.h"
#include "MapDrawer.h"
#include "EntityRes.h"
//舞台绘制器
class StageDrawer
{
public:
	virtual ~StageDrawer();
	void Init(MyDX11Renderer* pRenderer, MyView* pView, GameMap* gameMap, EntityRes* entityRes, GamePxa* gamePxa);
	void Step();
	MyMapLayer* Draw(float deltaTime);
	void OnResetScale(int w, int h);
	void Reset();
	MapDrawer* GetMapDrawer();
private:
	MyDX11Renderer* pRenderer = nullptr;
	MyView* pView = nullptr;
	GameMap* gameMap = nullptr;
	EntityRes* entityRes = nullptr;
	GamePxa* gamePxa = nullptr;
	MapDrawer mapDrawer;
	//循环背景动画
	float timeCounter_mapLoopBk = 0;
	//风场动画
	//垂直风场
	float windAniSpeed = 0.1f;//风场动画速度
	float windAniIndex_set = 0;
	float windAniIndex_set_last = 0;
	//斜向风场
	float windAniSpeed2 = windAniSpeed * sqrtf(2) / 2;//风场动画速度
	float windAniIndex2_set = 0;
	float windAniIndex2_set_last = 0;
	//缓冲
	ExTextureBuffer stageBuffer, entityLight;
};

