Merge branch 'bugfixes', remote-tracking branch 'origin'

Conflicts:
	data/mp/multiplay/skirmish/semperfi.js
	lib/widget/widget.cpp
	src/qtscriptfuncs.cpp
master
per 2013-01-31 21:14:11 +01:00
commit 20edd9680d
5 changed files with 79 additions and 8 deletions

View File

@ -84,7 +84,7 @@ AX_CHECK_STRLCAT
AX_STACK_PROTECT_CC
AX_STACK_PROTECT_CXX
AC_CHECK_HEADERS(alloca.h)
AC_CHECK_HEADERS(alloca.h sys/ucontext.h)
# Check for gettext
AM_GNU_GETTEXT([external])

View File

@ -121,7 +121,9 @@ static LONG WINAPI windowsExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo)
# include <sys/types.h>
# include <sys/stat.h>
# include <sys/wait.h>
#ifdef HAVE_SYS_UCONTEXT_H
# include <sys/ucontext.h>
#endif
# include <sys/utsname.h>
#ifdef WZ_OS_LINUX
# include <sys/prctl.h>

View File

@ -31,11 +31,11 @@ fi
if [[ ! "${VCS_TICK}" = "0" ]]; then
# If we are not exactly on a tag make the branch look better and use the value for the tag too.
N_VCS_BRANCH="$(echo "${VCS_BRANCH}" | sed -e 's:remotes/:remote/:' -e 's:master:Master:')"
sed -e "s:${VCS_BRANCH}:${N_VCS_BRANCH}:" -e "s:${VCS_TAG}:${N_VCS_BRANCH}:" "${cauto}" > "${tauto}"
sed -e "s:\"${VCS_BRANCH}\":\"${N_VCS_BRANCH}\":" -e "s:\"${VCS_TAG}\":\"${N_VCS_BRANCH}\":" "${cauto}" > "${tauto}"
else
# When exactly on a tag make the value suitable for users.
N_VCS_TAG="$(echo "${VCS_TAG}" | sed -e 's:^v::' -e 's:^v/::' | sed -e 's:_beta: Beta :' -e 's:_rc: RC :')"
sed -e "s:${VCS_TAG}:${N_VCS_TAG}:" "${cauto}" > "${tauto}"
sed -e "s:\"${VCS_TAG}\":\"${N_VCS_TAG}\":" "${cauto}" > "${tauto}"
fi

View File

