parent
f23eaec9e3
commit
251ce39015
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Linux",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**"
|
||||||
|
],
|
||||||
|
"defines": [],
|
||||||
|
"compilerPath": "/usr/bin/gcc",
|
||||||
|
"cStandard": "gnu17",
|
||||||
|
"cppStandard": "gnu++17",
|
||||||
|
"intelliSenseMode": "linux-gcc-x64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
Binary file not shown.
@ -0,0 +1,35 @@
|
|||||||
|
#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--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
#ifndef ISOMETRICRENDERER_H_
|
||||||
|
#define ISOMETRICRENDERER_H_
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
typedef struct IsometricRenderer{
|
||||||
|
Texture texture;
|
||||||
|
} IsometricRenderer;
|
||||||
|
|
||||||
|
void renderMap(int width, int height);
|
||||||
|
|
||||||
|
#endif
|
||||||
Binary file not shown.
Loading…
Reference in new issue