diff options
| author | Max Horn | 2003-09-13 21:20:05 +0000 | 
|---|---|---|
| committer | Max Horn | 2003-09-13 21:20:05 +0000 | 
| commit | 30e478589676c64ce37135d1f558c49c4bb48e25 (patch) | |
| tree | 97a95e5138e2aa06bc26d6f60ee81725b063dd58 | |
| parent | 199e9632b8f4b0d90fc21640e288e1cb56db8948 (diff) | |
| download | scummvm-rg350-30e478589676c64ce37135d1f558c49c4bb48e25.tar.gz scummvm-rg350-30e478589676c64ce37135d1f558c49c4bb48e25.tar.bz2 scummvm-rg350-30e478589676c64ce37135d1f558c49c4bb48e25.zip | |
simplified code
svn-id: r10245
| -rw-r--r-- | sword2/resman.cpp | 6 | ||||
| -rw-r--r-- | sword2/save_rest.cpp | 55 | 
2 files changed, 29 insertions, 32 deletions
| diff --git a/sword2/resman.cpp b/sword2/resman.cpp index a409e0f772..01d764435d 100644 --- a/sword2/resman.cpp +++ b/sword2/resman.cpp @@ -258,9 +258,7 @@ void resMan::Close_ResMan(void) { //Tony29May96  #ifdef SCUMM_BIG_ENDIAN  // Quick macro to make swapping in-place easier to write -#define SWAP16_S(x)	x = (int16)SWAP_BYTES_16(x)  #define SWAP16(x)	x = SWAP_BYTES_16(x) -#define SWAP32_S(x)	x = (int16)SWAP_BYTES_32(x)  #define SWAP32(x)	x = SWAP_BYTES_32(x)  static void convertEndian(uint8 *file, uint32 len) {  	int i; @@ -284,8 +282,8 @@ static void convertEndian(uint8 *file, uint32 len) {  			_cdtEntry *cdtEntry = (_cdtEntry *) (file + sizeof(_animHeader));  			for (i = 0; i < animHead->noAnimFrames; i++, cdtEntry++) { -				SWAP16_S(cdtEntry->x); -				SWAP16_S(cdtEntry->y); +				SWAP16(cdtEntry->x); +				SWAP16(cdtEntry->y);  				SWAP32(cdtEntry->frameOffset);  				_frameHeader *frameHeader = (_frameHeader *) (file + cdtEntry->frameOffset); diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp index 38521fea3f..09196003b3 100644 --- a/sword2/save_rest.cpp +++ b/sword2/save_rest.cpp @@ -89,48 +89,47 @@ static _savegameHeader g_header;		// global because easier to copy to/from playe  #ifdef SCUMM_BIG_ENDIAN  // Quick macro to make swapping in-place easier to write -#define SWAP32_S(x)	x = (int32)SWAP_BYTES_32(x) -#define SWAP32_U(x)	x = SWAP_BYTES_32(x) +#define SWAP32(x)	x = SWAP_BYTES_32(x)  static void convertHeaderEndian(_savegameHeader &header) {  	int i;  	// _savegameHeader -	SWAP32_U(header.checksum); -	SWAP32_U(header.varLength); -	SWAP32_U(header.screenId); -	SWAP32_U(header.runListId); -	SWAP32_U(header.feet_x); -	SWAP32_U(header.feet_y); -	SWAP32_U(header.music_id); +	SWAP32(header.checksum); +	SWAP32(header.varLength); +	SWAP32(header.screenId); +	SWAP32(header.runListId); +	SWAP32(header.feet_x); +	SWAP32(header.feet_y); +	SWAP32(header.music_id);  	// _object_hub -	SWAP32_S(header.player_hub.type); -	SWAP32_U(header.player_hub.logic_level); +	SWAP32(header.player_hub.type); +	SWAP32(header.player_hub.logic_level);  	for (i = 0; i < TREE_SIZE; i++) { -		SWAP32_U(header.player_hub.logic[i]); -		SWAP32_U(header.player_hub.script_id[i]); -		SWAP32_U(header.player_hub.script_pc[i]); +		SWAP32(header.player_hub.logic[i]); +		SWAP32(header.player_hub.script_id[i]); +		SWAP32(header.player_hub.script_pc[i]);  	}  	// Object_logic -	SWAP32_S(header.logic.looping); -	SWAP32_S(header.logic.pause); +	SWAP32(header.logic.looping); +	SWAP32(header.logic.pause);  	// Object_graphic -	SWAP32_S(header.graphic.type); -	SWAP32_S(header.graphic.anim_resource); -	SWAP32_S(header.graphic.anim_pc); +	SWAP32(header.graphic.type); +	SWAP32(header.graphic.anim_resource); +	SWAP32(header.graphic.anim_pc);  	// Object_mega -	SWAP32_S(header.mega.currently_walking); -	SWAP32_S(header.mega.walk_pc); -	SWAP32_S(header.mega.scale_a); -	SWAP32_S(header.mega.scale_b); -	SWAP32_S(header.mega.feet_x); -	SWAP32_S(header.mega.feet_y); -	SWAP32_S(header.mega.current_dir); -	SWAP32_S(header.mega.colliding); -	SWAP32_S(header.mega.megaset_res); +	SWAP32(header.mega.currently_walking); +	SWAP32(header.mega.walk_pc); +	SWAP32(header.mega.scale_a); +	SWAP32(header.mega.scale_b); +	SWAP32(header.mega.feet_x); +	SWAP32(header.mega.feet_y); +	SWAP32(header.mega.current_dir); +	SWAP32(header.mega.colliding); +	SWAP32(header.mega.megaset_res);  }  #endif | 
