hud.cpp: fix wrong indent in drawItem
authorLoïc Blot <loic.blot@unix-experience.fr>
Mon, 19 Jun 2017 13:20:30 +0000 (15:20 +0200)
committerLoïc Blot <loic.blot@unix-experience.fr>
Mon, 19 Jun 2017 13:20:30 +0000 (15:20 +0200)
src/hud.cpp

index b030215d41eb0113b77c443e41760b36cd3df900..1b3b2f26420d5e1afea5eb1a5ede3a8aadc43b76 100644 (file)
@@ -120,79 +120,79 @@ void Hud::drawItem(const ItemStack &item, const core::rect<s32>& rect,
                bool selected)
 {
        if (selected) {
-                       /* draw hihlighting around selected item */
-                       if (use_hotbar_selected_image) {
-                               core::rect<s32> imgrect2 = rect;
-                               imgrect2.UpperLeftCorner.X  -= (m_padding*2);
-                               imgrect2.UpperLeftCorner.Y  -= (m_padding*2);
-                               imgrect2.LowerRightCorner.X += (m_padding*2);
-                               imgrect2.LowerRightCorner.Y += (m_padding*2);
-                                       video::ITexture *texture = tsrc->getTexture(hotbar_selected_image);
-                                       core::dimension2di imgsize(texture->getOriginalSize());
-                               draw2DImageFilterScaled(driver, texture, imgrect2,
-                                               core::rect<s32>(core::position2d<s32>(0,0), imgsize),
-                                               NULL, hbar_colors, true);
-                       } else {
-                               video::SColor c_outside(255,255,0,0);
-                               //video::SColor c_outside(255,0,0,0);
-                               //video::SColor c_inside(255,192,192,192);
-                               s32 x1 = rect.UpperLeftCorner.X;
-                               s32 y1 = rect.UpperLeftCorner.Y;
-                               s32 x2 = rect.LowerRightCorner.X;
-                               s32 y2 = rect.LowerRightCorner.Y;
-                               // Black base borders
-                               driver->draw2DRectangle(c_outside,
-                                       core::rect<s32>(
-                                       v2s32(x1 - m_padding, y1 - m_padding),
-                                       v2s32(x2 + m_padding, y1)
-                                       ), NULL);
-                               driver->draw2DRectangle(c_outside,
-                                       core::rect<s32>(
-                                       v2s32(x1 - m_padding, y2),
-                                       v2s32(x2 + m_padding, y2 + m_padding)
-                                       ), NULL);
-                               driver->draw2DRectangle(c_outside,
-                                       core::rect<s32>(
-                                       v2s32(x1 - m_padding, y1),
-                                               v2s32(x1, y2)
-                                       ), NULL);
-                               driver->draw2DRectangle(c_outside,
-                                       core::rect<s32>(
-                                               v2s32(x2, y1),
-                                       v2s32(x2 + m_padding, y2)
-                                       ), NULL);
-                               /*// Light inside borders
-                               driver->draw2DRectangle(c_inside,
-                                       core::rect<s32>(
-                                               v2s32(x1 - padding/2, y1 - padding/2),
-                                               v2s32(x2 + padding/2, y1)
-                                       ), NULL);
-                               driver->draw2DRectangle(c_inside,
-                                       core::rect<s32>(
-                                               v2s32(x1 - padding/2, y2),
-                                               v2s32(x2 + padding/2, y2 + padding/2)
-                                       ), NULL);
-                               driver->draw2DRectangle(c_inside,
-                                       core::rect<s32>(
-                                               v2s32(x1 - padding/2, y1),
-                                               v2s32(x1, y2)
-                                       ), NULL);
-                               driver->draw2DRectangle(c_inside,
-                                       core::rect<s32>(
-                                               v2s32(x2, y1),
-                                               v2s32(x2 + padding/2, y2)
-                                       ), NULL);
-                               */
-                       }
+               /* draw hihlighting around selected item */
+               if (use_hotbar_selected_image) {
+                       core::rect<s32> imgrect2 = rect;
+                       imgrect2.UpperLeftCorner.X  -= (m_padding*2);
+                       imgrect2.UpperLeftCorner.Y  -= (m_padding*2);
+                       imgrect2.LowerRightCorner.X += (m_padding*2);
+                       imgrect2.LowerRightCorner.Y += (m_padding*2);
+                               video::ITexture *texture = tsrc->getTexture(hotbar_selected_image);
+                               core::dimension2di imgsize(texture->getOriginalSize());
+                       draw2DImageFilterScaled(driver, texture, imgrect2,
+                                       core::rect<s32>(core::position2d<s32>(0,0), imgsize),
+                                       NULL, hbar_colors, true);
+               } else {
+                       video::SColor c_outside(255,255,0,0);
+                       //video::SColor c_outside(255,0,0,0);
+                       //video::SColor c_inside(255,192,192,192);
+                       s32 x1 = rect.UpperLeftCorner.X;
+                       s32 y1 = rect.UpperLeftCorner.Y;
+                       s32 x2 = rect.LowerRightCorner.X;
+                       s32 y2 = rect.LowerRightCorner.Y;
+                       // Black base borders
+                       driver->draw2DRectangle(c_outside,
+                               core::rect<s32>(
+                               v2s32(x1 - m_padding, y1 - m_padding),
+                               v2s32(x2 + m_padding, y1)
+                               ), NULL);
+                       driver->draw2DRectangle(c_outside,
+                               core::rect<s32>(
+                               v2s32(x1 - m_padding, y2),
+                               v2s32(x2 + m_padding, y2 + m_padding)
+                               ), NULL);
+                       driver->draw2DRectangle(c_outside,
+                               core::rect<s32>(
+                               v2s32(x1 - m_padding, y1),
+                                       v2s32(x1, y2)
+                               ), NULL);
+                       driver->draw2DRectangle(c_outside,
+                               core::rect<s32>(
+                                       v2s32(x2, y1),
+                               v2s32(x2 + m_padding, y2)
+                               ), NULL);
+                       /*// Light inside borders
+                       driver->draw2DRectangle(c_inside,
+                               core::rect<s32>(
+                                       v2s32(x1 - padding/2, y1 - padding/2),
+                                       v2s32(x2 + padding/2, y1)
+                               ), NULL);
+                       driver->draw2DRectangle(c_inside,
+                               core::rect<s32>(
+                                       v2s32(x1 - padding/2, y2),
+                                       v2s32(x2 + padding/2, y2 + padding/2)
+                               ), NULL);
+                       driver->draw2DRectangle(c_inside,
+                               core::rect<s32>(
+                                       v2s32(x1 - padding/2, y1),
+                                       v2s32(x1, y2)
+                               ), NULL);
+                       driver->draw2DRectangle(c_inside,
+                               core::rect<s32>(
+                                       v2s32(x2, y1),
+                                       v2s32(x2 + padding/2, y2)
+                               ), NULL);
+                       */
                }
-
-               video::SColor bgcolor2(128, 0, 0, 0);
-               if (!use_hotbar_image)
-                       driver->draw2DRectangle(bgcolor2, rect, NULL);
-               drawItemStack(driver, g_fontengine->getFont(), item, rect, NULL,
-                       client, selected ? IT_ROT_SELECTED : IT_ROT_NONE);
        }
 
+       video::SColor bgcolor2(128, 0, 0, 0);
+       if (!use_hotbar_image)
+               driver->draw2DRectangle(bgcolor2, rect, NULL);
+       drawItemStack(driver, g_fontengine->getFont(), item, rect, NULL,
+               client, selected ? IT_ROT_SELECTED : IT_ROT_NONE);
+}
+
 //NOTE: selectitem = 0 -> no selected; selectitem 1-based
 void Hud::drawItems(v2s32 upperleftpos, v2s32 screen_offset, s32 itemcount,
                s32 inv_offset, InventoryList *mainlist, u16 selectitem, u16 direction)