lol nemo, lol
authorunc0rr
Sun, 03 Mar 2013 23:23:41 +0400
changeset 8625 d77090a8a35e
parent 8624 12bdc51a6790 (diff)
parent 8621 f9677715a582 (current diff)
child 8627 ea2d32a03ac9
lol nemo, lol
--- a/QTfrontend/ui/page/AbstractPage.cpp	Fri Mar 01 16:12:25 2013 -0500
+++ b/QTfrontend/ui/page/AbstractPage.cpp	Sun Mar 03 23:23:41 2013 +0400
@@ -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);
--- a/QTfrontend/ui/page/pagemain.cpp	Fri Mar 01 16:12:25 2013 -0500
+++ b/QTfrontend/ui/page/pagemain.cpp	Sun Mar 03 23:23:41 2013 +0400
@@ -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);
 
--- a/QTfrontend/ui/page/pageroomslist.h	Fri Mar 01 16:12:25 2013 -0500
+++ b/QTfrontend/ui/page/pageroomslist.h	Sun Mar 03 23:23:41 2013 +0400
@@ -34,6 +34,8 @@
 
     public:
         RoomTableView(QWidget* parent = 0) : QTableView(parent){}
+        void moveUp();
+        void moveDown();
 };
 
 class PageRoomsList : public AbstractPage
--- a/QTfrontend/ui/widget/hatprompt.h	Fri Mar 01 16:12:25 2013 -0500
+++ b/QTfrontend/ui/widget/hatprompt.h	Sun Mar 03 23:23:41 2013 +0400
@@ -34,6 +34,10 @@
 
     public:
         HatListView(QWidget* parent = 0) : QListView(parent){}
+        void moveUp();
+        void moveDown();
+        void moveLeft();
+        void moveRight();
 };
 
 class HatPrompt : public QDialog
--- a/QTfrontend/ui/widget/roomnameprompt.cpp	Fri Mar 01 16:12:25 2013 -0500
+++ b/QTfrontend/ui/widget/roomnameprompt.cpp	Sun Mar 03 23:23:41 2013 +0400
@@ -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; }");
--- a/QTfrontend/ui/widget/seedprompt.cpp	Fri Mar 01 16:12:25 2013 -0500
+++ b/QTfrontend/ui/widget/seedprompt.cpp	Sun Mar 03 23:23:41 2013 +0400
@@ -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
--- a/QTfrontend/ui/widget/themeprompt.h	Fri Mar 01 16:12:25 2013 -0500
+++ b/QTfrontend/ui/widget/themeprompt.h	Sun Mar 03 23:23:41 2013 +0400
@@ -34,6 +34,10 @@
 
     public:
         ThemeListView(QWidget* parent = 0) : QListView(parent){}
+        void moveUp();
+        void moveDown();
+        void moveLeft();
+        void moveRight();
 };
 
 class ThemePrompt : public QDialog
--- a/hedgewars/uLandGraphics.pas	Fri Mar 01 16:12:25 2013 -0500
+++ b/hedgewars/uLandGraphics.pas	Sun Mar 03 23:23:41 2013 +0400
@@ -264,15 +264,13 @@
            (i > LAND_WIDTH - 1) or
            (j < 0) or
            (j > LAND_HEIGHT -1) then
-               begin               
-                result := 0;
-                exit;
-               end;
+           begin               
+           result := 0;
+           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;