# viewport_func.h

Go to the documentation of this file.

    00001 /* $Id: viewport_func.h 15428 2009-02-09 02:57:15Z rubidium $ */
    00002
    00005 #ifndef VIEWPORT_FUNC_H
    00006 #define VIEWPORT_FUNC_H
    00007
    00008 #include "gfx_type.h"
    00009 #include "viewport_type.h"
    00010 #include "vehicle_type.h"
    00011 #include "strings_type.h"
    00012 #include "window_type.h"
    00013 #include "tile_type.h"
    00014
    00015 void SetSelectionRed(bool);
    00016
    00017 void DeleteWindowViewport(Window *w);
    00018 void InitializeWindowViewport(Window *w, int x, int y, int width, int height, uint32 follow_flags, ZoomLevel zoom);
    00019 ViewPort *IsPtInWindowViewport(const Window *w, int x, int y);
    00020 Point GetTileBelowCursor();
    00021 void UpdateViewportPosition(Window *w);
    00022 void UpdateViewportSignPos(ViewportSign *sign, int left, int top, StringID str);
    00023
    00024 bool DoZoomInOutWindow(int how, Window *w);
    00025 void ZoomInOrOutToCursorWindow(bool in, Window * w);
    00026 Point GetTileZoomCenterWindow(bool in, Window * w);
    00027 void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out);
    00028
    00029 static inline void MaxZoomInOut(int how, Window *w)
    00030 {
    00031   while (DoZoomInOutWindow(how, w)) {};
    00032 }
    00033
    00034 void OffsetGroundSprite(int x, int y);
    00035
    00036 void DrawGroundSprite(SpriteID image, SpriteID pal, const SubSprite *sub = NULL);
    00037 void DrawGroundSpriteAt(SpriteID image, SpriteID pal, int32 x, int32 y, byte z, const SubSprite *sub = NULL);
    00038 void AddSortableSpriteToDraw(SpriteID image, SpriteID pal, int x, int y, int w, int h, int dz, int z, bool transparent = false, int bb_offset_x = 0, int bb_offset_y = 0, int bb_offset_z = 0, const SubSprite *sub = NULL);
    00039 void AddStringToDraw(int x, int y, StringID string, uint64 params_1, uint64 params_2, uint16 colour = 0, uint16 width = 0);
    00040 void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y, bool transparent = false, const SubSprite *sub = NULL);
    00041
    00042
    00043 void StartSpriteCombine();
    00044 void EndSpriteCombine();
    00045
    00046 bool HandleViewportClicked(const ViewPort *vp, int x, int y);
    00047 void PlaceObject();
    00048 void SetRedErrorSquare(TileIndex tile);
    00049 void SetTileSelectSize(int w, int h);
    00050 void SetTileSelectBigSize(int ox, int oy, int sx, int sy);
    00051
    00052 Vehicle *CheckMouseOverVehicle();
    00053
    00054 void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom);
    00055
    00056 bool ScrollWindowTo(int x, int y, Window *w, bool instant = false);
    00057
    00058 bool ScrollMainWindowToTile(TileIndex tile, bool instant = false);
    00059 bool ScrollMainWindowTo(int x, int y, bool instant = false);
    00060
    00061 extern Point _tile_fract_coords;
    00062
    00063 #endif /* VIEWPORT_FUNC_H */