From b40d92f3593cddc686622dd8500e5bc43972f2df Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Tue, 27 May 2014 20:24:25 +0900 Subject: [PATCH 1/2] tweaks --- build.sh | 4 ++-- install.sh | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 85da2f5efe..965c72cbbf 100755 --- a/build.sh +++ b/build.sh @@ -12,8 +12,8 @@ pushd build popd if [[ -t 1 ]]; then - echo "\033[95mDone! Run OpenRCT2 by typing:\n\nwine openrct2.exe\n\033[0m" + echo -e "\nDone! Run OpenRCT2 by typing:\n\n\033[95mwine openrct2.exe\n\033[0m" else - echo "Done! Run OpenRCT2 by typing:\n\nwine openrct2.exe\n" + echo -e "\nDone! Run OpenRCT2 by typing:\n\nwine openrct2.exe\n" fi diff --git a/install.sh b/install.sh index e5466b5f2c..f74e9bcf92 100755 --- a/install.sh +++ b/install.sh @@ -65,12 +65,10 @@ if [[ ! -d /usr/local/cross-tools/i686-w64-mingw32 ]]; then fi if [[ ! -f $cachedir/i686-w64-mingw32-pkg-config ]]; then - if [[ `uname` == "Darwin" ]]; then - # BSD echo doesn't recognize the -e flag. - echo "#! /bin/sh\nexport PKG_CONFIG_LIBDIR=/usr/local/cross-tools/i686-w64-mingw32/lib/pkgconfig\npkg-config \$@" > $cachedir/i686-w64-mingw32-pkg-config; - else - echo -e "#! /bin/sh\nexport PKG_CONFIG_LIBDIR=/usr/local/cross-tools/i686-w64-mingw32/lib/pkgconfig\npkg-config \$@" > $cachedir/i686-w64-mingw32-pkg-config; - fi + # If this fails to work because of newlines, be sure you are running this + # script with Bash, and not sh. We should really move this to a separate + # file. + echo -e "#! /bin/sh\nexport PKG_CONFIG_LIBDIR=/usr/local/cross-tools/i686-w64-mingw32/lib/pkgconfig\npkg-config \$@" > $cachedir/i686-w64-mingw32-pkg-config; fi chmod +x $cachedir/i686-w64-mingw32-pkg-config From 1df8b061d866eee2929de3c3c5d8ad72c02c2358 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Tue, 27 May 2014 20:57:27 +0900 Subject: [PATCH 2/2] Document RIDE_RATING macro --- src/rct2.h | 5 +++-- src/ride.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rct2.h b/src/rct2.h index b95864f69c..f5b765b206 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -64,7 +64,7 @@ typedef unsigned long long uint64; #define OPENRCT2_PLATFORM "Windows" #define OPENRCT2_TIMESTAMP __DATE__ " " __TIME__ -// Represent fixed point numbers +// Represent fixed point numbers. dp = decimal point typedef sint16 fixed16_1dp; typedef sint16 fixed16_2dp; typedef sint32 fixed32_1dp; @@ -74,7 +74,8 @@ typedef sint32 fixed32_2dp; typedef fixed16_1dp money16; typedef fixed32_1dp money32; -// Construct a fixed point number. +// Construct a fixed point number. For example, to create the value 3.65 you +// would write FIXED_2DP(3,65) #define FIXED_XDP(x, whole, fraction) ((whole) * (10 * x) + (fraction)) #define FIXED_1DP(whole, fraction) FIXED_XDP(1, whole, fraction) #define FIXED_2DP(whole, fraction) FIXED_XDP(2, whole, fraction) diff --git a/src/ride.h b/src/ride.h index 157cd72baf..5c1101e310 100644 --- a/src/ride.h +++ b/src/ride.h @@ -25,6 +25,8 @@ typedef fixed16_2dp ride_rating; +// Convenience function for writing ride ratings. The result is a 16 bit signed +// integer. To create the ride rating 3.65 type RIDE_RATING(3,65) #define RIDE_RATING(whole, fraction) FIXED_2DP(whole, fraction) // Used for return values, for functions that modify all three.