# HG changeset patch # User koda # Date 1362389610 -3600 # Node ID 0a6837edb278dff91fb56b25781be8decba2a175 # Parent bf63104605fe0b0050c22e8319c1c4f60652e8d9# Parent 76a265f3967cfdd7abec020f735fd98475a76f91 merge for the win diff -r 76a265f3967c -r 0a6837edb278 CMakeLists.txt --- a/CMakeLists.txt Sun Mar 03 23:25:34 2013 +0400 +++ b/CMakeLists.txt Mon Mar 04 10:33:30 2013 +0100 @@ -236,8 +236,6 @@ #get BUILD_TYPE and enable/disable optimisation message(STATUS "Using ${CMAKE_BUILD_TYPE} configuration") if(CMAKE_BUILD_TYPE MATCHES "DEBUG") - set(HW_DEV true) #becomes isDevBuild - list(APPEND pascal_flags "-O-" # disable all optimisations "-g" # enable debug symbols "-gl" # add line info to bt @@ -245,8 +243,6 @@ ) list(APPEND haskell_flags "-Wall" "-debug" "-dcore-lint" "-fno-warn-unused-do-bind") else() - set(HW_DEV false) - list(APPEND pascal_flags "-Os" # optimise for size "-Xs" # strip binary "-Si" # turn on inlining @@ -265,7 +261,6 @@ endif() if(ghc_executable) - set(HAVE_NETSERVER true) add_subdirectory(gameServer) message(STATUS "Found GHC: ${ghc_executable}") else() diff -r 76a265f3967c -r 0a6837edb278 QTfrontend/hwconsts.cpp.in --- a/QTfrontend/hwconsts.cpp.in Sun Mar 03 23:25:34 2013 +0400 +++ b/QTfrontend/hwconsts.cpp.in Mon Mar 04 10:33:30 2013 +0100 @@ -73,8 +73,5 @@ QString * netHost = new QString(); quint16 netPort = NETGAME_DEFAULT_PORT; -bool haveServer = ${HAVE_NETSERVER}; -bool isDevBuild = ${HW_DEV}; - int season = SEASON_NONE; int years_since_foundation = 0; diff -r 76a265f3967c -r 0a6837edb278 QTfrontend/hwconsts.h --- a/QTfrontend/hwconsts.h Sun Mar 03 23:25:34 2013 +0400 +++ b/QTfrontend/hwconsts.h Mon Mar 04 10:33:30 2013 +0100 @@ -50,8 +50,6 @@ extern QString * netHost; extern quint16 netPort; -extern bool haveServer; -extern bool isDevBuild; //Current season, SEASON_NONE by default extern int season; diff -r 76a265f3967c -r 0a6837edb278 QTfrontend/net/tcpBase.cpp --- a/QTfrontend/net/tcpBase.cpp Sun Mar 03 23:25:34 2013 +0400 +++ b/QTfrontend/net/tcpBase.cpp Mon Mar 04 10:33:30 2013 +0100 @@ -141,9 +141,10 @@ connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(StartProcessError(QProcess::ProcessError))); QStringList arguments=getArguments(); +#ifdef DEBUG // redirect everything written on stdout/stderr - if(isDevBuild) - process->setProcessChannelMode(QProcess::ForwardedChannels); + process->setProcessChannelMode(QProcess::ForwardedChannels); +#endif process->start(bindir->absolutePath() + "/hwengine", arguments); #endif diff -r 76a265f3967c -r 0a6837edb278 QTfrontend/ui/page/pagemain.cpp --- a/QTfrontend/ui/page/pagemain.cpp Sun Mar 03 23:25:34 2013 +0400 +++ b/QTfrontend/ui/page/pagemain.cpp Mon Mar 04 10:33:30 2013 +0100 @@ -127,17 +127,15 @@ { initPage(); - if(frontendEffects) setAttribute(Qt::WA_NoSystemBackground, true); + if(frontendEffects) + setAttribute(Qt::WA_NoSystemBackground, true); mainNote->setOpenExternalLinks(true); - if(!isDevBuild) - { - setDefautDescription(QLabel::tr("Tip: ") + randomTip()); - } - else - { - setDefautDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!")); - } +#ifdef DEBUG + setDefautDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!")); +#else + setDefautDescription(QLabel::tr("Tip: ") + randomTip()); +#endif } diff -r 76a265f3967c -r 0a6837edb278 QTfrontend/ui/page/pagenet.cpp --- a/QTfrontend/ui/page/pagenet.cpp Sun Mar 03 23:25:34 2013 +0400 +++ b/QTfrontend/ui/page/pagenet.cpp Mon Mar 04 10:33:30 2013 +0100 @@ -72,7 +72,12 @@ BtnNetSvrStart = formattedButton(QPushButton::tr("Start server")); BtnNetSvrStart->setMinimumWidth(180); - BtnNetSvrStart->setVisible(haveServer); + QString serverPath = bindir->absolutePath() + "/hedgewars-server"; +#ifdef Q_WS_WIN + serverPath += + ".exe"; +#endif + QFile server(serverPath); + BtnNetSvrStart->setVisible(server.exists()); footerLayout->addStretch(); footerLayout->addWidget(BtnNetSvrStart); diff -r 76a265f3967c -r 0a6837edb278 QTfrontend/ui/page/pageroomslist.cpp --- a/QTfrontend/ui/page/pageroomslist.cpp Sun Mar 03 23:25:34 2013 +0400 +++ b/QTfrontend/ui/page/pageroomslist.cpp Mon Mar 04 10:33:30 2013 +0100 @@ -75,7 +75,7 @@ corner->setFixedSize(10, 10); const QIcon& lp = QIcon(":/res/new.png"); - QSize sz = lp.actualSize(QSize(65535, 65535)); + //QSize sz = lp.actualSize(QSize(65535, 65535)); BtnCreate = new QPushButton(); BtnCreate->setText(tr("Create room")); BtnCreate->setIcon(lp); diff -r 76a265f3967c -r 0a6837edb278 QTfrontend/ui/widget/feedbackdialog.cpp --- a/QTfrontend/ui/widget/feedbackdialog.cpp Sun Mar 03 23:25:34 2013 +0400 +++ b/QTfrontend/ui/widget/feedbackdialog.cpp Mon Mar 04 10:33:30 2013 +0100 @@ -273,7 +273,7 @@ delete process; #endif -#ifdef __i386__ || __x86_64__ +#if defined(__i386__) || defined(__x86_64__) // cpu info quint32 registers[4]; quint32 i; diff -r 76a265f3967c -r 0a6837edb278 QTfrontend/ui_hwform.cpp --- a/QTfrontend/ui_hwform.cpp Sun Mar 03 23:25:34 2013 +0400 +++ b/QTfrontend/ui_hwform.cpp Mon Mar 04 10:33:30 2013 +0100 @@ -54,9 +54,10 @@ HWForm->setObjectName(QString::fromUtf8("HWForm")); HWForm->resize(QSize(640, 480).expandedTo(HWForm->minimumSizeHint())); HWForm->setMinimumSize(QSize(720, 450)); - QString suffix = isDevBuild ? - QMainWindow::tr("-r%1 (%2)").arg(*cRevisionString, *cHashString) : QString(""); - QString title = QMainWindow::tr("Hedgewars %1").arg(*cVersionString) + suffix; + QString title = QMainWindow::tr("Hedgewars %1").arg(*cVersionString); +#ifdef DEBUG + title += QMainWindow::tr("-r%1 (%2)").arg(*cRevisionString, *cHashString); +#endif HWForm->setWindowTitle(title); centralWidget = new QWidget(HWForm); centralWidget->setObjectName(QString::fromUtf8("centralWidget")); diff -r 76a265f3967c -r 0a6837edb278 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sun Mar 03 23:25:34 2013 +0400 +++ b/hedgewars/GSHandlers.inc Mon Mar 04 10:33:30 2013 +0100 @@ -92,7 +92,7 @@ else begin - if (gi^.State and gstMoving) = 0 then + if ((gi^.State and gstMoving) = 0) and (gi^.Hedgehog^.Effects[heFrozen] = 0) then begin gi^.dX.isNegative:= X 32) then continue; @@ -4584,8 +4584,8 @@ if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9) , lfIndestructible) then begin - Gear^.X := Gear^.X + Gear^.dX; - Gear^.Y := Gear^.Y + _1_9; + //Gear^.X := Gear^.X + Gear^.dX; + Gear^.Y := Gear^.Y + _1_9 end; end; if TestCollisionYwithGear(Gear, 1) <> 0 then @@ -4596,14 +4596,15 @@ end else begin - Gear^.dY := Gear^.dY + cGravity; - Gear^.Y := Gear^.Y + Gear^.dY; + //Gear^.dY := Gear^.dY + cGravity; + //Gear^.Y := Gear^.Y + Gear^.dY; if hwRound(Gear^.Y) > cWaterLine then Gear^.Timer := 1 end; - Gear^.X := Gear^.X + HitGear^.dX; + //Gear^.X := Gear^.X + HitGear^.dX; HitGear^.X := Gear^.X; + HitGear^.Y := Gear^.Y; SetLittle(HitGear^.dY); HitGear^.Active:= true; end; @@ -4956,7 +4957,7 @@ end; Gear^.Pos:= 4; // This condition might need tweaking - Gear^.Timer:= GetRandom(cHedgehogTurnTime*TeamsCount*2)+cHedgehogTurnTime*2 + Gear^.Timer:= GetRandom(cHedgehogTurnTime*TeamsCount)+cHedgehogTurnTime end; if (Gear^.Pos = 4) then @@ -4992,7 +4993,7 @@ Gear^.Power:= 0; end end - else dec(Gear^.Timer); + else if (CurrentHedgehog^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan) then dec(Gear^.Timer) end; end; @@ -5124,10 +5125,7 @@ AfterAttack; exit end - else - begin - updateFuel(Gear); - end; + else if Gear^.Message and (gmUp or gmDown) = 0 then updateFuel(Gear); with Gear^ do begin @@ -5182,14 +5180,14 @@ begin FillRoundInLandWithIce(Target.X, Target.Y, iceRadius); SetAllHHToActive; - IceState := iceWaitNextTarget; + IceState := iceWaitCollision; end; if (IceState = iceCollideWithWater) and ((GameTicks - IceTime) > groundFreezingTime) then begin DrawIceBreak(Target.X, cWaterLine - iceHeight, iceRadius, iceHeight); SetAllHHToActive; - IceState := iceWaitNextTarget; + IceState := iceWaitCollision; end; // freeze nearby hogs @@ -5203,7 +5201,7 @@ if hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] < 256 then hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] := hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] + 1 else if hogs.ar^[i]^.Hedgehog^.Effects[heFrozen] = 256 then - hogs.ar^[i]^.Hedgehog^.Effects[heFrozen]:= 100000 + hogs.ar^[i]^.Hedgehog^.Effects[heFrozen]:= cHedgehogTurnTime + cReadyDelay end; inc(Pos) end diff -r 76a265f3967c -r 0a6837edb278 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Mar 03 23:25:34 2013 +0400 +++ b/hedgewars/uGears.pas Mon Mar 04 10:33:30 2013 +0100 @@ -838,7 +838,7 @@ ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg * 100, dsUnknown); // crank up damage for explosives + blowtorch end; - if (Gear^.Kind = gtHedgehog) and Gear^.Hedgehog^.King then + if (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.King or (Gear^.Hedgehog^.Effects[heFrozen] > 0)) then begin Gear^.dX:= Ammo^.dX * Power * _0_005; Gear^.dY:= Ammo^.dY * Power * _0_005 diff -r 76a265f3967c -r 0a6837edb278 hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Sun Mar 03 23:25:34 2013 +0400 +++ b/hedgewars/uGearsHedgehog.pas Mon Mar 04 10:33:30 2013 +0100 @@ -65,7 +65,12 @@ begin if (CurAmmoType = amSniperRifle) and ((GameFlags and gfArtillery) = 0) then cArtillery := false; - OnUsedAmmo(HHGear^.Hedgehog^) + if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0 then + begin + MultiShootAttacks:= Ammoz[CurAmmoType].Ammo.NumPerTurn; + AfterAttack + end + else OnUsedAmmo(HHGear^.Hedgehog^) end; MultiShootAttacks:= 0; @@ -1219,6 +1224,7 @@ begin if (Gear^.Message and (gmAllStoppable or gmLJump or gmHJump) = 0) and (Gear^.State and (gstHHJumping or gstHHHJump or gstAttacking) = 0) + and ((Gear^.Hedgehog = nil) or ((Gear^.Hedgehog^.Effects[heFrozen] = 0) or (Gear^.Hedgehog^.Effects[heFrozen] > 255))) and (not Gear^.dY.isNegative) and (TurnTimeLeft > 0) and (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then begin slope:= CalcSlopeBelowGear(Gear); @@ -1256,7 +1262,7 @@ if GameTicks mod 100 = 0 then CheckIce(Gear); if Gear^.Hedgehog^.Effects[heFrozen] > 0 then begin - if Gear^.Hedgehog^.Effects[heFrozen] > 256 then + if (Gear^.Hedgehog^.Effects[heFrozen] > 256) and (CurrentHedgehog^.Team^.Clan <> Gear^.Hedgehog^.Team^.Clan) then dec(Gear^.Hedgehog^.Effects[heFrozen]) else if GameTicks mod 10 = 0 then dec(Gear^.Hedgehog^.Effects[heFrozen]) diff -r 76a265f3967c -r 0a6837edb278 hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Sun Mar 03 23:25:34 2013 +0400 +++ b/hedgewars/uGearsRender.pas Mon Mar 04 10:33:30 2013 +0100 @@ -1271,8 +1271,13 @@ begin i:= random(100)+100; if Gear^.Target.X <> NoPointX then - DrawLine(Gear^.Target.X, Gear^.Target.Y, hwRound(HHGear^.X), hwRound(HHGear^.Y), 4.0, i, i, $FF, $40) - else DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40); + begin + DrawLine(Gear^.Target.X, Gear^.Target.Y, hwRound(HHGear^.X), hwRound(HHGear^.Y), 4.0, i, i, $FF, $40); + end + else + begin + DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40); + end; end end end; diff -r 76a265f3967c -r 0a6837edb278 hedgewars/uGearsUtils.pas --- a/hedgewars/uGearsUtils.pas Sun Mar 03 23:25:34 2013 +0400 +++ b/hedgewars/uGearsUtils.pas Mon Mar 04 10:33:30 2013 +0100 @@ -182,8 +182,7 @@ i:= _1; if (CurrentHedgehog <> nil) and CurrentHedgehog^.King then i:= _1_5; -if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Effects[heFrozen] > 0) then i:=i*_0_2; -if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.King) then +if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.King or (Gear^.Hedgehog^.Effects[heFrozen] > 0)) then ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent * _0_5) else ModifyDamage:= hwRound(_0_01 * cDamageModifier * dmg * i * cDamagePercent) diff -r 76a265f3967c -r 0a6837edb278 hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Sun Mar 03 23:25:34 2013 +0400 +++ b/hedgewars/uLandGraphics.pas Mon Mar 04 10:33:30 2013 +0100 @@ -265,7 +265,7 @@ (j < 0) or (j > LAND_HEIGHT -1) then begin - result := 0; + result := 9; exit; end; diff -r 76a265f3967c -r 0a6837edb278 hedgewars/uRender.pas --- a/hedgewars/uRender.pas Sun Mar 03 23:25:34 2013 +0400 +++ b/hedgewars/uRender.pas Mon Mar 04 10:33:30 2013 +0100 @@ -349,7 +349,7 @@ end; procedure DrawLine(X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte); -var VertexBuffer: array [0..3] of TVertex2f; +var VertexBuffer: array [0..1] of TVertex2f; begin glDisable(GL_TEXTURE_2D); glEnable(GL_LINE_SMOOTH);