effect_position.c
changeset 733 bed6cd368f0d
parent 725 bdf7b8d20566
child 737 d3fa63933df2
     1.1 --- a/effect_position.c	Sat Sep 09 12:01:35 2017 -0700
     1.2 +++ b/effect_position.c	Sat Sep 09 12:14:24 2017 -0700
     1.3 @@ -1196,96 +1196,115 @@
     1.4          switch (channels) {
     1.5              case 1:
     1.6              case 2:
     1.7 -                    f = (_Eff_build_volume_table_u8()) ? _Eff_position_table_u8 :
     1.8 +                f = (_Eff_build_volume_table_u8()) ? _Eff_position_table_u8 :
     1.9                                                          _Eff_position_u8;
    1.10                  break;
    1.11 -                case 4:
    1.12 -                        f = _Eff_position_u8_c4;
    1.13 +            case 4:
    1.14 +                f = _Eff_position_u8_c4;
    1.15                  break;
    1.16 -                case 6:
    1.17 -                        f = _Eff_position_u8_c6;
    1.18 +            case 6:
    1.19 +                f = _Eff_position_u8_c6;
    1.20 +                break;
    1.21 +            default:
    1.22 +                Mix_SetError("Unsupported audio channels");
    1.23                  break;
    1.24          }
    1.25 -            break;
    1.26 +        break;
    1.27  
    1.28          case AUDIO_S8:
    1.29          switch (channels) {
    1.30              case 1:
    1.31              case 2:
    1.32 -                    f = (_Eff_build_volume_table_s8()) ? _Eff_position_table_s8 :
    1.33 +                f = (_Eff_build_volume_table_s8()) ? _Eff_position_table_s8 :
    1.34                                                          _Eff_position_s8;
    1.35                  break;
    1.36 -                case 4:
    1.37 -                        f = _Eff_position_s8_c4;
    1.38 +            case 4:
    1.39 +                f = _Eff_position_s8_c4;
    1.40                  break;
    1.41 -                case 6:
    1.42 -                        f = _Eff_position_s8_c6;
    1.43 +            case 6:
    1.44 +                f = _Eff_position_s8_c6;
    1.45 +                break;
    1.46 +            default:
    1.47 +                Mix_SetError("Unsupported audio channels");
    1.48                  break;
    1.49          }
    1.50 -            break;
    1.51 +        break;
    1.52  
    1.53          case AUDIO_U16LSB:
    1.54          switch (channels) {
    1.55              case 1:
    1.56              case 2:
    1.57 -                    f = _Eff_position_u16lsb;
    1.58 +                f = _Eff_position_u16lsb;
    1.59                  break;
    1.60 -                case 4:
    1.61 -                    f = _Eff_position_u16lsb_c4;
    1.62 +            case 4:
    1.63 +                f = _Eff_position_u16lsb_c4;
    1.64                  break;
    1.65 -                case 6:
    1.66 -                    f = _Eff_position_u16lsb_c6;
    1.67 +            case 6:
    1.68 +                f = _Eff_position_u16lsb_c6;
    1.69 +                break;
    1.70 +            default:
    1.71 +                Mix_SetError("Unsupported audio channels");
    1.72                  break;
    1.73          }
    1.74 -            break;
    1.75 +        break;
    1.76  
    1.77          case AUDIO_S16LSB:
    1.78          switch (channels) {
    1.79              case 1:
    1.80              case 2:
    1.81 -                    f = _Eff_position_s16lsb;
    1.82 +                f = _Eff_position_s16lsb;
    1.83                  break;
    1.84 -                case 4:
    1.85 -                    f = _Eff_position_s16lsb_c4;
    1.86 +            case 4:
    1.87 +                f = _Eff_position_s16lsb_c4;
    1.88                  break;
    1.89 -                case 6:
    1.90 -                    f = _Eff_position_s16lsb_c6;
    1.91 +            case 6:
    1.92 +                f = _Eff_position_s16lsb_c6;
    1.93 +                break;
    1.94 +            default:
    1.95 +                Mix_SetError("Unsupported audio channels");
    1.96                  break;
    1.97          }
    1.98 -            break;
    1.99 +        break;
   1.100  
   1.101          case AUDIO_U16MSB:
   1.102          switch (channels) {
   1.103              case 1:
   1.104              case 2:
   1.105 -                    f = _Eff_position_u16msb;
   1.106 +                f = _Eff_position_u16msb;
   1.107                  break;
   1.108 -                case 4:
   1.109 -                    f = _Eff_position_u16msb_c4;
   1.110 +            case 4:
   1.111 +                f = _Eff_position_u16msb_c4;
   1.112                  break;
   1.113 -                case 6:
   1.114 -                    f = _Eff_position_u16msb_c6;
   1.115 +            case 6:
   1.116 +                f = _Eff_position_u16msb_c6;
   1.117 +                break;
   1.118 +            default:
   1.119 +                Mix_SetError("Unsupported audio channels");
   1.120                  break;
   1.121          }
   1.122 -            break;
   1.123 +        break;
   1.124  
   1.125          case AUDIO_S16MSB:
   1.126          switch (channels) {
   1.127              case 1:
   1.128              case 2:
   1.129 -                    f = _Eff_position_s16msb;
   1.130 +                f = _Eff_position_s16msb;
   1.131                  break;
   1.132 -                case 4:
   1.133 -                    f = _Eff_position_s16msb_c4;
   1.134 +            case 4:
   1.135 +                f = _Eff_position_s16msb_c4;
   1.136                  break;
   1.137 -                case 6:
   1.138 -                    f = _Eff_position_s16msb_c6;
   1.139 +            case 6:
   1.140 +                f = _Eff_position_s16msb_c6;
   1.141 +                break;
   1.142 +            default:
   1.143 +                Mix_SetError("Unsupported audio channels");
   1.144                  break;
   1.145          }
   1.146 -            break;
   1.147 +        break;
   1.148  
   1.149          default:
   1.150              Mix_SetError("Unsupported audio format");
   1.151 +            break;
   1.152      }
   1.153  
   1.154      return(f);