[Widelands-dev] [Merge] lp:~widelands-dev/widelands/avoid_wraparound into lp:widelands

2016-01-27 Thread SirVer
SirVer has proposed merging lp:~widelands-dev/widelands/avoid_wraparound into 
lp:widelands.

Commit message:
Switched overzealous uint32_t -> int to avoid underflow errors on minus 
arithmetic.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1522582 in widelands: "vertical stripes if port window is on the top of 
screen"
  https://bugs.launchpad.net/widelands/+bug/1522582

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/avoid_wraparound/+merge/284067

Fixes stripes of the port window.

The problem is that we do unsigned d = (unsized(0) - unsized(50)) / 2, which is 
is a huge number. 

later we compare

2 *(d + ~50)  < 1000 

which is true, because we wrap around the other way again. 

The solution is to never use unsigned integers unless absolutely needed. I 
changed a lot of pixel size to be int instead of uint32_t. 
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/avoid_wraparound into lp:widelands.
=== modified file 'src/graphic/rendertarget.cc'
--- src/graphic/rendertarget.cc	2016-01-23 14:54:44 +
+++ src/graphic/rendertarget.cc	2016-01-27 08:11:43 +
@@ -329,10 +329,10 @@
 	Rect destination_rect(dst.x - animation.hotspot().x + source_rect.x,
 	  dst.y - animation.hotspot().y + source_rect.y, source_rect.w,
 	  source_rect.h);
-
 	Rect srcrc(source_rect);
-	if (to_surface_geometry(&destination_rect, &srcrc))
+	if (to_surface_geometry(&destination_rect, &srcrc)) {
 		animation.blit(time, destination_rect.origin(), srcrc, player_color, m_surface);
+	}
 
 	// Look if there is a sound effect registered for this frame and trigger the
 	// effect (see SoundHandler::stereo_position).

=== modified file 'src/logic/editor_game_base.cc'
--- src/logic/editor_game_base.cc	2016-01-17 09:54:31 +
+++ src/logic/editor_game_base.cc	2016-01-27 08:11:43 +
@@ -634,9 +634,8 @@
 	assert (player_area.x < map().get_width());
 	assert(0 <= player_area.y);
 	assert (player_area.y < map().get_height());
-	const Field & first_field = map()[0];
-	assert(&first_field <= player_area.field);
-	assert(player_area.field < &first_field + map().max_index());
+	assert(&map()[0] <= player_area.field);
+	assert(player_area.field < &map()[0] + map().max_index());
 	assert(0 < player_area.player_number);
 	assert(player_area.player_number <= map().get_nrplayers());
 	MapRegion > mr(map(), player_area);

=== modified file 'src/logic/map_objects/tribes/ship.h'
--- src/logic/map_objects/tribes/ship.h	2016-01-18 19:08:41 +
+++ src/logic/map_objects/tribes/ship.h	2016-01-27 08:11:43 +
@@ -280,7 +280,6 @@
 		uint32_t m_destination;
 		uint8_t  m_ship_state;
 		std::string m_shipname;
-		uint32_t m_shipname_index;
 		std::unique_ptr m_expedition;
 		std::vector m_items;
 	};

