# HG changeset patch # User nemo # Date 1362339595 18000 # Node ID 91ad5fe4f1d5522a4e14e61473154221693ac2ed # Parent 627e76986a08c447172c49cfe045919865b299a7# Parent f9677715a582e26236118e4f85fc225ffe3e4796 add neglected merge diff -r f9677715a582 -r 91ad5fe4f1d5 QTfrontend/ui/page/AbstractPage.cpp --- a/QTfrontend/ui/page/AbstractPage.cpp Fri Mar 01 16:12:25 2013 -0500 +++ b/QTfrontend/ui/page/AbstractPage.cpp Sun Mar 03 14:39:55 2013 -0500 @@ -53,7 +53,7 @@ // add back/exit button btnBack = formattedButton(":/res/Exit.png", true); btnBack->setWhatsThis(tr("Go back")); - bottomLeftLayout->addWidget(btnBack, 0); + bottomLeftLayout->addWidget(btnBack, 0, Qt::AlignBottom); // add body layout as defined by the subclass pageLayout->addLayout(bodyLayoutDefinition(), 0, 0, 1, 3); diff -r f9677715a582 -r 91ad5fe4f1d5 QTfrontend/ui/page/pagemain.cpp --- a/QTfrontend/ui/page/pagemain.cpp Fri Mar 01 16:12:25 2013 -0500 +++ b/QTfrontend/ui/page/pagemain.cpp Sun Mar 03 14:39:55 2013 -0500 @@ -78,12 +78,12 @@ pageLayout->setAlignment(BtnInfo, Qt::AlignHCenter); BtnFeedback = addButton("Feedback", pageLayout, 4, 0, 1, 4, false); - BtnFeedback->setFixedSize(86, 27); + BtnFeedback->setStyleSheet("padding: 5px 10px"); BtnFeedback->setWhatsThis(tr("Leave a feedback here reporting issues, suggesting features or just saying how you like Hedgewars")); pageLayout->setAlignment(BtnFeedback, Qt::AlignHCenter); BtnDataDownload = addButton(tr("Downloadable Content"), pageLayout, 5, 0, 1, 4, false); - BtnDataDownload->setFixedSize(176, 27); + BtnDataDownload->setStyleSheet("padding: 5px 10px"); BtnDataDownload->setWhatsThis(tr("Access the user created content downloadable from our website")); pageLayout->setAlignment(BtnDataDownload, Qt::AlignHCenter); diff -r f9677715a582 -r 91ad5fe4f1d5 QTfrontend/ui/page/pageroomslist.h --- a/QTfrontend/ui/page/pageroomslist.h Fri Mar 01 16:12:25 2013 -0500 +++ b/QTfrontend/ui/page/pageroomslist.h Sun Mar 03 14:39:55 2013 -0500 @@ -34,6 +34,8 @@ public: RoomTableView(QWidget* parent = 0) : QTableView(parent){} + void moveUp(); + void moveDown(); }; class PageRoomsList : public AbstractPage diff -r f9677715a582 -r 91ad5fe4f1d5 QTfrontend/ui/widget/hatprompt.h --- a/QTfrontend/ui/widget/hatprompt.h Fri Mar 01 16:12:25 2013 -0500 +++ b/QTfrontend/ui/widget/hatprompt.h Sun Mar 03 14:39:55 2013 -0500 @@ -34,6 +34,10 @@ public: HatListView(QWidget* parent = 0) : QListView(parent){} + void moveUp(); + void moveDown(); + void moveLeft(); + void moveRight(); }; class HatPrompt : public QDialog diff -r f9677715a582 -r 91ad5fe4f1d5 QTfrontend/ui/widget/roomnameprompt.cpp --- a/QTfrontend/ui/widget/roomnameprompt.cpp Fri Mar 01 16:12:25 2013 -0500 +++ b/QTfrontend/ui/widget/roomnameprompt.cpp Sun Mar 03 14:39:55 2013 -0500 @@ -62,8 +62,13 @@ QPushButton * btnOkay = new QPushButton(tr("Create room")); connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept())); - buttonLayout->addWidget(btnCancel); - buttonLayout->addWidget(btnOkay); +#ifdef Q_WS_MAC + buttonLayout->addWidget(btnCancel); + buttonLayout->addWidget(btnOkay); +#else + buttonLayout->addWidget(btnOkay); + buttonLayout->addWidget(btnCancel); +#endif btnOkay->setDefault(true); setStyleSheet("QPushButton { padding: 5px; }"); diff -r f9677715a582 -r 91ad5fe4f1d5 QTfrontend/ui/widget/seedprompt.cpp --- a/QTfrontend/ui/widget/seedprompt.cpp Fri Mar 01 16:12:25 2013 -0500 +++ b/QTfrontend/ui/widget/seedprompt.cpp Sun Mar 03 14:39:55 2013 -0500 @@ -62,8 +62,13 @@ QPushButton * btnOkay = new QPushButton(tr("Set seed")); connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept())); +#ifdef Q_WS_MAC buttonLayout->addWidget(btnCancel); buttonLayout->addWidget(btnOkay); +#else + buttonLayout->addWidget(btnOkay); + buttonLayout->addWidget(btnCancel); +#endif btnOkay->setDefault(true); } else diff -r f9677715a582 -r 91ad5fe4f1d5 QTfrontend/ui/widget/themeprompt.h --- a/QTfrontend/ui/widget/themeprompt.h Fri Mar 01 16:12:25 2013 -0500 +++ b/QTfrontend/ui/widget/themeprompt.h Sun Mar 03 14:39:55 2013 -0500 @@ -34,6 +34,10 @@ public: ThemeListView(QWidget* parent = 0) : QListView(parent){} + void moveUp(); + void moveDown(); + void moveLeft(); + void moveRight(); }; class ThemePrompt : public QDialog diff -r f9677715a582 -r 91ad5fe4f1d5 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Fri Mar 01 16:12:25 2013 -0500 +++ b/hedgewars/GSHandlers.inc Sun Mar 03 14:39:55 2013 -0500 @@ -5182,14 +5182,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 diff -r f9677715a582 -r 91ad5fe4f1d5 hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Fri Mar 01 16:12:25 2013 -0500 +++ b/hedgewars/uGearsRender.pas Sun Mar 03 14:39:55 2013 -0500 @@ -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 f9677715a582 -r 91ad5fe4f1d5 hedgewars/uLandGraphics.pas --- a/hedgewars/uLandGraphics.pas Fri Mar 01 16:12:25 2013 -0500 +++ b/hedgewars/uLandGraphics.pas Sun Mar 03 14:39:55 2013 -0500 @@ -264,15 +264,13 @@ (i > LAND_WIDTH - 1) or (j < 0) or (j > LAND_HEIGHT -1) then - begin - result := 0; - exit; - end; + begin + result := 9; + exit; + end; - if ((Land[j, i] and $FF00) = 0) and ((Land[j, i] and lfIce) = 0) then - begin + if Land[j, i] and $FF00 and not lfIce = 0 then result := result + 1; - end; end; end; @@ -288,15 +286,25 @@ iceSurface:= SpritesData[sprIceTexture].Surface; icePixels := iceSurface^.pixels; w:= LandPixels[y, x]; - w:= round(((w shr RShift and $FF) * RGB_LUMINANCE_RED + - (w shr BShift and $FF) * RGB_LUMINANCE_GREEN + - (w shr GShift and $FF) * RGB_LUMINANCE_BLUE)); - if w < 128 then w:= w+128; - if w > 255 then w:= 255; - w:= (w shl RShift) or (w shl BShift) or (w shl GShift) or (LandPixels[y,x] and AMask); - //LandPixels[y, x]:= w; - LandPixels[y, x]:= addBgColor(w, IceColor); - LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]); + if w > 0 then + begin + w:= round(((w shr RShift and $FF) * RGB_LUMINANCE_RED + + (w shr BShift and $FF) * RGB_LUMINANCE_GREEN + + (w shr GShift and $FF) * RGB_LUMINANCE_BLUE)); + if w < 128 then w:= w+128; + if w > 255 then w:= 255; + w:= (w shl RShift) or (w shl BShift) or (w shl GShift) or (LandPixels[y,x] and AMask); + LandPixels[y, x]:= addBgColor(w, IceColor); + LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]) + end + else + begin + LandPixels[y, x]:= IceColor and not AMask or $E8 shl AShift; + LandPixels[y, x]:= addBgColor(LandPixels[y, x], icePixels^[iceSurface^.w * (y mod iceSurface^.h) + (x mod iceSurface^.w)]); + // silly workaround to avoid having to make background erasure a tadb it smarter about sea ice + if LandPixels[y, x] and AMask shr AShift = 255 then + LandPixels[y, x]:= LandPixels[y, x] and not AMask or 254 shl AShift; + end; end; function getIncrementInquarter(dx, dy, quarter: Longint): Longint; inline; @@ -385,10 +393,10 @@ begin for j := min(max(y, 0), LAND_HEIGHT - 1) to min(max(y + iceHeight, 0), LAND_HEIGHT - 1) do begin - if land[j, i] = 0 then + if Land[j, i] = 0 then begin - land[j, i] := lfIce; - drawIcePixel(j, i); + Land[j, i] := lfIce; + drawIcePixel(j, i); end; end; end; diff -r f9677715a582 -r 91ad5fe4f1d5 hedgewars/uRender.pas --- a/hedgewars/uRender.pas Fri Mar 01 16:12:25 2013 -0500 +++ b/hedgewars/uRender.pas Sun Mar 03 14:39:55 2013 -0500 @@ -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);