#pragma once
#include "global.h"
struct MyView;
class Entity;
#define GAMEFADE_TEXTURE L"fade"
//渐入渐出绘制
class GameFade
{
public:
	void Init(MyDX11Renderer* pRenderer, MyView* pView, std::weak_ptr<Entity>* mychar_ptr);
	void Reset();
	void Step();
	void Draw();
	void FAI(int direction);
	void FAO(int direction);
	bool GetLight();
	void SetLight(bool bLight);
	bool GetFadeIn();
	bool GetFadeOut();
private:
	MyDX11Renderer* pRenderer = nullptr;
	MyView* pView = nullptr;
	std::weak_ptr<Entity>* mychar_ptr = nullptr;
	bool fadelight = true;
	bool fadein = false;
	bool fadeout = false;
	int fade_counter = 0;
	int fade_direction = 0;
	BYTE alpha = 0xff;
	void FadeStep();
	void FadeStep2();//不加速4号方向
	void FadeDrawSq(double x, double y, int r, int time);
};

