effect_position.c
changeset 617 87116a42526e
parent 601 05123263dab3
child 621 944412baab72
     1.1 --- a/effect_position.c	Tue May 21 21:09:26 2013 -0700
     1.2 +++ b/effect_position.c	Tue May 21 21:21:23 2013 -0700
     1.3 @@ -42,7 +42,7 @@
     1.4      #include <unistd.h>
     1.5      struct timeval tv1;
     1.6      struct timeval tv2;
     1.7 -    
     1.8 +
     1.9      gettimeofday(&tv1, NULL);
    1.10  
    1.11          ... do your thing here ...
    1.12 @@ -134,19 +134,19 @@
    1.13      if (args->room_angle == 180)
    1.14      for (i = 0; i < len; i += sizeof (Uint8) * 2) {
    1.15          /* must adjust the sample so that 0 is the center */
    1.16 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.17 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.18              * args->right_f) * args->distance_f) + 128);
    1.19          ptr++;
    1.20 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.21 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.22              * args->left_f) * args->distance_f) + 128);
    1.23          ptr++;
    1.24      }
    1.25      else for (i = 0; i < len; i += sizeof (Uint8) * 2) {
    1.26          /* must adjust the sample so that 0 is the center */
    1.27 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.28 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.29              * args->left_f) * args->distance_f) + 128);
    1.30          ptr++;
    1.31 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.32 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.33              * args->right_f) * args->distance_f) + 128);
    1.34          ptr++;
    1.35      }
    1.36 @@ -171,64 +171,64 @@
    1.37      if (args->room_angle == 0)
    1.38      for (i = 0; i < len; i += sizeof (Uint8) * 6) {
    1.39          /* must adjust the sample so that 0 is the center */
    1.40 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.41 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.42              * args->left_f) * args->distance_f) + 128);
    1.43          ptr++;
    1.44 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.45 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.46              * args->right_f) * args->distance_f) + 128);
    1.47          ptr++;
    1.48 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.49 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.50              * args->left_rear_f) * args->distance_f) + 128);
    1.51          ptr++;
    1.52 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.53 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.54              * args->right_rear_f) * args->distance_f) + 128);
    1.55          ptr++;
    1.56      }
    1.57      else if (args->room_angle == 90)
    1.58      for (i = 0; i < len; i += sizeof (Uint8) * 6) {
    1.59          /* must adjust the sample so that 0 is the center */
    1.60 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.61 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.62              * args->right_f) * args->distance_f) + 128);
    1.63          ptr++;
    1.64 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.65 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.66              * args->right_rear_f) * args->distance_f) + 128);
    1.67          ptr++;
    1.68 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.69 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.70              * args->left_f) * args->distance_f) + 128);
    1.71          ptr++;
    1.72 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.73 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.74              * args->left_rear_f) * args->distance_f) + 128);
    1.75          ptr++;
    1.76      }
    1.77      else if (args->room_angle == 180)
    1.78      for (i = 0; i < len; i += sizeof (Uint8) * 6) {
    1.79          /* must adjust the sample so that 0 is the center */
    1.80 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.81 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.82              * args->right_rear_f) * args->distance_f) + 128);
    1.83          ptr++;
    1.84 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.85 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.86              * args->left_rear_f) * args->distance_f) + 128);
    1.87          ptr++;
    1.88 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.89 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.90              * args->right_f) * args->distance_f) + 128);
    1.91          ptr++;
    1.92 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
    1.93 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
    1.94              * args->left_f) * args->distance_f) + 128);
    1.95          ptr++;
    1.96      }
    1.97      else if (args->room_angle == 270)
    1.98      for (i = 0; i < len; i += sizeof (Uint8) * 6) {
    1.99          /* must adjust the sample so that 0 is the center */
   1.100 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.101 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.102              * args->left_rear_f) * args->distance_f) + 128);
   1.103          ptr++;
   1.104 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.105 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.106              * args->left_f) * args->distance_f) + 128);
   1.107          ptr++;
   1.108 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.109 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.110              * args->right_rear_f) * args->distance_f) + 128);
   1.111          ptr++;
   1.112 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.113 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.114              * args->right_f) * args->distance_f) + 128);
   1.115          ptr++;
   1.116      }
   1.117 @@ -255,94 +255,94 @@
   1.118      if (args->room_angle == 0)
   1.119      for (i = 0; i < len; i += sizeof (Uint8) * 6) {
   1.120          /* must adjust the sample so that 0 is the center */
   1.121 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.122 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.123              * args->left_f) * args->distance_f) + 128);
   1.124          ptr++;
   1.125 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.126 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.127              * args->right_f) * args->distance_f) + 128);
   1.128          ptr++;
   1.129 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.130 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.131              * args->left_rear_f) * args->distance_f) + 128);
   1.132          ptr++;
   1.133 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.134 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.135              * args->right_rear_f) * args->distance_f) + 128);
   1.136          ptr++;
   1.137 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.138 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.139              * args->center_f) * args->distance_f) + 128);
   1.140          ptr++;
   1.141 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.142 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.143              * args->lfe_f) * args->distance_f) + 128);
   1.144          ptr++;
   1.145      }
   1.146      else if (args->room_angle == 90)
   1.147      for (i = 0; i < len; i += sizeof (Uint8) * 6) {
   1.148          /* must adjust the sample so that 0 is the center */
   1.149 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.150 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.151              * args->right_f) * args->distance_f) + 128);
   1.152          ptr++;
   1.153 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.154 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.155              * args->right_rear_f) * args->distance_f) + 128);
   1.156          ptr++;
   1.157 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.158 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.159              * args->left_f) * args->distance_f) + 128);
   1.160          ptr++;
   1.161 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.162 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.163              * args->left_rear_f) * args->distance_f) + 128);
   1.164          ptr++;
   1.165 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.166 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.167              * args->right_rear_f) * args->distance_f/2) + 128)
   1.168 -            + (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.169 +            + (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.170              * args->right_f) * args->distance_f/2) + 128);
   1.171          ptr++;
   1.172 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.173 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.174              * args->lfe_f) * args->distance_f) + 128);
   1.175          ptr++;
   1.176      }
   1.177      else if (args->room_angle == 180)
   1.178      for (i = 0; i < len; i += sizeof (Uint8) * 6) {
   1.179          /* must adjust the sample so that 0 is the center */
   1.180 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.181 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.182              * args->right_rear_f) * args->distance_f) + 128);
   1.183          ptr++;
   1.184 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.185 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.186              * args->left_rear_f) * args->distance_f) + 128);
   1.187          ptr++;
   1.188 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.189 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.190              * args->right_f) * args->distance_f) + 128);
   1.191          ptr++;
   1.192 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.193 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.194              * args->left_f) * args->distance_f) + 128);
   1.195          ptr++;
   1.196 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.197 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.198              * args->right_rear_f) * args->distance_f/2) + 128)
   1.199 -            + (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.200 +            + (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.201              * args->left_rear_f) * args->distance_f/2) + 128);
   1.202          ptr++;
   1.203 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.204 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.205              * args->lfe_f) * args->distance_f) + 128);
   1.206          ptr++;
   1.207      }
   1.208      else if (args->room_angle == 270)
   1.209      for (i = 0; i < len; i += sizeof (Uint8) * 6) {
   1.210          /* must adjust the sample so that 0 is the center */
   1.211 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.212 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.213              * args->left_rear_f) * args->distance_f) + 128);
   1.214          ptr++;
   1.215 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.216 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.217              * args->left_f) * args->distance_f) + 128);
   1.218          ptr++;
   1.219 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.220 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.221              * args->right_rear_f) * args->distance_f) + 128);
   1.222          ptr++;
   1.223 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.224 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.225              * args->right_f) * args->distance_f) + 128);
   1.226          ptr++;
   1.227 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.228 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.229              * args->left_f) * args->distance_f/2) + 128)
   1.230 -            + (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.231 +            + (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.232              * args->left_rear_f) * args->distance_f/2) + 128);
   1.233          ptr++;
   1.234 -        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128)) 
   1.235 +        *ptr = (Uint8) ((Sint8) ((((float) (Sint8) (*ptr - 128))
   1.236              * args->lfe_f) * args->distance_f) + 128);
   1.237          ptr++;
   1.238      }
   1.239 @@ -368,9 +368,9 @@
   1.240      Uint8 *d = ((Uint8 *) _Eff_volume_table) + (256 * args->distance_u8);
   1.241  
   1.242      if (args->room_angle == 180) {
   1.243 -	    Uint8 *temp = l;
   1.244 -	    l = r;
   1.245 -	    r = temp;
   1.246 +        Uint8 *temp = l;
   1.247 +        l = r;
   1.248 +        r = temp;
   1.249      }
   1.250          /*
   1.251           * if there's only a mono channnel, then l[] and r[] are always
   1.252 @@ -462,25 +462,25 @@
   1.253          *ptr = (Sint8)((((float) *ptr) * args->right_f) * args->distance_f); ptr++;
   1.254          *ptr = (Sint8)((((float) *ptr) * args->left_rear_f) * args->distance_f); ptr++;
   1.255          *ptr = (Sint8)((((float) *ptr) * args->right_rear_f) * args->distance_f); ptr++;
   1.256 -	break;
   1.257 +    break;
   1.258         case 90:
   1.259          *ptr = (Sint8)((((float) *ptr) * args->right_f) * args->distance_f); ptr++;
   1.260          *ptr = (Sint8)((((float) *ptr) * args->right_rear_f) * args->distance_f); ptr++;
   1.261          *ptr = (Sint8)((((float) *ptr) * args->left_f) * args->distance_f); ptr++;
   1.262          *ptr = (Sint8)((((float) *ptr) * args->left_rear_f) * args->distance_f); ptr++;
   1.263 -	break;
   1.264 +    break;
   1.265         case 180:
   1.266          *ptr = (Sint8)((((float) *ptr) * args->right_rear_f) * args->distance_f); ptr++;
   1.267          *ptr = (Sint8)((((float) *ptr) * args->left_rear_f) * args->distance_f); ptr++;
   1.268          *ptr = (Sint8)((((float) *ptr) * args->right_f) * args->distance_f); ptr++;
   1.269          *ptr = (Sint8)((((float) *ptr) * args->left_f) * args->distance_f); ptr++;
   1.270 -	break;
   1.271 +    break;
   1.272         case 270:
   1.273          *ptr = (Sint8)((((float) *ptr) * args->left_rear_f) * args->distance_f); ptr++;
   1.274          *ptr = (Sint8)((((float) *ptr) * args->left_f) * args->distance_f); ptr++;
   1.275          *ptr = (Sint8)((((float) *ptr) * args->right_rear_f) * args->distance_f); ptr++;
   1.276          *ptr = (Sint8)((((float) *ptr) * args->right_f) * args->distance_f); ptr++;
   1.277 -	break;
   1.278 +    break;
   1.279        }
   1.280      }
   1.281  }
   1.282 @@ -510,7 +510,7 @@
   1.283          *ptr = (Sint8)((((float) *ptr) * args->right_rear_f) * args->distance_f); ptr++;
   1.284          *ptr = (Sint8)((((float) *ptr) * args->center_f) * args->distance_f); ptr++;
   1.285          *ptr = (Sint8)((((float) *ptr) * args->lfe_f) * args->distance_f); ptr++;
   1.286 -	break;
   1.287 +    break;
   1.288         case 90:
   1.289          *ptr = (Sint8)((((float) *ptr) * args->right_f) * args->distance_f); ptr++;
   1.290          *ptr = (Sint8)((((float) *ptr) * args->right_rear_f) * args->distance_f); ptr++;
   1.291 @@ -519,7 +519,7 @@
   1.292          *ptr = (Sint8)((((float) *ptr) * args->right_rear_f) * args->distance_f / 2)
   1.293             + (Sint8)((((float) *ptr) * args->right_f) * args->distance_f / 2); ptr++;
   1.294          *ptr = (Sint8)((((float) *ptr) * args->lfe_f) * args->distance_f); ptr++;
   1.295 -	break;
   1.296 +    break;
   1.297         case 180:
   1.298          *ptr = (Sint8)((((float) *ptr) * args->right_rear_f) * args->distance_f); ptr++;
   1.299          *ptr = (Sint8)((((float) *ptr) * args->left_rear_f) * args->distance_f); ptr++;
   1.300 @@ -528,7 +528,7 @@
   1.301          *ptr = (Sint8)((((float) *ptr) * args->right_rear_f) * args->distance_f / 2)
   1.302             + (Sint8)((((float) *ptr) * args->left_rear_f) * args->distance_f / 2); ptr++;
   1.303          *ptr = (Sint8)((((float) *ptr) * args->lfe_f) * args->distance_f); ptr++;
   1.304 -	break;
   1.305 +    break;
   1.306         case 270:
   1.307          *ptr = (Sint8)((((float) *ptr) * args->left_rear_f) * args->distance_f); ptr++;
   1.308          *ptr = (Sint8)((((float) *ptr) * args->left_f) * args->distance_f); ptr++;
   1.309 @@ -537,7 +537,7 @@
   1.310          *ptr = (Sint8)((((float) *ptr) * args->left_f) * args->distance_f / 2)
   1.311             + (Sint8)((((float) *ptr) * args->left_rear_f) * args->distance_f / 2); ptr++;
   1.312          *ptr = (Sint8)((((float) *ptr) * args->lfe_f) * args->distance_f); ptr++;
   1.313 -	break;
   1.314 +    break;
   1.315        }
   1.316      }
   1.317  }
   1.318 @@ -562,9 +562,9 @@
   1.319      Sint8 *d = ((Sint8 *) _Eff_volume_table) + (256 * args->distance_u8);
   1.320  
   1.321      if (args->room_angle == 180) {
   1.322 -	    Sint8 *temp = l;
   1.323 -	    l = r;
   1.324 -	    r = temp;
   1.325 +        Sint8 *temp = l;
   1.326 +        l = r;
   1.327 +        r = temp;
   1.328      }
   1.329  
   1.330  
   1.331 @@ -610,20 +610,20 @@
   1.332      for (i = 0; i < len; i += sizeof (Uint16) * 2) {
   1.333          Sint16 sampl = (Sint16) (SDL_SwapLE16(*(ptr+0)) - 32768);
   1.334          Sint16 sampr = (Sint16) (SDL_SwapLE16(*(ptr+1)) - 32768);
   1.335 -        
   1.336 +
   1.337          Uint16 swapl = (Uint16) ((Sint16) (((float) sampl * args->left_f)
   1.338                                      * args->distance_f) + 32768);
   1.339          Uint16 swapr = (Uint16) ((Sint16) (((float) sampr * args->right_f)
   1.340                                      * args->distance_f) + 32768);
   1.341  
   1.342 -	if (args->room_angle == 180) {
   1.343 -        	*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.344 -        	*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.345 -	}
   1.346 -	else {
   1.347 -        	*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.348 -        	*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.349 -	}
   1.350 +    if (args->room_angle == 180) {
   1.351 +            *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.352 +            *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.353 +    }
   1.354 +    else {
   1.355 +            *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.356 +            *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.357 +    }
   1.358      }
   1.359  }
   1.360  static void _Eff_position_u16lsb_c4(int chan, void *stream, int len, void *udata)
   1.361 @@ -637,7 +637,7 @@
   1.362          Sint16 sampr = (Sint16) (SDL_SwapLE16(*(ptr+1)) - 32768);
   1.363          Sint16 samplr = (Sint16) (SDL_SwapLE16(*(ptr+2)) - 32768);
   1.364          Sint16 samprr = (Sint16) (SDL_SwapLE16(*(ptr+3)) - 32768);
   1.365 -        
   1.366 +
   1.367          Uint16 swapl = (Uint16) ((Sint16) (((float) sampl * args->left_f)
   1.368                                      * args->distance_f) + 32768);
   1.369          Uint16 swapr = (Uint16) ((Sint16) (((float) sampr * args->right_f)
   1.370 @@ -647,32 +647,32 @@
   1.371          Uint16 swaprr = (Uint16) ((Sint16) (((float) samprr * args->right_rear_f)
   1.372                                      * args->distance_f) + 32768);
   1.373  
   1.374 -	switch (args->room_angle) {
   1.375 -		case 0:
   1.376 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.377 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.378 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.379 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.380 -			break;
   1.381 -		case 90:
   1.382 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.383 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.384 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.385 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.386 -			break;
   1.387 -		case 180:
   1.388 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.389 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.390 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.391 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.392 -			break;
   1.393 -		case 270:
   1.394 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.395 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.396 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.397 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.398 -			break;
   1.399 -	}
   1.400 +    switch (args->room_angle) {
   1.401 +        case 0:
   1.402 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.403 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.404 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.405 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.406 +            break;
   1.407 +        case 90:
   1.408 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.409 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.410 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.411 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.412 +            break;
   1.413 +        case 180:
   1.414 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.415 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.416 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.417 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.418 +            break;
   1.419 +        case 270:
   1.420 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.421 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.422 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.423 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.424 +            break;
   1.425 +    }
   1.426      }
   1.427  }
   1.428  static void _Eff_position_u16lsb_c6(int chan, void *stream, int len, void *udata)
   1.429 @@ -702,40 +702,40 @@
   1.430          Uint16 swapwf = (Uint16) ((Sint16) (((float) sampwf * args->lfe_f)
   1.431                                      * args->distance_f) + 32768);
   1.432  
   1.433 -	switch (args->room_angle) {
   1.434 -		case 0:
   1.435 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.436 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.437 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.438 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.439 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapce);
   1.440 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapwf);
   1.441 -			break;
   1.442 -		case 90:
   1.443 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.444 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.445 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.446 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.447 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapr)/2 + (Uint16) SDL_SwapLE16(swaprr)/2;
   1.448 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapwf);
   1.449 -			break;
   1.450 -		case 180:
   1.451 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.452 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.453 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.454 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.455 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaprr)/2 + (Uint16) SDL_SwapLE16(swaplr)/2;
   1.456 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapwf);
   1.457 -			break;
   1.458 -		case 270:
   1.459 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.460 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.461 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.462 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.463 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapl)/2 + (Uint16) SDL_SwapLE16(swaplr)/2;
   1.464 -        		*(ptr++) = (Uint16) SDL_SwapLE16(swapwf);
   1.465 -			break;
   1.466 -	}
   1.467 +    switch (args->room_angle) {
   1.468 +        case 0:
   1.469 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.470 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.471 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.472 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.473 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapce);
   1.474 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapwf);
   1.475 +            break;
   1.476 +        case 90:
   1.477 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.478 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.479 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.480 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.481 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapr)/2 + (Uint16) SDL_SwapLE16(swaprr)/2;
   1.482 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapwf);
   1.483 +            break;
   1.484 +        case 180:
   1.485 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.486 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.487 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.488 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.489 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaprr)/2 + (Uint16) SDL_SwapLE16(swaplr)/2;
   1.490 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapwf);
   1.491 +            break;
   1.492 +        case 270:
   1.493 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaplr);
   1.494 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapl);
   1.495 +                *(ptr++) = (Uint16) SDL_SwapLE16(swaprr);
   1.496 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapr);
   1.497 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapl)/2 + (Uint16) SDL_SwapLE16(swaplr)/2;
   1.498 +                *(ptr++) = (Uint16) SDL_SwapLE16(swapwf);
   1.499 +            break;
   1.500 +    }
   1.501      }
   1.502  }
   1.503  
   1.504 @@ -748,8 +748,8 @@
   1.505  
   1.506  #if 0
   1.507      if (len % (sizeof(Sint16) * 2)) {
   1.508 -	    fprintf(stderr,"Not an even number of frames! len=%d\n", len);
   1.509 -	    return;
   1.510 +        fprintf(stderr,"Not an even number of frames! len=%d\n", len);
   1.511 +        return;
   1.512      }
   1.513  #endif
   1.514  
   1.515 @@ -758,14 +758,14 @@
   1.516                                      args->left_f) * args->distance_f);
   1.517          Sint16 swapr = (Sint16) ((((float) (Sint16) SDL_SwapLE16(*(ptr+1))) *
   1.518                                      args->right_f) * args->distance_f);
   1.519 -	if (args->room_angle == 180) {
   1.520 -        	*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.521 -        	*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.522 -	}
   1.523 -	else {
   1.524 -        	*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.525 -        	*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.526 -	}
   1.527 +    if (args->room_angle == 180) {
   1.528 +            *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.529 +            *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.530 +    }
   1.531 +    else {
   1.532 +            *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.533 +            *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.534 +    }
   1.535      }
   1.536  }
   1.537  static void _Eff_position_s16lsb_c4(int chan, void *stream, int len, void *udata)
   1.538 @@ -784,32 +784,32 @@
   1.539                                      args->left_rear_f) * args->distance_f);
   1.540          Sint16 swaprr = (Sint16) ((((float) (Sint16) SDL_SwapLE16(*(ptr+2))) *
   1.541                                      args->right_rear_f) * args->distance_f);
   1.542 -	switch (args->room_angle) {
   1.543 -		case 0:
   1.544 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.545 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.546 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.547 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.548 -			break;
   1.549 -		case 90:
   1.550 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.551 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.552 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.553 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.554 -			break;
   1.555 -		case 180:
   1.556 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.557 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.558 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.559 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.560 -			break;
   1.561 -		case 270:
   1.562 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.563 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.564 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.565 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.566 -			break;
   1.567 -	}
   1.568 +    switch (args->room_angle) {
   1.569 +        case 0:
   1.570 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.571 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.572 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.573 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.574 +            break;
   1.575 +        case 90:
   1.576 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.577 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.578 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.579 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.580 +            break;
   1.581 +        case 180:
   1.582 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.583 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.584 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.585 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.586 +            break;
   1.587 +        case 270:
   1.588 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.589 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.590 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.591 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.592 +            break;
   1.593 +    }
   1.594      }
   1.595  }
   1.596  
   1.597 @@ -833,40 +833,40 @@
   1.598                                      args->center_f) * args->distance_f);
   1.599          Sint16 swapwf = (Sint16) ((((float) (Sint16) SDL_SwapLE16(*(ptr+5))) *
   1.600                                      args->lfe_f) * args->distance_f);
   1.601 -	switch (args->room_angle) {
   1.602 -		case 0:
   1.603 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.604 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.605 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.606 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.607 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapce);
   1.608 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapwf);
   1.609 -			break;
   1.610 -		case 90:
   1.611 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.612 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.613 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.614 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.615 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapr)/2 + (Sint16) SDL_SwapLE16(swaprr)/2;
   1.616 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapwf);
   1.617 -			break;
   1.618 -		case 180:
   1.619 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.620 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.621 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.622 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.623 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaprr)/2 + (Sint16) SDL_SwapLE16(swaplr)/2;
   1.624 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapwf);
   1.625 -			break;
   1.626 -		case 270:
   1.627 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.628 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.629 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.630 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.631 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapl)/2 + (Sint16) SDL_SwapLE16(swaplr)/2;
   1.632 -        		*(ptr++) = (Sint16) SDL_SwapLE16(swapwf);
   1.633 -			break;
   1.634 -	}
   1.635 +    switch (args->room_angle) {
   1.636 +        case 0:
   1.637 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.638 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.639 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.640 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.641 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapce);
   1.642 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapwf);
   1.643 +            break;
   1.644 +        case 90:
   1.645 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.646 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.647 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.648 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.649 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapr)/2 + (Sint16) SDL_SwapLE16(swaprr)/2;
   1.650 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapwf);
   1.651 +            break;
   1.652 +        case 180:
   1.653 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.654 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.655 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.656 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.657 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaprr)/2 + (Sint16) SDL_SwapLE16(swaplr)/2;
   1.658 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapwf);
   1.659 +            break;
   1.660 +        case 270:
   1.661 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaplr);
   1.662 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapl);
   1.663 +                *(ptr++) = (Sint16) SDL_SwapLE16(swaprr);
   1.664 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapr);
   1.665 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapl)/2 + (Sint16) SDL_SwapLE16(swaplr)/2;
   1.666 +                *(ptr++) = (Sint16) SDL_SwapLE16(swapwf);
   1.667 +            break;
   1.668 +    }
   1.669      }
   1.670  }
   1.671  
   1.672 @@ -880,20 +880,20 @@
   1.673      for (i = 0; i < len; i += sizeof (Sint16) * 2) {
   1.674          Sint16 sampl = (Sint16) (SDL_SwapBE16(*(ptr+0)) - 32768);
   1.675          Sint16 sampr = (Sint16) (SDL_SwapBE16(*(ptr+1)) - 32768);
   1.676 -        
   1.677 +
   1.678          Uint16 swapl = (Uint16) ((Sint16) (((float) sampl * args->left_f)
   1.679                                      * args->distance_f) + 32768);
   1.680          Uint16 swapr = (Uint16) ((Sint16) (((float) sampr * args->right_f)
   1.681                                      * args->distance_f) + 32768);
   1.682  
   1.683 -	if (args->room_angle == 180) {
   1.684 -        	*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.685 -        	*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.686 -	}
   1.687 -	else {
   1.688 -        	*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.689 -        	*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.690 -	}
   1.691 +    if (args->room_angle == 180) {
   1.692 +            *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.693 +            *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.694 +    }
   1.695 +    else {
   1.696 +            *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.697 +            *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.698 +    }
   1.699      }
   1.700  }
   1.701  static void _Eff_position_u16msb_c4(int chan, void *stream, int len, void *udata)
   1.702 @@ -908,7 +908,7 @@
   1.703          Sint16 sampr = (Sint16) (SDL_SwapBE16(*(ptr+1)) - 32768);
   1.704          Sint16 samplr = (Sint16) (SDL_SwapBE16(*(ptr+2)) - 32768);
   1.705          Sint16 samprr = (Sint16) (SDL_SwapBE16(*(ptr+3)) - 32768);
   1.706 -        
   1.707 +
   1.708          Uint16 swapl = (Uint16) ((Sint16) (((float) sampl * args->left_f)
   1.709                                      * args->distance_f) + 32768);
   1.710          Uint16 swapr = (Uint16) ((Sint16) (((float) sampr * args->right_f)
   1.711 @@ -918,32 +918,32 @@
   1.712          Uint16 swaprr = (Uint16) ((Sint16) (((float) samprr * args->right_rear_f)
   1.713                                      * args->distance_f) + 32768);
   1.714  
   1.715 -	switch (args->room_angle) {
   1.716 -		case 0:
   1.717 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.718 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.719 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.720 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.721 -			break;
   1.722 -		case 90:
   1.723 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.724 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.725 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.726 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.727 -			break;
   1.728 -		case 180:
   1.729 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.730 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.731 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.732 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.733 -			break;
   1.734 -		case 270:
   1.735 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.736 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.737 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.738 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.739 -			break;
   1.740 -	}
   1.741 +    switch (args->room_angle) {
   1.742 +        case 0:
   1.743 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.744 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.745 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.746 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.747 +            break;
   1.748 +        case 90:
   1.749 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.750 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.751 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.752 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.753 +            break;
   1.754 +        case 180:
   1.755 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.756 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.757 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.758 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.759 +            break;
   1.760 +        case 270:
   1.761 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.762 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.763 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.764 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.765 +            break;
   1.766 +    }
   1.767      }
   1.768  }
   1.769  static void _Eff_position_u16msb_c6(int chan, void *stream, int len, void *udata)
   1.770 @@ -960,7 +960,7 @@
   1.771          Sint16 samprr = (Sint16) (SDL_SwapBE16(*(ptr+3)) - 32768);
   1.772          Sint16 sampce = (Sint16) (SDL_SwapBE16(*(ptr+4)) - 32768);
   1.773          Sint16 sampwf = (Sint16) (SDL_SwapBE16(*(ptr+5)) - 32768);
   1.774 -        
   1.775 +
   1.776          Uint16 swapl = (Uint16) ((Sint16) (((float) sampl * args->left_f)
   1.777                                      * args->distance_f) + 32768);
   1.778          Uint16 swapr = (Uint16) ((Sint16) (((float) sampr * args->right_f)
   1.779 @@ -974,40 +974,40 @@
   1.780          Uint16 swapwf = (Uint16) ((Sint16) (((float) sampwf * args->lfe_f)
   1.781                                      * args->distance_f) + 32768);
   1.782  
   1.783 -	switch (args->room_angle) {
   1.784 -		case 0:
   1.785 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.786 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.787 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.788 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.789 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapce);
   1.790 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapwf);
   1.791 -			break;
   1.792 -		case 90:
   1.793 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.794 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.795 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.796 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.797 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapr)/2 + (Uint16) SDL_SwapBE16(swaprr)/2;
   1.798 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapwf);
   1.799 -			break;
   1.800 -		case 180:
   1.801 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.802 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.803 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.804 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.805 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaprr)/2 + (Uint16) SDL_SwapBE16(swaplr)/2;
   1.806 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapwf);
   1.807 -			break;
   1.808 -		case 270:
   1.809 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.810 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.811 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.812 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.813 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapl)/2 + (Uint16) SDL_SwapBE16(swaplr)/2;
   1.814 -        		*(ptr++) = (Uint16) SDL_SwapBE16(swapwf);
   1.815 -			break;
   1.816 -	}
   1.817 +    switch (args->room_angle) {
   1.818 +        case 0:
   1.819 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.820 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.821 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.822 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.823 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapce);
   1.824 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapwf);
   1.825 +            break;
   1.826 +        case 90:
   1.827 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.828 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.829 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.830 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.831 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapr)/2 + (Uint16) SDL_SwapBE16(swaprr)/2;
   1.832 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapwf);
   1.833 +            break;
   1.834 +        case 180:
   1.835 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.836 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.837 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.838 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.839 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaprr)/2 + (Uint16) SDL_SwapBE16(swaplr)/2;
   1.840 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapwf);
   1.841 +            break;
   1.842 +        case 270:
   1.843 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaplr);
   1.844 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapl);
   1.845 +                *(ptr++) = (Uint16) SDL_SwapBE16(swaprr);
   1.846 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapr);
   1.847 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapl)/2 + (Uint16) SDL_SwapBE16(swaplr)/2;
   1.848 +                *(ptr++) = (Uint16) SDL_SwapBE16(swapwf);
   1.849 +            break;
   1.850 +    }
   1.851      }
   1.852  }
   1.853  
   1.854 @@ -1043,32 +1043,32 @@
   1.855                                      args->left_rear_f) * args->distance_f);
   1.856          Sint16 swaprr = (Sint16) ((((float) (Sint16) SDL_SwapBE16(*(ptr+3))) *
   1.857                                      args->right_rear_f) * args->distance_f);
   1.858 -	switch (args->room_angle) {
   1.859 -		case 0:
   1.860 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.861 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.862 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.863 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.864 -			break;
   1.865 -		case 90:
   1.866 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.867 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.868 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.869 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.870 -			break;
   1.871 -		case 180:
   1.872 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.873 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.874 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.875 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.876 -			break;
   1.877 -		case 270:
   1.878 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.879 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.880 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.881 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.882 -			break;
   1.883 -	}
   1.884 +    switch (args->room_angle) {
   1.885 +        case 0:
   1.886 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.887 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.888 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.889 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.890 +            break;
   1.891 +        case 90:
   1.892 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.893 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.894 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.895 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.896 +            break;
   1.897 +        case 180:
   1.898 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.899 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.900 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.901 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.902 +            break;
   1.903 +        case 270:
   1.904 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.905 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.906 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.907 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.908 +            break;
   1.909 +    }
   1.910      }
   1.911  }
   1.912  static void _Eff_position_s16msb_c6(int chan, void *stream, int len, void *udata)
   1.913 @@ -1092,40 +1092,40 @@
   1.914          Sint16 swapwf = (Sint16) ((((float) (Sint16) SDL_SwapBE16(*(ptr+5))) *
   1.915                                      args->lfe_f) * args->distance_f);
   1.916  
   1.917 -	switch (args->room_angle) {
   1.918 -		case 0:
   1.919 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.920 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.921 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.922 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.923 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapce);
   1.924 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapwf);
   1.925 -			break;
   1.926 -		case 90:
   1.927 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.928 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.929 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.930 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.931 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapr)/2 + (Sint16) SDL_SwapBE16(swaprr)/2;
   1.932 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapwf);
   1.933 -			break;
   1.934 -		case 180:
   1.935 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.936 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.937 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.938 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.939 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaprr)/2 + (Sint16) SDL_SwapBE16(swaplr)/2;
   1.940 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapwf);
   1.941 -			break;
   1.942 -		case 270:
   1.943 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.944 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.945 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.946 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.947 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapl)/2 + (Sint16) SDL_SwapBE16(swaplr)/2;
   1.948 -        		*(ptr++) = (Sint16) SDL_SwapBE16(swapwf);
   1.949 -			break;
   1.950 -	}
   1.951 +    switch (args->room_angle) {
   1.952 +        case 0:
   1.953 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.954 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.955 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.956 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.957 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapce);
   1.958 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapwf);
   1.959 +            break;
   1.960 +        case 90:
   1.961 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.962 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.963 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.964 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.965 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapr)/2 + (Sint16) SDL_SwapBE16(swaprr)/2;
   1.966 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapwf);
   1.967 +            break;
   1.968 +        case 180:
   1.969 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.970 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.971 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.972 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.973 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaprr)/2 + (Sint16) SDL_SwapBE16(swaplr)/2;
   1.974 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapwf);
   1.975 +            break;
   1.976 +        case 270:
   1.977 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaplr);
   1.978 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapl);
   1.979 +                *(ptr++) = (Sint16) SDL_SwapBE16(swaprr);
   1.980 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapr);
   1.981 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapl)/2 + (Sint16) SDL_SwapBE16(swaplr)/2;
   1.982 +                *(ptr++) = (Sint16) SDL_SwapBE16(swapwf);
   1.983 +            break;
   1.984 +    }
   1.985      }
   1.986  }
   1.987  
   1.988 @@ -1192,95 +1192,95 @@
   1.989  
   1.990      switch (format) {
   1.991          case AUDIO_U8:
   1.992 -	    switch (channels) {
   1.993 -		    case 1:
   1.994 -		    case 2:
   1.995 -            		f = (_Eff_build_volume_table_u8()) ? _Eff_position_table_u8 :
   1.996 -                                                 		_Eff_position_u8;
   1.997 -	    		break;
   1.998 -	    	    case 4:
   1.999 +        switch (channels) {
  1.1000 +            case 1:
  1.1001 +            case 2:
  1.1002 +                    f = (_Eff_build_volume_table_u8()) ? _Eff_position_table_u8 :
  1.1003 +                                                        _Eff_position_u8;
  1.1004 +                break;
  1.1005 +                case 4:
  1.1006                          f = _Eff_position_u8_c4;
  1.1007 -	    		break;
  1.1008 -	    	    case 6:
  1.1009 +                break;
  1.1010 +                case 6:
  1.1011                          f = _Eff_position_u8_c6;
  1.1012 -	    		break;
  1.1013 -	    }
  1.1014 +                break;
  1.1015 +        }
  1.1016              break;
  1.1017  
  1.1018          case AUDIO_S8:
  1.1019 -	    switch (channels) {
  1.1020 -		    case 1:
  1.1021 -		    case 2:
  1.1022 -            		f = (_Eff_build_volume_table_s8()) ? _Eff_position_table_s8 :
  1.1023 -                                                 		_Eff_position_s8;
  1.1024 -	    		break;
  1.1025 -	    	    case 4:
  1.1026 +        switch (channels) {
  1.1027 +            case 1:
  1.1028 +            case 2:
  1.1029 +                    f = (_Eff_build_volume_table_s8()) ? _Eff_position_table_s8 :
  1.1030 +                                                        _Eff_position_s8;
  1.1031 +                break;
  1.1032 +                case 4:
  1.1033                          f = _Eff_position_s8_c4;
  1.1034 -	    		break;
  1.1035 -	    	    case 6:
  1.1036 +                break;
  1.1037 +                case 6:
  1.1038                          f = _Eff_position_s8_c6;
  1.1039 -	    		break;
  1.1040 -	    }
  1.1041 +                break;
  1.1042 +        }
  1.1043              break;
  1.1044  
  1.1045          case AUDIO_U16LSB:
  1.1046 -	    switch (channels) {
  1.1047 -		    case 1:
  1.1048 -		    case 2:
  1.1049 -            		f = _Eff_position_u16lsb;
  1.1050 -	    		break;
  1.1051 -	    	    case 4:
  1.1052 -            		f = _Eff_position_u16lsb_c4;
  1.1053 -	    		break;
  1.1054 -	    	    case 6:
  1.1055 -            		f = _Eff_position_u16lsb_c6;
  1.1056 -	    		break;
  1.1057 -	    }
  1.1058 +        switch (channels) {
  1.1059 +            case 1:
  1.1060 +            case 2:
  1.1061 +                    f = _Eff_position_u16lsb;
  1.1062 +                break;
  1.1063 +                case 4:
  1.1064 +                    f = _Eff_position_u16lsb_c4;
  1.1065 +                break;
  1.1066 +                case 6:
  1.1067 +                    f = _Eff_position_u16lsb_c6;
  1.1068 +                break;
  1.1069 +        }
  1.1070              break;
  1.1071  
  1.1072          case AUDIO_S16LSB:
  1.1073 -	    switch (channels) {
  1.1074 -		    case 1:
  1.1075 -		    case 2:
  1.1076 -            		f = _Eff_position_s16lsb;
  1.1077 -	    		break;
  1.1078 -	    	    case 4:
  1.1079 -            		f = _Eff_position_s16lsb_c4;
  1.1080 -	    		break;
  1.1081 -	    	    case 6:
  1.1082 -            		f = _Eff_position_s16lsb_c6;
  1.1083 -	    		break;
  1.1084 -	    }
  1.1085 +        switch (channels) {
  1.1086 +            case 1:
  1.1087 +            case 2:
  1.1088 +                    f = _Eff_position_s16lsb;
  1.1089 +                break;
  1.1090 +                case 4:
  1.1091 +                    f = _Eff_position_s16lsb_c4;
  1.1092 +                break;
  1.1093 +                case 6:
  1.1094 +                    f = _Eff_position_s16lsb_c6;
  1.1095 +                break;
  1.1096 +        }
  1.1097              break;
  1.1098  
  1.1099          case AUDIO_U16MSB:
  1.1100 -	    switch (channels) {
  1.1101 -		    case 1:
  1.1102 -		    case 2:
  1.1103 -            		f = _Eff_position_u16msb;
  1.1104 -	    		break;
  1.1105 -	    	    case 4:
  1.1106 -            		f = _Eff_position_u16msb_c4;
  1.1107 -	    		break;
  1.1108 -	    	    case 6:
  1.1109 -            		f = _Eff_position_u16msb_c6;
  1.1110 -	    		break;
  1.1111 -	    }
  1.1112 +        switch (channels) {
  1.1113 +            case 1:
  1.1114 +            case 2:
  1.1115 +                    f = _Eff_position_u16msb;
  1.1116 +                break;
  1.1117 +                case 4:
  1.1118 +                    f = _Eff_position_u16msb_c4;
  1.1119 +                break;
  1.1120 +                case 6:
  1.1121 +                    f = _Eff_position_u16msb_c6;
  1.1122 +                break;
  1.1123 +        }
  1.1124              break;
  1.1125  
  1.1126          case AUDIO_S16MSB:
  1.1127 -	    switch (channels) {
  1.1128 -		    case 1:
  1.1129 -		    case 2:
  1.1130 -            		f = _Eff_position_s16msb;
  1.1131 -	    		break;
  1.1132 -	    	    case 4:
  1.1133 -            		f = _Eff_position_s16msb_c4;
  1.1134 -	    		break;
  1.1135 -	    	    case 6:
  1.1136 -            		f = _Eff_position_s16msb_c6;
  1.1137 -	    		break;
  1.1138 -	    }
  1.1139 +        switch (channels) {
  1.1140 +            case 1:
  1.1141 +            case 2:
  1.1142 +                    f = _Eff_position_s16msb;
  1.1143 +                break;
  1.1144 +                case 4:
  1.1145 +                    f = _Eff_position_s16msb_c4;
  1.1146 +                break;
  1.1147 +                case 6:
  1.1148 +                    f = _Eff_position_s16msb_c6;
  1.1149 +                break;
  1.1150 +        }
  1.1151              break;
  1.1152  
  1.1153          default:
  1.1154 @@ -1388,34 +1388,34 @@
  1.1155      if (center < 0) center = 0; if (center > 255) center = 255;
  1.1156  
  1.1157      if (room_angle == 90) {
  1.1158 -    	speaker_amplitude[0] = (Uint8)left_rear;
  1.1159 -    	speaker_amplitude[1] = (Uint8)left;
  1.1160 -    	speaker_amplitude[2] = (Uint8)right_rear;
  1.1161 -    	speaker_amplitude[3] = (Uint8)right;
  1.1162 +        speaker_amplitude[0] = (Uint8)left_rear;
  1.1163 +        speaker_amplitude[1] = (Uint8)left;
  1.1164 +        speaker_amplitude[2] = (Uint8)right_rear;
  1.1165 +        speaker_amplitude[3] = (Uint8)right;
  1.1166      }
  1.1167      else if (room_angle == 180) {
  1.1168 -	if (channels == 2) {
  1.1169 -    	    speaker_amplitude[0] = (Uint8)right;
  1.1170 -    	    speaker_amplitude[1] = (Uint8)left;
  1.1171 -	}
  1.1172 -	else {
  1.1173 -    	    speaker_amplitude[0] = (Uint8)right_rear;
  1.1174 -    	    speaker_amplitude[1] = (Uint8)left_rear;
  1.1175 -    	    speaker_amplitude[2] = (Uint8)right;
  1.1176 -    	    speaker_amplitude[3] = (Uint8)left;
  1.1177 -	}
  1.1178 +    if (channels == 2) {
  1.1179 +            speaker_amplitude[0] = (Uint8)right;
  1.1180 +            speaker_amplitude[1] = (Uint8)left;
  1.1181 +    }
  1.1182 +    else {
  1.1183 +            speaker_amplitude[0] = (Uint8)right_rear;
  1.1184 +            speaker_amplitude[1] = (Uint8)left_rear;
  1.1185 +            speaker_amplitude[2] = (Uint8)right;
  1.1186 +            speaker_amplitude[3] = (Uint8)left;
  1.1187 +    }
  1.1188      }
  1.1189      else if (room_angle == 270) {
  1.1190 -    	speaker_amplitude[0] = (Uint8)right;
  1.1191 -    	speaker_amplitude[1] = (Uint8)right_rear;
  1.1192 -    	speaker_amplitude[2] = (Uint8)left;
  1.1193 -    	speaker_amplitude[3] = (Uint8)left_rear;
  1.1194 +        speaker_amplitude[0] = (Uint8)right;
  1.1195 +        speaker_amplitude[1] = (Uint8)right_rear;
  1.1196 +        speaker_amplitude[2] = (Uint8)left;
  1.1197 +        speaker_amplitude[3] = (Uint8)left_rear;
  1.1198      }
  1.1199      else {
  1.1200 -    	speaker_amplitude[0] = (Uint8)left;
  1.1201 -    	speaker_amplitude[1] = (Uint8)right;
  1.1202 -    	speaker_amplitude[2] = (Uint8)left_rear;
  1.1203 -    	speaker_amplitude[3] = (Uint8)right_rear;
  1.1204 +        speaker_amplitude[0] = (Uint8)left;
  1.1205 +        speaker_amplitude[1] = (Uint8)right;
  1.1206 +        speaker_amplitude[2] = (Uint8)left_rear;
  1.1207 +        speaker_amplitude[3] = (Uint8)right_rear;
  1.1208      }
  1.1209      speaker_amplitude[4] = (Uint8)center;
  1.1210      speaker_amplitude[5] = 255;
  1.1211 @@ -1438,13 +1438,13 @@
  1.1212  
  1.1213      if (channels > 2) {
  1.1214          /* left = right = 255 => angle = 0, to unregister effect as when channels = 2 */
  1.1215 -    	/* left = 255 =>  angle = -90;  left = 0 => angle = +89 */
  1.1216 +        /* left = 255 =>  angle = -90;  left = 0 => angle = +89 */
  1.1217          int angle = 0;
  1.1218          if ((left != 255) || (right != 255)) {
  1.1219 -	    angle = (int)left;
  1.1220 -    	    angle = 127 - angle;
  1.1221 -	    angle = -angle;
  1.1222 -    	    angle = angle * 90 / 128; /* Make it larger for more effect? */
  1.1223 +        angle = (int)left;
  1.1224 +            angle = 127 - angle;
  1.1225 +        angle = -angle;
  1.1226 +            angle = angle * 90 / 128; /* Make it larger for more effect? */
  1.1227          }
  1.1228          return( Mix_SetPosition(channel, angle, 0) );
  1.1229      }
  1.1230 @@ -1571,18 +1571,18 @@
  1.1231  
  1.1232      if (channels == 2)
  1.1233      {
  1.1234 -	if (angle > 180)
  1.1235 -		room_angle = 180; /* exchange left and right channels */
  1.1236 -	else room_angle = 0;
  1.1237 +    if (angle > 180)
  1.1238 +        room_angle = 180; /* exchange left and right channels */
  1.1239 +    else room_angle = 0;
  1.1240      }
  1.1241  
  1.1242      if (channels == 4 || channels == 6)
  1.1243      {
  1.1244 -	if (angle > 315) room_angle = 0;
  1.1245 -	else if (angle > 225) room_angle = 270;
  1.1246 -	else if (angle > 135) room_angle = 180;
  1.1247 -	else if (angle > 45) room_angle = 90;
  1.1248 -	else room_angle = 0;
  1.1249 +    if (angle > 315) room_angle = 0;
  1.1250 +    else if (angle > 225) room_angle = 270;
  1.1251 +    else if (angle > 135) room_angle = 180;
  1.1252 +    else if (angle > 45) room_angle = 90;
  1.1253 +    else room_angle = 0;
  1.1254      }
  1.1255  
  1.1256