diff options
30 files changed, 2874 insertions, 104 deletions
diff --git a/community-staging/spring/PKGBUILD b/community-staging/spring/PKGBUILD new file mode 100644 index 000000000..654885736 --- /dev/null +++ b/community-staging/spring/PKGBUILD @@ -0,0 +1,47 @@ +# $Id: PKGBUILD 73670 2012-07-13 06:44:56Z svenstaro $ +# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com> +# Contributor: Arkham <arkham at archlinux dot us> +# Contributor: Christoph Zeiler <archNOSPAM_at_moonblade.dot.org> + +pkgname=spring +pkgver=0.89.0 +_pkgver=89.0 +pkgrel=1 +pkgdesc='A free 3D real-time-strategy (RTS) game engine' +arch=('i686' 'x86_64') +url="http://springrts.com/" +license=('GPL') +depends=('openal' 'glew' 'boost-libs' 'freetype2' 'devil' 'libvorbis' 'sdl' + 'libxcursor') +makedepends=('boost' 'cmake' 'zip' 'xz' 'p7zip' 'python2' 'java-environment') +optdepends=('python2: python-based bots' + 'java-runtime: java-based bots') +source=(http://downloads.sourceforge.net/sourceforge/springrts/${pkgname}_${_pkgver}_src.tar.lzma + boost-1.50.patch) +md5sums=('36fc266e925bc3790a68bf1bc7ebb315' + 'a3c3b4a53eeb499090b027fd6b3cf848') + +build() { + bsdtar -xf ${pkgname}_${_pkgver}_src.tar.lzma + + cd spring_${_pkgver} + + sed "s/TIME_UTC/TIME_UTC_/g" -i AI/Skirmish/E323AI/CScopedTimer.h + patch -Np1 < $srcdir/boost-1.50.patch + + cmake . \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DDATADIR=share/spring + make +} + +package() { + cd spring_${_pkgver} + + make DESTDIR=$pkgdir install + + install -d $pkgdir/etc/spring + echo '$HOME/.spring' > $pkgdir/etc/spring/datadir +} + +# vim sw=2:ts=2 et: diff --git a/community-staging/spring/boost-1.50.patch b/community-staging/spring/boost-1.50.patch new file mode 100644 index 000000000..f8a8b5695 --- /dev/null +++ b/community-staging/spring/boost-1.50.patch @@ -0,0 +1,2539 @@ +diff -ru spring_89.0/rts/Game/Camera/CameraController.cpp /home/svenstaro/src/spring/rts/Game/Camera/CameraController.cpp +--- spring_89.0/rts/Game/Camera/CameraController.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/Camera/CameraController.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -59,7 +59,7 @@ + bool CCameraController::GetUseDistToGroundForIcons() { + + const float3& dir = GetDir().UnsafeNormalize(); +- const float dot = std::min(1.0f, std::max(0.0f, fabs(dir.dot(UpVector)))); ++ const float dot = std::min(1.0f, std::max(0.0f, math::fabs(dir.dot(UpVector)))); + + if (dot < switchVal) { + // flat angle (typical for first person camera) +diff -ru spring_89.0/rts/Game/Camera/FPSController.cpp /home/svenstaro/src/spring/rts/Game/Camera/FPSController.cpp +--- spring_89.0/rts/Game/Camera/FPSController.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/Camera/FPSController.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -80,9 +80,9 @@ + oldHeight = pos.y - gndHeight; + } + +- dir.x = (float)(cos(camera->rot.x) * sin(camera->rot.y)); +- dir.z = (float)(cos(camera->rot.x) * cos(camera->rot.y)); +- dir.y = (float)(sin(camera->rot.x)); ++ dir.x = (float)(math::cos(camera->rot.x) * math::sin(camera->rot.y)); ++ dir.z = (float)(math::cos(camera->rot.x) * math::cos(camera->rot.y)); ++ dir.y = (float)(math::sin(camera->rot.x)); + dir.ANormalize(); + } + +diff -ru spring_89.0/rts/Game/Camera/FreeController.cpp /home/svenstaro/src/spring/rts/Game/Camera/FreeController.cpp +--- spring_89.0/rts/Game/Camera/FreeController.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/Camera/FreeController.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -51,9 +51,9 @@ + dir = float3(0.0f, -2.0f, -1.0f); + dir.ANormalize(); + if (camera) { +- const float hDist = sqrt((dir.x * dir.x) + (dir.z * dir.z)); +- camera->rot.y = atan2(dir.x, dir.z); +- camera->rot.x = atan2(dir.y, hDist); ++ const float hDist = math::sqrt((dir.x * dir.x) + (dir.z * dir.z)); ++ camera->rot.y = math::atan2(dir.x, dir.z); ++ camera->rot.x = math::atan2(dir.y, hDist); + } + pos -= (dir * 1000.0f); + +@@ -84,14 +84,14 @@ + + // lock the view direction to the target + const float3 diff(trackPos - pos); +- const float rads = atan2(diff.x, diff.z); ++ const float rads = math::atan2(diff.x, diff.z); + camera->rot.y = rads; + + const float len2D = diff.Length2D(); +- if (fabs(len2D) <= 0.001f) { ++ if (math::fabs(len2D) <= 0.001f) { + camera->rot.x = 0.0f; + } else { +- camera->rot.x = atan2((trackPos.y - pos.y), len2D); ++ camera->rot.x = math::atan2((trackPos.y - pos.y), len2D); + } + + camera->UpdateForward(); +@@ -130,11 +130,11 @@ + if (pos.y < (gndHeight + gndOffset + 1.0f)) { + float3 hDir; + hDir.y = 0.0f; +- hDir.x = (float)sin(camera->rot.y); +- hDir.z = (float)cos(camera->rot.y); ++ hDir.x = (float)math::sin(camera->rot.y); ++ hDir.z = (float)math::cos(camera->rot.y); + const float3 gndNormal = ground->GetSmoothNormal(pos.x, pos.z, false); + const float dot = gndNormal.dot(hDir); +- const float gndRotX = (float)acos(dot) - (PI * 0.5f); ++ const float gndRotX = (float)math::acos(dot) - (PI * 0.5f); + const float rotXdiff = (gndRotX - camera->rot.x); + autoTiltVel = (autoTilt * rotXdiff); + } +@@ -214,8 +214,8 @@ + // convert the angular velocity into its positional change + const float3 diff2 = (pos - trackPos); + const float deltaRad = (avel.y * ft); +- const float cos_val = cos(deltaRad); +- const float sin_val = sin(deltaRad); ++ const float cos_val = math::cos(deltaRad); ++ const float sin_val = math::sin(deltaRad); + pos.x = trackPos.x + ((cos_val * diff2.x) + (sin_val * diff2.z)); + pos.z = trackPos.z + ((cos_val * diff2.z) - (sin_val * diff2.x)); + } +@@ -246,7 +246,7 @@ + if (pos.y < minHeight) { + pos.y = minHeight; + if (gndLock) { +- vel.y = min(fabs(scrollSpeed), ((minHeight - prevPos.y) / ft)); ++ vel.y = min(math::fabs(scrollSpeed), ((minHeight - prevPos.y) / ft)); + } else { + vel.y = 0.0f; + } +@@ -263,7 +263,7 @@ + camera->rot.x = -xRotLimit; + avel.x = 0.0f; + } +- camera->rot.y = fmod(camera->rot.y, PI * 2.0f); ++ camera->rot.y = math::fmod(camera->rot.y, PI * 2.0f); + + // setup for the next loop + prevVel = vel; +@@ -277,9 +277,9 @@ + float3 CFreeController::GetDir() const + { + float3 dir; +- dir.x = (float)(sin(camera->rot.y) * cos(camera->rot.x)); +- dir.z = (float)(cos(camera->rot.y) * cos(camera->rot.x)); +- dir.y = (float)(sin(camera->rot.x)); ++ dir.x = (float)(math::sin(camera->rot.y) * math::cos(camera->rot.x)); ++ dir.z = (float)(math::cos(camera->rot.y) * math::cos(camera->rot.x)); ++ dir.y = (float)(math::sin(camera->rot.x)); + dir.ANormalize(); + return dir; + } +@@ -373,7 +373,7 @@ + if ((yDiff * dir.y) >= 0.0f) { + pos = float3(newPos.x, h, newPos.z); + } else { +- pos = target - (dir * fabs(yDiff / dir.y)); ++ pos = target - (dir * math::fabs(yDiff / dir.y)); + } // FIXME + /* + const float oldPosY = pos.y; +diff -ru spring_89.0/rts/Game/Camera/OrbitController.cpp /home/svenstaro/src/spring/rts/Game/Camera/OrbitController.cpp +--- spring_89.0/rts/Game/Camera/OrbitController.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/Camera/OrbitController.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -51,8 +51,8 @@ + const float3 w = (v / v.Length()); // do not normalize v in-place + + const float d = v.Length(); +- const float e = RAD2DEG(acos(v.Length2D() / d)); +- const float r = RAD2DEG(acos(w.x)); ++ const float e = RAD2DEG(math::acos(v.Length2D() / d)); ++ const float r = RAD2DEG(math::acos(w.x)); + + distance = cDistance = d; + elevation = cElevation = e; +@@ -251,12 +251,12 @@ + float tx = cx; + + tx = cx; +- cx = cx * cos(beta) + cy * sin(beta); +- cy = tx * sin(beta) + cy * cos(beta); ++ cx = cx * math::cos(beta) + cy * math::sin(beta); ++ cy = tx * math::sin(beta) + cy * math::cos(beta); + + tx = cx; +- cx = cx * cos(gamma) - cz * sin(gamma); +- cz = tx * sin(gamma) + cz * cos(gamma); ++ cx = cx * math::cos(gamma) - cz * math::sin(gamma); ++ cz = tx * math::sin(gamma) + cz * math::cos(gamma); + + return float3(cx, cy, cz); + } +diff -ru spring_89.0/rts/Game/Camera/OverheadController.cpp /home/svenstaro/src/spring/rts/Game/Camera/OverheadController.cpp +--- spring_89.0/rts/Game/Camera/OverheadController.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/Camera/OverheadController.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -52,7 +52,7 @@ + move.x = -move.x; + move.y = -move.y; + } +- move *= sqrt(move.z) * 200; ++ move *= math::sqrt(move.z) * 200; + + pos.x += move.x * pixelSize * 2.0f * scrollSpeed; + pos.z -= move.y * pixelSize * 2.0f * scrollSpeed; +diff -ru spring_89.0/rts/Game/Camera/RotOverheadController.cpp /home/svenstaro/src/spring/rts/Game/Camera/RotOverheadController.cpp +--- spring_89.0/rts/Game/Camera/RotOverheadController.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/Camera/RotOverheadController.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -29,7 +29,7 @@ + + void CRotOverheadController::KeyMove(float3 move) + { +- move *= sqrt(move.z) * 400; ++ move *= math::sqrt(move.z) * 400; + + float3 flatForward = camera->forward; + if(camera->forward.y < -0.9f) +@@ -68,9 +68,9 @@ + + void CRotOverheadController::UpdateVectors() + { +- dir.x=(float)(sin(camera->rot.y) * cos(camera->rot.x)); +- dir.y=(float)(sin(camera->rot.x)); +- dir.z=(float)(cos(camera->rot.y) * cos(camera->rot.x)); ++ dir.x=(float)(math::sin(camera->rot.y) * math::cos(camera->rot.x)); ++ dir.y=(float)(math::sin(camera->rot.x)); ++ dir.z=(float)(math::cos(camera->rot.y) * math::cos(camera->rot.x)); + dir.ANormalize(); + + pos.x = Clamp(pos.x, 0.01f, gs->mapx * SQUARE_SIZE - 0.01f); +diff -ru spring_89.0/rts/Game/Camera/SmoothController.cpp /home/svenstaro/src/spring/rts/Game/Camera/SmoothController.cpp +--- spring_89.0/rts/Game/Camera/SmoothController.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/Camera/SmoothController.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -55,7 +55,7 @@ + move.y = -move.y; + } + +- move *= sqrt(move.z) * 200.0f; ++ move *= math::sqrt(move.z) * 200.0f; + + const float3 thisMove(move.x * pixelSize * 2.0f * scrollSpeed, 0.0f, -move.y * pixelSize * 2.0f * scrollSpeed); + +@@ -103,7 +103,7 @@ + move.x = -move.x; + move.y = -move.y; + } +- move *= sqrt(move.z) * 200.0f; ++ move *= math::sqrt(move.z) * 200.0f; + + const float3 thisMove(move.x * pixelSize * 2.0f * scrollSpeed, 0.0f, -move.y * pixelSize * 2.0f * scrollSpeed); + +diff -ru spring_89.0/rts/Game/Camera/TWController.cpp /home/svenstaro/src/spring/rts/Game/Camera/TWController.cpp +--- spring_89.0/rts/Game/Camera/TWController.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/Camera/TWController.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -35,7 +35,7 @@ + flatForward.y=0; + flatForward.ANormalize(); + +- move *= sqrt(move.z) * 200; ++ move *= math::sqrt(move.z) * 200; + pos += (camera->right * move.x + flatForward * move.y) * scrollSpeed; + UpdateVectors(); + } +@@ -79,9 +79,9 @@ + + camera->rot.x = Clamp(camera->rot.x, -PI * 0.4f, -0.1f); + +- dir.x = sin(camera->rot.y) * cos(camera->rot.x); +- dir.y = sin(camera->rot.x); +- dir.z = cos(camera->rot.y) * cos(camera->rot.x); ++ dir.x = math::sin(camera->rot.y) * math::cos(camera->rot.x); ++ dir.y = math::sin(camera->rot.x); ++ dir.z = math::cos(camera->rot.y) * math::cos(camera->rot.x); + dir.ANormalize(); + } + +diff -ru spring_89.0/rts/Game/Camera.cpp /home/svenstaro/src/spring/rts/Game/Camera.cpp +--- spring_89.0/rts/Game/Camera.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/Camera.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -89,7 +89,7 @@ + up.UnsafeANormalize(); + + const float aspect = globalRendering->aspectRatio; +- const float viewx = tan(aspect * halfFov); ++ const float viewx = math::tan(aspect * halfFov); + const float viewy = tanHalfFov; + + if (globalRendering->viewSizeY <= 0) { +@@ -218,9 +218,9 @@ + + void CCamera::UpdateForward() + { +- forward.z = cos(rot.y) * cos(rot.x); +- forward.x = sin(rot.y) * cos(rot.x); +- forward.y = sin(rot.x); ++ forward.z = math::cos(rot.y) * math::cos(rot.x); ++ forward.x = math::sin(rot.y) * math::cos(rot.x); ++ forward.y = math::sin(rot.x); + forward.Normalize(); + } + +@@ -229,7 +229,7 @@ + { + fov = myfov; + halfFov = (fov * 0.5f) * (PI / 180.f); +- tanHalfFov = tan(halfFov); ++ tanHalfFov = math::tan(halfFov); + } + + +@@ -330,7 +330,7 @@ + float3 pInt; + + // prevent DIV0 when calculating line.dir +- if (fabs(xdir.z) < 0.001f) ++ if (math::fabs(xdir.z) < 0.001f) + xdir.z = 0.001f; + + if (ydir.y != 0.0f) { +diff -ru spring_89.0/rts/Game/CameraHandler.cpp /home/svenstaro/src/spring/rts/Game/CameraHandler.cpp +--- spring_89.0/rts/Game/CameraHandler.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/CameraHandler.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -139,7 +139,7 @@ + cameraTimeLeft = std::max(0.0f, (cameraTimeLeft - globalRendering->lastFrameTime)); + const float nextTime = cameraTimeLeft; + const float exp = cameraTimeExponent; +- const float ratio = 1.0f - (float)pow((nextTime / currTime), exp); ++ const float ratio = 1.0f - (float)math::pow((nextTime / currTime), exp); + + const float deltaFOV = wantedCamFOV - camera->GetFov(); + const float3 deltaPos = wantedCamPos - camera->pos; +diff -ru spring_89.0/rts/Game/GameServer.cpp /home/svenstaro/src/spring/rts/Game/GameServer.cpp +--- spring_89.0/rts/Game/GameServer.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/GameServer.cpp 2012-07-13 06:34:42.936060485 +0200 +@@ -253,7 +253,7 @@ + // Something in CGameServer::CGameServer borks the FPU control word + // maybe the threading, or something in CNet::InitServer() ?? + // Set single precision floating point math. +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + #endif + } + +diff -ru spring_89.0/rts/Game/SelectedUnitsAI.cpp /home/svenstaro/src/spring/rts/Game/SelectedUnitsAI.cpp +--- spring_89.0/rts/Game/SelectedUnitsAI.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/SelectedUnitsAI.cpp 2012-07-13 06:34:43.086060494 +0200 +@@ -179,7 +179,7 @@ + const float3 sideDir = frontdir.cross(UpVector); + + // calculate so that the units form in an aproximate square +- float length = 100.0f + (sqrt((float)nbrOfSelectedUnits) * 32.0f); ++ float length = 100.0f + (math::sqrt((float)nbrOfSelectedUnits) * 32.0f); + + // push back some extra params so it confer with a front move + c.params.push_back(pos.x + (sideDir.x * length)); +diff -ru spring_89.0/rts/Game/TraceRay.cpp /home/svenstaro/src/spring/rts/Game/TraceRay.cpp +--- spring_89.0/rts/Game/TraceRay.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/TraceRay.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -75,7 +75,7 @@ + if (closeFlatLength > length) + closeFlatLength = length; + +- if (fabs(linear - quadratic * closeFlatLength) < 0.15f) { ++ if (math::fabs(linear - quadratic * closeFlatLength) < 0.15f) { + // relatively flat region -> use approximation + dif.y -= (linear + quadratic * closeFlatLength) * closeFlatLength; + +diff -ru spring_89.0/rts/Game/UI/EndGameBox.cpp /home/svenstaro/src/spring/rts/Game/UI/EndGameBox.cpp +--- spring_89.0/rts/Game/UI/EndGameBox.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/UI/EndGameBox.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -29,11 +29,11 @@ + + if (num == 0) { + sprintf(c, "0"); +- } else if (fabs(num) < 10 * mul) { ++ } else if (math::fabs(num) < 10 * mul) { + sprintf(c, "%.1f", num); +- } else if (fabs(num) < 10000 * mul) { ++ } else if (math::fabs(num) < 10000 * mul) { + sprintf(c, "%.0f", num); +- } else if (fabs(num) < 10000000 * mul) { ++ } else if (math::fabs(num) < 10000000 * mul) { + sprintf(c, "%.0fk", num / 1000); + } else { + sprintf(c, "%.0fM", num / 1000000); +@@ -165,7 +165,7 @@ + if (dispMode > 0 ) { + if ((mx > (box.x1 + 0.01f)) && (mx < (box.x1 + 0.12f)) && + (my < (box.y1 + 0.57f)) && (my > (box.y1 + 0.571f - stats.size()*0.02f))) { +- int sel = (int) floor(-(my - box.y1 - 0.57f) * 50); ++ int sel = (int) math::floor(-(my - box.y1 - 0.57f) * 50); + + if (button == 1) { + stat1 = sel; +@@ -341,7 +341,7 @@ + + if ((mx > box.x1 + 0.01f) && (mx < box.x1 + 0.12f) && + (my < box.y1 + 0.57f) && (my > box.y1 + 0.571f - (stats.size() * 0.02f))) { +- const int sel = (int) floor(50 * -(my - box.y1 - 0.57f)); ++ const int sel = (int) math::floor(50 * -(my - box.y1 - 0.57f)); + + glColor4f(0.7f, 0.2f, 0.2f, guiAlpha); + glDisable(GL_TEXTURE_2D); +diff -ru spring_89.0/rts/Game/UI/EndGameBox.h /home/svenstaro/src/spring/rts/Game/UI/EndGameBox.h +--- spring_89.0/rts/Game/UI/EndGameBox.h 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/UI/EndGameBox.h 2012-07-13 06:34:43.066060493 +0200 +@@ -60,8 +60,8 @@ + if (team >= 0 && static_cast<size_t>(team) >= values.size()) { + values.resize(team + 1); + } +- if (values[team].size() > 0 && fabs(value-values[team].back()) > maxdif) { +- maxdif = fabs(value-values[team].back()); ++ if (values[team].size() > 0 && math::fabs(value-values[team].back()) > maxdif) { ++ maxdif = math::fabs(value-values[team].back()); + } + + values[team].push_back(value); +diff -ru spring_89.0/rts/Game/UI/MouseCursor.cpp /home/svenstaro/src/spring/rts/Game/UI/MouseCursor.cpp +--- spring_89.0/rts/Game/UI/MouseCursor.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/UI/MouseCursor.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -355,7 +355,7 @@ + return; + } + +- animTime = fmod(animTime + globalRendering->lastFrameTime, animPeriod); ++ animTime = math::fmod(animTime + globalRendering->lastFrameTime, animPeriod); + + if (animTime < frames[currentFrame].startTime) { + currentFrame = 0; +diff -ru spring_89.0/rts/Game/UI/ResourceBar.cpp /home/svenstaro/src/spring/rts/Game/UI/ResourceBar.cpp +--- spring_89.0/rts/Game/UI/ResourceBar.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/UI/ResourceBar.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -48,11 +48,11 @@ + + if (num == 0) + sprintf(c, "0"); +- if ( fabs(num) < (10 * mul)) { ++ if ( math::fabs(num) < (10 * mul)) { + sprintf(c, "%.1f", num); +- } else if (fabs(num) < (10000 * mul)) { ++ } else if (math::fabs(num) < (10000 * mul)) { + sprintf(c, "%.0f", num); +- } else if (fabs(num) < (10000000 * mul)) { ++ } else if (math::fabs(num) < (10000000 * mul)) { + sprintf(c, "%.0fk", num / 1000); + } else { + sprintf(c, "%.0fM", num / 1000000); +@@ -180,11 +180,11 @@ + + smallFont->SetTextColor(1.0f, 0.3f, 0.3f, 1.0f); // Expenses + smallFont->glFormat(metalx + 0.044f, box.y1, labelsFontSize, FONT_DESCENDER | fontOptions, "-%s(-%s)", +- FloatToSmallString(fabs(myTeam->prevMetalPull)).c_str(), +- FloatToSmallString(fabs(myTeam->metalSent)).c_str()); ++ FloatToSmallString(math::fabs(myTeam->prevMetalPull)).c_str(), ++ FloatToSmallString(math::fabs(myTeam->metalSent)).c_str()); + smallFont->glFormat(energyx + 0.044f, box.y1, labelsFontSize, FONT_DESCENDER | fontOptions, "-%s(-%s)", +- FloatToSmallString(fabs(myTeam->prevEnergyPull)).c_str(), +- FloatToSmallString(fabs(myTeam->energySent)).c_str()); ++ FloatToSmallString(math::fabs(myTeam->prevEnergyPull)).c_str(), ++ FloatToSmallString(math::fabs(myTeam->energySent)).c_str()); + + smallFont->SetTextColor(0.4f, 1.0f, 0.4f, 0.95f); // Income + smallFont->glFormat(metalx + 0.044f, box.y2 - 2*globalRendering->pixelY, labelsFontSize, FONT_ASCENDER | fontOptions, "+%s", +diff -ru spring_89.0/rts/Game/UI/SelectionKeyHandler.cpp /home/svenstaro/src/spring/rts/Game/UI/SelectionKeyHandler.cpp +--- spring_89.0/rts/Game/UI/SelectionKeyHandler.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/UI/SelectionKeyHandler.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -367,9 +367,9 @@ + camera->rot.x=-1; + + float3 wantedCamDir; +- wantedCamDir.x=(float)(sin(camera->rot.y)*cos(camera->rot.x)); +- wantedCamDir.y=(float)(sin(camera->rot.x)); +- wantedCamDir.z=(float)(cos(camera->rot.y)*cos(camera->rot.x)); ++ wantedCamDir.x=(float)(math::sin(camera->rot.y)*math::cos(camera->rot.x)); ++ wantedCamDir.y=(float)(math::sin(camera->rot.x)); ++ wantedCamDir.z=(float)(math::cos(camera->rot.y)*math::cos(camera->rot.x)); + wantedCamDir.ANormalize(); + + camHandler->GetCurrentController().SetPos(sel->pos - wantedCamDir*800); +diff -ru spring_89.0/rts/Game/UI/UnitTracker.cpp /home/svenstaro/src/spring/rts/Game/UI/UnitTracker.cpp +--- spring_89.0/rts/Game/UI/UnitTracker.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Game/UI/UnitTracker.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -297,8 +297,8 @@ + modPlanePos.y = minHeight; + } + +- trackPos += (modPlanePos - trackPos) * (1 - pow(0.95f, deltaTime)); +- trackDir += (u->frontdir - trackDir) * (1 - pow(0.90f, deltaTime)); ++ trackPos += (modPlanePos - trackPos) * (1 - math::pow(0.95f, deltaTime)); ++ trackDir += (u->frontdir - trackDir) * (1 - math::pow(0.90f, deltaTime)); + trackDir.ANormalize(); + + camera->pos = trackPos; +diff -ru spring_89.0/rts/lib/gml/gmlsrv.h /home/svenstaro/src/spring/rts/lib/gml/gmlsrv.h +--- spring_89.0/rts/lib/gml/gmlsrv.h 2012-07-10 00:10:09.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/lib/gml/gmlsrv.h 2012-07-13 06:34:43.209393834 +0200 +@@ -361,7 +361,7 @@ + if (gmlShareLists) { + ogc[thr]->WorkerThreadPost(); + } +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + while(dorun) { + gmlClientSub(); + } +@@ -452,7 +452,7 @@ + Threading::SetThreadName("sim"); + Watchdog::RegisterThread(WDT_SIM, true); + set_threadnum(GML_SIM_THREAD_NUM); +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + while(dorun) { + gmlClientAuxSub(); + } +diff -ru spring_89.0/rts/lib/headlessStubs/sdlstub_cppbit.cpp /home/svenstaro/src/spring/rts/lib/headlessStubs/sdlstub_cppbit.cpp +--- spring_89.0/rts/lib/headlessStubs/sdlstub_cppbit.cpp 2012-07-10 00:10:09.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/lib/headlessStubs/sdlstub_cppbit.cpp 2012-07-13 06:35:00.626061514 +0200 +@@ -12,10 +12,16 @@ + extern "C" { + #endif + ++#if (BOOST_VERSION >= 105000) //boost 1.50 renamed TIME_UTC to TIME_UTC_ ++ #define SPRING_UTCTIME boost::TIME_UTC_ ++#else ++ #define SPRING_UTCTIME boost::TIME_UTC ++#endif ++ + int stub_sdl_getSystemMilliSeconds() { + + boost::xtime t; +- boost::xtime_get(&t, boost::TIME_UTC); ++ boost::xtime_get(&t, SPRING_UTCTIME); + const int milliSeconds = t.sec * 1000 + (t.nsec / 1000000); + return milliSeconds; + } +@@ -23,7 +29,7 @@ + void stub_sdl_sleepMilliSeconds(int milliSeconds) { + + boost::xtime t; +- boost::xtime_get(&t, boost::TIME_UTC); ++ boost::xtime_get(&t, SPRING_UTCTIME); + t.nsec += 1000000 * milliSeconds; + boost::thread::sleep(t); + } +diff -ru spring_89.0/rts/lib/streflop/streflopC.cpp /home/svenstaro/src/spring/rts/lib/streflop/streflopC.cpp +--- spring_89.0/rts/lib/streflop/streflopC.cpp 2012-07-10 00:10:10.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/lib/streflop/streflopC.cpp 2012-07-13 06:34:42.939393819 +0200 +@@ -9,16 +9,16 @@ + #endif + + void streflop_init_Simple() { +- streflop_init<Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + } + + void streflop_init_Double() { +- streflop_init<Double>(); ++ streflop::streflop_init<streflop::Double>(); + } + + #if defined(Extended) + void streflop_init_Extended() { +- streflop_init<Extended>(); ++ streflop::streflop_init<streflop::Extended>(); + } + #endif // defined(Extended) + +diff -ru spring_89.0/rts/lib/streflop/streflop_cond.h /home/svenstaro/src/spring/rts/lib/streflop/streflop_cond.h +--- spring_89.0/rts/lib/streflop/streflop_cond.h 2012-07-10 00:10:10.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/lib/streflop/streflop_cond.h 2012-07-13 06:34:42.906060483 +0200 +@@ -11,8 +11,6 @@ + + #if defined(STREFLOP_X87) || defined(STREFLOP_SSE) || defined(STREFLOP_SOFT) + #include "streflop.h" +-using namespace streflop; +- + namespace math { + using namespace streflop; + } +@@ -20,6 +18,7 @@ + #include <cmath> + namespace math { + using std::fabs; ++ // We are using fastmath::sqrt_sse instead! + // using std::sqrt; + using std::sin; + using std::cos; +diff -ru spring_89.0/rts/Map/BasicMapDamage.cpp /home/svenstaro/src/spring/rts/Map/BasicMapDamage.cpp +--- spring_89.0/rts/Map/BasicMapDamage.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Map/BasicMapDamage.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -33,7 +33,7 @@ + + for (int a = 0; a <= CRATER_TABLE_SIZE; ++a) { + const float r = a / float(CRATER_TABLE_SIZE); +- const float d = cos((r - 0.1f) * (PI + 0.3f)) * (1 - r) * (0.5f + 0.5f * cos(std::max(0.0f, r * 3 - 2) * PI)); ++ const float d = math::cos((r - 0.1f) * (PI + 0.3f)) * (1 - r) * (0.5f + 0.5f * math::cos(std::max(0.0f, r * 3 - 2) * PI)); + craterTable[a] = d; + } + +@@ -83,7 +83,7 @@ + const float* curHeightMap = readmap->GetCornerHeightMapSynced(); + const float* orgHeightMap = readmap->GetOriginalHeightMapSynced(); + const unsigned char* typeMap = readmap->GetTypeMapSynced(); +- const float baseStrength = -pow(strength, 0.6f) * 3 / mapHardness; ++ const float baseStrength = -math::pow(strength, 0.6f) * 3 / mapHardness; + const float invRadius = 1.0f / radius; + + for (int y = e->y1; y <= e->y2; ++y) { +@@ -111,7 +111,7 @@ + orgHeightMap[y * gs->mapxp1 + x]; + + if (prevDif * dif > 0.0f) { +- dif /= fabs(prevDif) * 0.1f + 1; ++ dif /= math::fabs(prevDif) * 0.1f + 1; + } + + e->squares.push_back(dif); +@@ -148,7 +148,7 @@ + orgHeightMap[z * gs->mapxp1 + x]; + + if (prevDif * dif > 0.0f) { +- dif /= fabs(prevDif) * 0.1f + 1; ++ dif /= math::fabs(prevDif) * 0.1f + 1; + } + + totalDif += dif; +diff -ru spring_89.0/rts/Map/Ground.cpp /home/svenstaro/src/spring/rts/Map/Ground.cpp +--- spring_89.0/rts/Map/Ground.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Map/Ground.cpp 2012-07-13 06:34:43.086060494 +0200 +@@ -433,8 +433,8 @@ + + float3 CGround::GetSmoothNormal(float x, float y, bool synced) const + { +- int sx = (int) floor(x / SQUARE_SIZE); +- int sy = (int) floor(y / SQUARE_SIZE); ++ int sx = (int) math::floor(x / SQUARE_SIZE); ++ int sy = (int) math::floor(y / SQUARE_SIZE); + + if (sy < 1) + sy = 1; +diff -ru spring_89.0/rts/Map/SM3/Plane.cpp /home/svenstaro/src/spring/rts/Map/SM3/Plane.cpp +--- spring_89.0/rts/Map/SM3/Plane.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Map/SM3/Plane.cpp 2012-07-13 06:34:43.066060493 +0200 +@@ -15,7 +15,7 @@ + a = ry1*rz2 - ry2*rz1; + b = rz1*rx2 - rz2*rx1; + c = rx1*ry2 - rx2*ry1; +- float len = (float)sqrt(a*a + b*b + c*c); ++ float len = (float)math::sqrt(a*a + b*b + c*c); + a /= len; + b /= len; + c /= len; +@@ -37,10 +37,10 @@ + bool Plane::EpsilonCompare(const Plane& pln, float epsilon) + { + Plane t; +- t.a = fabs(a - pln.a); +- t.b = fabs(b - pln.b); +- t.c = fabs(c - pln.c); +- t.d = fabs(d - pln.d); ++ t.a = math::fabs(a - pln.a); ++ t.b = math::fabs(b - pln.b); ++ t.c = math::fabs(c - pln.c); ++ t.d = math::fabs(d - pln.d); + if (t.a > epsilon || t.b > epsilon || t.c > epsilon || t.d > epsilon) { + return false; + } +diff -ru spring_89.0/rts/Map/SM3/terrain/Lightcalc.cpp /home/svenstaro/src/spring/rts/Map/SM3/terrain/Lightcalc.cpp +--- spring_89.0/rts/Map/SM3/terrain/Lightcalc.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Map/SM3/terrain/Lightcalc.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -197,7 +197,7 @@ + continue; + } + +- float len = sqrt(dx*dx + dy*dy); ++ float len = math::sqrt(dx*dx + dy*dy); + const float step = 5.0f; + float invLength2d = step / len; + dx *= invLength2d; +diff -ru spring_89.0/rts/Map/SM3/terrain/Textures.cpp /home/svenstaro/src/spring/rts/Map/SM3/terrain/Textures.cpp +--- spring_89.0/rts/Map/SM3/terrain/Textures.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Map/SM3/terrain/Textures.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -248,7 +248,7 @@ + } + + // flatness=dotproduct of surface normal with up vector +- float slope = 1.0f - fabs(norm_y); ++ float slope = 1.0f - math::fabs(norm_y); + + if (slope < gi->minSlope - gi->minSlopeFuzzy) { + bm->at(x,y) = 0.0f; +@@ -307,7 +307,7 @@ + Vector3 n; + + if (sx*sx + sy*sy < 32*32) { +- const int sz = (int)sqrt(static_cast<float>(32 * 32 - sx*sx - sy*sy)); ++ const int sz = (int)math::sqrt(static_cast<float>(32 * 32 - sx*sx - sy*sy)); + n = Vector3(sx, sy, sz); + n.ANormalize(); + } +diff -ru spring_89.0/rts/Map/SMF/Legacy/LegacyMeshDrawer.cpp /home/svenstaro/src/spring/rts/Map/SMF/Legacy/LegacyMeshDrawer.cpp +--- spring_89.0/rts/Map/SMF/Legacy/LegacyMeshDrawer.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Map/SMF/Legacy/LegacyMeshDrawer.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -99,7 +99,7 @@ + const int minz = bty * smfReadMap->bigTexSize; + const int maxz = minz + smfReadMap->bigTexSize; + const float miny = readmap->currMinHeight; +- const float maxy = fabs(cam->pos.y); ++ const float maxy = math::fabs(cam->pos.y); + + const float3 mins( 0, miny, minz); + const float3 maxs(smfReadMap->mapSizeX, maxy, maxz); +diff -ru spring_89.0/rts/Map/SMF/ROAM/Patch.cpp /home/svenstaro/src/spring/rts/Map/SMF/ROAM/Patch.cpp +--- spring_89.0/rts/Map/SMF/ROAM/Patch.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Map/SMF/ROAM/Patch.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -405,7 +405,7 @@ + + // Variance of this triangle is the actual height at it's hypotenuse midpoint minus the interpolated height. + // Use values passed on the stack instead of re-accessing the Height Field. +- float myVariance = fabs(centerZ - ((leftZ + rightZ) / 2)); ++ float myVariance = math::fabs(centerZ - ((leftZ + rightZ) / 2)); + + if (leftZ*rightZ<0 || leftZ*centerZ<0 || rightZ*centerZ<0) + myVariance = std::max(myVariance * 1.5f, 20.0f); //shore lines get more variance for higher accuracy +diff -ru spring_89.0/rts/Map/SMF/SMFRenderState.cpp /home/svenstaro/src/spring/rts/Map/SMF/SMFRenderState.cpp +--- spring_89.0/rts/Map/SMF/SMFRenderState.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Map/SMF/SMFRenderState.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -385,7 +385,7 @@ + smfShaderCurrARB->SetUniformTarget(GL_VERTEX_PROGRAM_ARB); + smfShaderCurrARB->SetUniform4f(10, 1.0f / (gs->pwr2mapx * SQUARE_SIZE), 1.0f / (gs->pwr2mapy * SQUARE_SIZE), 0, 1); + smfShaderCurrARB->SetUniform4f(12, 1.0f / smfMap->bigTexSize, 1.0f / smfMap->bigTexSize, 0, 1); +- smfShaderCurrARB->SetUniform4f(13, -floor(camera->pos.x * 0.02f), -floor(camera->pos.z * 0.02f), 0, 0); ++ smfShaderCurrARB->SetUniform4f(13, -math::floor(camera->pos.x * 0.02f), -math::floor(camera->pos.z * 0.02f), 0, 0); + smfShaderCurrARB->SetUniform4f(14, 0.02f, 0.02f, 0, 1); + smfShaderCurrARB->SetUniformTarget(GL_FRAGMENT_PROGRAM_ARB); + smfShaderCurrARB->SetUniform4f(10, ambientColor.x, ambientColor.y, ambientColor.z, 1); +diff -ru spring_89.0/rts/Rendering/Env/AdvSky.cpp /home/svenstaro/src/spring/rts/Rendering/Env/AdvSky.cpp +--- spring_89.0/rts/Rendering/Env/AdvSky.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Env/AdvSky.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -65,8 +65,8 @@ + memset(thicknessTransform, 0, 1024); + memset(covers, 0, 4 * 32 * sizeof(float)); + +- domeheight = cos(PI / 16) * 1.01f; +- domeWidth = sin(2 * PI / 32) * 400 * 1.7f; ++ domeheight = math::cos(PI / 16) * 1.01f; ++ domeWidth = math::sin(2 * PI / 32) * 400 * 1.7f; + + UpdateSkyDir(); + InitSun(); +@@ -383,7 +383,7 @@ + case 0: { + for(int a=0; a<CLOUD_DETAIL; a++) { + float fade = gs->frameNum / (70.0f * (2<<(CLOUD_DETAIL-1-a))); +- fade -= floor(fade/2)*2; ++ fade -= math::floor(fade/2)*2; + if(fade>1) { + fade = 2 - fade; + if(!cloudDown[a]) { +@@ -417,11 +417,11 @@ + int qcda=(4<<CLOUD_DETAIL)>>a; + int *pkernel=kernel; + for(int y=0; y<cs4a; ++y, pkernel+=CLOUD_SIZE/4) { +- float ydist=fabs(1.0f+y-cs8a)/cs8a; ++ float ydist=math::fabs(1.0f+y-cs8a)/cs8a; + ydist=ydist*ydist*(3-2*ydist); + int *pkrn=pkernel; + for(int x=0; x<cs4a; ++x) { +- float xdist=fabs(1.0f+x-cs8a)/cs8a; ++ float xdist=math::fabs(1.0f+x-cs8a)/cs8a; + xdist=xdist*xdist*(3-2*xdist); + + float contrib=(1-xdist)*(1-ydist); +@@ -533,7 +533,7 @@ + unsigned char *tt=thicknessTransform; + for(int a=0;a<1024;++a){ + float f=(1023.0f-(a+cloudDensity*1024-512))/1023.0f; +- float alpha=pow(f*2,3); ++ float alpha=math::pow(f*2,3); + if(alpha>1) + alpha=1; + *at=(int) (alpha*255); +@@ -560,11 +560,11 @@ + + float ymod=(sunTexCoordY-0.5f)*domeWidth*0.025f*256; + float fy=ymod+modCamera.z*CLOUD_SIZE*0.000025f; +- int baseY=int(floor(fy))&CLOUD_MASK; +- fy-=floor(fy); ++ int baseY=int(math::floor(fy))&CLOUD_MASK; ++ fy-=math::floor(fy); + float fx=gs->frameNum*0.00005f*CLOUD_SIZE+modCamera.x*CLOUD_SIZE*0.000025f; +- int baseX=int(floor(fx))&CLOUD_MASK; +- fx-=floor(fx); ++ int baseX=int(math::floor(fx))&CLOUD_MASK; ++ fx-=math::floor(fx); + + float *cvs=(float *)covers[0], *cvs1=(float *)covers[1], *cvs2=(float *)covers[2], *cvs3=(float *)covers[3]; + if(baseX!=oldCoverBaseX || baseY!=oldCoverBaseY){ +@@ -622,8 +622,8 @@ + glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ONE); + glBegin(GL_TRIANGLE_STRIP); + for(int x=0;x<257;++x){ +- float dx = sin(x*2*PI/256.0f); +- float dy = cos(x*2*PI/256.0f); ++ float dx = math::sin(x*2*PI/256.0f); ++ float dy = math::cos(x*2*PI/256.0f); + + glTexCoord2f(x/256.0f,0.125f); + glVertexf3(modSunDir*5+ldir*dx*0.0014f+udir*dy*0.0014f); +@@ -646,7 +646,7 @@ + mem[(y*128+x)*4+0]=255; + mem[(y*128+x)*4+1]=255; + mem[(y*128+x)*4+2]=255; +- float dist=sqrt((float)(y-64)*(y-64)+(x-64)*(x-64)); ++ float dist=math::sqrt((float)(y-64)*(y-64)+(x-64)*(x-64)); + if(dist>60) + mem[(y*128+x)*4+3]=0; + else +@@ -749,7 +749,7 @@ + + for(int a=0;a<5;++a){ + float fade = gs->frameNum / float(30<<a); +- fade -= floor(fade/2)*2; ++ fade -= math::floor(fade/2)*2; + int size = std::min(32,256>>a); + + if(fade>1){ +@@ -770,7 +770,7 @@ + + } + float tSize = std::max(1,8>>a); +- float c = pow(2.0f,a)*6/255.0f; ++ float c = math::pow(2.0f,a)*6/255.0f; + CVertexArray* va = GetVertexArray(); + va->Initialize(); + va->CheckInitSize(4*VA_SIZE_T); +@@ -867,10 +867,10 @@ + + const float hdist = math::sqrt(dir.x * dir.x + dir.z * dir.z); + const float ang = GetRadFromXY(dir.x, dir.z) + skyAngle; +- const float fy = asin(hdist / 400); ++ const float fy = math::asin(hdist / 400); + +- dir.x = hdist * cos(ang); +- dir.z = hdist * sin(ang); ++ dir.x = hdist * math::cos(ang); ++ dir.z = hdist * math::sin(ang); + dir.y = (fastmath::cos(fy) - domeheight) * 400; + + dir.ANormalize(); +@@ -903,7 +903,7 @@ + const float3& dir = GetDirFromTexCoord(x / 256.0f, (255.0f - y) / 256.0f); + + const float sunInt = skyLight->GetLightIntensity(); +- const float sunDist = acos(dir.dot(skyLight->GetLightDir())) * 50; ++ const float sunDist = math::acos(dir.dot(skyLight->GetLightDir())) * 50; + const float sunMod = sunInt * (0.3f / math::sqrt(sunDist) + 3.0f / (1 + sunDist)); + + const float green = std::min(1.0f, (0.55f + sunMod)); +@@ -918,7 +918,7 @@ + void CAdvSky::UpdateTexPart(int x, int y, unsigned char (*texp)[4]) { + const float3& dir = GetDirFromTexCoord(x / 512.0f, (511.0f - y) / 512.0f); + +- const float sunDist = acos(dir.dot(skyLight->GetLightDir())) * 70; ++ const float sunDist = math::acos(dir.dot(skyLight->GetLightDir())) * 70; + const float sunMod = skyLight->GetLightIntensity() * 12.0f / (12 + sunDist); + + const float red = std::min(skyColor.x + sunMod * sunColor.x, 1.0f); +diff -ru spring_89.0/rts/Rendering/Env/AdvTreeDrawer.cpp /home/svenstaro/src/spring/rts/Rendering/Env/AdvTreeDrawer.cpp +--- spring_89.0/rts/Rendering/Env/AdvTreeDrawer.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Env/AdvTreeDrawer.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -229,7 +229,7 @@ + std::list<FallingTree>::iterator prev = fti++; + fallingTrees.erase(prev); + } else { +- fti->speed += (sin(fti->fallPos) * 0.04f); ++ fti->speed += (math::sin(fti->fallPos) * 0.04f); + ++fti; + } + } +@@ -616,7 +616,7 @@ + if (camera->InView(pos + float3(0.0f, MAX_TREE_HEIGHT / 2, 0.0f), MAX_TREE_HEIGHT / 2.0f)) { + const float ang = fti->fallPos * PI; + +- const float3 yvec(fti->dir.x * sin(ang), cos(ang), fti->dir.z * sin(ang)); ++ const float3 yvec(fti->dir.x * math::sin(ang), math::cos(ang), fti->dir.z * math::sin(ang)); + const float3 zvec((yvec.cross(float3(-1.0f, 0.0f, 0.0f))).ANormalize()); + const float3 xvec(yvec.cross(zvec)); + +@@ -957,7 +957,7 @@ + if (camera->InView(pos + float3(0, MAX_TREE_HEIGHT / 2, 0), MAX_TREE_HEIGHT / 2)) { + const float ang = fti->fallPos * PI; + +- const float3 yvec(fti->dir.x * sin(ang), cos(ang), fti->dir.z * sin(ang)); ++ const float3 yvec(fti->dir.x * math::sin(ang), math::cos(ang), fti->dir.z * math::sin(ang)); + const float3 zvec((yvec.cross(float3(1.0f, 0.0f, 0.0f))).ANormalize()); + const float3 xvec(zvec.cross(yvec)); + +diff -ru spring_89.0/rts/Rendering/Env/AdvTreeGenerator.cpp /home/svenstaro/src/spring/rts/Rendering/Env/AdvTreeGenerator.cpp +--- spring_89.0/rts/Rendering/Env/AdvTreeGenerator.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Env/AdvTreeGenerator.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -159,9 +159,9 @@ + int numIter=(int)max(3.0f,size*10); + for(int a=0;a<=numIter;a++){ + float angle=a/(float)numIter*2*PI; +- float col=0.4f+(((orto1*sin(angle)+orto2*cos(angle)).dot(flatSun)))*0.3f; +- barkva->AddVertexTN(start+orto1*sin(angle)*size+orto2*cos(angle)*size,angle/PI*0.125f*0.5f,0,float3(0,0,col)); +- barkva->AddVertexTN(end+orto1*sin(angle)*size*0.2f+orto2*cos(angle)*size*0.2f,angle/PI*0.125f*0.5f,3,float3(0,0,col)); ++ float col=0.4f+(((orto1*math::sin(angle)+orto2*math::cos(angle)).dot(flatSun)))*0.3f; ++ barkva->AddVertexTN(start+orto1*math::sin(angle)*size+orto2*math::cos(angle)*size,angle/PI*0.125f*0.5f,0,float3(0,0,col)); ++ barkva->AddVertexTN(end+orto1*math::sin(angle)*size*0.2f+orto2*math::cos(angle)*size*0.2f,angle/PI*0.125f*0.5f,3,float3(0,0,col)); + } + barkva->EndStrip(); + } +@@ -176,18 +176,18 @@ + + for (int a = 0; a < numBranch; ++a) { + const float angle = baseAngle + (a * 3.88f) + fRand(0.5f); +- float3 dir = orto1 * sin(angle) + orto2 * cos(angle); ++ float3 dir = orto1 * math::sin(angle) + orto2 * math::cos(angle); + dir.y = 0.3f + fRand(0.4f); + dir.ANormalize(); + const float3 start(0, (a + 5) * height / (numBranch + 5), 0); +- const float length = (height * (0.4f + fRand(0.1f))) * sqrt(float(numBranch - a) / numBranch); ++ const float length = (height * (0.4f + fRand(0.1f))) * math::sqrt(float(numBranch - a) / numBranch); + + TrunkIterator(start, dir, length, length * 0.05f, 1); + } + + for (int a = 0; a < 3; ++a) { + const float angle = (a * 3.88f) + fRand(0.5f); +- float3 dir = orto1*sin(angle)+orto2*cos(angle); ++ float3 dir = orto1*math::sin(angle)+orto2*math::cos(angle); + dir.y = 0.8f; + dir.ANormalize(); + const float3 start(0, height - 0.3f, 0); +@@ -225,7 +225,7 @@ + const float newLength = length * (float(numTrunks - a) / (numTrunks + 1)); + + float3 newbase = start + dir * length * (float(a + 1) / (numTrunks + 1)); +- float3 newDir = dir + orto1 * cos(angle) * dirDif + orto2 * sin(angle) * dirDif; ++ float3 newDir = dir + orto1 * math::cos(angle) * dirDif + orto2 * math::sin(angle) * dirDif; + newDir.ANormalize(); + + TrunkIterator(newbase, newDir, newLength, newLength * 0.05f, depth - 1); +@@ -245,8 +245,8 @@ + + float3 pos = start + dir * length * (0.7f + fRand(0.3f)); + pos += +- (orto1 * sin(angle) + orto2 * cos(angle)) * +- (sqrt((float) a + 1) * 0.6f + fRand(0.4f)) * ++ (orto1 * math::sin(angle) + orto2 * math::cos(angle)) * ++ (math::sqrt((float) a + 1) * 0.6f + fRand(0.4f)) * + 0.1f * MAX_TREE_HEIGHT; + + if (pos.y < 0.2f * MAX_TREE_HEIGHT) +@@ -538,12 +538,12 @@ + float baseAngle=fRand(2*PI); + for(int a=0;a<numBranch;++a){ + float sh = 0.2f + fRand(0.2f); +- float h = height * pow(sh + float(a)/numBranch * (1-sh), (float)0.7f); ++ float h = height * math::pow(sh + float(a)/numBranch * (1-sh), (float)0.7f); + float angle = baseAngle + (a * 0.618f + fRand(0.1f)) * 2 * PI; +- float3 dir(orto1 * sin(angle) + orto2 * cos(angle)); ++ float3 dir(orto1 * math::sin(angle) + orto2 * math::cos(angle)); + dir.y = (a - numBranch) * 0.01f - (0.2f + fRand(0.2f)); + dir.ANormalize(); +- float size = sqrt((float)numBranch - a + 5) * 0.08f * MAX_TREE_HEIGHT; ++ float size = math::sqrt((float)numBranch - a + 5) * 0.08f * MAX_TREE_HEIGHT; + DrawPineBranch(float3(0,h,0),dir,size); + } + //create the top +@@ -569,16 +569,16 @@ + for(int a=0;a<numIter;a++){ + float angle=a/(float)numIter*2*PI; + float angle2=(a+1)/(float)numIter*2*PI; +- float col=0.45f+(((orto1*sin(angle)+orto2*cos(angle)).dot(flatSun)))*0.3f; +- float col2=0.45f+(((orto1*sin(angle2)+orto2*cos(angle2)).dot(flatSun)))*0.3f; ++ float col=0.45f+(((orto1*math::sin(angle)+orto2*math::cos(angle)).dot(flatSun)))*0.3f; ++ float col2=0.45f+(((orto1*math::sin(angle2)+orto2*math::cos(angle2)).dot(flatSun)))*0.3f; + +- va->AddVertexTN(start+orto1*sin(angle)*size+orto2*cos(angle)*size, angle/PI*0.125f*0.5f+0.5f, 0, float3(0,0,col)); +- va->AddVertexTN(end+orto1*sin(angle)*size*0.1f+orto2*cos(angle)*size*0.1f, angle/PI*0.125f*0.5f+0.5f, 3, float3(0,0,col)); +- va->AddVertexTN(start+orto1*sin(angle2)*size+orto2*cos(angle2)*size, angle2/PI*0.125f*0.5f+0.5f, 0, float3(0,0,col2)); +- +- va->AddVertexTN(start+orto1*sin(angle2)*size+orto2*cos(angle2)*size, angle2/PI*0.125f*0.5f+0.5f, 0, float3(0,0,col2)); +- va->AddVertexTN(end+orto1*sin(angle)*size*0.1f+orto2*cos(angle)*size*0.1f, angle/PI*0.125f*0.5f+0.5f, 3, float3(0,0,col)); +- va->AddVertexTN(end+orto1*sin(angle2)*size*0.1f+orto2*cos(angle2)*size*0.1f, angle2/PI*0.125f*0.5f+0.5f, 3, float3(0,0,col2)); ++ va->AddVertexTN(start+orto1*math::sin(angle)*size+orto2*math::cos(angle)*size, angle/PI*0.125f*0.5f+0.5f, 0, float3(0,0,col)); ++ va->AddVertexTN(end+orto1*math::sin(angle)*size*0.1f+orto2*math::cos(angle)*size*0.1f, angle/PI*0.125f*0.5f+0.5f, 3, float3(0,0,col)); ++ va->AddVertexTN(start+orto1*math::sin(angle2)*size+orto2*math::cos(angle2)*size, angle2/PI*0.125f*0.5f+0.5f, 0, float3(0,0,col2)); ++ ++ va->AddVertexTN(start+orto1*math::sin(angle2)*size+orto2*math::cos(angle2)*size, angle2/PI*0.125f*0.5f+0.5f, 0, float3(0,0,col2)); ++ va->AddVertexTN(end+orto1*math::sin(angle)*size*0.1f+orto2*math::cos(angle)*size*0.1f, angle/PI*0.125f*0.5f+0.5f, 3, float3(0,0,col)); ++ va->AddVertexTN(end+orto1*math::sin(angle2)*size*0.1f+orto2*math::cos(angle2)*size*0.1f, angle2/PI*0.125f*0.5f+0.5f, 3, float3(0,0,col2)); + } + } + +diff -ru spring_89.0/rts/Rendering/Env/AdvWater.cpp /home/svenstaro/src/spring/rts/Rendering/Env/AdvWater.cpp +--- spring_89.0/rts/Rendering/Env/AdvWater.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Env/AdvWater.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -48,7 +48,7 @@ + for (int y = 0; y < 64; ++y) { + for (int x = 0; x < 64; ++x) { + scrap[(y*64 + x)*4 + 0] = 128; +- scrap[(y*64 + x)*4 + 1] = (unsigned char)(sin(y*PI*2.0f/64.0f)*128 + 128); ++ scrap[(y*64 + x)*4 + 1] = (unsigned char)(math::sin(y*PI*2.0f/64.0f)*128 + 128); + scrap[(y*64 + x)*4 + 2] = 0; + scrap[(y*64 + x)*4 + 3] = 255; + } +@@ -62,8 +62,8 @@ + for (int x = 0; x < 64; ++x) { + const float ang = 26.5f*PI/180.0f; + const float pos = y*2+x; +- scrap[(y*64 + x)*4 + 0] = (unsigned char)((sin(pos*PI*2.0f/64.0f))*128*sin(ang)) + 128; +- scrap[(y*64 + x)*4 + 1] = (unsigned char)((sin(pos*PI*2.0f/64.0f))*128*cos(ang)) + 128; ++ scrap[(y*64 + x)*4 + 0] = (unsigned char)((math::sin(pos*PI*2.0f/64.0f))*128*math::sin(ang)) + 128; ++ scrap[(y*64 + x)*4 + 1] = (unsigned char)((math::sin(pos*PI*2.0f/64.0f))*128*math::cos(ang)) + 128; + } + } + glBindTexture(GL_TEXTURE_2D, rawBumpTexture[1]); +@@ -75,8 +75,8 @@ + for (int x = 0; x < 64; ++x) { + const float ang = -19*PI/180.0f; + const float pos = 3*y - x; +- scrap[(y*64 + x)*4 + 0] = (unsigned char)((sin(pos*PI*2.0f/64.0f))*128*sin(ang)) + 128; +- scrap[(y*64 + x)*4 + 1] = (unsigned char)((sin(pos*PI*2.0f/64.0f))*128*cos(ang)) + 128; ++ scrap[(y*64 + x)*4 + 0] = (unsigned char)((math::sin(pos*PI*2.0f/64.0f))*128*math::sin(ang)) + 128; ++ scrap[(y*64 + x)*4 + 1] = (unsigned char)((math::sin(pos*PI*2.0f/64.0f))*128*math::cos(ang)) + 128; + } + } + glBindTexture(GL_TEXTURE_2D, rawBumpTexture[2]); +@@ -192,14 +192,14 @@ + dir = xbase + dv; + dir.ANormalize(); + zpos = camera->pos + dir*(camera->pos.y / -dir.y); +- zpos.y = sin(zpos.z*0.1f + gs->frameNum*0.06f)*0.06f + 0.05f; ++ zpos.y = math::sin(zpos.z*0.1f + gs->frameNum*0.06f)*0.06f + 0.05f; + col[3] = (unsigned char)((0.8f + 0.7f*dir.y)*255); + va->AddVertexQTC(zpos, x*(1.0f/numDivs), screenY - yInc, col); + + dir = xbase; + dir.ANormalize(); + zpos = camera->pos + dir*(camera->pos.y / -dir.y); +- zpos.y = sin(zpos.z*0.1f + gs->frameNum*0.06f)*0.06f + 0.05f; ++ zpos.y = math::sin(zpos.z*0.1f + gs->frameNum*0.06f)*0.06f + 0.05f; + col[3] = (unsigned char)((0.8f + 0.7f*dir.y)*255); + va->AddVertexQTC(zpos, x*(1.0f/numDivs), screenY, col); + +diff -ru spring_89.0/rts/Rendering/Env/BasicSky.cpp /home/svenstaro/src/spring/rts/Rendering/Env/BasicSky.cpp +--- spring_89.0/rts/Rendering/Env/BasicSky.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Env/BasicSky.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -67,8 +67,8 @@ + rawClouds=newmat2<int>(CLOUD_SIZE,CLOUD_SIZE); + blendMatrix=newmat3<int>(CLOUD_DETAIL,32,32); + +- domeheight=cos(PI/16)*1.01f; +- domeWidth=sin(PI/16)*400*1.7f; ++ domeheight=math::cos(PI/16)*1.01f; ++ domeWidth=math::sin(PI/16)*400*1.7f; + + UpdateSkyDir(); + InitSun(); +@@ -369,7 +369,7 @@ + case 0: { + for(int a=0; a<CLOUD_DETAIL; a++) { + float fade = gs->frameNum / (70.0f * (2<<(CLOUD_DETAIL-1-a))); +- fade -= floor(fade/2)*2; ++ fade -= math::floor(fade/2)*2; + if(fade>1) { + fade = 2 - fade; + if(!cloudDown[a]) { +@@ -403,11 +403,11 @@ + int qcda=(4<<CLOUD_DETAIL)>>a; + int *pkernel=kernel; + for(int y=0; y<cs4a; ++y, pkernel+=CLOUD_SIZE/4) { +- float ydist=fabs(1.0f+y-cs8a)/cs8a; ++ float ydist=math::fabs(1.0f+y-cs8a)/cs8a; + ydist=ydist*ydist*(3-2*ydist); + int *pkrn=pkernel; + for(int x=0; x<cs4a; ++x) { +- float xdist=fabs(1.0f+x-cs8a)/cs8a; ++ float xdist=math::fabs(1.0f+x-cs8a)/cs8a; + xdist=xdist*xdist*(3-2*xdist); + + float contrib=(1-xdist)*(1-ydist); +@@ -506,7 +506,7 @@ + unsigned char *tt=thicknessTransform; + for(int a=0;a<1024;++a){ + float f=(1023.0f-(a+cloudDensity*1024-512))/1023.0f; +- float alpha=pow(f*2,3); ++ float alpha=math::pow(f*2,3); + if(alpha>1) + alpha=1; + *at=(unsigned char)(alpha*255); +@@ -533,11 +533,11 @@ + + float ymod=(sunTexCoordY-0.5f)*domeWidth*0.025f*256; + float fy=ymod+modCamera.z*CLOUD_SIZE*0.000025f; +- int baseY=int(floor(fy))&CLOUD_MASK; +- fy-=floor(fy); ++ int baseY=int(math::floor(fy))&CLOUD_MASK; ++ fy-=math::floor(fy); + float fx=gs->frameNum*0.00005f*CLOUD_SIZE+modCamera.x*CLOUD_SIZE*0.000025f; +- int baseX=int(floor(fx))&CLOUD_MASK; +- fx-=floor(fx); ++ int baseX=int(math::floor(fx))&CLOUD_MASK; ++ fx-=math::floor(fx); + + float *cvs=(float *)covers[0], *cvs1=(float *)covers[1], *cvs2=(float *)covers[2], *cvs3=(float *)covers[3]; + if(baseX!=oldCoverBaseX || baseY!=oldCoverBaseY){ +@@ -589,8 +589,8 @@ + glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ONE); + glBegin(GL_TRIANGLE_STRIP); + for(int x=0;x<257;++x){ +- float dx=sin(x*2*PI/256.0f); +- float dy=cos(x*2*PI/256.0f); ++ float dx=math::sin(x*2*PI/256.0f); ++ float dy=math::cos(x*2*PI/256.0f); + + glTexCoord2f(x/256.0f,0.25f); + glVertexf3(modSunDir*5+ldir*dx*0.0014f+udir*dy*0.0014f); +@@ -613,7 +613,7 @@ + mem[(y*128+x)*4+0]=255; + mem[(y*128+x)*4+1]=255; + mem[(y*128+x)*4+2]=255; +- float dist=sqrt((float)(y-64)*(y-64)+(x-64)*(x-64)); ++ float dist=math::sqrt((float)(y-64)*(y-64)+(x-64)*(x-64)); + if(dist>60) + mem[(y*128+x)*4+3]=0; + else +@@ -764,10 +764,10 @@ + + const float hdist = math::sqrt(dir.x * dir.x + dir.z * dir.z); + const float ang = GetRadFromXY(dir.x, dir.z) + skyAngle; +- const float fy = asin(hdist / 400); ++ const float fy = math::asin(hdist / 400); + +- dir.x = hdist * cos(ang); +- dir.z = hdist * sin(ang); ++ dir.x = hdist * math::cos(ang); ++ dir.z = hdist * math::sin(ang); + dir.y = (fastmath::cos(fy) - domeheight) * 400; + + dir.ANormalize(); +@@ -800,7 +800,7 @@ + const float3& dir = GetDirFromTexCoord(x / 256.0f, (255.0f - y) / 256.0f); + + const float sunInt = skyLight->GetLightIntensity(); +- const float sunDist = acos(dir.dot(skyLight->GetLightDir())) * 50; ++ const float sunDist = math::acos(dir.dot(skyLight->GetLightDir())) * 50; + const float sunMod = sunInt * (0.3f / math::sqrt(sunDist) + 2.0f / sunDist); + + const float green = std::min(1.0f, (0.55f + sunMod)); +@@ -814,7 +814,7 @@ + void CBasicSky::UpdateTexPart(int x, int y, unsigned char (*texp)[4]) { + const float3& dir = GetDirFromTexCoord(x / 512.0f, (511.0f - y) / 512.0f); + +- const float sunDist = acos(dir.dot(skyLight->GetLightDir())) * 70; ++ const float sunDist = math::acos(dir.dot(skyLight->GetLightDir())) * 70; + const float sunMod = skyLight->GetLightIntensity() * 12.0f / (12 + sunDist); + + const float red = std::min(skyColor.x + sunMod * sunColor.x, 1.0f); +diff -ru spring_89.0/rts/Rendering/Env/CubeMapHandler.cpp /home/svenstaro/src/spring/rts/Rendering/Env/CubeMapHandler.cpp +--- spring_89.0/rts/Rendering/Env/CubeMapHandler.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Env/CubeMapHandler.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -269,7 +269,7 @@ + for (int x = 0; x < size; ++x) { + const float3 dir = (cdir + (xdif * (x + 0.5f)) / size + (ydif * (y + 0.5f)) / size).Normalize(); + const float dot = std::max(0.0f, dir.dot(sky->GetLight()->GetLightDir())); +- const float spec = std::min(1.0f, pow(dot, mapInfo->light.specularExponent) + pow(dot, 3.0f) * 0.25f); ++ const float spec = std::min(1.0f, math::pow(dot, mapInfo->light.specularExponent) + math::pow(dot, 3.0f) * 0.25f); + + buf[x * 4 + 0] = (mapInfo->light.unitSpecularColor.x * spec * 255); + buf[x * 4 + 1] = (mapInfo->light.unitSpecularColor.y * spec * 255); +diff -ru spring_89.0/rts/Rendering/Env/DynWater.cpp /home/svenstaro/src/spring/rts/Rendering/Env/DynWater.cpp +--- spring_89.0/rts/Rendering/Env/DynWater.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Env/DynWater.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -88,9 +88,9 @@ + + for (int y = 0; y < 64; ++y) { + for (int x = 0; x < 64; ++x) { +- temp[(y*64 + x)*4 + 0] = sin(x*PI*2.0f/64.0f) + ((x < 32) ? -1 : 1)*0.3f; ++ temp[(y*64 + x)*4 + 0] = math::sin(x*PI*2.0f/64.0f) + ((x < 32) ? -1 : 1)*0.3f; + temp[(y*64 + x)*4 + 1] = temp[(y*64 + x)*4 + 0]; +- temp[(y*64 + x)*4 + 2] = cos(x*PI*2.0f/64.0f) + ((x < 32) ? (16 - x) : (x - 48))/16.0f*0.3f; ++ temp[(y*64 + x)*4 + 2] = math::cos(x*PI*2.0f/64.0f) + ((x < 32) ? (16 - x) : (x - 48))/16.0f*0.3f; + temp[(y*64 + x)*4 + 3] = 0; + } + } +@@ -197,7 +197,7 @@ + const float dy = y - 31.5f; + for (int x = 0; x < 64; ++x) { + const float dx = x-31.5f; +- const float dist = sqrt(dx*dx + dy*dy); ++ const float dist = math::sqrt(dx*dx + dy*dy); + temp[(y*64 + x)*4 + 0] = std::max(0.0f, 1 - dist/30.f) * std::max(0.0f, 1 - dist/30.f); + temp[(y*64 + x)*4 + 1] = std::max(0.0f, 1 - dist/30.f); + temp[(y*64 + x)*4 + 2] = std::max(0.0f, 1 - dist/30.f) * std::max(0.0f, 1 - dist/30.f); +@@ -425,8 +425,8 @@ + + oldCamPosBig = camPosBig; + +- camPosBig.x = floor(std::max((float)WH_SIZE, std::min((float)gs->mapx*SQUARE_SIZE-WH_SIZE, (float)camera->pos.x))/(W_SIZE*16))*(W_SIZE*16); +- camPosBig.z = floor(std::max((float)WH_SIZE, std::min((float)gs->mapy*SQUARE_SIZE-WH_SIZE, (float)camera->pos.z))/(W_SIZE*16))*(W_SIZE*16); ++ camPosBig.x = math::floor(std::max((float)WH_SIZE, std::min((float)gs->mapx*SQUARE_SIZE-WH_SIZE, (float)camera->pos.x))/(W_SIZE*16))*(W_SIZE*16); ++ camPosBig.z = math::floor(std::max((float)WH_SIZE, std::min((float)gs->mapy*SQUARE_SIZE-WH_SIZE, (float)camera->pos.z))/(W_SIZE*16))*(W_SIZE*16); + + glDisable(GL_DEPTH_TEST); + glDepthMask(0); +@@ -835,8 +835,8 @@ + va = GetVertexArray(); + va->Initialize(); + +- camPosBig2.x = floor(std::max((float)WH_SIZE, std::min((float)gs->mapx*SQUARE_SIZE - WH_SIZE, (float)camera->pos.x))/(W_SIZE*16))*(W_SIZE*16); +- camPosBig2.z = floor(std::max((float)WH_SIZE, std::min((float)gs->mapy*SQUARE_SIZE - WH_SIZE, (float)camera->pos.z))/(W_SIZE*16))*(W_SIZE*16); ++ camPosBig2.x = math::floor(std::max((float)WH_SIZE, std::min((float)gs->mapx*SQUARE_SIZE - WH_SIZE, (float)camera->pos.x))/(W_SIZE*16))*(W_SIZE*16); ++ camPosBig2.z = math::floor(std::max((float)WH_SIZE, std::min((float)gs->mapy*SQUARE_SIZE - WH_SIZE, (float)camera->pos.z))/(W_SIZE*16))*(W_SIZE*16); + + // FIXME: + // 1. DynWater::UpdateCamRestraints was never called ==> <this->left> and <this->right> were always empty +@@ -1132,8 +1132,8 @@ + // hovercraft + const float3& pos = unit->pos; + +- if ((fabs(pos.x - camPosBig.x) > (WH_SIZE - 50)) || +- (fabs(pos.z - camPosBig.z) > (WH_SIZE - 50))) ++ if ((math::fabs(pos.x - camPosBig.x) > (WH_SIZE - 50)) || ++ (math::fabs(pos.z - camPosBig.z) > (WH_SIZE - 50))) + { + continue; + } +@@ -1144,7 +1144,7 @@ + if ((pos.y > -4.0f) && (pos.y < 4.0f)) { + const float3 frontAdd = unit->frontdir * unit->radius * 0.75f; + const float3 sideAdd = unit->rightdir * unit->radius * 0.75f; +- const float depth = sqrt(sqrt(unit->mass)) * 0.4f; ++ const float depth = math::sqrt(math::sqrt(unit->mass)) * 0.4f; + const float3 n(depth, 0.05f * depth, depth); + + va2->AddVertexQTN(pos + frontAdd + sideAdd, 0, 0, n); +@@ -1156,8 +1156,8 @@ + // surface ship + const float3& pos = unit->pos; + +- if ((fabs(pos.x - camPosBig.x) > (WH_SIZE - 50)) || +- (fabs(pos.z - camPosBig.z) > (WH_SIZE - 50))) ++ if ((math::fabs(pos.x - camPosBig.x) > (WH_SIZE - 50)) || ++ (math::fabs(pos.z - camPosBig.z) > (WH_SIZE - 50))) + { + continue; + } +@@ -1171,7 +1171,7 @@ + + const float3 frontAdd = unit->frontdir * unit->radius * 0.75f; + const float3 sideAdd = unit->rightdir * unit->radius * 0.18f; +- const float depth = sqrt(sqrt(unit->mass)); ++ const float depth = math::sqrt(math::sqrt(unit->mass)); + const float3 n(depth, 0.04f * unit->speed.Length2D() * depth, depth); + + va->AddVertexQTN(pos + frontAdd + sideAdd, 0, 0, n); +@@ -1249,8 +1249,8 @@ + for (std::vector<Explosion>::iterator ei = explosions.begin(); ei != explosions.end(); ++ei) { + Explosion& explo = *ei; + float3 pos = explo.pos; +- if ((fabs(pos.x - camPosBig.x) > (WH_SIZE - 50)) +- || (fabs(pos.z - camPosBig.z) > (WH_SIZE - 50))) ++ if ((math::fabs(pos.x - camPosBig.x) > (WH_SIZE - 50)) ++ || (math::fabs(pos.z - camPosBig.z) > (WH_SIZE - 50))) + { + continue; + } +diff -ru spring_89.0/rts/Rendering/Env/GrassDrawer.cpp /home/svenstaro/src/spring/rts/Rendering/Env/GrassDrawer.cpp +--- spring_89.0/rts/Rendering/Env/GrassDrawer.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Env/GrassDrawer.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -75,11 +75,11 @@ + } + + // TODO: get rid of the magic constants +- maxGrassDist = 800 + sqrt((float) detail) * 240; ++ maxGrassDist = 800 + math::sqrt((float) detail) * 240; + maxDetailedDist = 146 + detail * 24; + detailedBlocks = int((maxDetailedDist - 24) / bMSsq) + 1; + numTurfs = 3 + int(detail * 0.5f); +- strawPerTurf = 50 + int(sqrt((float) detail) * 10); ++ strawPerTurf = 50 + int(math::sqrt((float) detail) * 10); + + blocksX = gs->mapx / grassSquareSize /grassBlockSize; + blocksY = gs->mapy / grassSquareSize / grassBlockSize; +@@ -641,7 +641,7 @@ + const float3 billboardDirX = (billboardDirZ.cross(UpVector)).ANormalize(); + const float3 billboardDirY = billboardDirX.cross(billboardDirZ); + +- const float ang = acos(billboardDirZ.y); ++ const float ang = math::acos(billboardDirZ.y); + const int texPart = std::min(15, int(std::max(0, int((ang + PI / 16 - PI / 2) / PI * 30)))); + + if (globalRendering->haveGLSL) { +@@ -673,7 +673,7 @@ + const float3 billboardDirX = (billboardDirZ.cross(UpVector)).ANormalize(); + const float3 billboardDirY = billboardDirX.cross(billboardDirZ); + +- const float ang = acos(billboardDirZ.y); ++ const float ang = math::acos(billboardDirZ.y); + const int texPart = std::min(15, int(std::max(0, int((ang + PI / 16 - PI / 2) / PI * 30)))); + + if (globalRendering->haveGLSL) { +@@ -820,7 +820,7 @@ + float3 forwardVect = sideVect.cross(UpVector); + sideVect *= mapInfo->grass.bladeWidth; + +- const float3 cornerPos = (UpVector * cos(maxAng) + forwardVect * sin(maxAng)) * length; ++ const float3 cornerPos = (UpVector * math::cos(maxAng) + forwardVect * math::sin(maxAng)) * length; + float3 basePos(30.0f, 0.0f, 30.0f); + + while (basePos.SqLength2D() > (turfSize * turfSize / 4)) { +@@ -837,10 +837,10 @@ + + const float3 edgePosL = + -sideVect * (1 - h) + +- (UpVector * cos(ang) + forwardVect * sin(ang)) * length * h; ++ (UpVector * math::cos(ang) + forwardVect * math::sin(ang)) * length * h; + const float3 edgePosR = + sideVect * (1.0f - h) + +- (UpVector * cos(ang) + forwardVect * sin(ang)) * length * h; ++ (UpVector * math::cos(ang) + forwardVect * math::sin(ang)) * length * h; + + if (b == 0) { + va->AddVertexT(basePos + (edgePosR - float3(0.0f, 0.1f, 0.0f)), xtexBase + xtexOffset, h); +diff -ru spring_89.0/rts/Rendering/Env/SkyLight.cpp /home/svenstaro/src/spring/rts/Rendering/Env/SkyLight.cpp +--- spring_89.0/rts/Rendering/Env/SkyLight.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Env/SkyLight.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -72,7 +72,7 @@ + bool DynamicSkyLight::SetLightDir(const float4& newLightDir) { + if (newLightDir != lightDir) { + static float4 lastUpdate = ZeroVector; +- static const float minCosAngle = cos(1.5f * (PI/180.f)); ++ static const float minCosAngle = math::cos(1.5f * (PI/180.f)); + + if (lastUpdate.dot(newLightDir) < minCosAngle) { + lastUpdate = newLightDir; +@@ -92,7 +92,7 @@ + const float angularVelocity = 2.0f * PI / sunOrbitTime; + + const float sunAng = startAngle - initialSunAngle - angularVelocity * gameSeconds; +- const float4 sunPos = sunRotation.Mul(float3(sunOrbitRad * cos(sunAng), sunOrbitHeight, sunOrbitRad * sin(sunAng))); ++ const float4 sunPos = sunRotation.Mul(float3(sunOrbitRad * math::cos(sunAng), sunOrbitHeight, sunOrbitRad * math::sin(sunAng))); + + return sunPos; + } +@@ -108,18 +108,18 @@ + if (newLightDir.w == FLT_MAX) { + // old: newLightDir is position where sun reaches highest altitude + const float sunLen = newLightDir.Length2D(); +- const float sunAzimuth = (sunLen <= 0.001f) ? PI / 2.0f : atan(newLightDir.y / sunLen); +- const float sunHeight = tan(sunAzimuth - 0.001f); ++ const float sunAzimuth = (sunLen <= 0.001f) ? PI / 2.0f : math::atan(newLightDir.y / sunLen); ++ const float sunHeight = math::tan(sunAzimuth - 0.001f); + +- float3 v1(cos(initialSunAngle), sunHeight, sin(initialSunAngle)); ++ float3 v1(math::cos(initialSunAngle), sunHeight, math::sin(initialSunAngle)); + v1.ANormalize(); + + if (v1.y <= orbitMinSunHeight) { + newLightDir = UpVector; + sunOrbitHeight = v1.y; +- sunOrbitRad = sqrt(1.0f - sunOrbitHeight * sunOrbitHeight); ++ sunOrbitRad = math::sqrt(1.0f - sunOrbitHeight * sunOrbitHeight); + } else { +- float3 v2(cos(initialSunAngle + PI), orbitMinSunHeight, sin(initialSunAngle + PI)); ++ float3 v2(math::cos(initialSunAngle + PI), orbitMinSunHeight, math::sin(initialSunAngle + PI)); + v2.ANormalize(); + float3 v3 = v2 - v1; + sunOrbitRad = v3.Length() / 2.0f; +@@ -137,7 +137,7 @@ + } else { + // new: newLightDir is center position of orbit, and newLightDir.w is orbit height + sunOrbitHeight = std::max(-1.0f, std::min(newLightDir.w, 1.0f)); +- sunOrbitRad = sqrt(1.0f - sunOrbitHeight * sunOrbitHeight); ++ sunOrbitRad = math::sqrt(1.0f - sunOrbitHeight * sunOrbitHeight); + } + + sunRotation.LoadIdentity(); +diff -ru spring_89.0/rts/Rendering/GL/glExtra.cpp /home/svenstaro/src/spring/rts/Rendering/GL/glExtra.cpp +--- spring_89.0/rts/Rendering/GL/glExtra.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/GL/glExtra.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -83,7 +83,7 @@ + float adjustment = rad/2; + float ydiff = 0; + int j; +- for(j = 0; j < 50 && fabs(adjRadius - rad) + ydiff > .01*rad; j++){ ++ for(j = 0; j < 50 && math::fabs(adjRadius - rad) + ydiff > .01*rad; j++){ + if(adjRadius > rad) { + rad += adjustment; + } else { +@@ -93,7 +93,7 @@ + pos.x = center.x + (sinR * rad); + pos.z = center.z + (cosR * rad); + float newY = ground->GetHeightAboveWater(pos.x, pos.z, false); +- ydiff = fabs(pos.y - newY); ++ ydiff = math::fabs(pos.y - newY); + pos.y = newY; + heightDiff = (pos.y - center.y); + adjRadius = weapon ? weapon->GetRange2D(heightDiff*weapon->heightMod) : rad; +diff -ru spring_89.0/rts/Rendering/GroundDecalHandler.cpp /home/svenstaro/src/spring/rts/Rendering/GroundDecalHandler.cpp +--- spring_89.0/rts/Rendering/GroundDecalHandler.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/GroundDecalHandler.cpp 2012-07-13 06:34:43.082727161 +0200 +@@ -963,7 +963,7 @@ + radius = damage * 0.25f; + + if (damage > 400) +- damage = 400 + sqrt(damage - 399); ++ damage = 400 + math::sqrt(damage - 399); + + pos.ClampInBounds(); + +diff -ru spring_89.0/rts/Rendering/InMapDrawView.cpp /home/svenstaro/src/spring/rts/Rendering/InMapDrawView.cpp +--- spring_89.0/rts/Rendering/InMapDrawView.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/InMapDrawView.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -38,7 +38,7 @@ + for (int y = 0; y < 64; y++) { + // circular thingy + for (int x = 0; x < 64; x++) { +- float dist = sqrt((float)(x - 32) * (x - 32) + (y - 32) * (y - 32)); ++ float dist = math::sqrt((float)(x - 32) * (x - 32) + (y - 32) * (y - 32)); + if (dist > 31.0f) { + // do nothing - leave transparent + } else if (dist > 30.0f) { +diff -ru spring_89.0/rts/Rendering/LineDrawer.cpp /home/svenstaro/src/spring/rts/Rendering/LineDrawer.cpp +--- spring_89.0/rts/Rendering/LineDrawer.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/LineDrawer.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -29,7 +29,7 @@ + void CLineDrawer::UpdateLineStipple() + { + stippleTimer += (globalRendering->lastFrameTime * cmdColors.StippleSpeed()); +- stippleTimer = fmod(stippleTimer, (16.0f / 20.0f)); ++ stippleTimer = math::fmod(stippleTimer, (16.0f / 20.0f)); + } + + +diff -ru spring_89.0/rts/Rendering/Models/S3OParser.cpp /home/svenstaro/src/spring/rts/Rendering/Models/S3OParser.cpp +--- spring_89.0/rts/Rendering/Models/S3OParser.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Rendering/Models/S3OParser.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -319,7 +319,7 @@ + float3& t = tTangents[vrtIdx]; + int h = 1; + +- if (isnan(n.x) || isnan(n.y) || isnan(n.z)) { ++ if (math::isnan(n.x) || math::isnan(n.y) || math::isnan(n.z)) { + n = float3(0.0f, 0.0f, 1.0f); + } + if (s == ZeroVector) { s = float3(1.0f, 0.0f, 0.0f); } +diff -ru spring_89.0/rts/Sim/Misc/LosMap.cpp /home/svenstaro/src/spring/rts/Sim/Misc/LosMap.cpp +--- spring_89.0/rts/Sim/Misc/LosMap.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Misc/LosMap.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -182,7 +182,7 @@ + + y = (int)i; + x = 1; +- y = (int) (sqrt((float)r2 - 1) + 0.5f); ++ y = (int) (math::sqrt((float)r2 - 1) + 0.5f); + while (x < y) { + if(!PaintTable[x+y*Radius]) { + DrawLine(PaintTable, x, y, Radius); +@@ -198,7 +198,7 @@ + } + + x += 1; +- y = (int) (sqrt((float)r2 - x*x) + 0.5f); ++ y = (int) (math::sqrt((float)r2 - x*x) + 0.5f); + } + if (x == y) { + if(!PaintTable[x+y*Radius]) { +diff -ru spring_89.0/rts/Sim/Misc/QuadField.cpp /home/svenstaro/src/spring/rts/Sim/Misc/QuadField.cpp +--- spring_89.0/rts/Sim/Misc/QuadField.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Misc/QuadField.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -329,12 +329,12 @@ + float zp = start.z; + const float invQuadSize = 1.0f / QUAD_SIZE; + +- if ((floor(start.x * invQuadSize) == floor(to.x * invQuadSize)) && +- (floor(start.z * invQuadSize) == floor(to.z * invQuadSize))) ++ if ((math::floor(start.x * invQuadSize) == math::floor(to.x * invQuadSize)) && ++ (math::floor(start.z * invQuadSize) == math::floor(to.z * invQuadSize))) + { + *endQuad = ((int(start.x * invQuadSize)) + (int(start.z * invQuadSize)) * numQuadsX); + ++endQuad; +- } else if (floor(start.x * invQuadSize) == floor(to.x * invQuadSize)) { ++ } else if (math::floor(start.x * invQuadSize) == math::floor(to.x * invQuadSize)) { + const int first = (int)(start.x * invQuadSize) + ((int)(start.z * invQuadSize) * numQuadsX); + const int last = (int)(to.x * invQuadSize) + ((int)(to.z * invQuadSize) * numQuadsX); + +@@ -347,7 +347,7 @@ + *endQuad = a; ++endQuad; + } + } +- } else if (floor(start.z * invQuadSize) == floor(to.z * invQuadSize)) { ++ } else if (math::floor(start.z * invQuadSize) == math::floor(to.z * invQuadSize)) { + const int first = (int)(start.x * invQuadSize) + ((int)(start.z * invQuadSize) * numQuadsX); + const int last = (int)(to.x * invQuadSize) + ((int)(to.z * invQuadSize) * numQuadsX); + +@@ -369,14 +369,14 @@ + ++endQuad; + + if (dx > 0) { +- xn = (floor(xp * invQuadSize) * QUAD_SIZE + QUAD_SIZE - xp) / dx; ++ xn = (math::floor(xp * invQuadSize) * QUAD_SIZE + QUAD_SIZE - xp) / dx; + } else { +- xn = (floor(xp * invQuadSize) * QUAD_SIZE - xp) / dx; ++ xn = (math::floor(xp * invQuadSize) * QUAD_SIZE - xp) / dx; + } + if (dz > 0) { +- zn = (floor(zp * invQuadSize) * QUAD_SIZE + QUAD_SIZE - zp) / dz; ++ zn = (math::floor(zp * invQuadSize) * QUAD_SIZE + QUAD_SIZE - zp) / dz; + } else { +- zn = (floor(zp * invQuadSize) * QUAD_SIZE - zp) / dz; ++ zn = (math::floor(zp * invQuadSize) * QUAD_SIZE - zp) / dz; + } + + if (xn < zn) { +@@ -388,8 +388,8 @@ + } + + keepgoing = +- (fabs(xp - start.x) < fabs(to.x - start.x)) && +- (fabs(zp - start.z) < fabs(to.z - start.z)); ++ (math::fabs(xp - start.x) < math::fabs(to.x - start.x)) && ++ (math::fabs(zp - start.z) < math::fabs(to.z - start.z)); + } + } + +diff -ru spring_89.0/rts/Sim/MoveTypes/ClassicGroundMoveType.cpp /home/svenstaro/src/spring/rts/Sim/MoveTypes/ClassicGroundMoveType.cpp +--- spring_89.0/rts/Sim/MoveTypes/ClassicGroundMoveType.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/MoveTypes/ClassicGroundMoveType.cpp 2012-07-13 06:34:43.256060504 +0200 +@@ -386,7 +386,7 @@ + + const float dif = wSpeed - currentSpeed; + +- if (fabs(dif) < 0.05f) { ++ if (math::fabs(dif) < 0.05f) { + deltaSpeed = dif * 0.125f; + nextDeltaSpeedUpdate = gs->frameNum + 8; + } else if (dif > 0.0f) { +@@ -529,7 +529,7 @@ + skidRotSpeed = 0.0f; + owner->physicalState = oldPhysState; + owner->moveType->useHeading = true; +- float rp = floor(skidRotPos2 + skidRotSpeed2 + 0.5f); ++ float rp = math::floor(skidRotPos2 + skidRotSpeed2 + 0.5f); + skidRotSpeed2 = (rp - skidRotPos2) * 0.5f; + ChangeHeading(owner->heading); + } else { +@@ -545,10 +545,10 @@ + } + + float remTime=speedf/speedReduction-1; +- float rp=floor(skidRotPos2+skidRotSpeed2*remTime+0.5f); ++ float rp=math::floor(skidRotPos2+skidRotSpeed2*remTime+0.5f); + skidRotSpeed2=(remTime+1 == 0 ) ? 0 : (rp-skidRotPos2)/(remTime+1); + +- if(floor(skidRotPos2)!=floor(skidRotPos2+skidRotSpeed2)){ ++ if(math::floor(skidRotPos2)!=math::floor(skidRotPos2+skidRotSpeed2)){ + skidRotPos2=0; + skidRotSpeed2=0; + } +@@ -571,7 +571,7 @@ + speed*=0.95f; + } + else { +- speed += (normal*(fabs(speed.dot(normal)) + .1))*1.9f; ++ speed += (normal*(math::fabs(speed.dot(normal)) + .1))*1.9f; + speed*=.8; + } + } +@@ -625,7 +625,7 @@ + float totRad = owner->radius + u->radius; + + if (sqDist < totRad * totRad && sqDist != 0) { +- float dist = sqrt(sqDist); ++ float dist = math::sqrt(sqDist); + float3 dif = midPos - u->midPos; + dif /= std::max(dist, 1.f); + +@@ -682,7 +682,7 @@ + float sqDist=(midPos-u->midPos).SqLength(); + float totRad=owner->radius+u->radius; + if(sqDist<totRad*totRad && sqDist!=0){ +- float dist=sqrt(sqDist); ++ float dist=math::sqrt(sqDist); + float3 dif=midPos-u->midPos; + dif/=std::max(dist, 1.f); + float impactSpeed = -owner->speed.dot(dif); +@@ -721,8 +721,8 @@ + + skidRotPos2 += skidRotSpeed2; + +- float cosp = cos(skidRotPos2 * PI * 2.0f); +- float sinp = sin(skidRotPos2 * PI * 2.0f); ++ float cosp = math::cos(skidRotPos2 * PI * 2.0f); ++ float sinp = math::sin(skidRotPos2 * PI * 2.0f); + + float3 f1 = skidRotVector * skidRotVector.dot(owner->frontdir); + float3 f2 = owner->frontdir - f1; +@@ -812,7 +812,7 @@ + float objectDistToAvoidDirCenter = objectToUnit.dot(rightOfAvoid); + + if (objectToUnit.dot(avoidanceDir) < radiusSum && +- fabs(objectDistToAvoidDirCenter) < radiusSum && ++ math::fabs(objectDistToAvoidDirCenter) < radiusSum && + (o->moveDef || Distance2D(owner, o) >= 0)) { + + if (objectDistToAvoidDirCenter > 0.0f) { +@@ -824,7 +824,7 @@ + rightOfAvoid = avoidanceDir.cross(float3(0.0f, 1.0f, 0.0f)); + } else { + avoidLeft += +- (radiusSum - fabs(objectDistToAvoidDirCenter)) * ++ (radiusSum - math::fabs(objectDistToAvoidDirCenter)) * + AVOIDANCE_STRENGTH * fastmath::isqrt2(distanceToObjectSq); + avoidanceDir -= (rightOfAvoid * avoidLeft); + avoidanceDir.Normalize(); +@@ -952,7 +952,7 @@ + if (!decRate) { + return 0.0f; + } +- return fabs(speed*speed / decRate); ++ return math::fabs(speed*speed / decRate); + } + + float3 CClassicGroundMoveType::Here() +@@ -1043,7 +1043,7 @@ + const float zmove = (owner->mapPos.y + owner->zsize / 2) * SQUARE_SIZE; + const float xmove = (owner->mapPos.x + owner->xsize / 2) * SQUARE_SIZE; + +- if (fabs(owner->frontdir.x) > fabs(owner->frontdir.z)) { ++ if (math::fabs(owner->frontdir.x) > math::fabs(owner->frontdir.z)) { + if (newmp.y < owner->mapPos.y) { + haveCollided |= CheckColV(newmp.y, newmp.x, newmp.x + owner->xsize - 1, zmove - 3.99f, owner->mapPos.y); + newmp = owner->GetMapPos(); +@@ -1261,20 +1261,20 @@ + float xp = start.x; + float zp = start.z; + +- if (floor(start.x) == floor(to.x)) { ++ if (math::floor(start.x) == math::floor(to.x)) { + if (dz > 0.0f) { +- for (int a = 1; a < floor(to.z); ++a) ++ for (int a = 1; a < math::floor(to.z); ++a) + lineTable[yt][xt].push_back(int2(0, a)); + } else { +- for (int a = -1; a > floor(to.z); --a) ++ for (int a = -1; a > math::floor(to.z); --a) + lineTable[yt][xt].push_back(int2(0, a)); + } +- } else if (floor(start.z) == floor(to.z)) { ++ } else if (math::floor(start.z) == math::floor(to.z)) { + if (dx > 0.0f) { +- for (int a = 1; a < floor(to.x); ++a) ++ for (int a = 1; a < math::floor(to.x); ++a) + lineTable[yt][xt].push_back(int2(a, 0)); + } else { +- for (int a = -1; a > floor(to.x); --a) ++ for (int a = -1; a > math::floor(to.x); --a) + lineTable[yt][xt].push_back(int2(a, 0)); + } + } else { +@@ -1283,14 +1283,14 @@ + + while (keepgoing) { + if (dx > 0.0f) { +- xn = (floor(xp) + 1.0f - xp) / dx; ++ xn = (math::floor(xp) + 1.0f - xp) / dx; + } else { +- xn = (floor(xp) - xp) / dx; ++ xn = (math::floor(xp) - xp) / dx; + } + if (dz > 0.0f) { +- zn = (floor(zp) + 1.0f - zp) / dz; ++ zn = (math::floor(zp) + 1.0f - zp) / dz; + } else { +- zn = (floor(zp) - zp) / dz; ++ zn = (math::floor(zp) - zp) / dz; + } + + if (xn < zn) { +@@ -1302,10 +1302,10 @@ + } + + keepgoing = +- fabs(xp - start.x) < fabs(to.x - start.x) && +- fabs(zp - start.z) < fabs(to.z - start.z); ++ math::fabs(xp - start.x) < math::fabs(to.x - start.x) && ++ math::fabs(zp - start.z) < math::fabs(to.z - start.z); + +- lineTable[yt][xt].push_back( int2(int(floor(xp)), int(floor(zp))) ); ++ lineTable[yt][xt].push_back( int2(int(math::floor(xp)), int(math::floor(zp))) ); + } + + lineTable[yt][xt].pop_back(); +@@ -1335,7 +1335,7 @@ + const MoveDef& md = *(owner->unitDef->moveDef); + const float cmod = movemath->GetPosSpeedMod(md, moveSquareX * 2, moveSquareY * 2); + +- if (fabs(owner->frontdir.x) < fabs(owner->frontdir.z)) { ++ if (math::fabs(owner->frontdir.x) < math::fabs(owner->frontdir.z)) { + if (newMoveSquareX > moveSquareX) { + const float nmod = movemath->GetPosSpeedMod(md, newMoveSquareX * 2, newMoveSquareY * 2); + if (cmod > 0.01f && nmod <= 0.01f) { +diff -ru spring_89.0/rts/Sim/MoveTypes/GroundMoveType.cpp /home/svenstaro/src/spring/rts/Sim/MoveTypes/GroundMoveType.cpp +--- spring_89.0/rts/Sim/MoveTypes/GroundMoveType.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/MoveTypes/GroundMoveType.cpp 2012-07-13 06:34:43.249393836 +0200 +@@ -1808,20 +1808,20 @@ + float xp = start.x; + float zp = start.z; + +- if (floor(start.x) == floor(to.x)) { ++ if (math::floor(start.x) == math::floor(to.x)) { + if (dz > 0.0f) { +- for (int a = 1; a <= floor(to.z); ++a) ++ for (int a = 1; a <= math::floor(to.z); ++a) + lineTable[yt][xt].push_back(int2(0, a)); + } else { +- for (int a = -1; a >= floor(to.z); --a) ++ for (int a = -1; a >= math::floor(to.z); --a) + lineTable[yt][xt].push_back(int2(0, a)); + } +- } else if (floor(start.z) == floor(to.z)) { ++ } else if (math::floor(start.z) == math::floor(to.z)) { + if (dx > 0.0f) { +- for (int a = 1; a <= floor(to.x); ++a) ++ for (int a = 1; a <= math::floor(to.x); ++a) + lineTable[yt][xt].push_back(int2(a, 0)); + } else { +- for (int a = -1; a >= floor(to.x); --a) ++ for (int a = -1; a >= math::floor(to.x); --a) + lineTable[yt][xt].push_back(int2(a, 0)); + } + } else { +@@ -1830,14 +1830,14 @@ + + while (keepgoing) { + if (dx > 0.0f) { +- xn = (floor(xp) + 1.0f - xp) / dx; ++ xn = (math::floor(xp) + 1.0f - xp) / dx; + } else { +- xn = (floor(xp) - xp) / dx; ++ xn = (math::floor(xp) - xp) / dx; + } + if (dz > 0.0f) { +- zn = (floor(zp) + 1.0f - zp) / dz; ++ zn = (math::floor(zp) + 1.0f - zp) / dz; + } else { +- zn = (floor(zp) - zp) / dz; ++ zn = (math::floor(zp) - zp) / dz; + } + + if (xn < zn) { +@@ -1851,7 +1851,7 @@ + keepgoing = + math::fabs(xp - start.x) <= math::fabs(to.x - start.x) && + math::fabs(zp - start.z) <= math::fabs(to.z - start.z); +- int2 pt(int(floor(xp)), int(floor(zp))); ++ int2 pt(int(math::floor(xp)), int(math::floor(zp))); + + static const int MIN_IDX = -int(LINETABLE_SIZE / 2); + static const int MAX_IDX = -MIN_IDX; +diff -ru spring_89.0/rts/Sim/MoveTypes/HoverAirMoveType.cpp /home/svenstaro/src/spring/rts/Sim/MoveTypes/HoverAirMoveType.cpp +--- spring_89.0/rts/Sim/MoveTypes/HoverAirMoveType.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/MoveTypes/HoverAirMoveType.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -325,7 +325,7 @@ + { + #define NOZERO(x) std::max(x, 0.0001f) + +- const float driftSpeed = fabs(owner->unitDef->dlHoverFactor); ++ const float driftSpeed = math::fabs(owner->unitDef->dlHoverFactor); + float3 deltaVec = goalPos - owner->pos; + float3 deltaDir = float3(deltaVec.x, 0.0f, deltaVec.z); + float l = NOZERO(deltaDir.Length2D()); +@@ -342,7 +342,7 @@ + deltaDir -= owner->speed; + l = deltaDir.SqLength2D(); + if (l > (maxSpeed * maxSpeed)) { +- deltaDir *= maxSpeed / NOZERO(sqrt(l)); ++ deltaDir *= maxSpeed / NOZERO(math::sqrt(l)); + } + wantedSpeed = owner->speed + deltaDir; + +diff -ru spring_89.0/rts/Sim/MoveTypes/StrafeAirMoveType.cpp /home/svenstaro/src/spring/rts/Sim/MoveTypes/StrafeAirMoveType.cpp +--- spring_89.0/rts/Sim/MoveTypes/StrafeAirMoveType.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/MoveTypes/StrafeAirMoveType.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -412,7 +412,7 @@ + } + } + +- if (fabs(owner->rightdir.y) < maxAileron * 3.0f * speedf || owner->updir.y < 0.0f) { ++ if (math::fabs(owner->rightdir.y) < maxAileron * 3.0f * speedf || owner->updir.y < 0.0f) { + elevator = 1; + } + UpdateAirPhysics(0, aileron, elevator, 1, owner->frontdir); +@@ -528,13 +528,13 @@ + if (goalDir.dot(frontdir) < -0.2f + inefficientAttackTime * 0.002f && frontdir.y > -0.2f && speedf > 2.0f && gs->randFloat() > 0.996f) + maneuver = 1; + +- if (goalDir.dot(frontdir) < -0.2f + inefficientAttackTime * 0.002f && fabs(frontdir.y) < 0.2f && gs->randFloat() > 0.996f && gHeightAW + 400 < pos.y) { ++ if (goalDir.dot(frontdir) < -0.2f + inefficientAttackTime * 0.002f && math::fabs(frontdir.y) < 0.2f && gs->randFloat() > 0.996f && gHeightAW + 400 < pos.y) { + maneuver = 2; + maneuverSubState = 0; + } + + // roll +- if (speedf > 0.45f && pos.y + owner->speed.y * 60 * fabs(frontdir.y) + std::min(0.0f, float(updir.y)) * 150 > gHeightAW + 60 + fabs(rightdir.y) * 150) { ++ if (speedf > 0.45f && pos.y + owner->speed.y * 60 * math::fabs(frontdir.y) + std::min(0.0f, float(updir.y)) * 150 > gHeightAW + 60 + math::fabs(rightdir.y) * 150) { + const float goalBankDif = goalDotRight + rightdir.y * 0.2f; + if (goalBankDif > maxAileron * speedf * 4.0f) { + aileron = 1; +@@ -706,7 +706,7 @@ + } else if (goalBankDif < -maxAileron * speedf * 4 && rightdir.y < maxBank) { + aileron = -1; + } else { +- if (fabs(rightdir.y) < maxBank) { ++ if (math::fabs(rightdir.y) < maxBank) { + aileron = goalBankDif / (maxAileron * speedf * 4); + } else { + if (rightdir.y < 0.0f && goalBankDif < 0.0f) { +@@ -762,7 +762,7 @@ + } else if (hdif > (maxElevator * speedf * speedf * 20) && frontdir.y < maxPitch) { + elevator = 1; + } else { +- if (fabs(frontdir.y) < maxPitch) ++ if (math::fabs(frontdir.y) < maxPitch) + elevator = hdif / (maxElevator * speedf * speedf * 20); + } + } +diff -ru spring_89.0/rts/Sim/Path/Default/PathEstimator.cpp /home/svenstaro/src/spring/rts/Sim/Path/Default/PathEstimator.cpp +--- spring_89.0/rts/Sim/Path/Default/PathEstimator.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Path/Default/PathEstimator.cpp 2012-07-13 06:34:42.939393819 +0200 +@@ -201,7 +201,7 @@ + + void CPathEstimator::CalcOffsetsAndPathCosts(int thread) { + //! reset FPU state for synced computations +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + + // NOTE: EstimatePathCosts() [B] is temporally dependent on CalculateBlockOffsets() [A], + // A must be completely finished before B_i can be safely called. This means we cannot +diff -ru spring_89.0/rts/Sim/Path/QTPFS/PathManager.cpp /home/svenstaro/src/spring/rts/Sim/Path/QTPFS/PathManager.cpp +--- spring_89.0/rts/Sim/Path/QTPFS/PathManager.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Path/QTPFS/PathManager.cpp 2012-07-13 06:34:43.016060490 +0200 +@@ -251,7 +251,7 @@ + + + void QTPFS::PathManager::InitNodeLayersThreaded(const SRectangle& rect) { +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + + char loadMsg[512] = {'\0'}; + const char* fmtString = "[PathManager::%s] using %u threads for %u node-layers (cached? %s)"; +@@ -310,7 +310,7 @@ + } + #endif + +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + } + + void QTPFS::PathManager::InitNodeLayersThread( +@@ -360,7 +360,7 @@ + + + void QTPFS::PathManager::UpdateNodeLayersThreaded(const SRectangle& rect) { +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + + #ifdef QTPFS_OPENMP_ENABLED + { +@@ -375,7 +375,7 @@ + } + #endif + +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + } + + void QTPFS::PathManager::UpdateNodeLayersThread( +@@ -569,7 +569,7 @@ + SCOPED_TIMER("PathManager::Update"); + + #ifdef QTPFS_ENABLE_THREADED_UPDATE +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + + // allow ThreadUpdate to run one iteration + condThreadUpdate->notify_one(); +@@ -579,7 +579,7 @@ + // wait for the ThreadUpdate iteration to finish + condThreadUpdated->wait(lock); + +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + #else + ThreadUpdate(); + #endif +diff -ru spring_89.0/rts/Sim/Projectiles/ExplosionGenerator.cpp /home/svenstaro/src/spring/rts/Sim/Projectiles/ExplosionGenerator.cpp +--- spring_89.0/rts/Sim/Projectiles/ExplosionGenerator.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Projectiles/ExplosionGenerator.cpp 2012-07-13 06:34:43.082727161 +0200 +@@ -262,7 +262,7 @@ + damage *= gfxMod; + damage = std::max(damage, 0.0f); + +- const float sqrtDmg = sqrt(damage); ++ const float sqrtDmg = math::sqrt(damage); + const float camLength = camVect.Length(); + float moveLength = radius * 0.03f; + +@@ -283,7 +283,7 @@ + if (airExplosion || waterExplosion) { smokeDamage *= 0.6f; } + + if (smokeDamage > 0.01f) { +- smokeDamageSQRT = sqrt(smokeDamage); ++ smokeDamageSQRT = math::sqrt(smokeDamage); + smokeDamageISQRT = 1.0f / (smokeDamageSQRT * 0.35f); + } + +@@ -507,17 +507,17 @@ + } + case OP_SAWTOOTH: { + // this translates to modulo except it works with floats +- val -= (*(float*) code) * floor(val / (*(float*) code)); ++ val -= (*(float*) code) * math::floor(val / (*(float*) code)); + code += 4; + break; + } + case OP_DISCRETE: { +- val = (*(float*) code) * floor(val / (*(float*) code)); ++ val = (*(float*) code) * math::floor(val / (*(float*) code)); + code += 4; + break; + } + case OP_SINE: { +- val = (*(float*) code) * sin(val); ++ val = (*(float*) code) * math::sin(val); + code += 4; + break; + } +@@ -538,12 +538,12 @@ + break; + } + case OP_POW: { +- val = pow(val, (*(float*) code)); ++ val = math::pow(val, (*(float*) code)); + code += 4; + break; + } + case OP_POWBUFF: { +- val = pow(val, buffer[(*(int*) code)]); ++ val = math::pow(val, buffer[(*(int*) code)]); + code += 4; + break; + } +diff -ru spring_89.0/rts/Sim/Projectiles/PieceProjectile.cpp /home/svenstaro/src/spring/rts/Sim/Projectiles/PieceProjectile.cpp +--- spring_89.0/rts/Sim/Projectiles/PieceProjectile.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Projectiles/PieceProjectile.cpp 2012-07-13 06:34:43.069393827 +0200 +@@ -111,7 +111,7 @@ + oldSmokeDir.Normalize(); + const float3 camDir = (pos - camera->pos).Normalize(); + +- if (camera->pos.distance(pos) + (1 - fabs(camDir.dot(oldSmokeDir))) * 3000 < 200) { ++ if (camera->pos.distance(pos) + (1 - math::fabs(camDir.dot(oldSmokeDir))) * 3000 < 200) { + drawTrail = false; + } + +@@ -334,7 +334,7 @@ + + if (!drawTrail) { + float3 camDir = (pos - camera->pos).Normalize(); +- if (camera->pos.distance(pos) + (1 - fabs(camDir.dot(dir))) * 3000 > 300) { ++ if (camera->pos.distance(pos) + (1 - math::fabs(camDir.dot(dir))) * 3000 > 300) { + drawTrail = true; + } + } +@@ -373,7 +373,7 @@ + const float3 dif2 = (oldSmokePos - camera->pos).Normalize(); + const float3 dir2 = (dif2.cross(oldSmokeDir)).Normalize(); + +- float a1 = ((1 - 0.0f / (Smoke_Time)) * 255) * (0.7f + fabs(dif.dot(dir))); ++ float a1 = ((1 - 0.0f / (Smoke_Time)) * 255) * (0.7f + math::fabs(dif.dot(dir))); + float alpha = std::min(255.0f, std::max(0.f, a1)); + col[0] = (unsigned char) (color * alpha); + col[1] = (unsigned char) (color * alpha); +@@ -381,7 +381,7 @@ + col[3] = (unsigned char) (alpha); + + unsigned char col2[4]; +- float a2 = ((1 - float(age2) / (Smoke_Time)) * 255) * (0.7f + fabs(dif2.dot(oldSmokeDir))); ++ float a2 = ((1 - float(age2) / (Smoke_Time)) * 255) * (0.7f + math::fabs(dif2.dot(oldSmokeDir))); + + if (age < 8) + a2 = 0; +diff -ru spring_89.0/rts/Sim/Projectiles/Unsynced/SimpleParticleSystem.cpp /home/svenstaro/src/spring/rts/Sim/Projectiles/Unsynced/SimpleParticleSystem.cpp +--- spring_89.0/rts/Sim/Projectiles/Unsynced/SimpleParticleSystem.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Projectiles/Unsynced/SimpleParticleSystem.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -188,7 +188,7 @@ + particles[i].size = particleSize + gu->usRandFloat()*particleSizeSpread; + particles[i].pos = pos; + +- particles[i].speed = ((up * emitMul.y) * cos(ay) - ((right * emitMul.x) * cos(az) - (forward * emitMul.z) * sin(az)) * sin(ay)) * (particleSpeed + (gu->usRandFloat() * particleSpeedSpread)); ++ particles[i].speed = ((up * emitMul.y) * math::cos(ay) - ((right * emitMul.x) * math::cos(az) - (forward * emitMul.z) * math::sin(az)) * math::sin(ay)) * (particleSpeed + (gu->usRandFloat() * particleSpeedSpread)); + } + + drawRadius = (particleSpeed + particleSpeedSpread) * (particleLife * particleLifeSpread); +@@ -232,7 +232,7 @@ + const float az = gu->usRandFloat() * 2 * PI; + const float ay = (emitRot + emitRotSpread*gu->usRandFloat()) * (PI / 180.0); + +- float3 pspeed = ((up * emitMul.y) * cos(ay) - ((right * emitMul.x) * cos(az) - (forward * emitMul.z) * sin(az)) * sin(ay)) * (particleSpeed + (gu->usRandFloat() * particleSpeedSpread)); ++ float3 pspeed = ((up * emitMul.y) * math::cos(ay) - ((right * emitMul.x) * math::cos(az) - (forward * emitMul.z) * math::sin(az)) * math::sin(ay)) * (particleSpeed + (gu->usRandFloat() * particleSpeedSpread)); + + CGenericParticleProjectile* particle = new CGenericParticleProjectile(pos + explosionPos, pspeed, owner); + +diff -ru spring_89.0/rts/Sim/Projectiles/Unsynced/SmokeTrailProjectile.cpp /home/svenstaro/src/spring/rts/Sim/Projectiles/Unsynced/SmokeTrailProjectile.cpp +--- spring_89.0/rts/Sim/Projectiles/Unsynced/SmokeTrailProjectile.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Projectiles/Unsynced/SmokeTrailProjectile.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -124,7 +124,7 @@ + if (lastSegment) { + a1 = 0; + } +- a1 *= 0.7f + fabs(dif1.dot(dir1)); ++ a1 *= 0.7f + math::fabs(dif1.dot(dir1)); + float alpha = std::min(255.f, std::max(0.f, a1)); + col[0] = (unsigned char) (color * alpha); + col[1] = (unsigned char) (color * alpha); +@@ -136,7 +136,7 @@ + if (firstSegment) { + a2 = 0; + } +- a2 *= 0.7f + fabs(dif2.dot(dir2)); ++ a2 *= 0.7f + math::fabs(dif2.dot(dir2)); + alpha = std::min(255.f, std::max(0.0f, a2)); + col2[0] = (unsigned char) (color * alpha); + col2[1] = (unsigned char) (color * alpha); +@@ -153,7 +153,7 @@ + + unsigned char col3[4]; + float a2 = (1 - (float)(age + 4) / lifeTime) * 255; +- a2 *= 0.7f + fabs(dif3.dot(middir)); ++ a2 *= 0.7f + math::fabs(dif3.dot(middir)); + alpha = std::min(255.0f, std::max(0.0f, a2)); + col3[0] = (unsigned char) (color * alpha); + col3[1] = (unsigned char) (color * alpha); +diff -ru spring_89.0/rts/Sim/Projectiles/Unsynced/SpherePartProjectile.cpp /home/svenstaro/src/spring/rts/Sim/Projectiles/Unsynced/SpherePartProjectile.cpp +--- spring_89.0/rts/Sim/Projectiles/Unsynced/SpherePartProjectile.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Projectiles/Unsynced/SpherePartProjectile.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -49,7 +49,7 @@ + const float yp = (y + ypart) / 16.0f*PI - PI/2; + for (int x = 0; x < 5; ++x) { + float xp = (x + xpart) / 32.0f*2*PI; +- vectors[y*5 + x] = float3(sin(xp)*cos(yp), sin(yp), cos(xp)*cos(yp)); ++ vectors[y*5 + x] = float3(math::sin(xp)*math::cos(yp), math::sin(yp), math::cos(xp)*math::cos(yp)); + } + } + pos = centerPos+vectors[12] * sphereSize; +@@ -86,7 +86,7 @@ + float alpha = + baseAlpha * + (1.0f - min(1.0f, float(age + globalRendering->timeOffset) / (float) ttl)) * +- (1.0f - fabs(y + ybase - 8.0f) / 8.0f * 1.0f); ++ (1.0f - math::fabs(y + ybase - 8.0f) / 8.0f * 1.0f); + + col[0] = (unsigned char) (color.x * 255.0f * alpha); + col[1] = (unsigned char) (color.y * 255.0f * alpha); +@@ -94,7 +94,7 @@ + col[3] = ((unsigned char) (40 * alpha)) + 1; + va->AddVertexQTC(centerPos + vectors[y*5 + x] * interSize, texx, texy, col); + va->AddVertexQTC(centerPos + vectors[y*5 + x + 1] * interSize, texx, texy, col); +- alpha = baseAlpha * (1.0f - min(1.0f, (float)(age + globalRendering->timeOffset) / (float) ttl)) * (1 - fabs(y + 1 + ybase - 8.0f) / 8.0f*1.0f); ++ alpha = baseAlpha * (1.0f - min(1.0f, (float)(age + globalRendering->timeOffset) / (float) ttl)) * (1 - math::fabs(y + 1 + ybase - 8.0f) / 8.0f*1.0f); + + col[0] = (unsigned char) (color.x * 255.0f * alpha); + col[1] = (unsigned char) (color.y * 255.0f * alpha); +diff -ru spring_89.0/rts/Sim/Projectiles/Unsynced/WakeProjectile.cpp /home/svenstaro/src/spring/rts/Sim/Projectiles/Unsynced/WakeProjectile.cpp +--- spring_89.0/rts/Sim/Projectiles/Unsynced/WakeProjectile.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Projectiles/Unsynced/WakeProjectile.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -79,7 +79,7 @@ + float interSize = size + sizeExpansion * globalRendering->timeOffset; + float interRot = rotation + rotSpeed * globalRendering->timeOffset; + +- const float3 dir1 = float3(cos(interRot), 0, sin(interRot)) * interSize; ++ const float3 dir1 = float3(math::cos(interRot), 0, math::sin(interRot)) * interSize; + const float3 dir2 = dir1.cross(UpVector); + + #define wt projectileDrawer->waketex +diff -ru spring_89.0/rts/Sim/Projectiles/WeaponProjectiles/MissileProjectile.cpp /home/svenstaro/src/spring/rts/Sim/Projectiles/WeaponProjectiles/MissileProjectile.cpp +--- spring_89.0/rts/Sim/Projectiles/WeaponProjectiles/MissileProjectile.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Projectiles/WeaponProjectiles/MissileProjectile.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -96,7 +96,7 @@ + drawRadius = radius + maxSpeed * 8; + + float3 camDir = (pos - camera->pos).ANormalize(); +- if ((camera->pos.distance(pos) * 0.2f + (1 - fabs(camDir.dot(dir))) * 3000) < 200) { ++ if ((camera->pos.distance(pos) * 0.2f + (1 - math::fabs(camDir.dot(dir))) * 3000) < 200) { + drawTrail = false; + } + +@@ -229,8 +229,8 @@ + // is too close or height difference too large) + const float horDiff = (targPos - pos).Length2D() + 0.01f; + const float verDiff = (targPos.y - pos.y) + 0.01f; +- const float dirDiff = fabs(targetDir.y - dir.y); +- const float ratio = fabs(verDiff / horDiff); ++ const float dirDiff = math::fabs(targetDir.y - dir.y); ++ const float ratio = math::fabs(verDiff / horDiff); + + dir.y -= (dirDiff * ratio); + } else { +@@ -295,7 +295,7 @@ + if (!drawTrail) { + const float3 camDir = (pos - camera->pos).ANormalize(); + +- if ((camera->pos.distance(pos) * 0.2f + (1 - fabs(camDir.dot(dir))) * 3000) > 300) { ++ if ((camera->pos.distance(pos) * 0.2f + (1 - math::fabs(camDir.dot(dir))) * 3000) > 300) { + drawTrail = true; + } + } +@@ -343,7 +343,7 @@ + dir2.ANormalize(); + + float a1 = (1.0f / (SMOKE_TIME)) * 255; +- a1 *= 0.7f + fabs(dif.dot(dir)); ++ a1 *= 0.7f + math::fabs(dif.dot(dir)); + const float alpha1 = std::min(255.0f, std::max(0.0f, a1)); + col[0] = (unsigned char) (color * alpha1); + col[1] = (unsigned char) (color * alpha1); +@@ -357,7 +357,7 @@ + a2 = 0; + } + +- a2 *= 0.7f + fabs(dif2.dot(oldDir)); ++ a2 *= 0.7f + math::fabs(dif2.dot(oldDir)); + const float alpha2 = std::min(255.0f, std::max(0.0f, a2)); + col2[0] = (unsigned char) (color * alpha2); + col2[1] = (unsigned char) (color * alpha2); +diff -ru spring_89.0/rts/Sim/Projectiles/WeaponProjectiles/StarburstProjectile.cpp /home/svenstaro/src/spring/rts/Sim/Projectiles/WeaponProjectiles/StarburstProjectile.cpp +--- spring_89.0/rts/Sim/Projectiles/WeaponProjectiles/StarburstProjectile.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Projectiles/WeaponProjectiles/StarburstProjectile.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -90,13 +90,13 @@ + } + } + +- maxGoodDif = cos(tracking * 0.6f); ++ maxGoodDif = math::cos(tracking * 0.6f); + curSpeed = speed.Length(); + dir = speed / curSpeed; + oldSmokeDir = dir; + + const float3 camDir = (pos - camera->pos).ANormalize(); +- const float camDist = (camera->pos.distance(pos) * 0.2f) + ((1.0f - fabs(camDir.dot(dir))) * 3000); ++ const float camDist = (camera->pos.distance(pos) * 0.2f) + ((1.0f - math::fabs(camDir.dot(dir))) * 3000); + + drawTrail = (camDist >= 200.0f); + drawRadius = maxSpeed * 8.0f; +@@ -304,7 +304,7 @@ + + if (!drawTrail) { + const float3 camDir = (pos - camera->pos).ANormalize(); +- const float camDist = (camera->pos.distance(pos) * 0.2f + (1 - fabs(camDir.dot(dir))) * 3000); ++ const float camDist = (camera->pos.distance(pos) * 0.2f + (1 - math::fabs(camDir.dot(dir))) * 3000); + + drawTrail = (camDist > 300.0f); + } +@@ -335,11 +335,11 @@ + + const float a1 = + ((1.0f - (0.0f / SMOKE_TIME)) * 255) * +- (0.7f + fabs(dif1.dot(dir))); ++ (0.7f + math::fabs(dif1.dot(dir))); + const float a2 = + (age < 8)? 0.0f: + ((1.0f - (age2 / SMOKE_TIME)) * 255) * +- (0.7f + fabs(dif2.dot(oldSmokeDir))); ++ (0.7f + math::fabs(dif2.dot(oldSmokeDir))); + const int alpha1 = std::min(255, (int) std::max(0.0f, a1)); + const int alpha2 = std::min(255, (int) std::max(0.0f, a2)); + +diff -ru spring_89.0/rts/Sim/Projectiles/WeaponProjectiles/WeaponProjectile.cpp /home/svenstaro/src/spring/rts/Sim/Projectiles/WeaponProjectiles/WeaponProjectile.cpp +--- spring_89.0/rts/Sim/Projectiles/WeaponProjectiles/WeaponProjectile.cpp 2012-07-10 00:10:07.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Projectiles/WeaponProjectiles/WeaponProjectile.cpp 2012-07-13 06:34:43.249393836 +0200 +@@ -252,8 +252,8 @@ + const float dot = speed.dot(normal); + + pos -= speed; +- speed -= (speed + normal * fabs(dot)) * (1 - weaponDef->bounceSlip); +- speed += (normal * (fabs(dot))) * (1 + weaponDef->bounceRebound); ++ speed -= (speed + normal * math::fabs(dot)) * (1 - weaponDef->bounceSlip); ++ speed += (normal * (math::fabs(dot))) * (1 + weaponDef->bounceRebound); + pos += speed; + + if (weaponDef->bounceExplosionGenerator) { +diff -ru spring_89.0/rts/Sim/Units/CommandAI/MobileCAI.cpp /home/svenstaro/src/spring/rts/Sim/Units/CommandAI/MobileCAI.cpp +--- spring_89.0/rts/Sim/Units/CommandAI/MobileCAI.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Units/CommandAI/MobileCAI.cpp 2012-07-13 06:34:43.079393827 +0200 +@@ -770,7 +770,7 @@ + b2 = w->TryTargetRotate(orderTarget, c.GetID() == CMD_MANUALFIRE); + b3 = Square(w->range - (w->relWeaponPos).Length()) > (orderTarget->pos.SqDistance(owner->pos)); + b4 = w->TryTargetHeading(GetHeadingFromVector(-diff.x, -diff.z), orderTarget->pos, orderTarget != NULL, orderTarget); +- edgeFactor = fabs(w->targetBorder); ++ edgeFactor = math::fabs(w->targetBorder); + } + + const float diffLength2D = diff.Length2D(); +diff -ru spring_89.0/rts/Sim/Units/CommandAI/TransportCAI.cpp /home/svenstaro/src/spring/rts/Sim/Units/CommandAI/TransportCAI.cpp +--- spring_89.0/rts/Sim/Units/CommandAI/TransportCAI.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Units/CommandAI/TransportCAI.cpp 2012-07-13 06:34:43.079393827 +0200 +@@ -349,7 +349,7 @@ + if (rx <= spread) + continue; + +- rx = sqrt(rx); ++ rx = math::sqrt(rx); + + const float minx = std::max( spread, center.x - rx); + const float maxx = std::min(float(gs->mapx * SQUARE_SIZE - spread), center.x + rx); +@@ -676,7 +676,7 @@ + am->ForceHeading(unloadHeading); + am->maxDrift = 1; + if ((owner->pos.SqDistance(pos) < 64) && +- (owner->updir.dot(UpVector) > 0.99f) && fabs(owner->heading - unloadHeading) < AIRTRANSPORT_DOCKING_ANGLE) { ++ (owner->updir.dot(UpVector) > 0.99f) && math::fabs(owner->heading - unloadHeading) < AIRTRANSPORT_DOCKING_ANGLE) { + if (!SpotIsClearIgnoreSelf(pos, unit)) { + // chosen spot is no longer clear to land, choose a new one + // if a new spot cannot be found, don't unload at all +diff -ru spring_89.0/rts/Sim/Units/UnitDef.cpp /home/svenstaro/src/spring/rts/Sim/Units/UnitDef.cpp +--- spring_89.0/rts/Sim/Units/UnitDef.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Units/UnitDef.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -399,9 +399,9 @@ + selfDCountdown = udTable.GetInt("selfDestructCountdown", 5); + + speed = udTable.GetFloat("maxVelocity", 0.0f) * GAME_SPEED; +- speed = fabs(speed); ++ speed = math::fabs(speed); + rSpeed = udTable.GetFloat("maxReverseVelocity", 0.0f) * GAME_SPEED; +- rSpeed = fabs(rSpeed); ++ rSpeed = math::fabs(rSpeed); + + fireState = udTable.GetInt("fireState", canFireControl? FIRESTATE_NONE: FIRESTATE_FIREATWILL); + fireState = std::min(fireState, int(FIRESTATE_FIREATWILL)); +@@ -462,8 +462,8 @@ + useSmoothMesh = udTable.GetBool("useSmoothMesh", true); + + +- maxAcc = fabs(udTable.GetFloat("acceleration", 0.5f)); // no negative values +- maxDec = fabs(udTable.GetFloat("brakeRate", 3.0f * maxAcc)) * (canfly? 0.1f: 1.0f); // no negative values ++ maxAcc = math::fabs(udTable.GetFloat("acceleration", 0.5f)); // no negative values ++ maxDec = math::fabs(udTable.GetFloat("brakeRate", 3.0f * maxAcc)) * (canfly? 0.1f: 1.0f); // no negative values + + turnRate = udTable.GetFloat("turnRate", 0.0f); + turnInPlace = udTable.GetBool("turnInPlace", true); +@@ -709,7 +709,7 @@ + seismicSignature = udTable.GetFloat("seismicSignature", -1.0f); + if (seismicSignature == -1.0f) { + if (!canFloat && !canHover && !canfly) { +- seismicSignature = sqrt(mass / 100.0f); ++ seismicSignature = math::sqrt(mass / 100.0f); + } else { + seismicSignature = 0.0f; + } +diff -ru spring_89.0/rts/Sim/Units/UnitHandler.cpp /home/svenstaro/src/spring/rts/Sim/Units/UnitHandler.cpp +--- spring_89.0/rts/Sim/Units/UnitHandler.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Units/UnitHandler.cpp 2012-07-13 06:34:43.076060493 +0200 +@@ -419,8 +419,8 @@ + // look for a nearby geothermal feature if we need one + for (std::vector<CFeature*>::const_iterator fi = features.begin(); fi != features.end(); ++fi) { + if ((*fi)->def->geoThermal +- && fabs((*fi)->pos.x - pos.x) < (xsize * 4 - 4) +- && fabs((*fi)->pos.z - pos.z) < (zsize * 4 - 4)) { ++ && math::fabs((*fi)->pos.x - pos.x) < (xsize * 4 - 4) ++ && math::fabs((*fi)->pos.z - pos.z) < (zsize * 4 - 4)) { + canBuild = BUILDSQUARE_OPEN; + break; + } +@@ -589,7 +589,7 @@ + BuildInfo bi(cmd); + tempF1 = pos + dir * ((bi.pos.y - pos.y) / dir.y) - bi.pos; + +- if (bi.def && (bi.GetXSize() / 2) * SQUARE_SIZE > fabs(tempF1.x) && (bi.GetZSize() / 2) * SQUARE_SIZE > fabs(tempF1.z)) { ++ if (bi.def && (bi.GetXSize() / 2) * SQUARE_SIZE > math::fabs(tempF1.x) && (bi.GetZSize() / 2) * SQUARE_SIZE > math::fabs(tempF1.z)) { + return cmd; + } + } +diff -ru spring_89.0/rts/Sim/Weapons/BombDropper.cpp /home/svenstaro/src/spring/rts/Sim/Weapons/BombDropper.cpp +--- spring_89.0/rts/Sim/Weapons/BombDropper.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Weapons/BombDropper.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -62,7 +62,7 @@ + const float s = -owner->speed.y; + const float sq = (s - 2*d) / -((weaponDef->myGravity == 0) ? mapInfo->map.gravity : -(weaponDef->myGravity)); + if (sq > 0) { +- predict = s / ((weaponDef->myGravity == 0) ? mapInfo->map.gravity : -(weaponDef->myGravity)) + sqrt(sq); ++ predict = s / ((weaponDef->myGravity == 0) ? mapInfo->map.gravity : -(weaponDef->myGravity)) + math::sqrt(sq); + } else { + predict = 0; + } +diff -ru spring_89.0/rts/Sim/Weapons/Cannon.cpp /home/svenstaro/src/spring/rts/Sim/Weapons/Cannon.cpp +--- spring_89.0/rts/Sim/Weapons/Cannon.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Weapons/Cannon.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -169,7 +169,7 @@ + + int ttl = 0; + float sqSpeed2D = dir.SqLength2D() * projectileSpeed * projectileSpeed; +- int predict = (int)ceil((sqSpeed2D == 0) ? (-2 * projectileSpeed * dir.y / gravity) ++ int predict = (int)math::ceil((sqSpeed2D == 0) ? (-2 * projectileSpeed * dir.y / gravity) + : math::sqrt(diff.SqLength2D() / sqSpeed2D)); + if(weaponDef->flighttime > 0) { + ttl = weaponDef->flighttime; +@@ -216,9 +216,9 @@ + // try to cache results, sacrifice some (not much too much even for a pewee) accuracy + // it saves a dozen or two expensive calculations per second when 5 guardians + // are shooting at several slow- and fast-moving targets +- if (fabs(diff.x - lastDiff.x) < (SQUARE_SIZE / 4.0f) && +- fabs(diff.y - lastDiff.y) < (SQUARE_SIZE / 4.0f) && +- fabs(diff.z - lastDiff.z) < (SQUARE_SIZE / 4.0f)) { ++ if (math::fabs(diff.x - lastDiff.x) < (SQUARE_SIZE / 4.0f) && ++ math::fabs(diff.y - lastDiff.y) < (SQUARE_SIZE / 4.0f) && ++ math::fabs(diff.z - lastDiff.z) < (SQUARE_SIZE / 4.0f)) { + return lastDir; + } + +@@ -237,7 +237,7 @@ + // FIXME: temporary safeguards against FP overflow + // (introduced by extreme off-map unit positions; the term + // DFsq * Dsq * ... * dy should never even approach 1e38) +- if (Dsq < 1e12f && fabs(dy) < 1e6f) { ++ if (Dsq < 1e12f && math::fabs(dy) < 1e6f) { + const float root1 = v*v*v*v + 2.0f*v*v*g*dy - g*g*DFsq; + + if (root1 >= 0.0f) { +diff -ru spring_89.0/rts/Sim/Weapons/WeaponDefHandler.cpp /home/svenstaro/src/spring/rts/Sim/Weapons/WeaponDefHandler.cpp +--- spring_89.0/rts/Sim/Weapons/WeaponDefHandler.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/Sim/Weapons/WeaponDefHandler.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -126,9 +126,9 @@ + + // should really be tan but TA seem to cap it somehow + // should also be 7fff or ffff theoretically but neither seems good +- wd.accuracy = sin((accuracy) * PI / 0xafff); +- wd.sprayAngle = sin((sprayAngle) * PI / 0xafff); +- wd.movingAccuracy = sin((movingAccuracy) * PI / 0xafff); ++ wd.accuracy = math::sin((accuracy) * PI / 0xafff); ++ wd.sprayAngle = math::sin((sprayAngle) * PI / 0xafff); ++ wd.movingAccuracy = math::sin((movingAccuracy) * PI / 0xafff); + + wd.targetMoveError = wdTable.GetFloat("targetMoveError", 0.0f); + wd.leadLimit = wdTable.GetFloat("leadLimit", -1.0f); +@@ -375,7 +375,7 @@ + + + const float gd = max(30.0f, wd.damages[0] / 20.0f); +- const float defExpSpeed = (8.0f + (gd * 2.5f)) / (9.0f + (sqrt(gd) * 0.7f)) * 0.5f; ++ const float defExpSpeed = (8.0f + (gd * 2.5f)) / (9.0f + (math::sqrt(gd) * 0.7f)) * 0.5f; + wd.explosionSpeed = wdTable.GetFloat("explosionSpeed", defExpSpeed); + + // Dynamic Damage +@@ -461,7 +461,7 @@ + wd.hitSound.setVolume(0, 5.0f); + wd.hitSound.setVolume(1, 5.0f); + } else { +- float fireSoundVolume = sqrt(wd.damages[0] * 0.5f); ++ float fireSoundVolume = math::sqrt(wd.damages[0] * 0.5f); + + if (wd.type == "LaserCannon") { + fireSoundVolume *= 0.5f; +@@ -472,7 +472,7 @@ + if ((fireSoundVolume > 100.0f) && + ((wd.type == "MissileLauncher") || + (wd.type == "StarburstLauncher"))) { +- fireSoundVolume = 10.0f * sqrt(hitSoundVolume); ++ fireSoundVolume = 10.0f * math::sqrt(hitSoundVolume); + } + + if (wd.damageAreaOfEffect > 8.0f) { +@@ -564,7 +564,7 @@ + + if (inverted == true) { + for(int i = 0; i < damageArrayHandler->GetNumTypes(); ++i) { +- dynDamages[i] = damages[i] - (1 - pow(1 / range * travDist, exp)) * damages[i]; ++ dynDamages[i] = damages[i] - (1 - math::pow(1 / range * travDist, exp)) * damages[i]; + + if (damageMin > 0) + dynDamages[i] = max(damages[i] * ddmod, dynDamages[i]); +@@ -577,7 +577,7 @@ + } + else { + for(int i = 0; i < damageArrayHandler->GetNumTypes(); ++i) { +- dynDamages[i] = (1 - pow(1 / range * travDist, exp)) * damages[i]; ++ dynDamages[i] = (1 - math::pow(1 / range * travDist, exp)) * damages[i]; + + if (damageMin > 0) + dynDamages[i] = max(damages[i] * ddmod, dynDamages[i]); +diff -ru spring_89.0/rts/System/Matrix44f.cpp /home/svenstaro/src/spring/rts/System/Matrix44f.cpp +--- spring_89.0/rts/System/Matrix44f.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/System/Matrix44f.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -72,8 +72,8 @@ + + *this=Mul(rm); + */ +- const float sr = sin(rad); +- const float cr = cos(rad); ++ const float sr = math::sin(rad); ++ const float cr = math::cos(rad); + + float a=m[4]; + m[4] = cr*a - sr*m[8]; +@@ -107,8 +107,8 @@ + + *this = Mul(rm); + */ +- const float sr = sin(rad); +- const float cr = cos(rad); ++ const float sr = math::sin(rad); ++ const float cr = math::cos(rad); + + float a=m[0]; + m[0] = cr*a + sr*m[8]; +@@ -142,8 +142,8 @@ + + *this = Mul(rm); + */ +- const float sr = sin(rad); +- const float cr = cos(rad); ++ const float sr = math::sin(rad); ++ const float cr = math::cos(rad); + + float a=m[0]; + m[0] = cr*a - sr*m[4]; +@@ -165,8 +165,8 @@ + + void CMatrix44f::Rotate(float rad, const float3& axis) + { +- const float sr = sin(rad); +- const float cr = cos(rad); ++ const float sr = math::sin(rad); ++ const float cr = math::cos(rad); + + for(int a=0;a<3;++a){ + float3 v(m[a*4],m[a*4+1],m[a*4+2]); +diff -ru spring_89.0/rts/System/myMath.cpp /home/svenstaro/src/spring/rts/System/myMath.cpp +--- spring_89.0/rts/System/myMath.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/System/myMath.cpp 2012-07-13 06:34:43.072727160 +0200 +@@ -44,7 +44,7 @@ + } + + // Set single precision floating point math. +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + #if defined(__SUPPORT_SNAN__) && !defined(USE_GML) + streflop::feraiseexcept(streflop::FPU_Exceptions(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW)); + #endif +@@ -58,7 +58,7 @@ + #pragma omp parallel + { + //good_fpu_control_registers("OMP-Init"); +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + #if defined(__SUPPORT_SNAN__) && !defined(USE_GML) + streflop::feraiseexcept(streflop::FPU_Exceptions(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW)); + #endif +@@ -77,8 +77,8 @@ + for (int a = 0; a < NUM_HEADINGS; ++a) { + float ang = (a - (NUM_HEADINGS / 2)) * 2 * PI / NUM_HEADINGS; + float2 v; +- v.x = sin(ang); +- v.y = cos(ang); ++ v.x = math::sin(ang); ++ v.y = math::cos(ang); + headingToVectorTable[a] = v; + } + +@@ -107,9 +107,9 @@ + float3 ret; + float h = heading * TAANG2RAD; + float p = pitch * TAANG2RAD; +- ret.x = sin(h) * cos(p); +- ret.y = sin(p); +- ret.z = cos(h) * cos(p); ++ ret.x = math::sin(h) * math::cos(p); ++ ret.y = math::sin(p); ++ ret.z = math::cos(h) * math::cos(p); + return ret; + } + +@@ -138,7 +138,7 @@ + float3 dir(l2-l1); + float3 pdir(p-l1); + float length = dir.Length(); +- if (fabs(length) < 1e-4f) ++ if (math::fabs(length) < 1e-4f) + return l1; + float c = dir.dot(pdir) / length; + if (c < 0) c = 0; +diff -ru spring_89.0/rts/System/Net/Socket.cpp /home/svenstaro/src/spring/rts/System/Net/Socket.cpp +--- spring_89.0/rts/System/Net/Socket.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/System/Net/Socket.cpp 2012-07-13 06:34:42.939393819 +0200 +@@ -73,7 +73,7 @@ + //! (date of note: 08/05/10) + //! something in from_string() is invalidating the FPU flags + //! tested on win2k and linux (not happening there) +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + #endif + + return addr; +@@ -94,7 +94,7 @@ + #ifdef STREFLOP_H + //! (date of note: 08/22/10) + //! something in resolve() is invalidating the FPU flags +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + #endif + + return resolveIt; +diff -ru spring_89.0/rts/System/OffscreenGLContext.cpp /home/svenstaro/src/spring/rts/System/OffscreenGLContext.cpp +--- spring_89.0/rts/System/OffscreenGLContext.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/System/OffscreenGLContext.cpp 2012-07-13 06:34:42.939393819 +0200 +@@ -259,7 +259,7 @@ + #ifdef STREFLOP_H + // init streflop to make it available for synced computations, too + // redundant? threads copy the FPU state of their parent. +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + #endif + + try { +diff -ru spring_89.0/rts/System/Sound/SoundSource.h /home/svenstaro/src/spring/rts/System/Sound/SoundSource.h +--- spring_89.0/rts/System/Sound/SoundSource.h 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/System/Sound/SoundSource.h 2012-07-13 06:34:42.836060480 +0200 +@@ -7,7 +7,6 @@ + + #include <al.h> + #include <boost/noncopyable.hpp> +-#include <boost/thread/recursive_mutex.hpp> + + class IAudioChannel; + class float3; +diff -ru spring_89.0/rts/System/SpringApp.cpp /home/svenstaro/src/spring/rts/System/SpringApp.cpp +--- spring_89.0/rts/System/SpringApp.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/System/SpringApp.cpp 2012-07-13 06:34:42.982727155 +0200 +@@ -385,7 +385,7 @@ + #ifdef STREFLOP_H + //! Something in SDL_SetVideoMode (OpenGL drivers?) messes with the FPU control word. + //! Set single precision floating point math. +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + #endif + + //! setup GL smoothing +@@ -1009,7 +1009,7 @@ + SDL_Event event; + + while (SDL_PollEvent(&event)) { +- streflop_init<streflop::Simple>(); // SDL_PollEvent may modify FPU flags ++ streflop::streflop_init<streflop::Simple>(); // SDL_PollEvent may modify FPU flags + input.PushEvent(event); + } + } +diff -ru spring_89.0/rts/System/Sync/FPUCheck.cpp /home/svenstaro/src/spring/rts/System/Sync/FPUCheck.cpp +--- spring_89.0/rts/System/Sync/FPUCheck.cpp 2012-07-10 00:10:08.000000000 +0200 ++++ /home/svenstaro/src/spring/rts/System/Sync/FPUCheck.cpp 2012-07-13 06:34:42.939393819 +0200 +@@ -85,7 +85,7 @@ + LOG_L(L_WARNING, "[%s] Sync warning: (env.x87_mode) FPUCW 0x%04X instead of 0x%04X or 0x%04X (\"%s\")", __FUNCTION__, fenv.x87_mode, x87_a, x87_b, text); + + // Set single precision floating point math. +- streflop_init<streflop::Simple>(); ++ streflop::streflop_init<streflop::Simple>(); + #if defined(__SUPPORT_SNAN__) && !defined(USE_GML) + streflop::feraiseexcept(streflop::FPU_Exceptions(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW)); + #endif diff --git a/community/luarocks/PKGBUILD b/community/luarocks/PKGBUILD index ef6b63eb7..f82ecf63a 100644 --- a/community/luarocks/PKGBUILD +++ b/community/luarocks/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 72118 2012-06-08 21:45:36Z cbrannon $ +# $Id: PKGBUILD 73676 2012-07-13 11:41:36Z cbrannon $ # Maintainer: Chris Brannon <cmbrannon79@gmail.com> # Contributor: Geoffroy Carrier <geoffroy@archlinux.org> pkgname=luarocks -pkgver=2.0.9 +pkgver=2.0.10 pkgrel=1 pkgdesc='Deployment and management system for Lua modules' arch=('i686' 'x86_64') @@ -33,4 +33,4 @@ package() { install -D COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } -md5sums=('78dceb5c513fd241665688ecd229ff51') +md5sums=('85cccdbd995b489ae1a9aab33c14b7fc') diff --git a/community/nodejs/PKGBUILD b/community/nodejs/PKGBUILD index 237bc89af..7594993ed 100644 --- a/community/nodejs/PKGBUILD +++ b/community/nodejs/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 73072 2012-06-30 08:03:14Z bpiotrowski $ +# $Id: PKGBUILD 73678 2012-07-13 18:50:20Z bpiotrowski $ # Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl> # Contributor: Thomas Dziedzic < gostrc at gmail > # Contributor: James Campos <james.r.campos@gmail.com> @@ -8,7 +8,7 @@ # Contributor: TIanyi Cui <tianyicui@gmail.com> pkgname=nodejs -pkgver=0.8.1 +pkgver=0.8.2 pkgrel=1 pkgdesc='Evented I/O for V8 javascript' arch=('i686' 'x86_64') @@ -19,7 +19,7 @@ checkdepends=('curl') # curl used for check() optdepends=('openssl: TLS support') options=('!emptydirs') source=("http://nodejs.org/dist/v${pkgver}/node-v${pkgver}.tar.gz") -md5sums=('32a6f7b7cf196cb89bd973741ae58dd1') +md5sums=('2d1a74aa9e5ecfdb4c64d200b642eb1e') build() { cd node-v${pkgver} diff --git a/community/percona-server/PKGBUILD b/community/percona-server/PKGBUILD index 7466e57c2..5941996e8 100644 --- a/community/percona-server/PKGBUILD +++ b/community/percona-server/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 73641 2012-07-12 13:35:50Z mtorromeo $ +# $Id: PKGBUILD 73668 2012-07-13 06:40:20Z spupykin $ # Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com> pkgname=percona-server diff --git a/community/spacefm/PKGBUILD b/community/spacefm/PKGBUILD index 9de16b687..e89183510 100644 --- a/community/spacefm/PKGBUILD +++ b/community/spacefm/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 72589 2012-06-17 07:23:49Z bpiotrowski $ +# $Id: PKGBUILD 73680 2012-07-13 19:18:42Z bpiotrowski $ # Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl> # Contributor: IgnorantGuru http://igurublog.wordpress.com/contact-ignorantguru/ # Contributor: ridikulus_rat <the.ridikulus.rat@gmail.com> pkgname=spacefm -pkgver=0.7.8 +pkgver=0.7.9 pkgrel=1 pkgdesc="A multi-panel tabbed file manager" arch=('i686' 'x86_64') @@ -18,29 +18,20 @@ optdepends=('lsof: device processes' 'wget: plugin download' 'gksu: perform as root functionality' 'pmount: mount as non-root user' + 'udevil: mount as non-root user and mount networks' 'udisks: mount as non-root user' 'udisks2: mount as non-root user') - #'ktsuss: perform as root functionality' (AUR) - #'udevil-git: mount as non-root user and mount networks' (AUR) source=(https://raw.github.com/IgnorantGuru/spacefm/master/packages/${pkgver}/spacefm-${pkgver}.tar.xz) -md5sums=('746b8f55735217a0e6d48e4e666a7534') +md5sums=('428739bc310d7010eca3f64caf2e7c1e') build() { - cd "${srcdir}/${pkgname}-${pkgver}" - - # NOTE: To enable hal support add --enable-hal to - # configure line below. See README for details. - # NOTE: To disable inotify and use fam or gamin instead, add: - # --disable-inotify to configure line below. - # NOTE: To add a custom su program (mysu in this example), add: - # --with-preferable-sudo="mysu" to configure line below. - + cd $srcdir/$pkgname-$pkgver ./configure --prefix=/usr make } package() { - cd "${srcdir}/${pkgname}-${pkgver}" - make DESTDIR="${pkgdir}/" install + cd $srcdir/$pkgname-$pkgver + make DESTDIR=$pkgdir install } diff --git a/community/udevil/PKGBUILD b/community/udevil/PKGBUILD new file mode 100644 index 000000000..7a7df6839 --- /dev/null +++ b/community/udevil/PKGBUILD @@ -0,0 +1,39 @@ +# $Id: PKGBUILD 73683 2012-07-13 19:36:15Z bpiotrowski $ +# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl> +# Contributor: IgnorantGuru http://igurublog.wordpress.com/contact-ignorantguru/ + +pkgname=udevil +pkgver=0.3.0 +pkgrel=1 +arch=('i686' 'x86_64') +pkgdesc='Mount and unmount without password' +url='http://ignorantguru.github.com/udevil/' +license=('GPL3') +makedepends=('intltool' 'gettext') +depends=('udev' 'glib2') +optdepends=('nfs-utils: mount nfs shares' + 'sshfs: mount sftp shares' + 'curlftpfs: mount ftp shares' + 'cifs-utils: mount samba shares' + 'eject: eject via devmon' + 'zenity: devmon popups' + 'pmount: devmon mount without suid udevil' + 'udisks: devmon mount without suid udevil' + 'udisks2: devmon mount without suid udevil') +provides=('devmon') +backup=('etc/udevil/udevil.conf') +install=$pkgname.install +source=(https://raw.github.com/IgnorantGuru/$pkgname/master/packages/$pkgver/$pkgname-$pkgver.tar.xz) +md5sums=('a2695eb0e9d1d2b5208f781710b1a286') + +build() { + cd $srcdir/$pkgname-$pkgver + ./configure --prefix=/usr + make +} + +package() { + cd $srcdir/$pkgname-$pkgver + make DESTDIR=$pkgdir install +} + diff --git a/community/udevil/udevil.install b/community/udevil/udevil.install new file mode 100644 index 000000000..d839de662 --- /dev/null +++ b/community/udevil/udevil.install @@ -0,0 +1,4 @@ +post_install() { + echo '>>> REMEMBER to enable kernel polling when using devmon without udisks:' + echo ' http://ignorantguru.github.com/udevil/#polling' +} diff --git a/core/bash/PKGBUILD b/core/bash/PKGBUILD index 956361d38..1749c7168 100644 --- a/core/bash/PKGBUILD +++ b/core/bash/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 160448 2012-06-02 03:17:38Z allan $ +# $Id: PKGBUILD 163494 2012-07-13 12:31:26Z allan $ # Maintainer: Allan McRae <allan@archlinux.org> # Contributor: Aaron Griffin <aaron@archlinux.org> pkgname=bash _basever=4.2 -_patchlevel=029 #prepare for some patches +_patchlevel=036 #prepare for some patches pkgver=$_basever.$_patchlevel pkgrel=1 pkgdesc="The GNU Bourne Again shell" @@ -136,4 +136,18 @@ md5sums=('3fb927c7c33022f1c327f14a81c0d4b0' 'da9265aa2527fd4a7481baa3e0550287' '0043f8b75f46f43608a67b863e300fe8' 'ec444d229e8899fbaaf6fc7de2d82ae6' - 'b632fca3a4943825bfaf3bd29df6b27d') + 'b632fca3a4943825bfaf3bd29df6b27d' + 'b4bc1c4dc1b508ff9cdfc44f1a5039b5' + '2ffa9a802bbd57540021715f84cc76f4' + '89390ff6a3c2ef7e09dd4b8b097a8e56' + '3e9b529ef3726b75d125d678de76977f' + 'eee08003395c417f677d1a4bf8c548ee' + 'f670f7672b11d0df8c31885dbf15f390' + '2fe070dd6d75d8ff16f269184a16e9c4' + '5018b6b7737808141043b57cf4eb842d' + '4e610506c1711bf3483b965800ac3d5d' + 'cb65e541f9b60a8cb1fe58404f264b73' + '7cd9bfdf7cbfd45274d07620ee94c8d9' + 'a7d2eace0da5fd236c93dbfd93458838' + '9c3142956064d175a880bcb186e51ef9' + 'a1a87649853f20fe99572ddc02b0c67f') diff --git a/core/iputils/PKGBUILD b/core/iputils/PKGBUILD index efc4eda5c..e72795dd3 100644 --- a/core/iputils/PKGBUILD +++ b/core/iputils/PKGBUILD @@ -1,11 +1,11 @@ -# $Id: PKGBUILD 162361 2012-06-25 20:10:09Z stephane $ +# $Id: PKGBUILD 163489 2012-07-13 11:24:04Z stephane $ # Maintainer: Stéphane Gaudreault <stephane@archlinux.org> # Maintainer: Tobias Powalowski <tpowa@archlinux.org> # Contributor: Aaron Griffin <aaron@archlinux.org> pkgname=iputils pkgver=20101006 -pkgrel=3 +pkgrel=4 pkgdesc="IP Configuration Utilities (and Ping)" arch=('i686' 'x86_64') license=('GPL') @@ -18,9 +18,11 @@ conflicts=('netkit-base' 'arping' 'netkit-tftpd') replaces=('netkit-base') backup=(etc/xinetd.d/tftp) install=${pkgname}.install -source=(http://www.skbuff.net/${pkgname}/${pkgname}-s${pkgver}.tar.bz2 tftp.xinetd) +source=(http://www.skbuff.net/${pkgname}/${pkgname}-s${pkgver}.tar.bz2 tftp.xinetd + iputils-20101006-ping-integer-overflow.patch) sha1sums=('a08cc5423a7bf940205f2353fe3d129cd39ff242' - 'fc2ae26f5609725e3f4aeaf4ab82dfa6d2e378fd') + 'fc2ae26f5609725e3f4aeaf4ab82dfa6d2e378fd' + 'ec78574d798b53e4f8bdd37e42514fc17ed71667') build() { cd "${srcdir}/${pkgname}-s${pkgver}" @@ -28,6 +30,9 @@ build() { # Use our CFLAGS sed -i -e "/^CCOPT=/s|-O2|${CFLAGS}|" Makefile + # FS#28897 + patch -Np1 -i ../iputils-20101006-ping-integer-overflow.patch + make cd doc diff --git a/core/iputils/iputils-20101006-ping-integer-overflow.patch b/core/iputils/iputils-20101006-ping-integer-overflow.patch new file mode 100644 index 000000000..720e5e888 --- /dev/null +++ b/core/iputils/iputils-20101006-ping-integer-overflow.patch @@ -0,0 +1,11 @@ +--- iputils-s20101006/ping_common.c 2010-10-06 13:59:20.000000000 +0200 ++++ iputils-s20101006-patched/ping_common.c 2012-03-09 16:42:46.878151032 +0100 +@@ -590,7 +590,7 @@ + + /* If we are here, recvmsg() is unable to wait for + * required timeout. */ +- if (1000*next <= 1000000/(int)HZ) { ++ if (((uint64_t)1000*next) <= (uint64_t)1000000/(int)HZ) { + /* Very short timeout... So, if we wait for + * something, we sleep for MININTERVAL. + * Otherwise, spin! */ diff --git a/core/pcre/PKGBUILD b/core/pcre/PKGBUILD index f9290cebf..08a9117a6 100644 --- a/core/pcre/PKGBUILD +++ b/core/pcre/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 149938 2012-02-11 23:29:42Z allan $ +# $Id: PKGBUILD 163492 2012-07-13 12:30:53Z allan $ # Maintainer: Allan McRae <allan@archlinux.org> # Contributor: Eric Belanger <eric@archlinux.org> # Contributor: John Proctor <jproctor@prium.net> pkgname=pcre -pkgver=8.30 +pkgver=8.31 pkgrel=1 pkgdesc="A library that implements Perl 5-style regular expressions" arch=('i686' 'x86_64') @@ -13,8 +13,8 @@ license=('BSD') depends=('gcc-libs') options=('!libtool') source=(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${pkgname}-${pkgver}.tar.bz2{,.sig}) -md5sums=('98e8928cccc945d04279581e778fbdff' - '01eee0333fa71687e0b6756db77f94ad') +md5sums=('1c9a276af932b5599157f96e945391f0' + '873bcd2cd9f1e0aa1e28e256b3e31506') build() { cd "${srcdir}"/${pkgname}-${pkgver} diff --git a/core/pkg-config/PKGBUILD b/core/pkg-config/PKGBUILD index b671db33e..a235d17d8 100644 --- a/core/pkg-config/PKGBUILD +++ b/core/pkg-config/PKGBUILD @@ -1,28 +1,25 @@ -# $Id: PKGBUILD 156205 2012-04-16 03:57:28Z allan $ +# $Id: PKGBUILD 163491 2012-07-13 12:30:49Z allan $ # Maintainer: Allan McRae <allan@archlinux.org> # Committer: Judd Vinet <jvinet@zeroflux.org> pkgname=pkg-config -pkgver=0.26 -pkgrel=2 +pkgver=0.27 +pkgrel=1 pkgdesc="A system for managing library compile/link flags" arch=('i686' 'x86_64') url="http://pkgconfig.freedesktop.org/wiki/" license=('GPL') groups=('base-devel') -depends=('glibc' 'popt' 'glib2') +depends=('glib2') provides=("pkgconfig=${pkgver}") conflicts=('pkgconfig') replaces=('pkgconfig') source=(http://pkgconfig.freedesktop.org/releases/${pkgname}-${pkgver}.tar.gz) -md5sums=('47525c26a9ba7ba14bf85e01509a7234') +md5sums=('3a4c9feab14b6719afd8904945d9b4e4') build() { cd ${srcdir}/${pkgname}-${pkgver} - - # Use system popt - ./configure --prefix=/usr --with-installed-popt - + ./configure --prefix=/usr make } diff --git a/core/readline/PKGBUILD b/core/readline/PKGBUILD index f54f18351..b2b924f2d 100644 --- a/core/readline/PKGBUILD +++ b/core/readline/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 156214 2012-04-16 06:12:04Z allan $ +# $Id: PKGBUILD 163490 2012-07-13 12:30:45Z allan $ # Maintainer: Allan McRae <allan@archlinux.org> # Contributor: judd <jvinet@zeroflux.org> pkgname=readline _basever=6.2 -_patchlevel=002 #prepare for some patches +_patchlevel=003 #prepare for some patches pkgver=$_basever.$_patchlevel pkgrel=2 pkgdesc="GNU readline library" @@ -28,7 +28,9 @@ md5sums=('67948acb2ca081f23359d0256e9a271c' '83287d52a482f790dfb30ec0a8746669' '8e6a51e2e0e6e45a82752e3692c111ac' '0665020ea118e8434bd145fb71f452cc' - '285361ca6d48c51ae2428157e174e812') + '285361ca6d48c51ae2428157e174e812' + 'c9d5d79718856e711667dede87cb7622' + '4437205bb1462f5f32e4812b8292c675') build() { cd ${srcdir}/${pkgname}-$_basever diff --git a/core/usbutils/PKGBUILD b/core/usbutils/PKGBUILD index 65b4963cb..08513e513 100644 --- a/core/usbutils/PKGBUILD +++ b/core/usbutils/PKGBUILD @@ -1,11 +1,11 @@ -# $Id: PKGBUILD 159404 2012-05-23 20:09:22Z tomegun $ +# $Id: PKGBUILD 163502 2012-07-13 16:29:26Z tpowa $ # Maintainer: Tobias Powalowski <tpowa@archlinux.org> # Contributor: Tom Gundersen <teg@jklm.no> # Contributor: Judd Vinet <jvinet@zeroflux.org> # Contributor: Curtis Campbell <curtisjamescampbell@hotmail.com> pkgname=usbutils -pkgver=005 -pkgrel=2 +pkgver=006 +pkgrel=1 pkgdesc="USB Device Utilities" arch=(i686 x86_64) license=('GPL') @@ -14,9 +14,10 @@ depends=('libusb' 'hwids') optdepends=('python2: for lsusb.py usage' 'coreutils: for lsusb.py usage') url="http://linux-usb.sourceforge.net/" -# currently broken: http://www.kernel.org/pub/linux/utils/usb/$pkgname/$pkgname-$pkgver.tar.gz -source=("ftp://ftp.archlinux.org/other/${pkgname}/${pkgname}-${pkgver}.tar.bz2" +source=("http://www.kernel.org/pub/linux/utils/usb/usbutils/${pkgname}-${pkgver}.tar.xz" fix-python2.patch) +md5sums=('c9aa14ee3d6c991fda183f42cf72a8a8' + '45766196895b4cc50b53cd56e1bbf3d1') build() { cd $srcdir/$pkgname-$pkgver @@ -32,5 +33,3 @@ package() { # this is now in the hwids package rm -rf $pkgdir/usr/{share/hwdata,sbin} } -md5sums=('6a21f7b6c02b76df5e8a7c208d746654' - '45766196895b4cc50b53cd56e1bbf3d1') diff --git a/extra/doxygen/PKGBUILD b/extra/doxygen/PKGBUILD index 0d1b43b77..4f24d6fdd 100644 --- a/extra/doxygen/PKGBUILD +++ b/extra/doxygen/PKGBUILD @@ -1,17 +1,17 @@ -# $Id: PKGBUILD 162028 2012-06-19 01:01:27Z dan $ +# $Id: PKGBUILD 163499 2012-07-13 14:44:33Z dan $ # Maintainer: Dan McGee <dan@archlinux.org> pkgbase=doxygen pkgname=('doxygen' 'doxygen-docs') -pkgver=1.8.1.1 +pkgver=1.8.1.2 pkgrel=1 license=('GPL') arch=(i686 x86_64) url="http://www.doxygen.org/" makedepends=('gcc-libs' 'flex' 'qt' 'texlive-core' 'ghostscript' 'texlive-latexextra') source=(ftp://ftp.stack.nl/pub/users/dimitri/${pkgname}-${pkgver}.src.tar.gz) -md5sums=('a08c43c5675f79e0787e700c2d39ee33') -sha1sums=('51184af9f27d6572826581de0da5b6b044e34d94') +md5sums=('9c62259c34d51d839dafd1f0d5d85f17') +sha1sums=('a11e65a597019510051290d2af0e6f379838b9c5') build() { cd "${srcdir}/${pkgbase}-${pkgver}" diff --git a/extra/git/PKGBUILD b/extra/git/PKGBUILD index 4026a264e..29876c073 100644 --- a/extra/git/PKGBUILD +++ b/extra/git/PKGBUILD @@ -1,8 +1,8 @@ -# $Id: PKGBUILD 162371 2012-06-26 03:37:25Z dan $ +# $Id: PKGBUILD 163497 2012-07-13 14:43:17Z dan $ # Maintainer: Dan McGee <dan@archlinux.org> pkgname=git -pkgver=1.7.11.1 +pkgver=1.7.11.2 pkgrel=1 pkgdesc="the fast distributed version control system" arch=(i686 x86_64) @@ -100,7 +100,7 @@ package() { install -D -m644 "$srcdir"/git-daemon.conf "$pkgdir"/etc/conf.d/git-daemon.conf } -sha1sums=('d09664978931d215e43241689eb09371b509c7ce' - 'e2defbf75ff15d7684d70457e41bc45fb22f0e1f' +sha1sums=('f67b4f6c0277250411c6872ae7b8a872ae11d313' + '78b46ca7b5037c61a58086879869dadeac9eea3e' 'f2b41828bd912b72e2cb3e14677739c4f370de66' '149e2da1ecb48872ddb31c0945afeaad1f9653d7') diff --git a/extra/poppler/PKGBUILD b/extra/poppler/PKGBUILD index 7c8a9dd95..d1e213e76 100644 --- a/extra/poppler/PKGBUILD +++ b/extra/poppler/PKGBUILD @@ -1,9 +1,9 @@ -# $Id: PKGBUILD 162358 2012-06-25 18:51:22Z foutrelis $ +# $Id: PKGBUILD 163501 2012-07-13 16:26:14Z andyrtr $ # Maintainer: Jan de Groot <jgc@archlinux.org> pkgbase=poppler pkgname=('poppler' 'poppler-glib' 'poppler-qt') -pkgver=0.20.1 +pkgver=0.20.2 pkgrel=1 arch=(i686 x86_64) license=('GPL') @@ -13,7 +13,7 @@ url="http://poppler.freedesktop.org/" _testtag=0d2bfd4af4c76a3bac27ccaff793d9129df7b57a source=(http://poppler.freedesktop.org/${pkgbase}-${pkgver}.tar.gz http://cgit.freedesktop.org/poppler/test/snapshot/test-${_testtag}.tar.bz2) -md5sums=('a61e3b844061f5324512a16d6d16984c' +md5sums=('45dd2c16c8c4d1a39e830e45745c4e25' '9dc64c254a31e570507bdd4ad4ba629a') build() { diff --git a/extra/qemu/PKGBUILD b/extra/qemu/PKGBUILD index 648859602..b64cd54e8 100644 --- a/extra/qemu/PKGBUILD +++ b/extra/qemu/PKGBUILD @@ -1,24 +1,28 @@ -# $Id: PKGBUILD 161651 2012-06-13 12:26:10Z tpowa $ +# $Id: PKGBUILD 163504 2012-07-13 16:36:15Z tpowa $ # Maintainer: Tobias Powalowski <tpowa@archlinux.org> pkgname=qemu -pkgver=1.1.0 -pkgrel=2 +pkgver=1.1.1 +pkgrel=1 pkgdesc="A generic and open source processor emulator which achieves a good emulation speed by using dynamic translation." arch=('i686' 'x86_64') license=('GPL2' 'LGPL2.1') url="http://wiki.qemu.org/Index.html" makedepends=('texi2html' 'perl' 'python2') -depends=('libjpeg' 'libpng' 'sdl' 'alsa-lib' 'nss' 'glib2' 'gnutls>=2.4.1' 'bluez' 'vde2' 'util-linux' 'curl' 'libsasl' 'libgl' 'libpulse' 'seabios') +depends=('libjpeg' 'libpng' 'sdl' 'alsa-lib' 'nss' 'glib2' 'gnutls>=2.4.1' 'bluez' 'vde2' 'util-linux' 'curl' 'libsasl' 'libgl' 'libpulse' 'seabios' 'libcap-ng') backup=('etc/qemu/target-x86_64.conf') install=qemu.install -source=(http://wiki.qemu.org/download/${pkgname}-${pkgver}-1.tar.bz2 - 65-kvm.rules) +source=(http://wiki.qemu.org/download/${pkgname}-${pkgver}.tar.bz2 + 65-kvm.rules + qemu-glibc-2.16-build.patch) options=(!strip) build() { cd "${srcdir}/${pkgname}-${pkgver}" sed -i -e 's/lib64/lib/g' x86_64.ld + # patch from fedora git: http://pkgs.fedoraproject.org/gitweb/?p=qemu.git + # fix changes from glibc-2.16 + patch -Np1 -i ../qemu-glibc-2.16-build.patch ./configure --prefix=/usr --sysconfdir=/etc --audio-drv-list=oss,alsa,sdl,pa \ --python=/usr/bin/python2 \ --audio-card-list=ac97,sb16,es1370,hda \ @@ -42,5 +46,6 @@ package() { done } -md5sums=('f5c85c229b780bc39268845b6f365fc1' - 'b316a066d2f1bb57d8f5b7ea1d0d1caf') +md5sums=('f691baa30e8fb40f37f2797fba892e12' + 'b316a066d2f1bb57d8f5b7ea1d0d1caf' + '8687179e77ab954c4a43017d030f7349') diff --git a/extra/qemu/qemu-glibc-2.16-build.patch b/extra/qemu/qemu-glibc-2.16-build.patch new file mode 100644 index 000000000..08948fec6 --- /dev/null +++ b/extra/qemu/qemu-glibc-2.16-build.patch @@ -0,0 +1,70 @@ +From baf954154e7c0acda038c01a5c28aea4db7eec67 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" <rjones@redhat.com> +Date: Thu, 5 Jul 2012 14:28:03 +0100 +Subject: [PATCH] Replace 'struct siginfo' with 'siginfo_t'. + +glibc 2.16 will remove the undocumented definition of 'struct siginfo' +from <bits/siginfo.h>. + +This change is already present in glibc 2.15.90, so qemu compilation +of certain targets (eg. cris-user) breaks. + +This struct was always typedef'd to be the same as 'siginfo_t' which +is what POSIX documents, so use that instead. + +Signed-off-by: Richard W.M. Jones <rjones@redhat.com> +--- + linux-user/signal.c | 8 ++++---- + user-exec.c | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/linux-user/signal.c b/linux-user/signal.c +index 43346dc..108dff9 100644 +--- a/linux-user/signal.c ++++ b/linux-user/signal.c +@@ -2849,7 +2849,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, + * Arguments to signal handler: + * + * a0 = signal number +- * a1 = pointer to struct siginfo ++ * a1 = pointer to siginfo_t + * a2 = pointer to struct ucontext + * + * $25 and PC point to the signal handler, $29 points to the +@@ -3255,7 +3255,7 @@ struct target_signal_frame { + }; + + struct rt_signal_frame { +- struct siginfo info; ++ siginfo_t info; + struct ucontext uc; + uint32_t tramp[2]; + }; +@@ -3474,9 +3474,9 @@ struct target_signal_frame { + }; + + struct rt_signal_frame { +- struct siginfo *pinfo; ++ siginfo_t *pinfo; + void *puc; +- struct siginfo info; ++ siginfo_t info; + struct ucontext uc; + uint8_t retcode[8]; /* Trampoline code. */ + }; +diff --git a/user-exec.c b/user-exec.c +index b2a4261..1a9c276 100644 +--- a/user-exec.c ++++ b/user-exec.c +@@ -588,7 +588,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, + int cpu_signal_handler(int host_signum, void *pinfo, + void *puc) + { +- struct siginfo *info = pinfo; ++ siginfo_t *info = pinfo; + struct ucontext *uc = puc; + unsigned long pc = uc->uc_mcontext.sc_iaoq[0]; + uint32_t insn = *(uint32_t *)pc; +-- +1.7.10.4 + diff --git a/extra/slim/PKGBUILD b/extra/slim/PKGBUILD index f6c46d1bf..e90fa2de2 100644 --- a/extra/slim/PKGBUILD +++ b/extra/slim/PKGBUILD @@ -1,12 +1,12 @@ -# $Id: PKGBUILD 160692 2012-06-03 19:17:38Z tpowa $ +# $Id: PKGBUILD 163488 2012-07-13 10:14:32Z tpowa $ # Maintainer: Gaetan Bisson <bisson@archlinux.org> # Contributor: Thayer Williams <thayer@archlinux.org> # Contributor: Alexander Fehr <pizzapunk gmail com> # Contributor: Hugo Ideler <hugoideler@dse.nl> pkgname=slim -pkgver=1.3.3 -pkgrel=5 +pkgver=1.3.4 +pkgrel=1 pkgdesc='Desktop-independent graphical login manager for X11' arch=('i686' 'x86_64') url='http://slim.berlios.de/' @@ -19,17 +19,15 @@ source=("http://download.berlios.de/${pkgname}/${pkgname}-${pkgver}.tar.gz" 'pam.d' 'logrotate' 'slim.service' - 'ptr_pam.patch' 'session-name.patch' - 'fix-numlock-1.3.3.patch') + 'libpng-1.4+-support.patch') install=install build() { cd "${srcdir}/${pkgname}-${pkgver}" - patch -p1 -i ../ptr_pam.patch # FS#23995: pointer mishandling confuses PAM patch -p1 -i ../session-name.patch # FS#26693: fix default session name - patch -p1 -i ../fix-numlock-1.3.3.patch # FS#29818: fix numlock handling + patch -Np1 -i ../libpng-1.4+-support.patch # taken from gentoo to build cd ${srcdir} mkdir build cd build @@ -55,11 +53,10 @@ package() { # install systemd files install -D -m644 ${srcdir}/slim.service ${pkgdir}/usr/lib/systemd/system/slim.service } -md5sums=('ce53e44c1e4a2eacf5bb7688ee2a5de8' +md5sums=('51543533e492b41007811f7d880720fa' 'd8ea9c4dee2811524b67f4f666311a1f' 'd33edc74724c6ca00445767ce38fc732' '43da096480bf72c3ccec8ad8400f34f0' - '7c0bf1fb6292537e2c63ec04f8532079' - 'ae4b237d472ec5d373e30080aa0ff804' + 'a5d6bde9e63899df7d2081e1585bbe54' 'ebcb6829028615686de7b64ceeaaf8ed' - '6c29c93370e44ed310ff30132424b619') + '6d19bd7a91592ed2bb902b22b9594565') diff --git a/extra/slim/libpng-1.4+-support.patch b/extra/slim/libpng-1.4+-support.patch new file mode 100644 index 000000000..57b39272b --- /dev/null +++ b/extra/slim/libpng-1.4+-support.patch @@ -0,0 +1,14 @@ +--- a/image.cpp 2012-06-26 04:20:14.000000000 -0400 ++++ b/image.cpp 2012-06-27 11:41:34.000000000 -0400 +@@ -781,7 +781,11 @@ + (png_infopp) NULL); + } + ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ if (setjmp(png_jmpbuf((png_ptr)))) { ++#else + if (setjmp(png_ptr->jmpbuf)) { ++#endif + goto png_destroy; + } + diff --git a/extra/slim/slim.service b/extra/slim/slim.service index 18d8c99be..b894085a0 100644 --- a/extra/slim/slim.service +++ b/extra/slim/slim.service @@ -6,4 +6,4 @@ After=systemd-user-sessions.service ExecStart=/usr/bin/slim -nodaemon [Install] -WantedBy=graphical.target +Alias=display-manager.service diff --git a/extra/vim/PKGBUILD b/extra/vim/PKGBUILD index 507eaed33..d0c30fd0b 100644 --- a/extra/vim/PKGBUILD +++ b/extra/vim/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 160931 2012-06-07 03:39:59Z tdziedzic $ +# $Id: PKGBUILD 163486 2012-07-13 05:33:54Z tdziedzic $ # Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com> # Maintainer: tobias [ tobias at archlinux org ] # Maintainer: Daniel J Griffiths <ghost1227@archlinux.us> @@ -6,8 +6,8 @@ pkgbase=vim pkgname=('vim' 'gvim' 'vim-runtime') _topver=7.3 -_patchlevel=547 -__hgrev=6f2497d0c277 +_patchlevel=600 +__hgrev=11d40fc82f11 _versiondir="vim${_topver//./}" pkgver=${_topver}.${_patchlevel} pkgrel=1 @@ -21,8 +21,8 @@ source=("ftp://ftp.archlinux.org/other/vim/vim-${pkgver}.tar.xz" 'vimrc' 'archlinux.vim' 'gvim.desktop') -sha1sums=('2c4f78a66b6ad7a759122d1f66c74079b678f39c' - '999f527d82a4c7818d017e3b8230e27950e87718' +sha1sums=('a1c54bde75476ace5d24d4c17f7a81818e80dfda' + '14d62fe89d8292a6d2f7c46e8c61bd59bbd01083' '4d9dcfb32874aa5467e6f06e418aeb4e675daaf2' '3494baf53a63581ba69f86a81293640ff681c5c5' '25dd3c2ce436e73a367c8f73b68f7f6889682437' diff --git a/libre/initscripts/0001-remove-run-nologin-before-leaving-rc.multi.patch b/libre/initscripts/0001-remove-run-nologin-before-leaving-rc.multi.patch new file mode 100644 index 000000000..a9b7a2423 --- /dev/null +++ b/libre/initscripts/0001-remove-run-nologin-before-leaving-rc.multi.patch @@ -0,0 +1,29 @@ +From 55bd14c586f0f64b8ee5515161be1aa1098d3226 Mon Sep 17 00:00:00 2001 +From: Dave Reisner <dreisner@archlinux.org> +Date: Tue, 3 Jul 2012 22:28:05 -0400 +Subject: [initscripts][PATCH] remove /run/nologin before leaving rc.multi +To: arch-projects@archlinux.org + +systemd-186 writes this file when running systemd-tmpfiles, but +initscripts never removes it. This disallows all non-root logins. + +Reported-by: Dan McGee <dan@archlinux.org> +Signed-off-by: Dave Reisner <dreisner@archlinux.org> +--- + rc.multi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/rc.multi b/rc.multi +index daf2372..7d4acaa 100755 +--- a/rc.multi ++++ b/rc.multi +@@ -31,4 +31,6 @@ run_hook multi_end + + bootlogd_stop + ++rm -f /run/nologin ++ + # vim: set ts=2 sw=2 noet: +-- +1.7.11.1 + diff --git a/libre/initscripts/PKGBUILD b/libre/initscripts/PKGBUILD index aee2585d9..cc509fdd3 100644 --- a/libre/initscripts/PKGBUILD +++ b/libre/initscripts/PKGBUILD @@ -5,7 +5,7 @@ # Maintainer (Parabola): Nicolas Reynolds <fauno@kiwwwi.com.ar> pkgname=initscripts -pkgver=2012.06.28 +pkgver=2012.07.14 pkgrel=1 pkgdesc="System initialization/bootup scripts (Parabola branding)" arch=('any') @@ -21,12 +21,19 @@ optdepends=('bridge-utils: Network bridging support' makedepends=(asciidoc) install=initscripts.install source=("https://repo.parabolagnulinux.org/other/${pkgname}-${pkgver}.tar.xz" + 0001-remove-run-nologin-before-leaving-rc.multi.patch 'wireless.conf.d') +build() { + cd ${srcdir}/${pkgname}-${pkgver} +# patch -Np1 <"$srcdir/0001-remove-run-nologin-before-leaving-rc.multi.patch" +} + package() { cd ${srcdir}/${pkgname}-${pkgver} make DESTDIR=${pkgdir} install install -D -m644 ${srcdir}/wireless.conf.d ${pkgdir}/etc/conf.d/wireless } -md5sums=('21651eaba1fd34542c78f39c755cd171' +md5sums=('15e2f373be03b25b0033fd4fb4820d30' + 'ba32b9d723c20b38487669fb3c00d3d5' '027576534885b8d5dded9be546057b12') diff --git a/multilib/lib32-mesa/PKGBUILD b/multilib/lib32-mesa/PKGBUILD index 3328274ca..af9075f4d 100644 --- a/multilib/lib32-mesa/PKGBUILD +++ b/multilib/lib32-mesa/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 72580 2012-06-16 20:40:13Z lcarlier $ +# $Id: PKGBUILD 73672 2012-07-13 07:27:12Z lcarlier $ # Contributor: Jan de Groot <jgc@archlinux.org> # Contributor: Andreas Radke <andyrtr@archlinux.org> @@ -13,10 +13,10 @@ if [ "${_git}" = "true" ]; then #pkgver=7.10.99.git20110709 pkgver=7.11 else - pkgver=8.0.3 + pkgver=8.0.4 fi -pkgrel=3.2 +pkgrel=1 arch=('x86_64') makedepends=('glproto>=1.4.15' 'lib32-libdrm>=2.4.33' 'lib32-libxxf86vm>=1.1.1' 'lib32-libxdamage>=1.1.3' 'lib32-expat>=2.0.1' 'lib32-libx11>=1.4.99.1' 'lib32-libxt>=1.1.1' 'lib32-gcc-libs>=4.6.1' 'dri2proto>=2.6' 'python2' 'libxml2' 'gcc-multilib' 'imake' 'lib32-llvm' 'namcap') @@ -30,7 +30,7 @@ if [ "${_git}" = "true" ]; then else source=(${source[@]} "ftp://ftp.freedesktop.org/pub/mesa/${pkgver}/MesaLib-${pkgver}.tar.bz2") md5sums=('0082f4d17674155aa13bc611a5687788' - 'cc5ee15e306b8c15da6a478923797171') + 'd546f988adfdf986cff45b1efa2d8a46') fi #options=('!buildflags') diff --git a/multilib/lib32-nouveau-dri/PKGBUILD b/multilib/lib32-nouveau-dri/PKGBUILD index b25a8cf65..376e6d827 100644 --- a/multilib/lib32-nouveau-dri/PKGBUILD +++ b/multilib/lib32-nouveau-dri/PKGBUILD @@ -1,10 +1,10 @@ -# $Id: PKGBUILD 72577 2012-06-16 19:28:03Z lcarlier $ +# $Id: PKGBUILD 73674 2012-07-13 07:40:10Z lcarlier $ # Maintainer: Jan de Groot <jgc@archlinux.org> # Maintainer: Andreas Radke <andyrtr@archlinux.org> pkgname=lib32-nouveau-dri -pkgver=8.0.3 -pkgrel=3.2 +pkgver=8.0.4 +pkgrel=1 arch=('x86_64') makedepends=('glproto>=1.4.15' 'lib32-libdrm-old' 'lib32-libdrm-nouveau1' 'lib32-libxxf86vm>=1.1.1' 'lib32-libxdamage>=1.1.3' 'lib32-expat>=2.0.1' 'lib32-libx11>=1.4.99.1' 'lib32-libxt>=1.1.1' 'lib32-gcc-libs>=4.6.1' 'dri2proto>=2.6' 'python2' 'libxml2' 'gcc-multilib' 'imake' 'lib32-llvm' 'namcap') @@ -16,7 +16,7 @@ source=(LICENSE ) md5sums=('5c65a0fe315dd347e09b1f2826a1df5a' 'c452ed3392468170726c004c2f4e02ca' - 'cc5ee15e306b8c15da6a478923797171') + 'd546f988adfdf986cff45b1efa2d8a46') build() { cd ${srcdir}/?esa-* diff --git a/~fauno/pandoc/PKGBUILD b/~fauno/pandoc/PKGBUILD index b577f0cf1..410a3dd2b 100644 --- a/~fauno/pandoc/PKGBUILD +++ b/~fauno/pandoc/PKGBUILD @@ -4,7 +4,7 @@ # Run `makepkg -srp SRCBUILD` if you want to update the source tarball pkgname=pandoc -pkgver=1.9.4 +pkgver=1.9.4.2 pkgrel=1 pkgdesc='Conversion between markup formats (no Haskell libs)' url='http://johnmacfarlane.net/pandoc/' @@ -57,6 +57,6 @@ package() { find ${pkgdir}/usr/share -type f -exec chmod 644 {} \; find ${pkgdir}/usr/share -type d -exec chmod 755 {} \; } -md5sums=('dbf83bc5fae25877f8f1444c67fcc706' - '179a9b8a716e1de8e6afba3d43c3ebef' - 'ec809a0c1f787dc53c896c391d32ef6e') +md5sums=('3a9191e729a4547370f756ba831cad77' + 'a8da851ee560ce54c7c5044dfb5042f0' + '8dab4575128cf33941a577bfb500c417') diff --git a/~fauno/pandoc/SRCBUILD b/~fauno/pandoc/SRCBUILD index c8b13d906..68939a103 100644 --- a/~fauno/pandoc/SRCBUILD +++ b/~fauno/pandoc/SRCBUILD @@ -2,7 +2,7 @@ # Based on haskell-pandoc pkgname=pandoc -pkgver=1.9.4 +pkgver=1.9.4.2 pkgrel=1 pkgdesc='Conversion between markup formats (no Haskell libs)' url='http://johnmacfarlane.net/pandoc/' |