KAZIK/src_graphics/bowling_audio.inc
Artvasil09 7e081beeca feat: enhance bowling physics, audio, ball weight selection, and visitor cast routines
- Bowling feel: impulse contact solver, string pinsetter cycle, in-world lengthwise return rack and visible ball return lift

- Ball weights: 4/5/6/7 kg selection with equal launch work physics, momentum balance, and projected picking

- Audio: dedicated MCI channels with 7 synthesized waveaudio cues (release, rolling, impacts, applause, pinsetter, return)

- First-person animations: 33-frame player underarm throw/follow-through sequence (player-underarm-v2)

- Visitors: 10 persistent shared cast identities with exclusive reservations, activity transitions, and chair sit/rise animations

- Tests & verification: comprehensive native regression test suites and updated documentation

- Synchronize binaries and update launcher hash to 536E23BED4055562BC63871826FF44FFED037923A9BE8E0F591131DB4FBD104B
2026-11-04 18:44:12 +03:00

119 lines
2.8 KiB
PHP

BowlingAudioOpen3D PROC uses esi
call BowlingAudioClose3D
; Offscreen mechanics probes have no playback device or foreground window.
cmp h3DWnd,0
je bp_audio_open_done
xor esi,esi
bp_audio_open:
invoke mciSendStringA,bpAudioOpens[esi*4],0,0,0
inc esi
cmp esi,7
jb bp_audio_open
mov bpAudioReady3D,1
mov bpAudioVolume3D,-1
bp_audio_open_done:
ret
BowlingAudioOpen3D ENDP
BowlingAudioClose3D PROC uses esi
cmp bpAudioReady3D,0
je bp_audio_close_done
xor esi,esi
bp_audio_close:
invoke mciSendStringA,bpAudioCloses[esi*4],0,0,0
inc esi
cmp esi,7
jb bp_audio_close
bp_audio_close_done:
mov bpAudioReady3D,0
mov bpAudioRolling3D,0
mov bpAudioReturning3D,0
ret
BowlingAudioClose3D ENDP
BowlingAudioUpdate3D PROC uses ebx esi
cmp bpAudioReady3D,0
je bp_audio_done
mov eax,settingsVolume
cmp eax,bpAudioVolume3D
je bp_audio_state
mov bpAudioVolume3D,eax
xor esi,esi
bp_audio_gain:
mov eax,settingsVolume
imul eax,70
test esi,esi
jnz @F
imul eax,settingsVolume,35
@@:
invoke FormatNumber,eax,OFFSET bpText3D
invoke CopyCString,OFFSET bpAudioCommand,bpAudioPrefixes[esi*4]
invoke AppendCString,OFFSET bpAudioCommand,OFFSET bpText3D
invoke mciSendStringA,OFFSET bpAudioCommand,0,0,0
inc esi
cmp esi,7
jb bp_audio_gain
bp_audio_state:
xor ebx,ebx
cmp bpState3D,BP_ROLL
jne @F
cmp bpScoreOpen3D,0
jne @F
cmp bpEndTicks3D,0
jne @F
mov ebx,1
@@:
cmp ebx,bpAudioRolling3D
je bp_audio_return
mov bpAudioRolling3D,ebx
test ebx,ebx
jz bp_audio_stop_roll
cmp bpAudioReleased3D,0
jne @F
mov bpAudioReleased3D,1
invoke mciSendStringA,OFFSET bpReleasePlay,0,0,0
@@:
mov eax,OFFSET bpRollPlay
jmp bp_audio_send_roll
bp_audio_stop_roll:
mov eax,OFFSET bpRollStop
bp_audio_send_roll:
invoke mciSendStringA,eax,0,0,0
bp_audio_return:
xor ebx,ebx
cmp bpState3D,BP_RETURN
jne @F
cmp bpScoreOpen3D,0
jne @F
cmp bpTime3D,2000
jae @F
mov ebx,1
@@:
cmp ebx,bpAudioReturning3D
je bp_audio_impact
mov bpAudioReturning3D,ebx
mov eax,OFFSET bpReturnStop
test ebx,ebx
jz @F
invoke FormatNumber,bpTime3D,OFFSET bpText3D
invoke CopyCString,OFFSET bpAudioCommand,OFFSET bpReturnPlay
invoke AppendCString,OFFSET bpAudioCommand,OFFSET bpText3D
mov eax,OFFSET bpAudioCommand
@@:
invoke mciSendStringA,eax,0,0,0
bp_audio_impact:
cmp bpImpactCooldown3D,0
jne bp_audio_done
cmp bpImpactEnergy3D,768
jb bp_audio_done
mov eax,OFFSET bpLightPlay
cmp bpImpactEnergy3D,4000
jb @F
mov eax,OFFSET bpImpactPlay
@@:
invoke mciSendStringA,eax,0,0,0
mov bpImpactCooldown3D,140
mov bpImpactEnergy3D,0
bp_audio_done:
ret
BowlingAudioUpdate3D ENDP