Skip to content

Commit

Permalink
Merge branch 'vanilla' into PR-28
Browse files Browse the repository at this point in the history
  • Loading branch information
OmniBlade authored Mar 25, 2024
2 parents 122b474 + 0d6fee7 commit 148200f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
13 changes: 3 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion common/base64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include "base64.h"
#include <stddef.h>
#include "endianness.h"

/*
** This is the magic padding character used to fill out the encoded data to a multiple of
Expand Down Expand Up @@ -425,4 +426,4 @@ implementations.
within base64-encoded parts of multipart entities because no hyphen
characters are used in the base64 encoding.
*/
*/
9 changes: 8 additions & 1 deletion common/mp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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. *
* *
Expand Down Expand Up @@ -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. *
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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. *
* *
Expand Down Expand Up @@ -951,6 +957,7 @@ int XMP_Count_Bytes(const digit* number, int precision)
}
return (count);
}
#endif

/***********************************************************************************************
* XMP_Move -- Assign one MP number to another. *
Expand Down

0 comments on commit 148200f

Please sign in to comment.