KAZIK/src_graphics/audio_code.inc

49 lines
1.2 KiB
PHP

; UI ticks yield to gameplay audio; missing files never trigger the Windows default beep.
.code
PlayCasinoSound3D PROC uses ebx sound:DWORD,handle:DWORD,flags:DWORD
mov ebx, sound
test ebx, ebx
jz casino_sound_stop
cmp ebx, OFFSET soundLose
jne @F
cmp bankroll, 0
je @F
mov ebx, OFFSET soundRoundLose
@@:
mov eax, 20003h ; SND_FILENAME | SND_NODEFAULT | SND_ASYNC
cmp ebx, OFFSET soundClick
je casino_sound_yield
cmp ebx, OFFSET soundShuffle
jne casino_sound_play
casino_sound_yield:
or eax, 10h ; SND_NOSTOP: do not cut an ongoing game action for a UI tick.
casino_sound_play:
IFDEF CASINO_ACTION_TEST
mov lastSoundPath3D, ebx
mov lastSoundFlags3D, eax
mov eax, 1
ELSE
invoke PlaySoundA, ebx, 0, eax
ENDIF
ret
casino_sound_stop:
IFDEF CASINO_ACTION_TEST
mov lastSoundPath3D, 0
mov lastSoundFlags3D, 0
ELSE
invoke PlaySoundA, 0, 0, 0
ENDIF
ret
PlayCasinoSound3D ENDP
CloseLegacySounds3D PROC uses esi
xor esi, esi
close_legacy_sound:
invoke mciSendStringA, legacySoundClosers3D[esi*4], 0, 0, 0
inc esi
cmp esi, legacySoundCount3D
jb close_legacy_sound
call StopTowerMusic
call StopJukeboxTrack3D
ret
CloseLegacySounds3D ENDP