diff options
author | davidovski <david@davidovski.xyz> | 2023-07-23 16:46:05 +0200 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-07-23 16:46:05 +0200 |
commit | c726acd0467906afee74afb7051bb2e705e26565 (patch) | |
tree | e8b9422ba926f09b85c229d51d5a99a077ea69e8 /src/tiled.h | |
parent | 0d78ec0e53d9824a029840e74bf0721ed2187e6a (diff) |
add chunk offset to rendering
Diffstat (limited to 'src/tiled.h')
-rw-r--r-- | src/tiled.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/tiled.h b/src/tiled.h index c3d0950..de469be 100644 --- a/src/tiled.h +++ b/src/tiled.h @@ -5,13 +5,22 @@ #define SCREEN_W 1280 #define SCREEN_H 720 +#define RENDER_DISTANCE 16 + typedef struct Tiled { TiledMap tiledMap; float zoom; + + // main viewport offset Vector2 offset; + // offset passed to shader for rendering + Vector2 renderOffset; + // offset used to calculate which chunks to render + int chunkOffset[2]; + int atlasSize[2]; - int mapSize[2]; + int renderArea[2]; Texture2D atlasTexture; @@ -23,7 +32,7 @@ typedef struct Tiled { int offsetLoc; int atlasSizeLoc; - int mapSizeLoc; + int renderAreaLoc; int atlasTextureLoc; int tilemapTextureLoc; |