diff --git a/CMakeLists.txt b/CMakeLists.txt index 77ae270d..3ce8dad3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,19 +33,9 @@ if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Windows") option(WIN9X "Enable support for Windows 95/98/ME." OFF) option(DSOUND "Enable DirectSound audio. (deprecated)" OFF) option(DDRAW "Enable DirectDraw video backend. (deprecated)" OFF) - option(SDL1 "Enable SDL1 video backend." OFF) - option(SDL2 "Enable SDL2 video backend." ON) - option(OPENAL "Enable OpenAL audio backend." ON) add_feature_info(Windows9x WIN9X "Windows 95/98/ME support" OFF) add_feature_info(DirectSound DSOUND "DirectSound audio backend (deprecated)") add_feature_info(DirectDraw DDRAW "DirectDraw video backend (deprecated)") - add_feature_info(SDL1 SDL1 "SDL1 video backend") - add_feature_info(SDL2 SDL2 "SDL2 video backend") - add_feature_info(OpenAL OPENAL "OpenAL audio backend") -else() - add_feature_info(SDL1 SDL1 "SDL1 video backend") - add_feature_info(SDL2 SDL2 "SDL2 video backend") - set(OPENAL TRUE) endif() if(APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -56,6 +46,9 @@ if(APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif() endif() +add_feature_info(SDL1 SDL1 "SDL1 video backend") +add_feature_info(SDL2 SDL2 "SDL2 video backend") +add_feature_info(OpenAL OPENAL "OpenAL audio backend") add_feature_info(RemasterTD BUILD_REMASTERTD, "Remastered Tiberian Dawn dll") add_feature_info(RemasterRA BUILD_REMASTERRA "Remastered Red Alert dll") add_feature_info(VanillaTD BUILD_VANILLATD "Tiberian Dawn executable") diff --git a/common/base64.cpp b/common/base64.cpp index e14f1e84..66947822 100644 --- a/common/base64.cpp +++ b/common/base64.cpp @@ -36,6 +36,7 @@ #include "base64.h" #include +#include "endianness.h" /* ** This is the magic padding character used to fill out the encoded data to a multiple of @@ -425,4 +426,4 @@ implementations. within base64-encoded parts of multipart entities because no hyphen characters are used in the base64 encoding. -*/ \ No newline at end of file +*/ diff --git a/common/mp.cpp b/common/mp.cpp index fdeef76a..e064cb23 100644 --- a/common/mp.cpp +++ b/common/mp.cpp @@ -265,6 +265,8 @@ void XMP_DER_Decode(digit* result, unsigned char const* input, int precision) } } +#ifndef __BIG_ENDIAN__ +// FIXME: does not for work big-endian /*********************************************************************************************** * XMP_Encode -- Encode MP number into buffer. * * * @@ -308,6 +310,7 @@ unsigned XMP_Encode(unsigned char* to, unsigned tobytes, digit const* from, int return (tobytes); } +#endif /*********************************************************************************************** * XMP_Encode -- Encode MP number into buffer as compactly as possible. * @@ -358,7 +361,8 @@ unsigned XMP_Encode(unsigned char* to, digit const* from, int precision) unsigned char* number_ptr; unsigned char* const end = (unsigned char*)from; - for (number_ptr = (unsigned char*)end + precision - 1; number_ptr > (unsigned char*)end; number_ptr--) { + for (number_ptr = (unsigned char*)end + precision * sizeof(digit) - 1; number_ptr > (unsigned char*)end; + number_ptr--) { if (*number_ptr != filler) break; } @@ -922,6 +926,8 @@ unsigned XMP_Count_Bits(const digit* number, int precision) return (total_bit_count); } +#ifndef __BIG_ENDIAN__ +// FIXME: does not work for big-endian /*********************************************************************************************** * XMP_Count_Bytes -- Counts the number of precision bytes in MP number. * * * @@ -951,6 +957,7 @@ int XMP_Count_Bytes(const digit* number, int precision) } return (count); } +#endif /*********************************************************************************************** * XMP_Move -- Assign one MP number to another. *