You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
754 B
36 lines
754 B
#include "isometricRenderer.h"
|
|
#include "raylib.h"
|
|
#include <stdio.h>
|
|
|
|
|
|
void IsometricRendererRenderMap(IsometricRenderer *renderer, int height){
|
|
float originX = 0.0f;
|
|
float originY = 0.0f;
|
|
|
|
int i = 0;
|
|
int j = 0;
|
|
|
|
int amount = 1;
|
|
for(i=0; i<height; i++){
|
|
for(j=0; j<amount; j++){
|
|
float x = originX - amount/2 * renderer->texture.width + j * renderer->texture.width;
|
|
if(amount%2 == 1){
|
|
x -= renderer->texture.width/2;
|
|
}
|
|
float y = i * renderer->texture.height/2;
|
|
DrawTexture(renderer->texture, x, y, WHITE);
|
|
|
|
|
|
|
|
}
|
|
if(i < height/2){
|
|
amount++;
|
|
}
|
|
else{
|
|
amount--;
|
|
}
|
|
}
|
|
|
|
|
|
}
|