25#include "audio/mixer.h"
26#include "common/error.h"
28#include "common/hash-str.h"
29#include "common/keyboard.h"
30#include "common/ptr.h"
31#include "common/random.h"
32#include "common/scummsys.h"
33#include "common/serializer.h"
34#include "common/system.h"
35#include "common/util.h"
36#include "engines/engine.h"
37#include "engines/savestate.h"
38#include "graphics/framelimiter.h"
39#include "graphics/screen.h"
40#include "video/video_decoder.h"
42#include "phoenixvr/angle.h"
43#include "phoenixvr/detection.h"
44#include "phoenixvr/region_set.h"
45#include "phoenixvr/script.h"
46#include "phoenixvr/variables.h"
47#include "phoenixvr/vr.h"
61struct PhoenixVRGameDescription;
64enum struct RolloverType : uint8 {
74 static constexpr uint kFPSLimit = 60;
75 static constexpr float kMaxTick = 4.0f / kFPSLimit;
94 uint32 getFeatures()
const;
98 bool gameIdMatches(
const char *gameId)
const;
131 void loadCursor(
int idx,
const Common::String &path,
int offsetX,
int offsetY);
133 void setCursorDefault(
int idx,
int cursorIdx);
140 void stopAllSounds();
148 void executeTest(
int idx);
149 void scheduleTest(
int idx);
151 void wait(
float seconds);
154 const Region *getRegion(
int idx)
const;
158 void startTimer(
float seconds,
bool showTimer);
159 void startTimer(
float seconds,
bool showTimer,
const Common::String &warp);
160 void pauseTimer(
bool pause,
bool deactivate);
164 void setZoom(
float fov) {
167 void interpolateAngle(
float x,
float y,
float speed,
float zoom);
168 void fade(
int start,
int stop,
int speed);
169 void transFade(
int speed);
171 void setXMax(
float max) {
172 _angleY.setRange(-max, max);
174 void limitView(
float min,
float max) {
175 _angleY.setRange(kPi2 - max, kPi2 - min);
179 void setYMax(
float min,
float max) {
180 _angleX.setRange(min, max);
184 _angleX.resetRange();
187 void setAngle(
float x,
float y) {
189 _angleY.set(kPi2 - x);
192 void setNord(
float a) {
196 bool testSaveSlot(
int idx)
const;
199 void drawSlot(
int idx,
int face,
int x,
int y);
200 void drawSaveCard(
int idx);
202 void captureContext();
205 _contextLabel = contextLabel;
208 bool isLoading()
const {
return !_loadedState.
empty(); }
210 bool wasRestarted()
const {
return _restarted; }
211 bool wasLoaded()
const {
return _loaded; }
212 uint currentLevel()
const;
214 void saveVariables();
215 void loadVariables();
217 void rollover(
int textId, RolloverType type);
223 void setGlobalVolume(
int vol);
224 void setGlobalPan(
int pan);
226 void drawArchiveText(
int textId,
const Common::Rect &dstRect,
int size,
bool bold, uint16 color);
229 void stopImageOverlay();
235 int retrieveState(
int index)
const;
236 void storeState(
int index,
int value);
239 void spriteScreen(
int index,
const Common::String &name,
int x,
int y);
241 void resetLensflare();
242 void setLensflare(
float x,
float y);
247 struct ArchiveImage {
253 TextState() : textId(-1), size(0), bold(false), color(0) {}
254 TextState(
int textId_,
const Common::Rect &rect_,
int size_,
bool bold_, uint16 color_) : textId(textId_), rect(rect_), size(size_), bold(bold_), color(color_) {}
268 struct CachedCursor {
278 CachedCursor *loadCursor(
const Common::String &path,
int offsetX = -1,
int offsetY = -1);
279 PointF currentVRPos()
const {
280 return RectF::transform(_angleX.angle(), _angleY.angle(), _fov);
283 void tickTimer(
float dt);
284 void loadNextScript();
286 void renderVR(
float dt);
287 void renderArchiveImages();
288 void renderArchiveTexts();
289 void paintText(
const TextState &textState);
290 void renderImageOverlay();
292 void renderFade(
int color);
293 void renderSprites();
294 void renderLensflare();
295 void renderLightEffect();
300 void setupSubtitles(Subtitles &subtitles)
const;
301 void drawAudioSubtitles();
304 void pauseEngineIntern(
bool pause)
override;
307 void saveThumbnail();
310 bool _hasFocus =
true;
316 Script::ConstWarpPtr _warp;
320 int _hoverIndex = -1;
321 int _hoverLeaveIndex = -1;
322 int _messengerInventoryHover = -1;
326 uint operator()(Common::KeyCode val)
const {
return static_cast<uint
>(val); }
331 Variables _variables;
357 struct PreloadedCursor {
375 bool _lensflareActive =
false;
376 float _lensflareX = 0.0f;
377 float _lensflareY = 0.0f;
380 struct WarpCursorState {
387 int _currentMusicVolume = 0;
388 int _globalPan = 128;
395 bool _showRegions =
false;
397 static constexpr byte kPaused = 2;
398 static constexpr byte kActive = 4;
399 byte _timerFlags = 0;
400 bool _showTimer =
false;
401 float _timer = 0, _initialTimer = 0;
411 static const int kFontSizeCount = 6;
415 TextState _rolloverText;
420 bool _cibleActive =
false;
421 uint32 _cibleStartMillis = 0;
422 int _ciblePeriodSeconds = 0;
428 bool _restarted =
false;
429 bool _loaded =
false;
435#define SHOULD_QUIT ::PhoenixVR::g_engine->shouldQuit()
SoundType
Definition: mixer.h:73
bool empty() const
Definition: array.h:352
uint getRandomNumber(uint max)
EngineFeature
Definition: engine.h:282
@ kSupportsReturnToLauncher
Definition: engine.h:296
@ kSupportsSavingDuringRuntime
Definition: engine.h:314
@ kSupportsLoadingDuringRuntime
Definition: engine.h:305
@ kSupportsSubtitleOptions
Definition: engine.h:287
Definition: framelimiter.h:40
Definition: managed_surface.h:51
Definition: phoenixvr.h:70
int getAutosaveSlot() const override
Definition: phoenixvr.h:115
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: phoenixvr.h:120
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: phoenixvr.h:117
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
uint32 getRandomNumber(uint maxNum)
Definition: phoenixvr.h:103
bool hasFeature(EngineFeature f) const override
Definition: phoenixvr.h:107
void syncSoundSettings() override
Definition: video_decoder.h:53
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: advancedDetector.h:164
Definition: hash-str.h:45
Definition: hash-str.h:49
Definition: region_set.h:34