Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'release' into develop

  • Loading branch information...
commit 3ed22def4117a9e81d134092a6703bdddc8b42da 2 parents 34a0fc9 + 35f884c
jK authored
View
1  CMakeLists.txt
@@ -132,6 +132,7 @@ if (OPENMP)
# Currently FindOpenMP fails and doesn't give _any_ linker flags
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp -lgomp")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fopenmp -lgomp")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fopenmp -lgomp")
endif(OPENMP_FOUND)
endif (OPENMP)
View
3  doc/changelog.txt
@@ -41,6 +41,9 @@ Bugfixes:
- fixed spring-mt & spring-safemode links in window's startmenu
- fixed incorrect drawMidPos (e.g. used for command line drawing)
+Installer:
+ ! add vcredist_x86.exe to the installer / remove MSVCR71.dll from mingwlibs
+ - fixed safemode shortcuts
-- 87.0 ---------------------------------------------------------
Bugfixes:
View
2  installer/sections/deprecated.nsh
@@ -23,11 +23,9 @@
Delete "$INSTDIR\vorbis.dll"
Delete "$INSTDIR\ogg.dll"
Delete "$INSTDIR\cache\ArchiveCacheV9.lua"
- Delete "$INSTDIR\ArchiveCacheV7.lua"
; deprecated files
Delete "$INSTDIR\SpringDownloader.exe"
Delete "$INSTDIR\springfiles.url"
- Delete "$INSTDIR\springfiles.url"
Delete "$INSTDIR\ArchiveCacheV7.lua"
; Old AI stuff
RmDir /r "$INSTDIR\AI\Global"
View
5 installer/sections/vcredist.nsh
@@ -1,6 +1,9 @@
!ifdef INSTALL
File /oname=vcredist_x86.exe ${VCREDIST}
- ExecWait '"$INSTDIR\vcredist_x86.exe" /q'
+ ${IfNot} ${SectionIsSelected} ${SEC_PORTABLE}
+ ; install vcredist only on non-portal installs
+ ExecWait '"$INSTDIR\vcredist_x86.exe" /q'
+ ${EndIF}
!else
Delete "$INSTDIR\vcredist_x86.exe"
!endif
View
11 installer/spring.nsi
@@ -128,12 +128,9 @@ Section "Engine" SEC_MAIN
!include "sections\springsettings.nsh"
${!echonow} "Processing: deprecated"
!include "sections\deprecated.nsh"
- ${!echonow} "Processing: vcredist"
- !include "sections\vcredist.nsh"
!undef INSTALL
SectionEnd
-
SectionGroup "Multiplayer battlerooms"
Section "SpringLobby" SEC_SPRINGLOBBY
!define INSTALL
@@ -196,6 +193,12 @@ Section /o "Portable" SEC_PORTABLE
!undef INSTALL
SectionEnd
+Section "" SEC_VCREDIST
+ !define INSTALL
+ ${!echonow} "Processing: vcredist"
+ !include "sections\vcredist.nsh"
+ !undef INSTALL
+SectionEnd
!include "sections\sectiondesc.nsh"
@@ -231,7 +234,7 @@ Function .onInit
skiprunchecks:
; enable/disable sections depending on parameters
- !include "sections/SetupSections.nsh"
+ !include "sections/setupSections.nsh"
FunctionEnd
Function un.onUninstSuccess
View
111 rts/Sim/MoveTypes/GroundMoveType.cpp
@@ -1399,8 +1399,8 @@ void CGroundMoveType::HandleObjectCollisions()
const float colliderSpeed = collider->speed.Length();
const float colliderRadius = FOOTPRINT_RADIUS(colliderMD->xsize, colliderMD->zsize, 0.75f);
- HandleUnitCollisions(collider, collider->pos, oldPos, colliderSpeed, colliderRadius, sepDirMask, colliderUD, colliderMD, colliderMM);
- HandleFeatureCollisions(collider, collider->pos, oldPos, colliderSpeed, colliderRadius, sepDirMask, colliderUD, colliderMD, colliderMM);
+ HandleUnitCollisions(collider, colliderSpeed, colliderRadius, sepDirMask, colliderUD, colliderMD, colliderMM);
+ HandleFeatureCollisions(collider, colliderSpeed, colliderRadius, sepDirMask, colliderUD, colliderMD, colliderMM);
}
collider->mobility->tempOwner = NULL;
@@ -1409,8 +1409,6 @@ void CGroundMoveType::HandleObjectCollisions()
void CGroundMoveType::HandleUnitCollisions(
CUnit* collider,
- const float3& colliderCurPos,
- const float3& colliderOldPos,
const float colliderSpeed,
const float colliderRadius,
const float3& sepDirMask,
@@ -1420,7 +1418,7 @@ void CGroundMoveType::HandleUnitCollisions(
) {
const float searchRadius = std::max(colliderSpeed, 1.0f) * (colliderRadius * 2.0f);
- const std::vector<CUnit*>& nearUnits = qf->GetUnitsExact(colliderCurPos, searchRadius);
+ const std::vector<CUnit*>& nearUnits = qf->GetUnitsExact(collider->pos, searchRadius);
std::vector<CUnit*>::const_iterator uit;
// NOTE: probably too large for most units (eg. causes tree falling animations to be skipped)
@@ -1441,9 +1439,6 @@ void CGroundMoveType::HandleUnitCollisions(
const MoveDef* collideeMD = collidee->mobility;
const CMoveMath* collideeMM = (collideeMobile)? collideeMD->moveMath: NULL;
- const float3& collideeCurPos = collidee->pos;
- const float3& collideeOldPos = collidee->moveType->oldPos;
-
// use the collidee's MoveDef footprint if it is mobile
// use the collidee's Unit (not UnitDef) footprint otherwise
const float collideeSpeed = collidee->speed.Length();
@@ -1451,7 +1446,7 @@ void CGroundMoveType::HandleUnitCollisions(
FOOTPRINT_RADIUS(collideeMD->xsize, collideeMD->zsize, 0.75f):
FOOTPRINT_RADIUS(collidee ->xsize, collidee ->zsize, 0.75f);
- const float3 separationVector = colliderCurPos - collideeCurPos;
+ const float3 separationVector = collider->pos - collidee->pos;
const float separationMinDistSq = (colliderRadius + collideeRadius) * (colliderRadius + collideeRadius);
if ((separationVector.SqLength() - separationMinDistSq) > 0.01f)
@@ -1497,8 +1492,12 @@ void CGroundMoveType::HandleUnitCollisions(
eventHandler.UnitUnitCollision(collider, collidee);
+ const float colliderRelRadius = colliderRadius / (colliderRadius + collideeRadius);
+ const float collideeRelRadius = collideeRadius / (colliderRadius + collideeRadius);
+ const float collisionRadiusSum = (colliderRadius * colliderRelRadius + collideeRadius * collideeRelRadius);
+
const float sepDistance = separationVector.Length() + 0.01f;
- const float penDistance = std::max((colliderRadius + collideeRadius) - sepDistance, 1.0f);
+ const float penDistance = std::max(collisionRadiusSum - sepDistance, 1.0f);
const float sepResponse = std::min(SQUARE_SIZE * 2.0f, penDistance * 0.5f);
const float3 sepDirection = (separationVector / sepDistance);
@@ -1512,24 +1511,41 @@ void CGroundMoveType::HandleUnitCollisions(
c1 = 1.0f + (1.0f - math::fabs(collider->frontdir.dot(-sepDirection))) * 5.0f,
c2 = 1.0f + (1.0f - math::fabs(collidee->frontdir.dot( sepDirection))) * 5.0f,
s1 = m1 * v1 * c1,
- s2 = m2 * v2 * c2;
+ s2 = m2 * v2 * c2,
+ r1 = s1 / (s1 + s2 + 1.0f),
+ r2 = s2 / (s1 + s2 + 1.0f);
// far from a realistic treatment, but works
- const float collisionMassSum = s1 + s2 + 1.0f;
- float colliderMassScale = std::max(0.01f, std::min(0.99f, 1.0f - (s1 / collisionMassSum)));
- float collideeMassScale = std::max(0.01f, std::min(0.99f, 1.0f - (s2 / collisionMassSum)));
+ float colliderMassScale = std::max(0.01f, std::min(0.99f, 1.0f - r1));
+ float collideeMassScale = std::max(0.01f, std::min(0.99f, 1.0f - r2));
+
+ if (collider->isMoving && collidee->isMoving) {
+ #define SIGN(v) ((int(v >= 0.0f) * 2) - 1)
+ // push collider and collidee laterally in opposite directions
+ const int colliderSign = SIGN( separationVector.dot(collider->rightdir));
+ const int collideeSign = SIGN(-separationVector.dot(collidee->rightdir));
+ const float3 colliderSlideVec = collider->rightdir * colliderSign * (1.0f / penDistance);
+ const float3 collideeSlideVec = collidee->rightdir * collideeSign * (1.0f / penDistance);
+
+ if (pushCollider) { collider->Move3D(colliderSlideVec * r2, true); }
+ if (pushCollidee) { collidee->Move3D(collideeSlideVec * r1, true); }
+ #undef SIGN
+ }
if (!collideeMobile) {
- const float3 colliderNxtPos = colliderCurPos + collider->speed;
- const CMoveMath::BlockType colliderCurPosBits = colliderMM->IsBlocked(*colliderMD, colliderCurPos);
- const CMoveMath::BlockType colliderNxtPosBits = colliderMM->IsBlocked(*colliderMD, colliderNxtPos);
+ CMoveMath::BlockType posBits;
- if ((colliderCurPosBits & CMoveMath::BLOCK_STRUCTURE) == 0)
+ if (collider->speed == ZeroVector)
continue;
- if (colliderNxtPos == colliderCurPos)
+
+ posBits = colliderMM->IsBlocked(*colliderMD, collider->pos);
+
+ if ((posBits & CMoveMath::BLOCK_STRUCTURE) == 0)
continue;
- if ((colliderNxtPosBits & CMoveMath::BLOCK_STRUCTURE) != 0) {
+ posBits = colliderMM->IsBlocked(*colliderMD, collider->pos + collider->speed);
+
+ if ((posBits & CMoveMath::BLOCK_STRUCTURE) != 0) {
// applied every frame objects are colliding, so be careful
collider->AddImpulse(sepDirection * sepDirMask);
@@ -1556,15 +1572,20 @@ void CGroundMoveType::HandleUnitCollisions(
}
}
- const float3 colliderNewPos = colliderCurPos + (colResponseVec * colliderMassScale);
- const float3 collideeNewPos = collideeCurPos - (colResponseVec * collideeMassScale);
+ const float3 colliderPushPos = collider->pos + (colResponseVec * colliderMassScale);
+ const float3 collideePushPos = collidee->pos - (colResponseVec * collideeMassScale);
+
+ const bool cancelColliderPush =
+ ((colliderMM->IsBlocked(*colliderMD, colliderPushPos) & CMoveMath::BLOCK_STRUCTURE) != 0) ||
+ ((colliderMM->GetPosSpeedMod(*colliderMD, colliderPushPos) <= 0.01f));
+ const bool cancelCollideePush =
+ (collideeMobile && (collideeMM->IsBlocked(*collideeMD, collideePushPos) & CMoveMath::BLOCK_STRUCTURE) != 0) ||
+ (collideeMobile && (collideeMM->GetPosSpeedMod(*collideeMD, collideePushPos) <= 0.01f));
// try to prevent both parties from being pushed onto non-traversable
// squares (without stopping them dead in their tracks, which is worse)
- if ( (colliderMM->IsBlocked(*colliderMD, colliderNewPos) & CMoveMath::BLOCK_STRUCTURE) != 0) { colliderMassScale = 0.0f; }
- if (collideeMobile && (collideeMM->IsBlocked(*collideeMD, collideeNewPos) & CMoveMath::BLOCK_STRUCTURE) != 0) { collideeMassScale = 0.0f; }
- if ( colliderMM->GetPosSpeedMod(*colliderMD, colliderNewPos) <= 0.01f) { colliderMassScale = 0.0f; }
- if (collideeMobile && collideeMM->GetPosSpeedMod(*collideeMD, collideeNewPos) <= 0.01f) { collideeMassScale = 0.0f; }
+ if (cancelColliderPush) { colliderMassScale = 0.0f; }
+ if (cancelCollideePush) { collideeMassScale = 0.0f; }
// ignore pushing contributions from idling friendly collidee's
// (or if we are resistant to them) without stopping; this will
@@ -1575,15 +1596,15 @@ void CGroundMoveType::HandleUnitCollisions(
// either both parties are pushed, or only one party is pushed and the other is stopped, or both are stopped
if ( pushCollider) { collider->Move3D( colResponseVec * colliderMassScale, true); }
- else if (colliderMobile) { collider->Move3D(colliderOldPos, false); }
+ else if (colliderMobile) { collider->Move3D(collider->moveType->oldPos, false); }
if ( pushCollidee) { collidee->Move3D(-colResponseVec * collideeMassScale, true); }
- else if (collideeMobile) { collidee->Move3D(collideeOldPos, false); }
+ else if (collideeMobile) { collidee->Move3D(collidee->moveType->oldPos, false); }
#if 0
if (!((gs->frameNum + collider->id) & 31) && !colliderCAI->unimportantMove) {
// if we do not have an internal move order, tell units around us to bugger off
// note: this causes too much chaos among the ranks when groups get large
- helper->BuggerOff(colliderCurPos + collider->frontdir * colliderRadius, colliderRadius, true, false, collider->team, collider);
+ helper->BuggerOff(collider->pos + collider->frontdir * colliderRadius, colliderRadius, true, false, collider->team, collider);
}
#endif
}
@@ -1591,8 +1612,6 @@ void CGroundMoveType::HandleUnitCollisions(
void CGroundMoveType::HandleFeatureCollisions(
CUnit* collider,
- const float3& colliderCurPos,
- const float3& colliderOldPos,
const float colliderSpeed,
const float colliderRadius,
const float3& sepDirMask,
@@ -1602,7 +1621,7 @@ void CGroundMoveType::HandleFeatureCollisions(
) {
const float searchRadius = std::max(colliderSpeed, 1.0f) * (colliderRadius * 2.0f);
- const std::vector<CFeature*>& nearFeatures = qf->GetFeaturesExact(colliderCurPos, searchRadius);
+ const std::vector<CFeature*>& nearFeatures = qf->GetFeaturesExact(collider->pos, searchRadius);
std::vector<CFeature*>::const_iterator fit;
const int dirSign = int(!reversing) * 2 - 1;
@@ -1612,13 +1631,11 @@ void CGroundMoveType::HandleFeatureCollisions(
CFeature* collidee = const_cast<CFeature*>(*fit);
// const FeatureDef* collideeFD = collidee->def;
- const float3& collideeCurPos = collidee->pos;
-
// use the collidee's Feature (not FeatureDef) footprint
// const float collideeRadius = FOOTPRINT_RADIUS(collideeFD->xsize, collideeFD->zsize, 0.75f);
const float collideeRadius = FOOTPRINT_RADIUS(collidee->xsize, collidee->zsize, 0.75f);
- const float3 separationVector = colliderCurPos - collideeCurPos;
+ const float3 separationVector = collider->pos - collidee->pos;
const float separationMinDistSq = (colliderRadius + collideeRadius) * (colliderRadius + collideeRadius);
if ((separationVector.SqLength() - separationMinDistSq) > 0.01f)
@@ -1650,23 +1667,27 @@ void CGroundMoveType::HandleFeatureCollisions(
c1 = (1.0f - math::fabs( collider->frontdir.dot(-sepDirection))) * 5.0f,
c2 = (1.0f - math::fabs(-collider->frontdir.dot( sepDirection))) * 5.0f,
s1 = m1 * v1 * c1,
- s2 = m2 * v2 * c2;
+ s2 = m2 * v2 * c2,
+ r1 = s1 / (s1 + s2 + 1.0f),
+ r2 = s2 / (s1 + s2 + 1.0f);
- const float collisionMassSum = s1 + s2 + 1.0f;
- const float colliderMassScale = std::max(0.01f, std::min(0.99f, 1.0f - (s1 / collisionMassSum)));
- // const float collideeMassScale = std::max(0.01f, std::min(0.99f, 1.0f - (s2 / collisionMassSum)));
+ const float colliderMassScale = std::max(0.01f, std::min(0.99f, 1.0f - r1));
+ // const float collideeMassScale = std::max(0.01f, std::min(0.99f, 1.0f - r2));
if (collidee->reachedFinalPos) {
- const float3 colliderNxtPos = colliderCurPos + collider->speed;
- const CMoveMath::BlockType colliderCurPosBits = colliderMM->IsBlocked(*colliderMD, colliderCurPos);
- const CMoveMath::BlockType colliderNxtPosBits = colliderMM->IsBlocked(*colliderMD, colliderNxtPos);
+ CMoveMath::BlockType posBits;
- if ((colliderCurPosBits & CMoveMath::BLOCK_STRUCTURE) == 0)
+ if (collider->speed == ZeroVector)
continue;
- if (colliderNxtPos == colliderCurPos)
+
+ posBits = colliderMM->IsBlocked(*colliderMD, collider->pos);
+
+ if ((posBits & CMoveMath::BLOCK_STRUCTURE) == 0)
continue;
- if ((colliderNxtPosBits & CMoveMath::BLOCK_STRUCTURE) != 0) {
+ posBits = colliderMM->IsBlocked(*colliderMD, collider->pos + collider->speed);
+
+ if ((posBits & CMoveMath::BLOCK_STRUCTURE) != 0) {
// applied every frame objects are colliding, so be careful
collider->AddImpulse(sepDirection * sepDirMask);
View
4 rts/Sim/MoveTypes/GroundMoveType.h
@@ -69,8 +69,6 @@ class CGroundMoveType : public AMoveType
void HandleObjectCollisions();
void HandleUnitCollisions(
CUnit* collider,
- const float3& colliderCurPos,
- const float3& colliderOldPos,
const float colliderSpeed,
const float colliderRadius,
const float3& sepDirMask,
@@ -79,8 +77,6 @@ class CGroundMoveType : public AMoveType
const CMoveMath* colliderMM);
void HandleFeatureCollisions(
CUnit* collider,
- const float3& colliderCurPos,
- const float3& colliderOldPos,
const float colliderSpeed,
const float colliderRadius,
const float3& sepDirMask,
Please sign in to comment.
Something went wrong with that request. Please try again.