diff options
author | Max Horn | 2007-09-18 20:16:33 +0000 |
---|---|---|
committer | Max Horn | 2007-09-18 20:16:33 +0000 |
commit | 3abc11611e1d1d93f1cf794df28879de3571bd01 (patch) | |
tree | e1ac8a925d1388f8df010a114d7bed471fc9fe3b /backends/platform/ds/arm9/source | |
parent | c3d3aebe87d16d4fc3b7ac8581b99fb97241c9ac (diff) | |
download | scummvm-rg350-3abc11611e1d1d93f1cf794df28879de3571bd01.tar.gz scummvm-rg350-3abc11611e1d1d93f1cf794df28879de3571bd01.tar.bz2 scummvm-rg350-3abc11611e1d1d93f1cf794df28879de3571bd01.zip |
Code formatting fixes
svn-id: r28945
Diffstat (limited to 'backends/platform/ds/arm9/source')
-rw-r--r-- | backends/platform/ds/arm9/source/blitters.cpp | 18 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/compressor/lz.cpp | 80 | ||||
-rw-r--r-- | backends/platform/ds/arm9/source/dsmain.cpp | 4 |
3 files changed, 51 insertions, 51 deletions
diff --git a/backends/platform/ds/arm9/source/blitters.cpp b/backends/platform/ds/arm9/source/blitters.cpp index 9af3c5d611..1ce8429a4d 100644 --- a/backends/platform/ds/arm9/source/blitters.cpp +++ b/backends/platform/ds/arm9/source/blitters.cpp @@ -148,7 +148,7 @@ void ComputeDivBy5TableIFN() return; isDivBy5Ready = true; - for(int i=0; i<160; ++i) + for (int i=0; i<160; ++i) { DIV_BY_5[i] = (2*i+5)/10; } @@ -311,7 +311,7 @@ static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const { ComputeDivBy5TableIFN(); - for(size_t i=0; i<64; ++i) + for (size_t i=0; i<64; ++i) { u32 s0 = palette[src[5*i+0]]; u32 s1 = palette[src[5*i+1]]; @@ -325,7 +325,7 @@ static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const #else static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const u8* src, const u16* palette) { - for(size_t i=0; i<64; ++i) + for (size_t i=0; i<64; ++i) { u16 s0 = palette[src[5*i+0]]; u16 s1 = palette[src[5*i+1]]; @@ -344,7 +344,7 @@ static inline void Rescale_320x1555Scanline_To_256x1555Scanline(u16* dest, const { ComputeDivBy5TableIFN(); - for(size_t i=0; i<64; ++i) + for (size_t i=0; i<64; ++i) { u16 s0 = src[5*i+0]; u16 s1 = src[5*i+1]; @@ -362,7 +362,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* p u32 fastRam[768]; // Palette lookup -> 0_888 - for(size_t i=0; i<256; ++i) + for (size_t i=0; i<256; ++i) { u32 col = palette[i]; u32 result = col & 0x0000001F; @@ -372,7 +372,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* p fastRam[i] = result; } - for(size_t i=0; i<200; ++i) + for (size_t i=0; i<200; ++i) { Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam); } @@ -381,10 +381,10 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* p void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* palette, int destStride, int srcStride) { u16 fastRam[256]; - for(size_t i=0; i<128; ++i) + for (size_t i=0; i<128; ++i) ((u32*)fastRam)[i] = ((const u32*)palette)[i]; - for(size_t i=0; i<200; ++i) + for (size_t i=0; i<200; ++i) { Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam); } @@ -393,7 +393,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, const u16* p void Rescale_320x256x1555_To_256x256x1555(u16* dest, const u16* src, int destStride, int srcStride) { - for(size_t i=0; i<200; ++i) + for (size_t i=0; i<200; ++i) { Rescale_320x1555Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride); } diff --git a/backends/platform/ds/arm9/source/compressor/lz.cpp b/backends/platform/ds/arm9/source/compressor/lz.cpp index 1234bf7b3b..47a36646c6 100644 --- a/backends/platform/ds/arm9/source/compressor/lz.cpp +++ b/backends/platform/ds/arm9/source/compressor/lz.cpp @@ -105,7 +105,7 @@ inline static unsigned int _LZ_StringCompare( unsigned char * str1, { unsigned int len; - for( len = minlen; (len < maxlen) && (str1[len] == str2[len]); ++ len ); + for ( len = minlen; (len < maxlen) && (str1[len] == str2[len]); ++ len ); return len; } @@ -123,18 +123,18 @@ inline static int _LZ_WriteVarSize( unsigned int x, unsigned char * buf ) /* Determine number of bytes needed to store the number x */ y = x >> 3; - for( num_bytes = 5; num_bytes >= 2; -- num_bytes ) + for ( num_bytes = 5; num_bytes >= 2; -- num_bytes ) { - if( y & 0xfe000000 ) break; + if ( y & 0xfe000000 ) break; y <<= 7; } /* Write all bytes, seven bits in each, with 8:th bit set for all */ /* but the last byte. */ - for( i = num_bytes-1; i >= 0; -- i ) + for ( i = num_bytes-1; i >= 0; -- i ) { b = (x >> (i*7)) & 0x0000007f; - if( i > 0 ) + if ( i > 0 ) { b |= 0x00000080; } @@ -164,7 +164,7 @@ inline static int _LZ_ReadVarSize( unsigned int * x, unsigned char * buf ) y = (y << 7) | (b & 0x0000007f); ++ num_bytes; } - while( b & 0x00000080 ); + while ( b & 0x00000080 ); /* Store value in x */ *x = y; @@ -200,26 +200,26 @@ int LZ_Compress( unsigned char *in, unsigned char *out, unsigned char *ptr1, *ptr2; /* Do we have anything to compress? */ - if( insize < 1 ) + if ( insize < 1 ) { return 0; } /* Create histogram */ - for( i = 0; i < 256; ++ i ) + for ( i = 0; i < 256; ++ i ) { histogram[ i ] = 0; } - for( i = 0; i < insize; ++ i ) + for ( i = 0; i < insize; ++ i ) { ++ histogram[ in[ i ] ]; } /* Find the least common byte, and use it as the code marker */ marker = 0; - for( i = 1; i < 256; ++ i ) + for ( i = 1; i < 256; ++ i ) { - if( histogram[ i ] < histogram[ marker ] ) + if ( histogram[ i ] < histogram[ marker ] ) { marker = i; } @@ -237,7 +237,7 @@ int LZ_Compress( unsigned char *in, unsigned char *out, do { /* Determine most distant position */ - if( inpos > LZ_MAX_OFFSET ) maxoffset = LZ_MAX_OFFSET; + if ( inpos > LZ_MAX_OFFSET ) maxoffset = LZ_MAX_OFFSET; else maxoffset = inpos; /* Get pointer to current position */ @@ -246,13 +246,13 @@ int LZ_Compress( unsigned char *in, unsigned char *out, /* Search history window for maximum length string match */ bestlength = 3; bestoffset = 0; - for( offset = 3; offset <= maxoffset; ++ offset ) + for ( offset = 3; offset <= maxoffset; ++ offset ) { /* Get pointer to candidate string */ ptr2 = &ptr1[ -offset ]; /* Quickly determine if this is a candidate (for speed) */ - if( (ptr1[ 0 ] == ptr2[ 0 ]) && + if ( (ptr1[ 0 ] == ptr2[ 0 ]) && (ptr1[ bestlength ] == ptr2[ bestlength ]) ) { /* Determine maximum length for this offset */ @@ -262,7 +262,7 @@ int LZ_Compress( unsigned char *in, unsigned char *out, length = _LZ_StringCompare( ptr1, ptr2, 0, maxlength ); /* Better match than any previous match? */ - if( length > bestlength ) + if ( length > bestlength ) { bestlength = length; bestoffset = offset; @@ -271,7 +271,7 @@ int LZ_Compress( unsigned char *in, unsigned char *out, } /* Was there a good enough match? */ - if( (bestlength >= 8) || + if ( (bestlength >= 8) || ((bestlength == 4) && (bestoffset <= 0x0000007f)) || ((bestlength == 5) && (bestoffset <= 0x00003fff)) || ((bestlength == 6) && (bestoffset <= 0x001fffff)) || @@ -288,19 +288,19 @@ int LZ_Compress( unsigned char *in, unsigned char *out, /* Output single byte (or two bytes if marker byte) */ symbol = in[ inpos ++ ]; out[ outpos ++ ] = symbol; - if( symbol == marker ) + if ( symbol == marker ) { out[ outpos ++ ] = 0; } -- bytesleft; } } - while( bytesleft > 3 ); + while ( bytesleft > 3 ); /* Dump remaining bytes, if any */ - while( inpos < insize ) + while ( inpos < insize ) { - if( in[ inpos ] == marker ) + if ( in[ inpos ] == marker ) { out[ outpos ++ ] = marker; out[ outpos ++ ] = 0; @@ -338,7 +338,7 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out, unsigned char *ptr1, *ptr2; /* Do we have anything to compress? */ - if( insize < 1 ) + if ( insize < 1 ) { return 0; } @@ -353,11 +353,11 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out, in[i+1] == in[jumptable[i]+1]. Following the jump table gives a dramatic boost for the string search'n'match loop compared to doing a brute force search. */ - for( i = 0; i < 65536; ++ i ) + for ( i = 0; i < 65536; ++ i ) { lastindex[ i ] = 0xffffffff; } - for( i = 0; i < insize-1; ++ i ) + for ( i = 0; i < insize-1; ++ i ) { symbols = (((unsigned int)in[i]) << 8) | ((unsigned int)in[i+1]); index = lastindex[ symbols ]; @@ -367,20 +367,20 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out, jumptable[ insize-1 ] = 0xffffffff; /* Create histogram */ - for( i = 0; i < 256; ++ i ) + for ( i = 0; i < 256; ++ i ) { histogram[ i ] = 0; } - for( i = 0; i < insize; ++ i ) + for ( i = 0; i < insize; ++ i ) { ++ histogram[ in[ i ] ]; } /* Find the least common byte, and use it as the code marker */ marker = 0; - for( i = 1; i < 256; ++ i ) + for ( i = 1; i < 256; ++ i ) { - if( histogram[ i ] < histogram[ marker ] ) + if ( histogram[ i ] < histogram[ marker ] ) { marker = i; } @@ -404,13 +404,13 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out, bestlength = 3; bestoffset = 0; index = jumptable[ inpos ]; - while( index != 0xffffffff ) + while ( index != 0xffffffff ) { /* Get pointer to candidate string */ ptr2 = &in[ index ]; /* Quickly determine if this is a candidate (for speed) */ - if( ptr2[ bestlength ] == ptr1[ bestlength ] ) + if ( ptr2[ bestlength ] == ptr1[ bestlength ] ) { /* Determine maximum length for this offset */ offset = inpos - index; @@ -420,7 +420,7 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out, length = _LZ_StringCompare( ptr1, ptr2, 2, maxlength ); /* Better match than any previous match? */ - if( length > bestlength ) + if ( length > bestlength ) { bestlength = length; bestoffset = offset; @@ -432,7 +432,7 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out, } /* Was there a good enough match? */ - if( (bestlength >= 8) || + if ( (bestlength >= 8) || ((bestlength == 4) && (bestoffset <= 0x0000007f)) || ((bestlength == 5) && (bestoffset <= 0x00003fff)) || ((bestlength == 6) && (bestoffset <= 0x001fffff)) || @@ -449,19 +449,19 @@ int LZ_CompressFast( unsigned char *in, unsigned char *out, /* Output single byte (or two bytes if marker byte) */ symbol = in[ inpos ++ ]; out[ outpos ++ ] = symbol; - if( symbol == marker ) + if ( symbol == marker ) { out[ outpos ++ ] = 0; } -- bytesleft; } } - while( bytesleft > 3 ); + while ( bytesleft > 3 ); /* Dump remaining bytes, if any */ - while( inpos < insize ) + while ( inpos < insize ) { - if( in[ inpos ] == marker ) + if ( in[ inpos ] == marker ) { out[ outpos ++ ] = marker; out[ outpos ++ ] = 0; @@ -492,7 +492,7 @@ void LZ_Uncompress( unsigned char *in, unsigned char *out, unsigned int i, inpos, outpos, length, offset; /* Do we have anything to compress? */ - if( insize < 1 ) + if ( insize < 1 ) { return; } @@ -506,10 +506,10 @@ void LZ_Uncompress( unsigned char *in, unsigned char *out, do { symbol = in[ inpos ++ ]; - if( symbol == marker ) + if ( symbol == marker ) { /* We had a marker byte */ - if( in[ inpos ] == 0 ) + if ( in[ inpos ] == 0 ) { /* It was a single occurrence of the marker byte */ out[ outpos ++ ] = marker; @@ -522,7 +522,7 @@ void LZ_Uncompress( unsigned char *in, unsigned char *out, inpos += _LZ_ReadVarSize( &offset, &in[ inpos ] ); /* Copy corresponding data from history window */ - for( i = 0; i < length; ++ i ) + for ( i = 0; i < length; ++ i ) { out[ outpos ] = out[ outpos - offset ]; ++ outpos; @@ -535,5 +535,5 @@ void LZ_Uncompress( unsigned char *in, unsigned char *out, out[ outpos ++ ] = symbol; } } - while( inpos < insize ); + while ( inpos < insize ); } diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index 43008a1770..1689a3f5f9 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -305,14 +305,14 @@ int getGameHeight() { } void initSprites() { - for(int i = 0; i < 128; i++) { + for (int i = 0; i < 128; i++) { sprites[i].attribute[0] = ATTR0_DISABLED; sprites[i].attribute[1] = 0; sprites[i].attribute[2] = 0; sprites[i].attribute[3] = 0; } - for(int i = 0; i < 128; i++) { + for (int i = 0; i < 128; i++) { spritesMain[i].attribute[0] = ATTR0_DISABLED; spritesMain[i].attribute[1] = 0; spritesMain[i].attribute[2] = 0; |