371 x = vp->width - (_cursor.pos.x - vp->left); |
371 x = vp->width - (_cursor.pos.x - vp->left); |
372 y = vp->height - (_cursor.pos.y - vp->top); |
372 y = vp->height - (_cursor.pos.y - vp->top); |
373 } |
373 } |
374 /* Get the tile below the cursor and center on the zoomed-out center */ |
374 /* Get the tile below the cursor and center on the zoomed-out center */ |
375 return GetTileFromScreenXY(_cursor.pos.x, _cursor.pos.y, x + vp->left, y + vp->top); |
375 return GetTileFromScreenXY(_cursor.pos.x, _cursor.pos.y, x + vp->left, y + vp->top); |
|
376 } |
|
377 |
|
378 /** Update the status of the zoom-buttons according to the zoom-level |
|
379 * of the viewport. This will update their status and invalidate accordingly |
|
380 * @param window pointer to the window that has the zoom buttons |
|
381 * @param vp pointer to the viewport whose zoom-level the buttons represent |
|
382 * @param widget_zoom_in widget index for window with zoom-in button |
|
383 * @param widget_zoom_out widget index for window with zoom-out button */ |
|
384 void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out) |
|
385 { |
|
386 SetWindowWidgetDisabledState(w, widget_zoom_in, vp->zoom == 0); |
|
387 InvalidateWidget(w, widget_zoom_in); |
|
388 |
|
389 SetWindowWidgetDisabledState(w, widget_zoom_out, vp->zoom == 2); |
|
390 InvalidateWidget(w, widget_zoom_out); |
376 } |
391 } |
377 |
392 |
378 void DrawGroundSpriteAt(uint32 image, int32 x, int32 y, byte z) |
393 void DrawGroundSpriteAt(uint32 image, int32 x, int32 y, byte z) |
379 { |
394 { |
380 ViewportDrawer *vd = _cur_vd; |
395 ViewportDrawer *vd = _cur_vd; |