|
|
|
|
@ -5,6 +5,7 @@
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include "../game.h"
|
|
|
|
|
#include "../List/list.h"
|
|
|
|
|
|
|
|
|
|
// @param deprecated
|
|
|
|
|
void IsometricRendererDrawMap(IsometricRenderer *renderer, int height)
|
|
|
|
|
@ -43,29 +44,7 @@ void IsometricRendererDrawMap(IsometricRenderer *renderer, int height)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// parameter could be changed to only IsometricMap[]
|
|
|
|
|
void IsometricRendererRenderIsometricMap(Game *game)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
int n = 0;
|
|
|
|
|
int i = 0;
|
|
|
|
|
int j = 0;
|
|
|
|
|
for(n = 0; n < 10; n++){
|
|
|
|
|
for(i=0; i < game->layers[n]->width; i++){
|
|
|
|
|
for(j=0; j < game->layers[n]->height; j++){
|
|
|
|
|
// if tile had texture id -1, it would be empty tile
|
|
|
|
|
if(game->layers[n]->tiles[i][j]->textureId == -1){
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
DrawTexture(
|
|
|
|
|
game->layers[n]->tileTextures[game->layers[n]->tiles[i][j]->textureId],
|
|
|
|
|
game->layers[n]->tiles[i][j]->offsetX,
|
|
|
|
|
game->layers[n]->tiles[i][j]->offsetY,
|
|
|
|
|
WHITE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
void IsometricRendererRenderIsometricMap(Game *game){
|
|
|
|
|
|
|
|
|
|
int windowWidth = GetScreenWidth();
|
|
|
|
|
int windowHeight = GetScreenHeight();
|
|
|
|
|
@ -105,25 +84,31 @@ void IsometricRendererRenderIsometricMap(Game *game)
|
|
|
|
|
maxJ = game->layers[0]->height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
int j = 0;
|
|
|
|
|
for (n = 0; n < 10; n++)
|
|
|
|
|
{
|
|
|
|
|
for (i = itmp; i < maxI; i++)
|
|
|
|
|
{
|
|
|
|
|
for (j = jtmp; j < maxJ; j++)
|
|
|
|
|
{
|
|
|
|
|
if (game->layers[n]->tiles[i][j]->textureId == -1)
|
|
|
|
|
{
|
|
|
|
|
int i = 0; // x
|
|
|
|
|
int j = 0; // y
|
|
|
|
|
|
|
|
|
|
for (n = 0; n < 10; n++){
|
|
|
|
|
Node *current = game->sprites->head;
|
|
|
|
|
for (j = jtmp; j < maxJ; j++){
|
|
|
|
|
|
|
|
|
|
for (i = itmp; i < maxI; i++){
|
|
|
|
|
if (game->layers[n]->tiles[i][j]->textureId == -1){
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
else{
|
|
|
|
|
DrawTexture(
|
|
|
|
|
game->layers[n]->tileTextures[game->layers[n]->tiles[i][j]->textureId],
|
|
|
|
|
game->layers[n]->tiles[i][j]->offsetX,
|
|
|
|
|
game->layers[n]->tiles[i][j]->offsetY,
|
|
|
|
|
WHITE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Draw sprites that are over the tile
|
|
|
|
|
while(current != 0 && current->data.y <= (j + 1) * game->layers[n]->textureWidth){
|
|
|
|
|
if(current->data.z == n){
|
|
|
|
|
DrawSpriteToWorld(¤t->data, game->layers, game->camera);
|
|
|
|
|
}
|
|
|
|
|
current = current->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|