src/functions.h
branchcpp_gui
changeset 6307 f40e88cff863
parent 6303 84c215fc8eb8
equal deleted inserted replaced
6306:036aa28ca80e 6307:f40e88cff863
     6 #define FUNCTIONS_H
     6 #define FUNCTIONS_H
     7 
     7 
     8 #include "gfx.h"
     8 #include "gfx.h"
     9 #include "window.h"
     9 #include "window.h"
    10 
    10 
    11 void DoClearSquare(TileIndex tile);
       
    12 void RunTileLoop();
       
    13 
       
    14 uint GetPartialZ(int x, int y, Slope corners);
       
    15 uint GetSlopeZ(int x, int y);
       
    16 uint32 GetTileTrackStatus(TileIndex tile, TransportType mode);
       
    17 void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac);
       
    18 void ChangeTileOwner(TileIndex tile, PlayerID old_player, PlayerID new_player);
       
    19 void AnimateTile(TileIndex tile);
       
    20 void ClickTile(TileIndex tile);
       
    21 void GetTileDesc(TileIndex tile, TileDesc *td);
       
    22 void UpdateTownMaxPass(Town *t);
    11 void UpdateTownMaxPass(Town *t);
    23 
       
    24 bool IsValidTile(TileIndex tile);
       
    25 
       
    26 static inline Point RemapCoords(int x, int y, int z)
       
    27 {
       
    28 	Point pt;
       
    29 	pt.x = (y - x) * 2;
       
    30 	pt.y = y + x - z;
       
    31 	return pt;
       
    32 }
       
    33 
       
    34 static inline Point RemapCoords2(int x, int y)
       
    35 {
       
    36 	return RemapCoords(x, y, GetSlopeZ(x, y));
       
    37 }
       
    38 
       
    39 
    12 
    40 /* clear_land.cpp */
    13 /* clear_land.cpp */
    41 void DrawHillyLandTile(const TileInfo *ti);
    14 void DrawHillyLandTile(const TileInfo *ti);
    42 void DrawClearLandTile(const TileInfo *ti, byte set);
    15 void DrawClearLandTile(const TileInfo *ti, byte set);
    43 void DrawClearLandFence(const TileInfo *ti);
    16 void DrawClearLandFence(const TileInfo *ti);
   169 bool EnsureNoVehicleOnGround(TileIndex tile);
   142 bool EnsureNoVehicleOnGround(TileIndex tile);
   170 void MarkAllViewportsDirty(int left, int top, int right, int bottom);
   143 void MarkAllViewportsDirty(int left, int top, int right, int bottom);
   171 void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost);
   144 void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost);
   172 void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost);
   145 void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost);
   173 
   146 
   174 void DrawFoundation(TileInfo *ti, uint f);
       
   175 
       
   176 bool CheckIfAuthorityAllows(TileIndex tile);
   147 bool CheckIfAuthorityAllows(TileIndex tile);
   177 Town *ClosestTownFromTile(TileIndex tile, uint threshold);
   148 Town *ClosestTownFromTile(TileIndex tile, uint threshold);
   178 void ChangeTownRating(Town *t, int add, int max);
   149 void ChangeTownRating(Town *t, int add, int max);
   179 
   150 
   180 uint GetTownRadiusGroup(const Town* t, TileIndex tile);
   151 uint GetTownRadiusGroup(const Town* t, TileIndex tile);
   181 int FindFirstBit(uint32 x);
   152 int FindFirstBit(uint32 x);
   182 void ShowHighscoreTable(int difficulty, int8 rank);
   153 void ShowHighscoreTable(int difficulty, int8 rank);
   183 TileIndex AdjustTileCoordRandomly(TileIndex a, byte rng);
       
   184 
   154 
   185 void AfterLoadTown();
   155 void AfterLoadTown();
   186 void UpdatePatches();
   156 void UpdatePatches();
   187 void AskExitGame();
   157 void AskExitGame();
   188 void AskExitToGameMenu();
   158 void AskExitToGameMenu();