Browse Source

Removed no longer used class

Ivan Savenko 1 year ago
parent
commit
5419df1140
2 changed files with 0 additions and 93 deletions
  1. 0 78
      client/windows/InfoWindows.cpp
  2. 0 15
      client/windows/InfoWindows.h

+ 0 - 78
client/windows/InfoWindows.cpp

@@ -232,84 +232,6 @@ std::string CInfoWindow::genText(std::string title, std::string description)
 	return std::string("{") + title + "}" + "\n\n" + description;
 }
 
-CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free)
- :free(Free),bitmap(Bitmap)
-{
-	init(x, y);
-}
-
-
-CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, const Point &p, ETextAlignment alignment, bool Free)
- : free(Free),bitmap(Bitmap)
-{
-	switch(alignment)
-	{
-	case ETextAlignment::BOTTOMRIGHT:
-		init(p.x - Bitmap->w, p.y - Bitmap->h);
-		break;
-	case ETextAlignment::CENTER:
-		init(p.x - Bitmap->w/2, p.y - Bitmap->h/2);
-		break;
-	case ETextAlignment::TOPLEFT:
-		init(p.x, p.y);
-		break;
-	case ETextAlignment::TOPCENTER:
-		init(p.x - Bitmap->w/2, p.y);
-		break;
-	default:
-		assert(0); //not implemented
-	}
-}
-
-CInfoPopup::CInfoPopup(SDL_Surface *Bitmap, bool Free)
-{
-	CCS->curh->hide();
-
-	free=Free;
-	bitmap=Bitmap;
-
-	if(bitmap)
-	{
-		pos.x = GH.screenDimensions().x / 2 - bitmap->w / 2;
-		pos.y = GH.screenDimensions().y / 2 - bitmap->h / 2;
-		pos.h = bitmap->h;
-		pos.w = bitmap->w;
-	}
-}
-
-void CInfoPopup::close()
-{
-	if(free)
-		SDL_FreeSurface(bitmap);
-	WindowBase::close();
-}
-
-void CInfoPopup::show(Canvas & to)
-{
-	CSDL_Ext::blitAt(bitmap,pos.x,pos.y,to.getInternalSurface());
-}
-
-CInfoPopup::~CInfoPopup()
-{
-	CCS->curh->show();
-}
-
-void CInfoPopup::init(int x, int y)
-{
-	CCS->curh->hide();
-
-	pos.x = x;
-	pos.y = y;
-	pos.h = bitmap->h;
-	pos.w = bitmap->w;
-
-	// Put the window back on screen if necessary
-	vstd::amax(pos.x, 0);
-	vstd::amax(pos.y, 0);
-	vstd::amin(pos.x, GH.screenDimensions().x - bitmap->w);
-	vstd::amin(pos.y, GH.screenDimensions().y - bitmap->h);
-}
-
 bool CRClickPopup::isPopupWindow() const
 {
 	return true;

+ 0 - 15
client/windows/InfoWindows.h

@@ -97,21 +97,6 @@ public:
 	virtual ~CRClickPopupInt();
 };
 
-class CInfoPopup : public CRClickPopup
-{
-public:
-	bool free; //TODO: comment me
-	SDL_Surface * bitmap; //popup background
-	void close() override;
-	void show(Canvas & to) override;
-	CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free=false);
-	CInfoPopup(SDL_Surface * Bitmap, const Point &p, ETextAlignment alignment, bool Free=false);
-	CInfoPopup(SDL_Surface * Bitmap = nullptr, bool Free = false);
-
-	void init(int x, int y);
-	~CInfoPopup();
-};
-
 /// popup on adventure map for town\hero and other objects with customized popup content
 class CInfoBoxPopup : public CWindowObject
 {