transfered from codeberg

This commit is contained in:
2026-03-26 14:46:39 -05:00
parent 630f28bb7e
commit 5ed2173793
136 changed files with 14932 additions and 0 deletions

43
source_code/main.c Normal file
View File

@@ -0,0 +1,43 @@
#include "function_success.h"
#include "player.h"
#include "game_initializer.h"
#include "game_renderer.h"
#include "chunk_scheduler.h"
#include "world.h"
#include <stdlib.h>
// This is the main function. You know what it is for.
int main(void)
{
world_struct* world = NULL;
player_struct* player = NULL;
if (!function_success(create_game(&world,
&player),
"failed to create world in main"))
{
return EXIT_FAILURE;
}
(void)start_chunk_scheduler(world);
while (!WindowShouldClose())
{
(void)destroy_inactive_chunks(world);
(void)update_player_controller(player);
(void)update_players_known_chunks(player,
world);
(void)update_world(world,
player);
(void)draw_game(world,
player);
}
(void)stop_chunk_scheduler();
(void)destroy_world(&world);
(void)destroy_player(&player);
(void)CloseWindow();
return EXIT_SUCCESS;
}