(main~>lib.h)+header for data structures,~migrate lib.h
+some file handlers for writing and reading (may help with very large renders by doing them piecemeal when I can)
This commit is contained in:
22
lib.h
Normal file
22
lib.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef LIB_H
|
||||||
|
#define LIB_H
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
typedef struct State
|
||||||
|
{
|
||||||
|
// Sandpiles
|
||||||
|
unsigned char *data;
|
||||||
|
size_t dwidth;
|
||||||
|
|
||||||
|
size_t window_len;
|
||||||
|
int multiplier;
|
||||||
|
|
||||||
|
bool thread_alive;
|
||||||
|
} state_t;
|
||||||
|
|
||||||
|
bool load_from_file(state_t *state, const char *filepath);
|
||||||
|
bool write_to_file(state_t *state, const char *filepath);
|
||||||
|
|
||||||
|
#endif
|
||||||
14
main.c
14
main.c
@@ -13,19 +13,7 @@
|
|||||||
#include <raylib.h>
|
#include <raylib.h>
|
||||||
#include <raymath.h>
|
#include <raymath.h>
|
||||||
|
|
||||||
struct State
|
#include "./lib.h"
|
||||||
{
|
|
||||||
// Sandpiles
|
|
||||||
unsigned char *data;
|
|
||||||
size_t dwidth;
|
|
||||||
|
|
||||||
size_t window_len;
|
|
||||||
int multiplier;
|
|
||||||
|
|
||||||
bool thread_alive;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct State state_t;
|
|
||||||
|
|
||||||
void step(state_t *state)
|
void step(state_t *state)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user