2016-02-25 08:39:15 -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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-02-28 21:42:13 -05:00
|
|
|
#ifndef TITANIC_STAR_CONTROL_H
|
|
|
|
#define TITANIC_STAR_CONTROL_H
|
2016-02-25 08:39:15 -05:00
|
|
|
|
2017-08-23 06:16:00 -07:00
|
|
|
#include "titanic/core/game_object.h" // class SimpleFile
|
2016-07-17 13:02:47 -04:00
|
|
|
#include "titanic/star_control/star_field.h"
|
2016-07-02 14:17:02 -04:00
|
|
|
#include "titanic/star_control/star_view.h"
|
2016-02-25 08:39:15 -05:00
|
|
|
|
|
|
|
namespace Titanic {
|
|
|
|
|
2017-08-23 06:16:00 -07:00
|
|
|
class CPetControl;
|
|
|
|
|
2016-02-28 21:42:13 -05:00
|
|
|
class CStarControl : public CGameObject {
|
2016-07-24 20:52:21 -04:00
|
|
|
DECLARE_MESSAGE_MAP;
|
2016-07-02 18:46:54 -04:00
|
|
|
bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
|
|
|
|
bool MouseMoveMsg(CMouseMoveMsg *msg);
|
|
|
|
bool KeyCharMsg(CKeyCharMsg *msg);
|
|
|
|
bool FrameMsg(CFrameMsg *msg);
|
2017-08-06 15:25:28 -04:00
|
|
|
bool MovementMsg(CMovementMsg *msg);
|
2016-03-05 21:44:57 -05:00
|
|
|
private:
|
2017-02-27 08:55:56 -05:00
|
|
|
bool _enabled;
|
2016-07-17 13:02:47 -04:00
|
|
|
CStarField _starField;
|
2016-07-02 14:17:02 -04:00
|
|
|
CStarView _view;
|
2016-06-30 23:40:58 -04:00
|
|
|
Rect _starRect;
|
2017-02-27 09:08:34 -05:00
|
|
|
CPetControl *_petControl;
|
2016-07-02 18:46:54 -04:00
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Called for ever new game frame
|
|
|
|
*/
|
|
|
|
void newFrame();
|
2016-02-25 08:39:15 -05:00
|
|
|
public:
|
2016-07-24 20:30:56 -04:00
|
|
|
CLASSDEF;
|
2016-03-05 21:44:57 -05:00
|
|
|
CStarControl();
|
2016-07-16 18:23:25 -04:00
|
|
|
virtual ~CStarControl();
|
2016-03-05 21:44:57 -05:00
|
|
|
|
2016-02-25 08:39:15 -05:00
|
|
|
/**
|
|
|
|
* Save the data for the class to file
|
|
|
|
*/
|
2016-06-29 19:53:16 -04:00
|
|
|
virtual void save(SimpleFile *file, int indent);
|
2016-02-25 08:39:15 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Load the data for the class from file
|
|
|
|
*/
|
|
|
|
virtual void load(SimpleFile *file);
|
2016-06-26 17:20:33 -04:00
|
|
|
|
2016-07-02 14:17:02 -04:00
|
|
|
/**
|
|
|
|
* Allows the item to draw itself
|
|
|
|
*/
|
|
|
|
virtual void draw(CScreenManager *screenManager);
|
|
|
|
|
2017-09-09 08:40:33 -07:00
|
|
|
/**
|
|
|
|
* _starField is currently showing the starfield
|
|
|
|
*/
|
|
|
|
bool isStarFieldMode();
|
|
|
|
|
2017-02-24 23:30:17 -05:00
|
|
|
/**
|
|
|
|
* Does an action in the star control
|
|
|
|
*/
|
2017-02-27 08:55:56 -05:00
|
|
|
void doAction(StarControlAction action);
|
2017-02-20 21:15:00 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the starfield puzzle has been solved
|
|
|
|
*/
|
|
|
|
bool isSolved() const;
|
2016-07-17 10:44:35 -04:00
|
|
|
|
2017-07-15 15:48:43 -04:00
|
|
|
/**
|
|
|
|
* Return true if the starfield puzzle was skipped
|
|
|
|
*/
|
|
|
|
bool isSkipped() const;
|
|
|
|
|
2017-03-29 22:25:33 -04:00
|
|
|
/**
|
|
|
|
* Forces the starfield to be solved
|
|
|
|
*/
|
|
|
|
void forceSolved();
|
|
|
|
|
2016-07-17 10:44:35 -04:00
|
|
|
/**
|
|
|
|
* Returns true if a star destination can be set
|
|
|
|
*/
|
|
|
|
bool canSetStarDestination() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when a star destination is set
|
|
|
|
*/
|
|
|
|
void starDestinationSet();
|
2017-08-06 20:36:28 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the camerea for the star view
|
|
|
|
*/
|
|
|
|
void updateCamera() { _view.updateCamera(); }
|
2016-02-25 08:39:15 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Titanic
|
|
|
|
|
2016-02-28 21:42:13 -05:00
|
|
|
#endif /* TITANIC_STAR_CONTROL_H */
|