aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index f291ee5..6bec32e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,6 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <time.h>
#include "typedef.h"
#include "ppm.h"
@@ -12,8 +11,8 @@ size_t TILES;
size_t TILE_WIDTH;
size_t TILE_HEIGHT;
-size_t SWIDTH = 10;
-size_t SHEIGHT = 10;
+size_t SWIDTH = 30;
+size_t SHEIGHT = 30;
int get_least_entropy_index()
{
@@ -85,17 +84,14 @@ void collapse_this(int i)
int main(void)
{
- calc_tiles();
- if(TILES > TILES_CAP) {
- printf("ERROR: Too many tiles: %ld\n", TILES);
- exit(EXIT_FAILURE);
- }
+ load_tiles();
+ print_tiles();
- time_t seed = 420;
+ time_t seed = 69;
srand(seed);
printf("The Seed is %ld\n", seed);
- generate_tile_masks(load_tile_connections());
+ generate_tile_masks(get_tile_connections());
init_tilemap();
while(1) {
@@ -108,12 +104,9 @@ int main(void)
collapse_this(lei);
}
- load_tiles();
-
size_t img_wdt = TILE_WIDTH * SWIDTH;
size_t img_hgt = TILE_HEIGHT * SHEIGHT;
small_t *image = malloc(img_wdt * img_hgt * 3);
- memset(image, 0, img_wdt * img_hgt);
for(size_t i = 0; i < SHEIGHT; i++)
{
@@ -135,7 +128,7 @@ int main(void)
char file_name[64] = {0};
sprintf(file_name, "files/file_%ld.ppm", seed);
- save_as_ppm(file_name, image, img_wdt, img_hgt, 10);
+ save_as_ppm(file_name, image, img_wdt, img_hgt, 9);
printf("Saved file with name: %s\n", file_name);
free(image);