ScummVM API documentation
quick_avatar_mover_process.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef WORLD_ACTORS_QUICKAVATARMOVERPROCESS_H
23 #define WORLD_ACTORS_QUICKAVATARMOVERPROCESS_H
24 
25 #include "ultima/ultima8/kernel/process.h"
26 
27 namespace Ultima {
28 namespace Ultima8 {
29 
31 public:
33  ~QuickAvatarMoverProcess() override;
34 
35  ENABLE_RUNTIME_CLASSTYPE()
36 
37  static QuickAvatarMoverProcess *get_instance();
38 
39  void run() override;
40  void terminate() override;
41 
42  static bool isQuarterSpeed() {
43  return _quarter;
44  }
45  static bool isClipping() {
46  return _clipping;
47  }
48  static void setQuarterSpeed(bool q) {
49  _quarter = q;
50  }
51  static void toggleClipping() {
52  _clipping = !_clipping;
53  }
54 
55  bool hasMovementFlags(uint32 flags) const {
56  return (_movementFlags & flags) != 0;
57  }
58  void setMovementFlag(uint32 mask) {
59  _movementFlags |= mask;
60  }
61  virtual void clearMovementFlag(uint32 mask) {
62  _movementFlags &= ~mask;
63  }
64  void resetMovementFlags() {
65  _movementFlags = 0;
66  }
67 
68  bool loadData(Common::ReadStream *rs, uint32 version);
69  void saveData(Common::WriteStream *ws) override;
70 
71  enum MovementFlags {
72  MOVE_LEFT = 0x01,
73  MOVE_RIGHT = 0x02,
74  MOVE_UP = 0x04,
75  MOVE_DOWN = 0x08,
76  MOVE_ASCEND = 0x10,
77  MOVE_DESCEND = 0x20,
78 
79  MOVE_ANY_DIRECTION = MOVE_LEFT | MOVE_RIGHT | MOVE_UP | MOVE_DOWN | MOVE_ASCEND | MOVE_DESCEND
80  };
81 
82 protected:
83  uint32 _movementFlags;
84  static ProcId _amp;
85  static bool _clipping;
86  static bool _quarter;
87 };
88 
89 } // End of namespace Ultima8
90 } // End of namespace Ultima
91 
92 #endif
Definition: stream.h:77
Definition: process.h:34
Definition: quick_avatar_mover_process.h:30
Definition: detection.h:27
void terminate() override
terminate the process. This wakes up all processes waiting for it.
void saveData(Common::WriteStream *ws) override
save Process data
Definition: stream.h:385