JanEhehalt 3 years ago
parent 7a12fdf2f2
commit 960e3cb1f6

@ -183,6 +183,7 @@ void IsometricMapDraw(Game *game){
IsometricMapProject(game->layers[0], game->camera, botleft.x, botleft.y, &botleft);
Vector2 botright = {windowWidth, windowHeight};
IsometricMapProject(game->layers[0], game->camera, botright.x, botright.y, &botright);
int extraTiles = 1;
int n = 0;
int itmp = (int)(topleft.x / game->layers[0]->textureWidth) - extraTiles;
@ -209,13 +210,13 @@ void IsometricMapDraw(Game *game){
Node *current = game->sprites->head;
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){
// 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
if( current->data.x > itmp &&
current->data.y > jtmp &&

@ -114,15 +114,15 @@ void ListDrawAllSprites(List *list, IsometricMap **map, Camera2D *camera){
IsometricMapProject(map[0], camera, botleft.x, botleft.y, &botleft);
Vector2 botright = {GetScreenWidth(), GetScreenHeight()};
IsometricMapProject(map[0], camera, botright.x, botright.y, &botright);
int itmp, jtmp, maxI, maxJ;
int extraPixels = 0;
int itmp, jtmp, maxI, maxJ;
itmp = (int)(topleft.x) - extraPixels;
jtmp = (int)(topright.y) - extraPixels;
maxI = (int)(botright.x) + extraPixels;
maxJ = (int)(botleft.y) + extraPixels;
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
if( current->data.x > itmp &&
current->data.y > jtmp &&

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
game.o

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
list.o

Binary file not shown.

BIN
main.o

Binary file not shown.

Binary file not shown.

BIN
spiel

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tile.o

Binary file not shown.
Loading…
Cancel
Save