forked from EasyRPG/Player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscene_map.h
105 lines (85 loc) · 2.78 KB
/
scene_map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* This file is part of EasyRPG Player.
*
* EasyRPG Player 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.
*
* EasyRPG Player 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 EasyRPG Player. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EP_SCENE_MAP_H
#define EP_SCENE_MAP_H
// Headers
#include "scene.h"
#include "spriteset_map.h"
#include "window_message.h"
#include "window_varlist.h"
#include "game_clock.h"
#include "game_map.h"
/**
* Scene Map class.
*/
class Scene_Map: public Scene {
public:
/**
* Constructor.
*/
explicit Scene_Map(int from_save_id);
~Scene_Map();
void Start() override;
void StartFromSave(int from_save_id);
void Continue(SceneType prev_scene) override;
void vUpdate() override;
void TransitionIn(SceneType prev_scene) override;
void TransitionOut(SceneType next_scene) override;
void DrawBackground(Bitmap& dst) override;
void OnTranslationChanged() override;
std::unique_ptr<Spriteset_Map> spriteset;
private:
enum TeleportTransitionRule {
eTransitionNormal,
eTransitionFade,
eTransitionForceFade,
eTransitionNone
};
void Start2(MapUpdateAsyncContext actx);
struct TeleportParams {
bool run_foreground_events = false;
bool erase_screen = false;
bool use_default_transition_in = false;
bool defer_recursive_teleports = false;
};
void StartPendingTeleport(TeleportParams tp);
void FinishPendingTeleport(TeleportParams tp);
void FinishPendingTeleport2(MapUpdateAsyncContext actx, TeleportParams tp);
void FinishPendingTeleport3(MapUpdateAsyncContext actx, TeleportParams tp);
void PerformAsyncTeleport(TeleportTarget original_tt);
void PreUpdate(MapUpdateAsyncContext& actx);
void PreUpdateForegroundEvents(MapUpdateAsyncContext& actx);
// Calls map update
void UpdateStage1(MapUpdateAsyncContext actx);
// Handles pending teleport and scene changes.
void UpdateStage2();
void UpdateSceneCalling();
void StartInn();
void UpdateInn();
void FinishInn();
template <typename F> void OnAsyncSuspend(F&& f, AsyncOp aop, bool is_preupdate);
void UpdateGraphics() override;
std::unique_ptr<Window_Message> message_window;
int from_save_id = 0;
bool screen_erased_by_event = false;
AsyncContinuation map_async_continuation = {};
lcf::rpg::Music music_before_inn = {};
bool activate_inn = false;
bool inn_started = false;
Game_Clock::time_point inn_timer = {};
};
#endif