|
|
|
@ -183,6 +183,7 @@ void IsometricMapDraw(Game *game){
|
|
|
|
IsometricMapProject(game->layers[0], game->camera, botleft.x, botleft.y, &botleft);
|
|
|
|
IsometricMapProject(game->layers[0], game->camera, botleft.x, botleft.y, &botleft);
|
|
|
|
Vector2 botright = {windowWidth, windowHeight};
|
|
|
|
Vector2 botright = {windowWidth, windowHeight};
|
|
|
|
IsometricMapProject(game->layers[0], game->camera, botright.x, botright.y, &botright);
|
|
|
|
IsometricMapProject(game->layers[0], game->camera, botright.x, botright.y, &botright);
|
|
|
|
|
|
|
|
|
|
|
|
int extraTiles = 1;
|
|
|
|
int extraTiles = 1;
|
|
|
|
int n = 0;
|
|
|
|
int n = 0;
|
|
|
|
int itmp = (int)(topleft.x / game->layers[0]->textureWidth) - extraTiles;
|
|
|
|
int itmp = (int)(topleft.x / game->layers[0]->textureWidth) - extraTiles;
|
|
|
|
@ -209,13 +210,13 @@ void IsometricMapDraw(Game *game){
|
|
|
|
|
|
|
|
|
|
|
|
Node *current = game->sprites->head;
|
|
|
|
Node *current = game->sprites->head;
|
|
|
|
int extraPixels = 0;
|
|
|
|
int extraPixels = 0;
|
|
|
|
|
|
|
|
// drawing some extra corner pixels
|
|
|
|
|
|
|
|
// if extraPixels == 0 you can see flickering in the corners
|
|
|
|
|
|
|
|
itmp = (int)(topleft.x) - extraPixels;
|
|
|
|
|
|
|
|
jtmp = (int)(topright.y) - extraPixels;
|
|
|
|
|
|
|
|
maxI = (int)(botright.x) + extraPixels;
|
|
|
|
|
|
|
|
maxJ = (int)(botleft.y) + extraPixels;
|
|
|
|
while(current != 0){
|
|
|
|
while(current != 0){
|
|
|
|
// drawing some extra corner pixels
|
|
|
|
|
|
|
|
// if extraPixels == 0 you can see flickering in the corners
|
|
|
|
|
|
|
|
itmp = (int)(topleft.x) - extraPixels;
|
|
|
|
|
|
|
|
jtmp = (int)(topright.y) - extraPixels;
|
|
|
|
|
|
|
|
maxI = (int)(botright.x) + extraPixels;
|
|
|
|
|
|
|
|
maxJ = (int)(botleft.y) + extraPixels;
|
|
|
|
|
|
|
|
// Only drawing the Sprites which are within Camera view
|
|
|
|
// Only drawing the Sprites which are within Camera view
|
|
|
|
if( current->data.x > itmp &&
|
|
|
|
if( current->data.x > itmp &&
|
|
|
|
current->data.y > jtmp &&
|
|
|
|
current->data.y > jtmp &&
|
|
|
|
|