src/codecs/load_voc.c
changeset 1093 6f0bea2ab267
parent 999 1a87fe70802d
child 1129 888c7be704ce
equal deleted inserted replaced
1092:e7e3052b74ae 1093:6f0bea2ab267
   299 
   299 
   300             case VOC_MARKER:
   300             case VOC_MARKER:
   301                 if (SDL_RWread(src, trash, sizeof (Uint8), 2) != 2)
   301                 if (SDL_RWread(src, trash, sizeof (Uint8), 2) != 2)
   302                     return 0;
   302                     return 0;
   303 
   303 
   304                 /* Falling! Falling! */
   304                 /* fallthrough */
   305 
   305 
   306             default:  /* text block or other krapola. */
   306             default:  /* text block or other krapola. */
   307                 for(i = 0; i < sblen; i++)
   307                 for(i = 0; i < sblen; i++)
   308                 {
   308                 {
   309                     if (SDL_RWread(src, &trash, sizeof (Uint8), 1) != 1)
   309                     if (SDL_RWread(src, &trash, sizeof (Uint8), 1) != 1)
   349         done = (Uint32)SDL_RWread(src, buf, 1, v->rest);
   349         done = (Uint32)SDL_RWread(src, buf, 1, v->rest);
   350         v->rest -= done;
   350         v->rest -= done;
   351         if (v->size == ST_SIZE_WORD)
   351         if (v->size == ST_SIZE_WORD)
   352         {
   352         {
   353             #if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
   353             #if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
   354                 Uint16 *samples = (Uint16 *)buf;
   354             Uint16 *samples = (Uint16 *)buf;
   355                 for (; v->rest > 0; v->rest -= 2)
   355             for (; v->rest > 0; v->rest -= 2)
   356                 {
   356             {
   357                     *samples = SDL_SwapLE16(*samples);
   357                 *samples = SDL_SwapLE16(*samples);
   358                     samples++;
   358                 samples++;
   359                 }
   359             }
   360             #endif
   360             #endif
   361             done >>= 1;
   361             done >>= 1;
   362         }
   362         }
   363     }
   363     }
   364 
   364