25 #include "audio/mixer.h" 26 #include "common/error.h" 27 #include "common/fs.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" 64 struct PhoenixVRGameDescription;
67 enum struct RolloverType : uint8 {
77 static constexpr uint kFPSLimit = 60;
78 static constexpr
float kMaxTick = 4.0f / kFPSLimit;
97 uint32 getFeatures()
const;
101 bool gameIdMatches(
const char *gameId)
const;
111 return (f == kSupportsLoadingDuringRuntime) ||
112 (f == kSupportsSavingDuringRuntime) ||
113 (f == kSupportsSubtitleOptions) ||
114 (f == kSupportsReturnToLauncher);
127 void syncSoundSettings()
override;
134 void loadCursor(
int idx,
const Common::String &path,
int w,
int h);
136 void setCursorDefault(
int idx,
int cursorIdx);
143 void stopAllSounds();
151 void executeTest(
int idx);
152 void scheduleTest(
int idx);
154 void wait(
float seconds);
157 const Region *getRegion(
int idx)
const;
161 void startTimer(
float seconds,
bool showTimer);
162 void startTimer(
float seconds,
bool showTimer,
const Common::String &warp);
163 void pauseTimer(
bool pause,
bool deactivate);
167 void setZoom(
float fov) {
170 void interpolateAngle(
float x,
float y,
float speed,
float zoom);
171 void fade(
int start,
int stop,
int speed);
172 void transFade(
int speed);
174 void setXMax(
float max) {
175 _angleY.setRange(-max, max);
177 void limitView(
float min,
float max) {
178 _angleY.setRange(kPi2 - max, kPi2 - min);
182 void setYMax(
float min,
float max) {
183 _angleX.setRange(min, max);
187 _angleX.resetRange();
190 void setAngle(
float x,
float y) {
192 _angleY.set(kPi2 - x);
195 void setNord(
float a) {
199 bool testSaveSlot(
int idx)
const;
202 void drawSlot(
int idx,
int face,
int x,
int y);
203 void drawSaveCard(
int idx);
205 void captureContext();
208 _contextLabel = contextLabel;
211 bool isLoading()
const {
return !_loadedState.empty(); }
213 bool wasRestarted()
const {
return _restarted; }
214 bool wasLoaded()
const {
return _loaded; }
215 uint currentLevel()
const;
217 void saveVariables();
218 void loadVariables();
220 void rollover(
int textId, RolloverType type);
226 void setGlobalVolume(
int vol);
227 void setGlobalPan(
int pan);
229 void drawArchiveText(
int textId,
const Common::Rect &dstRect,
int size,
bool bold, uint16 color);
232 void stopImageOverlay();
238 int retrieveState(
int index)
const;
239 void storeState(
int index,
int value);
242 void spriteScreen(
int index,
const Common::String &name,
int x,
int y);
244 void resetLensflare();
245 void setLensflare(
float x,
float y);
250 struct ArchiveImage {
256 TextState() : textId(-1), size(0), bold(
false), color(0) {}
257 TextState(
int textId_,
const Common::Rect &rect_,
int size_,
bool bold_, uint16 color_) : textId(textId_), rect(rect_), size(size_), bold(bold_), color(color_) {}
277 PointF currentVRPos()
const {
278 return RectF::transform(_angleX.angle(), _angleY.angle(), _fov);
281 void tickTimer(
float dt);
282 void loadNextScript();
284 void renderVR(
float dt);
285 void renderArchiveImages();
286 void renderArchiveTexts();
287 void paintText(
const TextState &textState);
288 void renderImageOverlay();
290 void renderFade(
int color);
291 void renderSprites();
292 void renderLensflare();
293 void renderLightEffect();
299 void drawAudioSubtitles();
302 void pauseEngineIntern(
bool pause)
override;
308 bool _hasFocus =
true;
318 int _hoverIndex = -1;
319 int _messengerInventoryHover = -1;
323 uint operator()(Common::KeyCode val)
const {
return static_cast<uint
>(val); }
354 struct PreloadedCursor {
372 bool _lensflareActive =
false;
373 float _lensflareX = 0.0f;
374 float _lensflareY = 0.0f;
380 int _currentMusicVolume = 0;
381 int _globalPan = 128;
388 bool _showRegions =
false;
390 static constexpr byte kPaused = 2;
391 static constexpr byte kActive = 4;
392 byte _timerFlags = 0;
393 bool _showTimer =
false;
394 float _timer = 0, _initialTimer = 0;
404 static const int kFontSizeCount = 6;
408 TextState _rolloverText;
413 bool _cibleActive =
false;
414 uint32 _cibleStartMillis = 0;
415 int _ciblePeriodSeconds = 0;
421 bool _restarted =
false;
422 bool _loaded =
false;
428 #define SHOULD_QUIT ::PhoenixVR::g_engine->shouldQuit() 432 #endif // PHOENIXVR_H Definition: managed_surface.h:51
bool hasFeature(EngineFeature f) const override
Definition: phoenixvr.h:110
Definition: framelimiter.h:40
bool saveThumbnail(Common::WriteStream &out)
EngineFeature
Definition: engine.h:282
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: phoenixvr.h:120
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: phoenixvr.h:123
Definition: advancedDetector.h:164
Definition: phoenixvr.h:73
uint getRandomNumber(uint max)
Definition: region_set.h:34
Definition: subtitles.h:78
SoundType
Definition: mixer.h:73
uint32 getRandomNumber(uint maxNum)
Definition: phoenixvr.h:106
Definition: video_decoder.h:53
Definition: algorithm.h:29
Definition: formatinfo.h:28
int getAutosaveSlot() const override
Definition: phoenixvr.h:118
Definition: variables.h:31
Definition: animation.h:37
Definition: hash-str.h:49
Definition: hash-str.h:45