Initial commit.
This commit is contained in:
22
src/gen.c
Normal file
22
src/gen.c
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "include/gen.h"
|
||||
#include "include/col.h"
|
||||
#include "include/vol.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
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++) {
|
||||
if (rand() % 2 == 0) vol_set_vox(x, y, z, COL_WHT);
|
||||
else vol_set_vox(x, y, z, COL_BLK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("Volume initialized.\n");
|
||||
}
|
||||
Reference in New Issue
Block a user