fallout2-ce/src/tile.h

65 lines
2.4 KiB
C
Raw Normal View History

2022-05-19 01:51:26 -07:00
#ifndef TILE_H
#define TILE_H
#include "geometry.h"
#include "map.h"
2022-09-23 05:43:44 -07:00
namespace fallout {
2022-10-29 08:52:22 -07:00
#define TILE_SET_CENTER_REFRESH_WINDOW 0x01
#define TILE_SET_CENTER_FLAG_IGNORE_SCROLL_RESTRICTIONS 0x02
2022-05-19 01:51:26 -07:00
typedef void(TileWindowRefreshProc)(Rect* rect);
typedef void(TileWindowRefreshElevationProc)(Rect* rect, int elevation);
extern const int _off_tile[6];
extern const int dword_51D984[6];
extern int gHexGridSize;
extern int gCenterTile;
int tileInit(TileData** a1, int squareGridWidth, int squareGridHeight, int hexGridWidth, int hexGridHeight, unsigned char* buf, int windowWidth, int windowHeight, int windowPitch, TileWindowRefreshProc* windowRefreshProc);
void _tile_reset_();
void tileReset();
void tileExit();
void tileDisable();
void tileEnable();
void tileWindowRefreshRect(Rect* rect, int elevation);
void tileWindowRefresh();
2022-05-23 15:37:46 -07:00
int tileSetCenter(int tile, int flags);
int tileRoofIsVisible();
2022-05-19 01:51:26 -07:00
int tileToScreenXY(int tile, int* x, int* y, int elevation);
int tileFromScreenXY(int x, int y, int elevation, bool ignoreBounds = false);
2022-05-19 01:51:26 -07:00
int tileDistanceBetween(int a1, int a2);
2022-05-23 15:37:46 -07:00
bool tileIsInFrontOf(int tile1, int tile2);
bool tileIsToRightOf(int tile1, int tile2);
2022-05-19 01:51:26 -07:00
int tileGetTileInDirection(int tile, int rotation, int distance);
int tileGetRotationTo(int a1, int a2);
int _tile_num_beyond(int from, int to, int distance);
2022-05-23 15:37:46 -07:00
bool tileIsEdge(int tile);
void tileScrollBlockingEnable();
void tileScrollBlockingDisable();
bool tileScrollBlockingIsEnabled();
void tileScrollLimitingEnable();
void tileScrollLimitingDisable();
bool tileScrollLimitingIsEnabled();
int squareTileToScreenXY(int squareTile, int* coordX, int* coordY, int elevation);
int squareTileToRoofScreenXY(int squareTile, int* screenX, int* screenY, int elevation);
int squareTileFromScreenXY(int screenX, int screenY, int elevation);
void squareTileScreenToCoord(int screenX, int screenY, int elevation, int* coordX, int* coordY);
void squareTileScreenToCoordRoof(int screenX, int screenY, int elevation, int* coordX, int* coordY);
2022-05-19 01:51:26 -07:00
void tileRenderRoofsInRect(Rect* rect, int elevation);
2022-12-20 04:10:42 -08:00
void tile_fill_roof(int x, int y, int elevation, bool on);
2022-05-19 01:51:26 -07:00
void tileRenderFloorsInRect(Rect* rect, int elevation);
bool _square_roof_intersect(int x, int y, int elevation);
void _grid_render(Rect* rect, int elevation);
int _tile_scroll_to(int tile, int flags);
2022-05-23 15:37:46 -07:00
static bool tileIsValid(int tile)
{
return tile >= 0 && tile < gHexGridSize;
}
2022-09-23 05:43:44 -07:00
} // namespace fallout
2022-05-19 01:51:26 -07:00
#endif /* TILE_H */