diff options
Diffstat (limited to 'code')
-rw-r--r-- | code/client/cl_cin.c | 116 |
1 files changed, 34 insertions, 82 deletions
diff --git a/code/client/cl_cin.c b/code/client/cl_cin.c index e15f4a7..3b75c2e 100644 --- a/code/client/cl_cin.c +++ b/code/client/cl_cin.c @@ -333,28 +333,14 @@ long RllDecodeStereoToMono(unsigned char *from,short *to,unsigned int size,char static void move8_32( byte *src, byte *dst, int spl ) { - double *dsrc, *ddst; - int dspl; - - dsrc = (double *)src; - ddst = (double *)dst; - dspl = spl>>3; - - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; + int i; + + for(i = 0; i < 8; ++i) + { + memcpy(dst, src, 32); + src += spl; + dst += spl; + } } /****************************************************************************** @@ -367,20 +353,14 @@ static void move8_32( byte *src, byte *dst, int spl ) static void move4_32( byte *src, byte *dst, int spl ) { - double *dsrc, *ddst; - int dspl; - - dsrc = (double *)src; - ddst = (double *)dst; - dspl = spl>>3; - - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; - dsrc += dspl; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; + int i; + + for(i = 0; i < 4; ++i) + { + memcpy(dst, src, 16); + src += spl; + dst += spl; + } } /****************************************************************************** @@ -393,28 +373,14 @@ static void move4_32( byte *src, byte *dst, int spl ) static void blit8_32( byte *src, byte *dst, int spl ) { - double *dsrc, *ddst; - int dspl; - - dsrc = (double *)src; - ddst = (double *)dst; - dspl = spl>>3; - - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += 4; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += 4; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += 4; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += 4; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += 4; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += 4; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; - dsrc += 4; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; ddst[2] = dsrc[2]; ddst[3] = dsrc[3]; + int i; + + for(i = 0; i < 8; ++i) + { + memcpy(dst, src, 32); + src += 32; + dst += spl; + } } /****************************************************************************** @@ -424,23 +390,16 @@ static void blit8_32( byte *src, byte *dst, int spl ) * Description: * ******************************************************************************/ -#define movs double static void blit4_32( byte *src, byte *dst, int spl ) { - movs *dsrc, *ddst; - int dspl; - - dsrc = (movs *)src; - ddst = (movs *)dst; - dspl = spl>>3; - - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; - dsrc += 2; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; - dsrc += 2; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; - dsrc += 2; ddst += dspl; - ddst[0] = dsrc[0]; ddst[1] = dsrc[1]; + int i; + + for(i = 0; i < 4; ++i) + { + memmove(dst, src, 16); + src += 16; + dst += spl; + } } /****************************************************************************** @@ -453,15 +412,8 @@ static void blit4_32( byte *src, byte *dst, int spl ) static void blit2_32( byte *src, byte *dst, int spl ) { - double *dsrc, *ddst; - int dspl; - - dsrc = (double *)src; - ddst = (double *)dst; - dspl = spl>>3; - - ddst[0] = dsrc[0]; - ddst[dspl] = dsrc[1]; + memcpy(dst, src, 8); + memcpy(dst+spl, src+8, 8); } /****************************************************************************** |