@ -1,10 +1,74 @@
#!/bin/sh
#!/bin/bash
export PATH=${PATH}:/sw/bin:/opt/local/bin:/usr/local/bin
OutDir="WarzoneHelp"
DirectorY="${OutDir}-41eac5e"
DirectorY="${OutDir}-d55b5bf"
FileName="${DirectorY}.tgz"
BuiltDLP="http://downloads.sourceforge.net/project/warzone2100/build-tools/mac/${FileName}"
MD5Sum="ebe80baed4440bdbce68c495c4f51c4d"
MD5Sum="247d204b649909bb3c4da5c5aed10425"
configs/FetchPrebuilt.sh "${DirectorY}" "${OutDir}" "${FileName}" "${BuiltDLP}" "${MD5Sum}"
exit ${?}
mWarzoneHelp="macosx/external/WarzoneHelp/Contents/Resources"
mWarzoneHelpLproj="${mWarzoneHelp}/en.lproj"
if [[ ! "0" == "$(type -aP a2x &> /dev/null; echo ${?})" ]] || [[ ! "0" == "$(type -aP pdflatex &> /dev/null; echo ${?})" ]]; then
echo "note: cannot build docs locally; downloaded materials may be outdated"
configs/FetchPrebuilt.sh "${DirectorY}" "${OutDir}" "${FileName}" "${BuiltDLP}" "${MD5Sum}"
exit ${?}
fi
test -r /sw/bin/init.sh && . /sw/bin/init.sh
alias sed="/usr/bin/sed"
alias grep="/usr/bin/grep"
cd "${SRCROOT}/.."
if [[ -d "macosx/external/WarzoneHelp" ]]; then
rm -fr "macosx/external/WarzoneHelp"
fi
mkdir -p "${mWarzoneHelpLproj}"
cp -af macosx/Resources/WarzoneHelp/info.plist macosx/external/WarzoneHelp/Contents
# ASCIIDoc based docs
# quickstartguide
a2x -f chunked -D "${mWarzoneHelpLproj}" doc/quickstartguide.asciidoc
cp -af ${mWarzoneHelpLproj}/quickstartguide.chunked/* ${mWarzoneHelpLproj}
rm -fr ${mWarzoneHelpLproj}/quickstartguide.chunked
# man page
a2x -f xhtml -d manpage -D "${mWarzoneHelpLproj}" doc/warzone2100.6.asciidoc
# Cleanup
cp -af "${mWarzoneHelpLproj}/docbook-xsl.css" "${mWarzoneHelpLproj}/images" ${mWarzoneHelp}
rm -fr "${mWarzoneHelpLproj}/docbook-xsl.css" "${mWarzoneHelpLproj}/images"
sed -i '' -e 's:href="docbook-xsl.css:href="../docbook-xsl.css:g' ${mWarzoneHelpLproj}/*.html
sed -i '' -e 's:src="images/:src="../images/:g' ${mWarzoneHelpLproj}/*.html
sed -i '' -e 's:warzone2100:Warzone:g' ${mWarzoneHelpLproj}/warzone2100.6.html
# LaTeX based docs
export TEXINPUTS=${TEXINPUTS}:/sw/share/doc/python25/Doc/texinputs/
# javascript doc
grep src/qtscript.cpp -e '//==' | sed 's://==::' > doc/globals.tex
grep src/qtscriptfuncs.cpp -e '//==' | sed 's://==::' >> doc/globals.tex
grep src/qtscript.cpp -e '//__' | sed 's://__::' > doc/events.tex
grep src/qtscript.cpp -e '//--' | sed 's://--::' > doc/functions.tex
grep src/qtscriptfuncs.cpp -e '//--' | sed 's://--::' >> doc/functions.tex
grep src/qtscriptfuncs.cpp -e '//;;' | sed 's://;;::' > doc/objects.tex
cd doc/
if ! pdflatex javascript.tex; then
exit 1
fi
pdflatex javascript.tex
cd ..
cp -af doc/javascript.pdf ${mWarzoneHelpLproj}
# Build the index
rm -f "${mWarzoneHelpLproj}/WarzoneHelp.helpindex"
hiutil -Caf "${mWarzoneHelp}/WarzoneHelp.helpindex" "${mWarzoneHelpLproj}"
cp -af "${mWarzoneHelp}/WarzoneHelp.helpindex" "${mWarzoneHelpLproj}"
rm -f "${mWarzoneHelp}/WarzoneHelp.helpindex"
exit 0

View File

@ -1840,6 +1840,7 @@ static QScriptValue js_pickStructLocation(QScriptContext *context, QScriptEngine
DROID *psDroid = IdToDroid(id, player);
QString statName = context->argument(1).toString();
int index = getStructStatFromName(statName.toUtf8().constData());
SCRIPT_ASSERT(context, index >= 0, "%s not found", statName.toUtf8().constData());
STRUCTURE_STATS *psStat = &asStructureStats[index];
const int startX = context->argument(2).toInt32();
const int startY = context->argument(3).toInt32();
@ -2187,6 +2188,7 @@ static QScriptValue js_orderDroidBuild(QScriptContext *context, QScriptEngine *)
DROID_ORDER order = (DROID_ORDER)context->argument(1).toInt32();
QString statName = context->argument(2).toString();
int index = getStructStatFromName(statName.toUtf8().constData());
SCRIPT_ASSERT(context, index >= 0, "%s not found", statName.toUtf8().constData());
STRUCTURE_STATS *psStats = &asStructureStats[index];
int x = context->argument(3).toInt32();
int y = context->argument(4).toInt32();
@ -2730,6 +2732,7 @@ static QScriptValue js_isStructureAvailable(QScriptContext *context, QScriptEngi
{
QString building = context->argument(0).toString();
int index = getStructStatFromName(building.toUtf8().constData());
SCRIPT_ASSERT(context, index >= 0, "%s not found", building.toUtf8().constData());
int player;
if (context->argumentCount() > 1)
{
@ -2894,6 +2897,7 @@ static QScriptValue js_addStructure(QScriptContext *context, QScriptEngine *engi
{
QString building = context->argument(0).toString();
int index = getStructStatFromName(building.toUtf8().constData());
SCRIPT_ASSERT(context, index >= 0, "%s not found", building.toUtf8().constData());
int player = context->argument(1).toInt32();
SCRIPT_ASSERT_PLAYER(context, player);
int x = context->argument(2).toInt32();
@ -2915,6 +2919,7 @@ static QScriptValue js_getStructureLimit(QScriptContext *context, QScriptEngine
{
QString building = context->argument(0).toString();
int index = getStructStatFromName(building.toUtf8().constData());
SCRIPT_ASSERT(context, index >= 0, "%s not found", building.toUtf8().constData());
int player;
if (context->argumentCount() > 1)
{