| 918 | } |
| 919 | |
| 920 | bool CreateSoundEffect(TCSNDDESC* desc, int monitor, int screen, int id) { |
| 921 | ASSERT(desc); |
| 922 | int efxtype = -1; |
| 923 | switch (desc->type) { |
| 924 | case TC_SND_STATIC: |
| 925 | efxtype = EFX_SOUND; |
| 926 | break; |
| 927 | default: |
| 928 | Int3(); |
| 929 | } |
| 930 | if (efxtype == -1) |
| 931 | return false; |
| 932 | // Creates an instance of the Effect |
| 933 | int efxnum = EfxCreate(efxtype, monitor, screen, id); |
| 934 | if (efxnum == -1) |
| 935 | return false; |
| 936 | tceffect *tce = &TCEffects[efxnum]; |
| 937 | if (desc->caps & TCSD_WAITTIME) |
| 938 | tce->start_time = desc->waittime; |
| 939 | else |
| 940 | tce->start_time = 0; |
| 941 | |
| 942 | switch (tce->type) { |
| 943 | case EFX_SOUND: |
| 944 | return CreateSound(tce, desc->filename); |
| 945 | } |
| 946 | return false; |
| 947 | } |
| 948 | |
| 949 | int CreateButtonEffect(TCBUTTONDESC* desc, int monitor, int screen, int id) { |
| 950 | ASSERT(desc); |
no test coverage detected