mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-19 10:22:39 +01:00
Codechange: Pass Viewport by reference.
This means we do not have to care what type of pointer is used.
This commit is contained in:
committed by
Peter Nelson
parent
70b4beb8e7
commit
8275bbfb87
@@ -2425,16 +2425,16 @@ void NWidgetViewport::InitializeViewport(Window *w, std::variant<TileIndex, Vehi
|
||||
*/
|
||||
void NWidgetViewport::UpdateViewportCoordinates(Window *w)
|
||||
{
|
||||
Viewport *vp = w->viewport;
|
||||
if (vp != nullptr) {
|
||||
vp->left = w->left + this->pos_x;
|
||||
vp->top = w->top + this->pos_y;
|
||||
vp->width = this->current_x;
|
||||
vp->height = this->current_y;
|
||||
if (w->viewport == nullptr) return;
|
||||
|
||||
vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
|
||||
vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);
|
||||
}
|
||||
Viewport &vp = *w->viewport;
|
||||
vp.left = w->left + this->pos_x;
|
||||
vp.top = w->top + this->pos_y;
|
||||
vp.width = this->current_x;
|
||||
vp.height = this->current_y;
|
||||
|
||||
vp.virtual_width = ScaleByZoom(vp.width, vp.zoom);
|
||||
vp.virtual_height = ScaleByZoom(vp.height, vp.zoom);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user