=== modified file 'src/ui_basic/box.cc'
--- src/ui_basic/box.cc	2016-01-17 08:29:59 +
+++ src/ui_basic/box.cc	2016-01-27 08:11:43 +
@@ -88,12 +88,12 @@
  */
 void Box::update_desired_size()
 {
-	uint32_t totaldepth = 0;
-	uint32_t maxbreadth = m_mindesiredbreadth;
+	int totaldepth = 0;
+	int maxbreadth = m_mindesiredbreadth;
 
 	for (uint32_t idx = 0; idx < m_items.size(); ++idx) {
-		uint32_t depth, breadth;
-		get_item_desired_size(idx, depth, breadth);
+		int depth, breadth;
+		get_item_desired_size(idx, &depth, &breadth);
 
 		totaldepth += depth;
 		if (breadth > maxbreadth)
@@ -131,11 +131,11 @@
 void Box::layout()
 {
 	// First pass: compute the depth and adjust whether we have a scrollbar
-	uint32_t totaldepth = 0;
+	int totaldepth = 0;
 
-	for (uint32_t idx = 0; idx < m_items.size(); ++idx) {
-		uint32_t depth, tmp;
-		get_item_desired_size(idx, depth, tmp);
+	for (size_t idx = 0; idx < m_items.size(); ++idx) {
+		int depth, tmp;
+		get_item_desired_size(idx, &depth, &tmp);
 
 		totaldepth += depth;
 	}
@@ -223,8 +223,8 @@
 		totalbreadth -= Scrollbar::Size;
 
 	for (uint32_t idx = 0; idx < m_items.size(); ++idx) {
-		uint32_t depth, breadth;
-		get_item_size(idx, depth, breadth);
+		int depth, breadth;
+		get_item_size(idx, &depth, &breadth);
 
 		if (m_items[idx].type == Item::ItemPanel) {
 			set_item_size
@@ -317,7 +317,7 @@
  * to the orientation axis.
 */
 void Box::get_item_desired_size
-	(uint32_t const idx, uint32_t & depth, uint32_t & breadth)
+	(uint32_t const idx, int* depth, int* breadth)
 {
 	assert(idx < m_items.size());
 
@@ -333,7 +333,7 @@
 		break;
 
 	case Item::ItemSpace:
-		depth   = it.u.space;
+		*depth = it.u.space;
 		breadth = 0;
 		break;
 	}
@@ -344,7 +344,7 @@
  * for expanding items, at least for now.
  */
 void Box::get_item_size
-	(uint32_t const idx, uint32_t & depth, uint32_t & breadth)
+	(uint32_t const idx, int* depth, int* breadth)
 {
 	assert(idx < m_items.size());
 
@@ -357,7 +357,7 @@
 /**
  * Set the given items actual size.
  */
-void Box::set_item_size(uint32_t idx, uint32_t depth, uint32_t breadth)
+void Box::set_item_size(ui

[Widelands-dev] [Merge] lp:~widelands-dev/widelands/avoid_wraparound into lp:widelands

2016-01-27 Thread bunnybot
Hi, I am bunnybot (https://github.com/widelands/bunnybot).

I am keeping the source branch lp:~widelands-dev/widelands/avoid_wraparound 
mirrored to 
https://github.com/widelands/widelands/tree/_widelands_dev_widelands_avoid_wraparound

You can give me commands by starting a line with @bunnybot . I 
understand: 
 merge: Merges the source branch into the target branch, closing the merge 
proposal. I will use the proposed commit message if it is set.
-- 
https://code.launchpad.net/~widelands-dev/widelands/avoid_wraparound/+merge/284067
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/avoid_wraparound into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1397500 into lp:widelands

2016-01-27 Thread SirVer
I made the regression tests work in this branch. Could you take it from here?
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1397500/+merge/243860
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1397500.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/avoid_wraparound into lp:widelands

2016-01-27 Thread GunChleoc
Review: Approve

Code LGTM, not tested yet.
-- 
https://code.launchpad.net/~widelands-dev/widelands/avoid_wraparound/+merge/284067
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/avoid_wraparound.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/changelog_license_date into lp:widelands

2016-01-27 Thread GunChleoc
We could combine the prosa from the development reports, what do you think?
-- 
https://code.launchpad.net/~widelands-dev/widelands/changelog_license_date/+merge/283871
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/changelog_license_date into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/avoid_wraparound into lp:widelands

2016-01-27 Thread kaputtnik
Review: Approve

No vertical stripes anymore. I tested also some other windows, no failure.

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/avoid_wraparound/+merge/284067
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/avoid_wraparound.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/avoid_wraparound into lp:widelands

2016-01-27 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/avoid_wraparound into 
lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/avoid_wraparound/+merge/284067
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/avoid_wraparound.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1397500 into lp:widelands

2016-01-27 Thread GunChleoc
Thanks - will have a look.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1397500/+merge/243860
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1397500.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/multiline_textarea into lp:widelands

2016-01-27 Thread GunChleoc
Thanks - bookmarked for fixing :)
-- 
https://code.launchpad.net/~widelands-dev/widelands/multiline_textarea/+merge/283736
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/multiline_textarea.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/changelog_license_date into lp:widelands

2016-01-27 Thread SirVer
Maybe too long. I say we merge that in and review the full changelog for b19 
and write ~10 bullets of prose with the highlights. 
-- 
https://code.launchpad.net/~widelands-dev/widelands/changelog_license_date/+merge/283871
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/changelog_license_date into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands

2016-01-27 Thread SirVer
SirVer has proposed merging lp:~widelands-dev/widelands/fix_huge_boxes into 
lp:widelands.

Commit message:
Fix ptr = 0 to *ptr = 0

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1538685 in widelands: "Some windows are huge"
  https://bugs.launchpad.net/widelands/+bug/1538685

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fix_huge_boxes/+merge/284176

Fixes huge boxes.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands.
=== modified file 'src/ui_basic/box.cc'
--- src/ui_basic/box.cc	2016-01-27 08:06:40 +
+++ src/ui_basic/box.cc	2016-01-27 19:16:27 +
@@ -134,14 +134,14 @@
 	int totaldepth = 0;
 
 	for (size_t idx = 0; idx < m_items.size(); ++idx) {
-		int depth, tmp;
-		get_item_desired_size(idx, &depth, &tmp);
-
+		int depth, unused;
+		get_item_desired_size(idx, &depth, &unused);
 		totaldepth += depth;
 	}
 
-	if (!m_items.empty())
+	if (!m_items.empty()) {
 		totaldepth += (m_items.size() - 1) * m_inner_spacing;
+	}
 
 	bool needscrollbar = false;
 	if (m_orientation == Horizontal) {
@@ -170,27 +170,24 @@
 			sb_h = get_inner_h();
 			pagesize = get_inner_h() - Scrollbar::Size;
 		}
-		if (!m_scrollbar) {
-			m_scrollbar = new Scrollbar
-	(this, sb_x, sb_y, sb_w,
-	 sb_h, m_orientation == Horizontal);
+		if (m_scrollbar == nullptr) {
+			m_scrollbar.reset(
+			   new Scrollbar(this, sb_x, sb_y, sb_w, sb_h, m_orientation == Horizontal));
 			m_scrollbar->moved.connect(boost::bind(&Box::scrollbar_moved, this, _1));
 		} else {
 			m_scrollbar->set_pos(Point(sb_x, sb_y));
 			m_scrollbar->set_size(sb_w, sb_h);
 		}
-
 		m_scrollbar->set_steps(totaldepth - pagesize);
 		m_scrollbar->set_singlestepsize(Scrollbar::Size);
 		m_scrollbar->set_pagesize(pagesize);
 	} else {
-		delete m_scrollbar;
-		m_scrollbar = nullptr;
+		m_scrollbar.reset();
 	}
 
 	// Second pass: Count number of infinite spaces
-	uint32_t infspace_count = 0;
-	for (uint32_t idx = 0; idx < m_items.size(); ++idx)
+	int infspace_count = 0;
+	for (size_t idx = 0; idx < m_items.size(); ++idx)
 		if (m_items[idx].fillspace)
 			infspace_count++;
 
@@ -198,9 +195,8 @@
 	// avoid having some pixels left at the end due to rounding errors, we
 	// divide the remaining space by the number of remaining infinite
 	// spaces every time, and not just one.
-	uint32_t max_depths =
-		m_orientation == Horizontal ? get_inner_w() : get_inner_h();
-	for (uint32_t idx = 0; idx < m_items.size(); ++idx)
+	int max_depths = m_orientation == Horizontal ? get_inner_w() : get_inner_h();
+	for (size_t idx = 0; idx < m_items.size(); ++idx)
 		if (m_items[idx].fillspace) {
 			assert(infspace_count > 0);
 			m_items[idx].assigned_var_depth =
@@ -334,7 +330,7 @@
 
 	case Item::ItemSpace:
 		*depth = it.u.space;
-		breadth = 0;
+		*breadth = 0;
 		break;
 	}
 }

=== modified file 'src/ui_basic/box.h'
--- src/ui_basic/box.h	2016-01-27 08:06:40 +
+++ src/ui_basic/box.h	2016-01-27 19:16:27 +
@@ -20,12 +20,13 @@
 #ifndef WL_UI_BASIC_BOX_H
 #define WL_UI_BASIC_BOX_H
 
+#include 
 #include 
 
 #include "ui_basic/panel.h"
+#include "ui_basic/scrollbar.h"
 
 namespace UI {
-struct Scrollbar;
 
 /**
  * A layouting panel that holds a number of child panels.
@@ -104,7 +105,7 @@
 	};
 
 	bool m_scrolling;
-	Scrollbar * m_scrollbar;
+	std::unique_ptr m_scrollbar;
 	uint32_t m_orientation;
 	uint32_t m_mindesiredbreadth;
 	uint32_t m_inner_spacing;

=== modified file 'src/ui_basic/listselect.cc'
--- src/ui_basic/listselect.cc	2015-11-08 17:31:06 +
+++ src/ui_basic/listselect.cc	2016-01-27 19:16:27 +
@@ -355,13 +355,10 @@
 	dst.brighten_rect(Rect(Point(0, 0), get_w(), get_h()), ms_darken_value);
 
 	while (idx < m_entry_records.size()) {
-		assert
-			(get_h()
-			 <
-			 static_cast(std::numeric_limits::max()));
-
-		if (y >= static_cast(get_h()))
+		assert(get_h() < std::numeric_limits::max());
+		if (y >= get_h()) {
 			break;
+		}
 
 		const EntryRecord & er = *m_entry_records[idx];
 

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands

2016-01-27 Thread bunnybot
Hi, I am bunnybot (https://github.com/widelands/bunnybot).

I am keeping the source branch lp:~widelands-dev/widelands/fix_huge_boxes 
mirrored to 
https://github.com/widelands/widelands/tree/_widelands_dev_widelands_fix_huge_boxes

You can give me commands by starting a line with @bunnybot . I 
understand: 
 merge: Merges the source branch into the target branch, closing the merge 
proposal. I will use the proposed commit message if it is set.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fix_huge_boxes/+merge/284176
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands

2016-01-27 Thread bunnybot
Continuous integration builds have changed state:

Travis build 419. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/105250971.
Appveyor build 320. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fix_huge_boxes-320.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fix_huge_boxes/+merge/284176
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands

2016-01-27 Thread GunChleoc
Isn't it fun that 0 still evaluates to NULL...

Code LGTM and tested. Travis also looks clean.

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/fix_huge_boxes/+merge/284176
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1397500 into lp:widelands

2016-01-27 Thread GunChleoc
Review: Resubmit

This is ready for testing and review now.

I tried clicking on everything that has an image in it, but I might have missed 
something.

The packaging also needs to be tested for all OSses.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1397500/+merge/243860
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1397500.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1397500 into lp:widelands

2016-01-27 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/bug-1397500 into lp:widelands 
has been updated.

Commit Message changed to:

Moved all data-related directories into a new "data" directory.

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1397500/+merge/243860
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1397500.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/padding_in_atlas into lp:widelands

2016-01-27 Thread SirVer
The proposal to merge lp:~widelands-dev/widelands/padding_in_atlas into 
lp:widelands has been updated.

Commit Message changed to:

- Add 1 pixel padding in the texture atlas to avoid texture bleeding.
- Filter all textures linearly instead of near. This looks nicer and texture
  bleeding has been taken care off.

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/padding_in_atlas/+merge/284216
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/padding_in_atlas into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/padding_in_atlas into lp:widelands

2016-01-27 Thread SirVer
The proposal to merge lp:~widelands-dev/widelands/padding_in_atlas into 
lp:widelands has been updated.

Description changed to:

See commit.

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/padding_in_atlas/+merge/284216
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/padding_in_atlas into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/changelog_license_date into lp:widelands

2016-01-27 Thread GunChleoc
Agreed - the development reports are definitely too long for this, but they 
might be easier as a point of departure than a list of fixed bugs.

I'd say we wait until we're about to branch the release candidate before we 
touch this again?

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/changelog_license_date/+merge/283871
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/changelog_license_date into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/padding_in_atlas into lp:widelands

2016-01-27 Thread SirVer
SirVer has proposed merging lp:~widelands-dev/widelands/padding_in_atlas into 
lp:widelands.

Commit message:
- Add 1 pixel padding in the texture atlas to avoid texture bleeding.
- Filter all textures linearly instead of near. This looks nicer and texture
  bleeding has been taken care off.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1538709 in widelands: "small lines beside roads"
  https://bugs.launchpad.net/widelands/+bug/1538709

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/padding_in_atlas/+merge/284216

See commit.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/padding_in_atlas into lp:widelands.
=== modified file 'src/graphic/gl/dither_program.cc'
--- src/graphic/gl/dither_program.cc	2016-01-17 09:55:27 +
+++ src/graphic/gl/dither_program.cc	2016-01-28 06:43:38 +
@@ -105,7 +105,7 @@
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, static_cast(GL_CLAMP_TO_EDGE));
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, static_cast(GL_CLAMP_TO_EDGE));
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, static_cast(GL_LINEAR));
-	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, static_cast(GL_NEAREST));
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, static_cast(GL_LINEAR));
 }
 
 DitherProgram::~DitherProgram() {}

=== modified file 'src/graphic/texture.cc'
--- src/graphic/texture.cc	2016-01-24 12:43:26 +
+++ src/graphic/texture.cc	2016-01-28 06:43:38 +
@@ -198,9 +198,9 @@
 
 	// set texture filter to use linear filtering. This looks nicer for resized
 	// texture. Most textures and images are not resized so the filtering
-	// makes no difference
+	// makes no difference.
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, static_cast(GL_LINEAR));
-	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, static_cast(GL_NEAREST));
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, static_cast(GL_LINEAR));
 }
 
 void Texture::lock() {

=== modified file 'src/graphic/texture_atlas.cc'
--- src/graphic/texture_atlas.cc	2016-01-13 07:27:55 +
+++ src/graphic/texture_atlas.cc	2016-01-28 06:43:38 +
@@ -25,6 +25,15 @@
 
 #include "base/wexception.h"
 
+namespace  {
+
+// This padding will be applied to the left and bottom of each block to
+// separate them during blitting if OpenGL decides to be a jerk about where to
+// sample.
+constexpr int kPadding = 1;
+
+}  // namespace
+
 TextureAtlas::Node::Node(const Rect& init_r) : used(false), r(init_r) {
 }
 
@@ -72,7 +81,7 @@
 const int texture_atlas_index,
 std::vector* pack_info) {
 	std::unique_ptr root(
-	   new Node(Rect(0, 0, blocks_.begin()->texture->width(), blocks_.begin()->texture->height(;
+	   new Node(Rect(0, 0, blocks_.begin()->texture->width() + kPadding, blocks_.begin()->texture->height() + kPadding)));
 
 	const auto grow_right = [&root](int delta_w) {
 		std::unique_ptr new_root(new Node(Rect(0, 0, root->r.w + delta_w, root->r.h)));
@@ -92,8 +101,8 @@
 
 	std::vector packed, not_packed;
 	for (Block& block : blocks_) {
-		const int block_width = block.texture->width();
-		const int block_height = block.texture->height();
+		const int block_width = block.texture->width() + kPadding;
+		const int block_height = block.texture->height() + kPadding;
 
 		Node* fitting_node = find_node(root.get(), block_width, block_height);
 		if (fitting_node == nullptr) {

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/padding_in_atlas into lp:widelands

2016-01-27 Thread bunnybot
Hi, I am bunnybot (https://github.com/widelands/bunnybot).

I am keeping the source branch lp:~widelands-dev/widelands/padding_in_atlas 
mirrored to 
https://github.com/widelands/widelands/tree/_widelands_dev_widelands_padding_in_atlas

You can give me commands by starting a line with @bunnybot . I 
understand: 
 merge: Merges the source branch into the target branch, closing the merge 
proposal. I will use the proposed commit message if it is set.
-- 
https://code.launchpad.net/~widelands-dev/widelands/padding_in_atlas/+merge/284216
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/padding_in_atlas into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands

2016-01-27 Thread bunnybot
Continuous integration builds have changed state:

Travis build 419. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/105250971.
Appveyor build 320. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fix_huge_boxes-320.
-- 
https://code.launchpad.net/~widelands-dev/widelands/fix_huge_boxes/+merge/284176
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands

2016-01-27 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/fix_huge_boxes into 
lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fix_huge_boxes/+merge/284176
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fix_huge_boxes into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/changelog_license_date into lp:widelands

2016-01-27 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/changelog_license_date into 
lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/changelog_license_date/+merge/283871
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/changelog_license_date into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/padding_in_atlas into lp:widelands

2016-01-27 Thread GunChleoc
Review: Approve

I can't reproduce the problem, so somebody else will need to test.

Code LGTM.
-- 
https://code.launchpad.net/~widelands-dev/widelands/padding_in_atlas/+merge/284216
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/padding_in_atlas.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/load_library into lp:widelands

2016-01-27 Thread SirVer
The SDL_Init in the richtext renderer was called twice.
-- 
https://code.launchpad.net/~widelands-dev/widelands/load_library/+merge/284218
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/load_library into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/load_library into lp:widelands

2016-01-27 Thread SirVer
SirVer has proposed merging lp:~widelands-dev/widelands/load_library into 
lp:widelands.

Commit message:
Explicitly load the GL library, so we might get notified about errors.


Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1536377 in widelands: "The texture atlas must use at least 2048 as size 
(1024 was given)"
  https://bugs.launchpad.net/widelands/+bug/1536377

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/load_library/+merge/284218

Tries to get more insight into the texture atlas bug.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/load_library into lp:widelands.
=== modified file 'src/graphic/graphic.cc'
--- src/graphic/graphic.cc	2016-01-24 12:43:26 +
+++ src/graphic/graphic.cc	2016-01-28 07:01:51 +
@@ -78,6 +78,10 @@
 	window_mode_height_ = window_mode_h;
 	requires_update_ = true;
 
+	if (SDL_GL_LoadLibrary(nullptr) == -1) {
+		throw wexception("SDL_GL_LoadLibrary failed: %s", SDL_GetError());
+	}
+
 	log("Graphics: Try to set Videomode %ux%u\n", window_mode_width_, window_mode_height_);
 	sdl_window_ =
 	   SDL_CreateWindow("Widelands Window", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,

=== modified file 'src/graphic/text/test/render_richtext.cc'
--- src/graphic/text/test/render_richtext.cc	2016-01-24 12:43:26 +
+++ src/graphic/text/test/render_richtext.cc	2016-01-28 07:01:51 +
@@ -93,8 +93,6 @@
 
 // Setup the static objects Widelands needs to operate and initializes systems.
 void initialize() {
-	SDL_Init(SDL_INIT_VIDEO);
-
 	g_fs = new LayeredFileSystem();
 	g_fs->add_file_system(&FileSystem::create(INSTALL_DATADIR));
 

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/load_library into lp:widelands

2016-01-27 Thread bunnybot
Hi, I am bunnybot (https://github.com/widelands/bunnybot).

I am keeping the source branch lp:~widelands-dev/widelands/load_library 
mirrored to 
https://github.com/widelands/widelands/tree/_widelands_dev_widelands_load_library

You can give me commands by starting a line with @bunnybot . I 
understand: 
 merge: Merges the source branch into the target branch, closing the merge 
proposal. I will use the proposed commit message if it is set.
-- 
https://code.launchpad.net/~widelands-dev/widelands/load_library/+merge/284218
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/load_library into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1397500 into lp:widelands

2016-01-27 Thread bunnybot
Continuous integration builds have changed state:

Travis build 420. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/105347928.
Appveyor build 321. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1397500-321.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1397500/+merge/243860
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1397500.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1397500 into lp:widelands

2016-01-27 Thread Tino
Review: Approve

I've removed the breaking comment in the iss file and my local build is working 
(but this uses a different iss file).
Let's wait for appveyor and travis...
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1397500/+merge/243860
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1397500.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1397500 into lp:widelands

2016-01-27 Thread Tino
Review: Needs Fixing

Sorry, it does not work: If started without --datadir Widelands assumes 
{execdir}\data correctly, but does not build the path correctly:

$ ./widelands
Set home directory: C:\Users\mit\.widelands
Widelands executable directory: C:\bin\Widelands
Adding directory: C:\bin\Widelands./data/

Caught exception (of type '17FileNotFoundError') in outermost handler!
The exception said: FileSystem::create: could not find file or directory: 
C:\bin\Widelands./data/

This should not happen. Please file a bug report on version 
bzr7353[bug-1397500](Release).
and remember to specify your operating system.

With --datadir it is fine:
$ ./widelands --datadir=./data
Set home directory: C:\Users\mit\.widelands
Adding directory: C:\bin\Widelands\./data
selected language: (system language)
Graphics: Try to set Videomode 800x600
Graphics: OpenGL: Version "4.3.0 - Build 10.18.14.4139"
Graphics: SDL_GL_RED_SIZE is 8
Graphics: SDL_GL_GREEN_SIZE is 8
Graphics: SDL_GL_BLUE_SIZE is 8
[...]
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1397500/+merge/243860
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1397500.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp