You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
#ifndef ISOMETRICMAP_H_
|
|
#define ISOMETRICMAP_H_
|
|
#include "raylib.h"
|
|
#include "tile.c"
|
|
|
|
typedef struct IsometricMap{
|
|
Texture2D tileTextures[10];
|
|
Tile ***tiles;
|
|
int originX;
|
|
int originY;
|
|
int width;
|
|
int height;
|
|
int widthBounds;
|
|
int heightBounds;
|
|
int layer;
|
|
} IsometricMap;
|
|
|
|
// TODO:
|
|
Tile * IsometricMapGetTileFromWorldCoordinates(IsometricMap *isometricMap, float x, float y);
|
|
|
|
// Working
|
|
IsometricMap * IsometricMapInit(int layer);
|
|
Vector2 * IsometricMapCalcOffsetForTileAt(int x, int y, int textureSize);
|
|
Tile * IsometricMapGetTileFromArrayPosition(IsometricMap *isometricMap, int x, int y);
|
|
// Screen Coordinates -> World Coordinates
|
|
void IsometricMapProject(IsometricMap *isometricMap, Camera2D *camera, float x, float y, Vector2 *tmp);
|
|
// World Coordinates -> Screen Coordinates
|
|
void IsometricMapUnproject(IsometricMap *isometricMap, Camera2D *camera, int x, int y, Vector2 *tmp);
|
|
void IsometricMapAddTile(IsometricMap *isometricMap, int x, int y, int textureId);
|
|
void IsometricMapChangeTextureIdOfTile(IsometricMap *map, int x, int y, int id);
|
|
|
|
|
|
#endif |