diff options
-rw-r--r-- | common/scummsys.h | 8 | ||||
-rw-r--r-- | scumm/smush/blitter.h | 4 | ||||
-rw-r--r-- | scumm/smush/brenderer.h | 4 | ||||
-rw-r--r-- | scumm/smush/channel.h | 4 | ||||
-rw-r--r-- | scumm/smush/chunk.h | 4 | ||||
-rw-r--r-- | scumm/smush/chunk_type.h | 4 | ||||
-rw-r--r-- | scumm/smush/codec1.h | 4 | ||||
-rw-r--r-- | scumm/smush/codec37.cpp | 3 | ||||
-rw-r--r-- | scumm/smush/codec37.h | 4 | ||||
-rw-r--r-- | scumm/smush/codec44.h | 4 | ||||
-rw-r--r-- | scumm/smush/codec47.h | 4 | ||||
-rw-r--r-- | scumm/smush/color.h | 4 | ||||
-rw-r--r-- | scumm/smush/config.h | 6 | ||||
-rw-r--r-- | scumm/smush/decoder.h | 4 | ||||
-rw-r--r-- | scumm/smush/frenderer.h | 5 | ||||
-rw-r--r-- | scumm/smush/imuse_channel.cpp | 12 | ||||
-rw-r--r-- | scumm/smush/mixer.h | 4 | ||||
-rw-r--r-- | scumm/smush/palette.h | 4 | ||||
-rw-r--r-- | scumm/smush/player.cpp | 6 | ||||
-rw-r--r-- | scumm/smush/player.h | 4 | ||||
-rw-r--r-- | scumm/smush/rect.h | 4 | ||||
-rw-r--r-- | scumm/smush/renderer.h | 4 | ||||
-rw-r--r-- | scumm/smush/scumm_renderer.h | 4 |
23 files changed, 54 insertions, 54 deletions
diff --git a/common/scummsys.h b/common/scummsys.h index 74fcfbcb84..61b5d6a500 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -237,6 +237,8 @@ typedef signed long int32; #endif +#define SWAP_BYTES(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) + #if defined(SCUMM_LITTLE_ENDIAN) //#if defined(SCUMM_NEED_ALIGNMENT) @@ -244,7 +246,7 @@ typedef signed long int32; //#endif -#define PROTO_MKID(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) +#define PROTO_MKID(a) SWAP_BYTES(a) #define PROTO_MKID_BE(a) (a & 0xffffffff) #if defined(INVERSE_MKID) @@ -297,7 +299,7 @@ FORCEINLINE uint32 READ_BE_UINT32(void *ptr) { #define TO_LE_32(__a__) __a__ #define TO_LE_16(__a__) __a__ -#define TO_BE_32(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) +#define TO_BE_32(a) SWAP_BYTES(a) uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a>>8) | (a<<8); } @@ -305,7 +307,7 @@ uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a>>8) | (a<<8); } #define MKID(a) (a) #define MKID_BE(a) (a) -//#define MKID_BE(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000)) +//#define MKID_BE(a) SWAP_BYTES(a) uint32 FORCEINLINE FROM_LE_32(uint32 a) { return ((a>>24)&0xFF) + ((a>>8)&0xFF00) + ((a<<8)&0xFF0000) + ((a<<24)&0xFF000000); diff --git a/scumm/smush/blitter.h b/scumm/smush/blitter.h index e9d0509cff..2590af0ac4 100644 --- a/scumm/smush/blitter.h +++ b/scumm/smush/blitter.h @@ -19,8 +19,8 @@ * */ -#ifndef __BLITTER_H_ -#define __BLITTER_H_ +#ifndef BLITTER_H +#define BLITTER_H #include "config.h" diff --git a/scumm/smush/brenderer.h b/scumm/smush/brenderer.h index 792fd034c4..80b0bb54ce 100644 --- a/scumm/smush/brenderer.h +++ b/scumm/smush/brenderer.h @@ -19,8 +19,8 @@ * */ -#ifndef __BRENDERER_H_ -#define __BRENDERER_H_ +#ifndef BRENDERER_H +#define BRENDERER_H #include "config.h" diff --git a/scumm/smush/channel.h b/scumm/smush/channel.h index b13d08d5a5..09a006356f 100644 --- a/scumm/smush/channel.h +++ b/scumm/smush/channel.h @@ -19,8 +19,8 @@ * */ -#ifndef __CHANNEL_H_ -#define __CHANNEL_H_ +#ifndef CHANNEL_H +#define CHANNEL_H #include "config.h" diff --git a/scumm/smush/chunk.h b/scumm/smush/chunk.h index 3b42800ee2..72c22229b1 100644 --- a/scumm/smush/chunk.h +++ b/scumm/smush/chunk.h @@ -19,8 +19,8 @@ * */ -#ifndef __CHUNK_H_ -#define __CHUNK_H_ +#ifndef CHUNK_H +#define CHUNK_H #include "config.h" diff --git a/scumm/smush/chunk_type.h b/scumm/smush/chunk_type.h index 06e5d77415..599fb86991 100644 --- a/scumm/smush/chunk_type.h +++ b/scumm/smush/chunk_type.h @@ -19,8 +19,8 @@ * */ -#ifndef __CHUNK_TYPE_H -#define __CHUNK_TYPE_H +#ifndef CHUNK_TYPE_H +#define CHUNK_TYPE_H #include "Chunk.h" diff --git a/scumm/smush/codec1.h b/scumm/smush/codec1.h index 2280da33ca..8bdb7f7d13 100644 --- a/scumm/smush/codec1.h +++ b/scumm/smush/codec1.h @@ -19,8 +19,8 @@ * */ -#ifndef __CODEC1_H_ -#define __CODEC1_H_ +#ifndef CODEC1_H +#define CODEC1_H #include "config.h" diff --git a/scumm/smush/codec37.cpp b/scumm/smush/codec37.cpp index f8dd7f99a1..3313ab6c5f 100644 --- a/scumm/smush/codec37.cpp +++ b/scumm/smush/codec37.cpp @@ -317,9 +317,6 @@ void Codec37Decoder::proc3WithoutFDFE(Blitter & dst, Chunk & src, int next_offs, } void Codec37Decoder::proc4(Blitter & dst, Chunk & src, int next_offs, int bw, int bh) { -#ifdef DEBUG_CODEC37_PROC4 - int b_nb = 0; -#endif do { int i = bw; do { diff --git a/scumm/smush/codec37.h b/scumm/smush/codec37.h index a98ec3985c..a60d80a268 100644 --- a/scumm/smush/codec37.h +++ b/scumm/smush/codec37.h @@ -19,8 +19,8 @@ * */ -#ifndef __CODEC37_H_ -#define __CODEC37_H_ +#ifndef CODEC37_H +#define CODEC37_H #include "config.h" diff --git a/scumm/smush/codec44.h b/scumm/smush/codec44.h index 4b933c1fbb..4929efbc54 100644 --- a/scumm/smush/codec44.h +++ b/scumm/smush/codec44.h @@ -19,8 +19,8 @@ * */ -#ifndef __CODEC44_H_ -#define __CODEC44_H_ +#ifndef CODEC44_H +#define CODEC44_H #include "config.h" diff --git a/scumm/smush/codec47.h b/scumm/smush/codec47.h index 5d2df4d9b3..4b793147b6 100644 --- a/scumm/smush/codec47.h +++ b/scumm/smush/codec47.h @@ -19,8 +19,8 @@ * */ -#ifndef __CODEC_47_H_ -#define __CODEC_47_H_ +#ifndef CODEC_47_H +#define CODEC_47_H #include "config.h" diff --git a/scumm/smush/color.h b/scumm/smush/color.h index 7ec7bafa93..d2ee53271a 100644 --- a/scumm/smush/color.h +++ b/scumm/smush/color.h @@ -19,8 +19,8 @@ * */ -#ifndef __Chunk_H_ -#define __Chunk_H_ +#ifndef COLOR_H +#define COLOR_H #include "config.h" diff --git a/scumm/smush/config.h b/scumm/smush/config.h index 4734413f2e..3622eb68bf 100644 --- a/scumm/smush/config.h +++ b/scumm/smush/config.h @@ -19,8 +19,8 @@ * */ -#ifndef __CONFIG_H_ -#define __CONFIG_H_ +#ifndef CONFIG_H +#define CONFIG_H #include <stdafx.h> #include <scumm.h> @@ -33,7 +33,7 @@ //~ #define NO_DEBUG_CHANNEL //~ #define NO_DEBUG_CLIPPER #define NO_DEBUG_CODEC1 -#define NO_DEBUG_CODEC37 +//#define NO_DEBUG_CODEC37 #define NO_DEBUG_CODEC44 //~ #define NO_DEBUG_WIN32 //~ #define NO_DEBUG_FONT_RENDERER diff --git a/scumm/smush/decoder.h b/scumm/smush/decoder.h index 79a8dc7c98..cff839214d 100644 --- a/scumm/smush/decoder.h +++ b/scumm/smush/decoder.h @@ -19,8 +19,8 @@ * */ -#ifndef __DECODER_H_ -#define __DECODER_H_ +#ifndef DECODER_H +#define DECODER_H #include "config.h" diff --git a/scumm/smush/frenderer.h b/scumm/smush/frenderer.h index 26c7d661ba..115106b963 100644 --- a/scumm/smush/frenderer.h +++ b/scumm/smush/frenderer.h @@ -19,8 +19,8 @@ * */ -#ifndef __FRENDERER_H_ -#define __FRENDERER_H_ +#ifndef FRENDERER_H +#define FRENDERER_H #include "config.h" @@ -159,6 +159,7 @@ public: @return \c true if everything went fine, \c false otherwise */ bool drawStringAbsolute(const char * str, char * buffer, const Point & size, int x, int y) const; + }; #endif diff --git a/scumm/smush/imuse_channel.cpp b/scumm/smush/imuse_channel.cpp index 94aab12519..049a9e1c4d 100644 --- a/scumm/smush/imuse_channel.cpp +++ b/scumm/smush/imuse_channel.cpp @@ -66,8 +66,8 @@ bool ImuseChannel::checkParameters(int index, int nbframes, int size, int unk1, bool ImuseChannel::appendData(Chunk & b, int size) { if(_dataSize == -1) { // First call assert(size > 8); - Chunk::type imus_type = b.getDword(); imus_type = TO_BE_32(imus_type); - unsigned int imus_size = b.getDword(); imus_size = TO_BE_32(imus_size); + Chunk::type imus_type = b.getDword(); imus_type = SWAP_BYTES(imus_type); + unsigned int imus_size = b.getDword(); imus_size = SWAP_BYTES(imus_size); if(imus_type != TYPE_iMUS) error("Invalid Chunk for imuse_channel"); size -= 8; _tbufferSize = size; @@ -99,14 +99,14 @@ bool ImuseChannel::appendData(Chunk & b, int size) { bool ImuseChannel::handleFormat(Chunk & src) { if(src.getSize() != 20) error("invalid size for FRMT Chunk"); unsigned imuse_start = src.getDword(); - imuse_start = TO_BE_32(imuse_start); + imuse_start = SWAP_BYTES(imuse_start); src.seek(4); _bitsize = src.getDword(); - _bitsize = TO_BE_32(_bitsize); + _bitsize = SWAP_BYTES(_bitsize); _rate = src.getDword(); - _rate = TO_BE_32(_rate); + _rate = SWAP_BYTES(_rate); _channels = src.getDword(); - _channels = TO_BE_32(_channels); + _channels = SWAP_BYTES(_channels); assert(_channels == 1 || _channels == 2); return true; } diff --git a/scumm/smush/mixer.h b/scumm/smush/mixer.h index 30858b6c29..d015ae9e61 100644 --- a/scumm/smush/mixer.h +++ b/scumm/smush/mixer.h @@ -19,8 +19,8 @@ * */ -#ifndef __MIXER_H_ -#define __MIXER_H_ +#ifndef MIXER_H +#define MIXER_H #include "config.h" diff --git a/scumm/smush/palette.h b/scumm/smush/palette.h index 4cc8491219..7b7241136a 100644 --- a/scumm/smush/palette.h +++ b/scumm/smush/palette.h @@ -19,8 +19,8 @@ * */ -#ifndef __PALETTE_H_ -#define __PALETTE_H_ +#ifndef PALETTE_H +#define PALETTE_H #include "config.h" diff --git a/scumm/smush/player.cpp b/scumm/smush/player.cpp index 4cce9e00fa..33da6467b6 100644 --- a/scumm/smush/player.cpp +++ b/scumm/smush/player.cpp @@ -258,9 +258,9 @@ void SmushPlayer::handleSkip(Chunk & b) { int code = b.getDword(); debug(6, "SmushPlayer::handleSkip(%d)", code); if(code >= 0 && code < 37) - _skipNext =_skips[code]; + _skipNext = _skips[code]; else - _skipNext =true; + _skipNext = true; } void SmushPlayer::handleStore(Chunk & b) { @@ -589,7 +589,7 @@ void SmushPlayer::handleAnimHeader(Chunk & b) { error("Wrong secondary version number for SMUSH animation"); if(_soundFrequency != 0 && _soundFrequency != 11025 && _soundFrequency != 22050) error("Wrong _sound_frequency number for SMUSH animation"); - }else if(_version > 2) { + } else if(_version > 2) { error("Wrong primary version number for SMUSH animation"); } if(_outputSound && _soundFrequency) { diff --git a/scumm/smush/player.h b/scumm/smush/player.h index 1221fb6c6b..131ad4c530 100644 --- a/scumm/smush/player.h +++ b/scumm/smush/player.h @@ -19,8 +19,8 @@ * */ -#ifndef __PLAYER_H_ -#define __PLAYER_H_ +#ifndef PLAYER_H +#define PLAYER_H #include "config.h" diff --git a/scumm/smush/rect.h b/scumm/smush/rect.h index c7483f54ef..1bbced477f 100644 --- a/scumm/smush/rect.h +++ b/scumm/smush/rect.h @@ -19,8 +19,8 @@ * */ -#ifndef __RECT_H_ -#define __RECT_H_ +#ifndef RECT_H +#define RECT_H #include "config.h" diff --git a/scumm/smush/renderer.h b/scumm/smush/renderer.h index dde44a3afe..361ca70397 100644 --- a/scumm/smush/renderer.h +++ b/scumm/smush/renderer.h @@ -19,8 +19,8 @@ * */ -#ifndef __RENDERER_H_ -#define __RENDERER_H_ +#ifndef RENDERER_H +#define RENDERER_H #include "config.h" diff --git a/scumm/smush/scumm_renderer.h b/scumm/smush/scumm_renderer.h index 097c657c17..2ee22db546 100644 --- a/scumm/smush/scumm_renderer.h +++ b/scumm/smush/scumm_renderer.h @@ -19,8 +19,8 @@ * */ -#ifndef __SCUMM_RENDERER_H_ -#define __SCUMM_RENDERER_H_ +#ifndef SCUMM_RENDERER_H +#define SCUMM_RENDERER_H #include "config.h" |