2016-02-22 20:43:14 -05:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TITANIC_GAME_VIEW_H
|
|
|
|
#define TITANIC_GAME_VIEW_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
|
|
|
|
namespace Titanic {
|
|
|
|
|
|
|
|
class CMainGameWindow;
|
|
|
|
class CGameManager;
|
2017-08-24 04:05:49 -07:00
|
|
|
class CResourceKey;
|
|
|
|
class CViewItem;
|
|
|
|
class CVideoSurface;
|
|
|
|
class Rect;
|
2016-02-22 20:43:14 -05:00
|
|
|
|
|
|
|
class CGameView {
|
|
|
|
protected:
|
|
|
|
CGameManager *_gameManager;
|
2016-03-12 19:23:00 -05:00
|
|
|
public:
|
2016-03-16 19:05:16 -04:00
|
|
|
CVideoSurface *_surface;
|
2016-02-22 20:43:14 -05:00
|
|
|
public:
|
|
|
|
CGameView();
|
2016-08-07 19:04:28 -04:00
|
|
|
virtual ~CGameView();
|
2016-02-22 20:43:14 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the game manager
|
|
|
|
*/
|
|
|
|
void setGameManager(CGameManager *gameManager);
|
2016-03-12 19:23:00 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called after loading a game has finished
|
|
|
|
*/
|
|
|
|
void postLoad();
|
|
|
|
|
|
|
|
virtual void deleteView(int roomNumber, int nodeNumber, int viewNumber);
|
|
|
|
|
2016-03-13 15:07:27 -04:00
|
|
|
/**
|
|
|
|
* Set the currently active view
|
|
|
|
*/
|
|
|
|
virtual void setView(CViewItem *item) = 0;
|
2016-10-09 14:59:58 +02:00
|
|
|
|
2016-03-21 20:53:49 -04:00
|
|
|
virtual void draw(const Rect &bounds) = 0;
|
2016-03-16 07:56:26 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a surface from a specified resource
|
|
|
|
*/
|
|
|
|
void createSurface(const CResourceKey &key);
|
2016-03-20 17:29:58 -04:00
|
|
|
|
2016-03-21 20:53:49 -04:00
|
|
|
/**
|
|
|
|
* Draws the background of a view
|
|
|
|
*/
|
|
|
|
void drawView();
|
2016-02-22 20:43:14 -05:00
|
|
|
};
|
|
|
|
|
2016-03-12 19:23:00 -05:00
|
|
|
class CSTGameView: public CGameView {
|
2016-02-22 20:43:14 -05:00
|
|
|
private:
|
|
|
|
CMainGameWindow *_gameWindow;
|
|
|
|
public:
|
2016-03-12 19:23:00 -05:00
|
|
|
CSTGameView(CMainGameWindow *gameWindow);
|
|
|
|
|
2016-03-13 15:07:27 -04:00
|
|
|
/**
|
|
|
|
* Set the currently active view
|
|
|
|
*/
|
2020-02-09 12:05:33 +01:00
|
|
|
void setView(CViewItem *item) override;
|
2016-03-13 15:07:27 -04:00
|
|
|
|
2016-03-20 00:01:40 -04:00
|
|
|
/**
|
|
|
|
* Handles drawing the view
|
|
|
|
*/
|
2020-02-09 12:05:33 +01:00
|
|
|
void draw(const Rect &bounds) override;
|
2016-02-22 20:43:14 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Titanic
|
|
|
|
|
|
|
|
#endif /* TITANIC_GAME_VIEW_H */
|