Posted March 01, 2025 by Cadex
#Devlog #Sacred Gambit
tileObjectpassable to signify if we can walk on the tile.
mapObjecttileSize that keeps track of the size of each tile.
std::vector<std::vector<tileObject>> tiles keeps a 2D list of tiles.
SDL_Texture* megaTex target texture that holds the texture of all the tiles rendered in a grid.
SDL_FPoint camPos and SDL_FPoint camPosGoal tracks where the camera is located and where it should be.
float scaleGoal tracks what our scale of the map being rendered should be, used for zoom.
getCamLimits gets the limits of where our camera should be allowed to go.
renderTiles draws all the tiles onto megaTex.
map methodscontrol reads input to control the map.
drawDebug draws information related to the map.
drawChunk based off map zoom, pos and rotation, updates the mapObject texture by rendering the correct chunk of megaTex to it.
loadMap called from the main menu to initialize the map.