summaryrefslogtreecommitdiff
path: root/src/d/d_vibration.cpp
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-05-24 18:54:46 -0400
committerGitHub <noreply@github.com>2025-05-24 18:54:46 -0400
commit7cd75e8f7b01a45ca8c72facfd5b4a3c1906c0e1 (patch)
treeece493d144cfcb3af860c2af8fa0480491f69706 /src/d/d_vibration.cpp
parent4a29f64e6bf5a06a541161638913f51c51d8a633 (diff)
Demo matches (#767)
Diffstat (limited to 'src/d/d_vibration.cpp')
-rw-r--r--src/d/d_vibration.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/d/d_vibration.cpp b/src/d/d_vibration.cpp
index 8c1d6e43..13aea711 100644
--- a/src/d/d_vibration.cpp
+++ b/src/d/d_vibration.cpp
@@ -53,9 +53,8 @@ namespace {
u32 randombit(s32 rounds, s32 patt_len) {
/* Makes a random rumble pattern by enabling up to rounds random bits */
u32 pattern = 0;
- s32 bit = 1 << 30;
for (int i = 0; i < rounds; i++){
- pattern |= (bit >> (u32)(patt_len * cM_rnd()));
+ pattern |= ((1 << 30) >> (u32)(patt_len * cM_rnd()));
}
return pattern;
}
@@ -64,7 +63,12 @@ namespace {
/* 8009C73C-8009CCCC .text Run__12dVibration_cFv */
int dVibration_c::Run() {
mRumbleState = RUMBLE_STATE_RUNNING;
- if (dComIfGs_checkOptVibration() != 1U){
+#if VERSION == VERSION_DEMO
+ if (dComIfGs_getOptVibration() != 1U)
+#else
+ if (dComIfGs_checkOptVibration() != 1U)
+#endif
+ {
mMotor.mShock.mPatternIdx = mMotor.mQuake.mPatternIdx = PATTERN_OFF;
mMotor.mShock.mCurrentFrame = mMotor.mQuake.mCurrentFrame = RESET_FRAME;
}
@@ -359,7 +363,10 @@ void dVibration_c::Pause() {
if (mRumbleState == RUMBLE_STATE_PAUSED){
return;
}
- if (mMotor.mShock.mPatternIdx != PATTERN_OFF || mMotor.mQuake.mPatternIdx != PATTERN_OFF){
+#if VERSION > VERSION_DEMO
+ if (mMotor.mShock.mPatternIdx != PATTERN_OFF || mMotor.mQuake.mPatternIdx != PATTERN_OFF)
+#endif
+ {
g_mDoCPd_gamePad[0]->stopMotorWaveHard();
g_mDoCPd_gamePad[0]->stopMotorHard();
}
@@ -374,6 +381,7 @@ void dVibration_c::Pause() {
mRumbleState = RUMBLE_STATE_PAUSED;
}
+#if VERSION > VERSION_DEMO
/* 8009D188-8009D1C4 .text __ct__12dVibration_cFv */
dVibration_c::dVibration_c() {
setDefault();
@@ -383,3 +391,4 @@ dVibration_c::dVibration_c() {
dVibration_c::~dVibration_c() {
Kill();
}
+#endif