diff options
Diffstat (limited to 'ViewController.cpp')
| -rw-r--r-- | ViewController.cpp | 16 | 
1 files changed, 8 insertions, 8 deletions
| diff --git a/ViewController.cpp b/ViewController.cpp index 67fd77c..40e624a 100644 --- a/ViewController.cpp +++ b/ViewController.cpp @@ -39,9 +39,9 @@ void ViewController::update_size() {  }  void ViewController::update_tiles() { -	for (unsigned y = 0; y < this->museum.canvas.data.rows; y++) { -		for (unsigned x = 0; x < this->museum.canvas.data.columns; x++) { -			Tile & tile = this->museum.canvas.get_tile(x, y); +	for (int y = 0; y < this->museum.canvas.data.rows; y++) { +		for (int x = 0; x < this->museum.canvas.data.columns; x++) { +			Tile & tile = this->museum.canvas.get_tile({ x, y });  			Rectangle rect = {  				.x = static_cast<float>(x * scale),  				.y = static_cast<float>(y * scale), @@ -66,10 +66,10 @@ void ViewController::update_artists() {  	}  } -void ViewController::draw_pathfinding_dot(pair<unsigned int, unsigned int> point, const Color & color) { +void ViewController::draw_pathfinding_dot(const XY & point, const Color & color) {  	this->view.fill_rect(center({ -		.x = static_cast<float>(point.first * scale), -		.y = static_cast<float>(point.second * scale), +		.x = static_cast<float>(point.x * scale), +		.y = static_cast<float>(point.y * scale),  		.width = static_cast<float>(pathfinding_size),  		.height = static_cast<float>(pathfinding_size),  	}), color); @@ -177,8 +177,8 @@ void ViewController::ev_mousedown(MouseCode button) {  void ViewController::ev_mousemove(unsigned x, unsigned y) {  	this->mouse_pos = { -		static_cast<float>(x) / static_cast<float>(this->scale), -		static_cast<float>(y) / static_cast<float>(this->scale), +		.x = static_cast<int>(x / this->scale), +		.y = static_cast<int>(y / this->scale),  	};  } |