2015-09-12 23:48:13 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
2016-10-03 09:24:13 +00:00
|
|
|
*
|
|
|
|
* 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 17:47:58 +00: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.
|
2016-10-03 09:24:13 +00: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 17:47:58 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2016-10-03 09:24:13 +00:00
|
|
|
*
|
|
|
|
*/
|
2015-09-12 23:48:13 +00:00
|
|
|
|
|
|
|
#ifndef BLADERUNNER_MOVEMENT_TRACK_H
|
|
|
|
#define BLADERUNNER_MOVEMENT_TRACK_H
|
|
|
|
|
|
|
|
#include "bladerunner/bladerunner.h"
|
|
|
|
|
|
|
|
namespace BladeRunner {
|
|
|
|
|
2016-09-10 16:16:17 +00:00
|
|
|
class BladeRunnerEngine;
|
|
|
|
class BoundingBox;
|
2018-03-24 16:20:27 +00:00
|
|
|
class SaveFileReadStream;
|
|
|
|
class SaveFileWriteStream;
|
2016-09-10 16:16:17 +00:00
|
|
|
|
|
|
|
class MovementTrack {
|
2018-01-14 11:12:06 +00:00
|
|
|
static const int kSize = 100;
|
2015-09-12 23:48:13 +00:00
|
|
|
|
2018-01-14 11:12:06 +00:00
|
|
|
struct Entry {
|
2019-07-17 16:08:43 +00:00
|
|
|
int waypointId;
|
2021-07-21 14:07:14 +00:00
|
|
|
// delay specifies how long (in milliseconds) to stay at the target waypoint (when reached)
|
2019-07-21 22:08:23 +00:00
|
|
|
int32 delay;
|
2019-07-17 16:08:43 +00:00
|
|
|
int angle;
|
|
|
|
bool run;
|
2018-01-14 11:12:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int _currentIndex;
|
|
|
|
int _lastIndex;
|
|
|
|
bool _hasNext;
|
|
|
|
bool _paused;
|
|
|
|
Entry _entries[kSize];
|
2015-09-12 23:48:13 +00:00
|
|
|
|
2016-09-10 16:16:17 +00:00
|
|
|
public:
|
|
|
|
MovementTrack();
|
|
|
|
~MovementTrack();
|
2021-06-14 09:43:40 +00:00
|
|
|
int append(int waypointId, int32 delayMillis, bool run);
|
|
|
|
int append(int waypointId, int32 delayMillis, int angle, bool run);
|
2016-09-10 16:16:17 +00:00
|
|
|
void flush();
|
|
|
|
void repeat();
|
2017-03-22 23:25:38 +00:00
|
|
|
void pause();
|
|
|
|
void unpause();
|
2018-01-14 11:12:06 +00:00
|
|
|
bool isPaused() const;
|
|
|
|
bool hasNext() const;
|
2021-06-14 09:43:40 +00:00
|
|
|
bool next(int *waypointId, int32 *delayMillis, int *angle, bool *run);
|
2015-09-12 23:48:13 +00:00
|
|
|
|
2018-03-24 16:20:27 +00:00
|
|
|
void save(SaveFileWriteStream &f);
|
|
|
|
void load(SaveFileReadStream &f);
|
|
|
|
|
2018-01-14 11:12:06 +00:00
|
|
|
private:
|
|
|
|
void reset();
|
2016-09-10 16:16:17 +00:00
|
|
|
};
|
2015-09-12 23:48:13 +00:00
|
|
|
|
|
|
|
} // End of namespace BladeRunner
|
|
|
|
|
|
|
|
#endif
|