mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 20:49:11 +00:00
(svn r16071) -Fix [FS#2845]: content download progress bar 'resetting' due to mathematical overflow.
This commit is contained in:
@@ -123,11 +123,11 @@ public:
|
|||||||
this->DrawWidgets();
|
this->DrawWidgets();
|
||||||
|
|
||||||
/* Draw nice progress bar :) */
|
/* Draw nice progress bar :) */
|
||||||
DrawFrameRect(20, 18, 20 + (int)((this->width - 40) * this->downloaded_bytes / this->total_bytes), 28, COLOUR_MAUVE, FR_NONE);
|
DrawFrameRect(20, 18, 20 + (int)((this->width - 40LL) * this->downloaded_bytes / this->total_bytes), 28, COLOUR_MAUVE, FR_NONE);
|
||||||
|
|
||||||
SetDParam(0, this->downloaded_bytes);
|
SetDParam(0, this->downloaded_bytes);
|
||||||
SetDParam(1, this->total_bytes);
|
SetDParam(1, this->total_bytes);
|
||||||
SetDParam(2, this->downloaded_bytes * 100 / this->total_bytes);
|
SetDParam(2, this->downloaded_bytes * 100LL / this->total_bytes);
|
||||||
DrawString(this->widget[NCDSWW_BACKGROUND].left + 2, this->widget[NCDSWW_BACKGROUND].right - 2, 35, STR_CONTENT_DOWNLOAD_PROGRESS_SIZE, TC_GREY, SA_CENTER);
|
DrawString(this->widget[NCDSWW_BACKGROUND].left + 2, this->widget[NCDSWW_BACKGROUND].right - 2, 35, STR_CONTENT_DOWNLOAD_PROGRESS_SIZE, TC_GREY, SA_CENTER);
|
||||||
|
|
||||||
if (this->downloaded_bytes == this->total_bytes) {
|
if (this->downloaded_bytes == this->total_bytes) {
|
||||||
|
Reference in New Issue
Block a user