2018-03-17 17:36:18 +02: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.
|
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2018-03-17 17:36:18 +02:00
|
|
|
*
|
|
|
|
* 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
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2018-03-17 17:36:18 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-06-27 15:27:49 +05:30
|
|
|
#ifndef PINK_SCREEN_H
|
|
|
|
#define PINK_SCREEN_H
|
2018-03-17 17:36:18 +02:00
|
|
|
|
2018-05-21 12:30:27 +03:00
|
|
|
#include "common/array.h"
|
|
|
|
#include "common/rect.h"
|
|
|
|
#include "common/system.h"
|
2018-03-23 21:51:13 +02:00
|
|
|
|
2018-06-09 15:54:21 +03:00
|
|
|
#include "graphics/macgui/macwindowmanager.h"
|
|
|
|
#include "graphics/screen.h"
|
|
|
|
|
2018-07-08 19:23:31 +02:00
|
|
|
namespace Graphics {
|
|
|
|
class MacMenu;
|
|
|
|
}
|
|
|
|
|
2018-03-17 17:36:18 +02:00
|
|
|
namespace Pink {
|
|
|
|
|
2018-04-02 08:57:56 +03:00
|
|
|
class Actor;
|
2018-03-23 21:51:13 +02:00
|
|
|
class ActionCEL;
|
2018-03-25 22:32:07 +03:00
|
|
|
class ActionSound;
|
2018-07-29 21:22:01 +03:00
|
|
|
class ActionText;
|
2021-04-30 15:20:23 +02:00
|
|
|
class PinkEngine;
|
2018-03-23 21:51:13 +02:00
|
|
|
|
2022-06-27 15:24:18 +05:30
|
|
|
class Screen {
|
2018-03-17 17:36:18 +02:00
|
|
|
public:
|
2022-06-27 15:24:18 +05:30
|
|
|
Screen(PinkEngine *vm);
|
|
|
|
~Screen();
|
2018-03-17 17:36:18 +02:00
|
|
|
|
2018-05-22 08:03:37 +03:00
|
|
|
void update();
|
2018-07-08 23:18:27 +02:00
|
|
|
bool processEvent(Common::Event &event);
|
2018-03-25 22:32:07 +03:00
|
|
|
|
2018-07-12 00:41:19 +02:00
|
|
|
void setPalette(const byte *palette);
|
2018-06-09 15:54:21 +03:00
|
|
|
|
2018-07-29 21:22:01 +03:00
|
|
|
void addTextAction(ActionText *action);
|
|
|
|
void removeTextAction(ActionText *action);
|
|
|
|
|
2018-05-22 08:03:37 +03:00
|
|
|
void addSprite(ActionCEL *sprite);
|
|
|
|
void removeSprite(ActionCEL *sprite);
|
2018-03-25 22:32:07 +03:00
|
|
|
|
2018-06-11 23:29:46 +03:00
|
|
|
void addDirtyRect(const Common::Rect &rect);
|
|
|
|
void addDirtyRects(ActionCEL *sprite);
|
|
|
|
|
2018-06-20 13:58:00 +02:00
|
|
|
void addSound(ActionSound *sound) { _sounds.push_back(sound); };
|
|
|
|
void removeSound(ActionSound *sound);
|
2018-03-25 22:32:07 +03:00
|
|
|
|
2021-04-15 20:30:25 +08:00
|
|
|
void addTextWindow(Graphics::MacTextWindow *window);
|
|
|
|
void removeTextWindow(Graphics::MacTextWindow *window);
|
|
|
|
|
2018-05-22 08:03:37 +03:00
|
|
|
void clear();
|
2018-03-27 13:53:03 +03:00
|
|
|
|
2018-05-25 21:15:46 +03:00
|
|
|
void pause(bool pause);
|
|
|
|
|
2018-06-03 14:27:58 +03:00
|
|
|
void saveStage();
|
|
|
|
void loadStage();
|
|
|
|
|
2020-06-04 20:51:11 +03:00
|
|
|
Actor *getActorByPoint(Common::Point point);
|
2018-06-09 15:54:21 +03:00
|
|
|
|
2019-10-17 01:43:54 +02:00
|
|
|
Graphics::MacWindowManager &getWndManager() { return *_wm; };
|
2018-06-09 15:54:21 +03:00
|
|
|
|
2019-10-04 22:33:01 +02:00
|
|
|
void draw(bool blit = true);
|
|
|
|
|
2021-04-30 17:21:50 +02:00
|
|
|
const Graphics::Font *getTextFont() { return _textFont; }
|
|
|
|
|
2018-03-28 11:47:09 +03:00
|
|
|
private:
|
2018-06-09 15:54:21 +03:00
|
|
|
void mergeDirtyRects();
|
|
|
|
void drawRect(const Common::Rect &rect);
|
|
|
|
|
2018-06-20 13:56:23 +03:00
|
|
|
private:
|
2018-06-09 15:54:21 +03:00
|
|
|
Graphics::Screen _surface;
|
2019-10-17 01:43:54 +02:00
|
|
|
Graphics::MacWindowManager *_wm;
|
2018-06-09 15:54:21 +03:00
|
|
|
Common::Array<Common::Rect> _dirtyRects;
|
2018-05-22 11:58:02 +03:00
|
|
|
Common::Array<ActionCEL *> _sprites;
|
2018-06-03 14:27:58 +03:00
|
|
|
Common::Array<ActionCEL *> _savedSprites;
|
2018-05-22 11:58:02 +03:00
|
|
|
Common::Array<ActionSound *> _sounds;
|
2018-07-29 21:22:01 +03:00
|
|
|
Common::Array<ActionText *> _textActions;
|
2021-04-15 20:30:25 +08:00
|
|
|
Common::Array<Graphics::MacTextWindow *> _textWindows;
|
2018-07-29 21:22:01 +03:00
|
|
|
bool _textRendered;
|
2021-04-30 17:21:50 +02:00
|
|
|
|
|
|
|
const Graphics::Font *_textFont;
|
|
|
|
bool _textFontCleanup;
|
2018-03-17 17:36:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Pink
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|