Return to 2D.
This commit is contained in:
110
src/gen.c
110
src/gen.c
@@ -1,28 +1,90 @@
|
||||
#include "include/gen.h"
|
||||
#include "include/col.h"
|
||||
#include "include/vol.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
Vec2 asth[WORLD_SZ][WORLD_SZ] = {
|
||||
{
|
||||
(Vec2){.x = 1, .y = 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
},
|
||||
{
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
},
|
||||
{
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
},
|
||||
{
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
},
|
||||
{
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
},
|
||||
{
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
},
|
||||
{
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
},
|
||||
{
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
(Vec2){1, 2},
|
||||
},
|
||||
};
|
||||
|
||||
void gen(void) {
|
||||
srand((unsigned int)time(NULL));
|
||||
|
||||
for (int x = 0; x < VOL_WIDTH; x++) {
|
||||
for (int y = 0; y < VOL_HEIGHT; y++) {
|
||||
for (int z = 0; z < VOL_DEPTH; z++) {
|
||||
int r = rand() % 4;
|
||||
switch (r) {
|
||||
case 0: vol_set_pt(x, y, z, COL_WHT); break;
|
||||
case 1: vol_set_pt(x, y, z, COL_GRY); break;
|
||||
case 2: vol_set_pt(x, y, z, COL_GRN); break;
|
||||
case 3: vol_set_pt(x, y, z, COL_BLU); break;
|
||||
default: vol_set_pt(x, y, z, COL_MAG);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("Volume initialized.\n");
|
||||
}
|
||||
Plate lith[2] = {
|
||||
(Plate){COL_BLU, 4, {(Pt){0, 0}, (Pt){4, 0}, (Pt){0, 8}, (Pt){4, 8}}},
|
||||
(Plate){COL_RED, 4, {(Pt){4, 0}, (Pt){8, 0}, (Pt){8, 8}, (Pt){4, 8}}}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user