base: cleanup
This commit is contained in:
@@ -91,13 +91,13 @@ typedef enum {
|
||||
} gpu_compare_mode_t;
|
||||
|
||||
typedef struct gpu_texture {
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
gpu_texture_format_t format;
|
||||
gpu_texture_state_t state;
|
||||
buffer_t *buffer;
|
||||
bool gpu_write;
|
||||
gpu_texture_impl_t impl;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
gpu_texture_format_t format;
|
||||
gpu_texture_state_t state;
|
||||
buffer_t *buffer;
|
||||
bool gpu_write;
|
||||
gpu_texture_impl_t impl;
|
||||
} gpu_texture_t;
|
||||
|
||||
typedef struct gpu_buffer {
|
||||
|
||||
@@ -28,7 +28,7 @@ string_array_t *ui_nodes_exclude_remove = NULL; // No removal f
|
||||
bool ui_nodes_socket_released = false;
|
||||
string_array_t *(*ui_nodes_enum_texts)(char *) = NULL; // Retrieve combo items for buttons of type ENUM
|
||||
any_array_t *(*ui_nodes_enum_textures)(char *) = NULL;
|
||||
gpu_texture_t *(*ui_nodes_preview_texture)(ui_node_t *) = NULL; // Retrieve preview image
|
||||
gpu_texture_t *(*ui_nodes_preview_texture)(ui_node_t *) = NULL; // Retrieve preview image
|
||||
void (*ui_nodes_on_custom_button)(int, char *) = NULL; // Call external function
|
||||
ui_canvas_control_t *(*ui_nodes_on_canvas_control)(void) = NULL;
|
||||
void (*ui_nodes_on_canvas_released)(void) = NULL;
|
||||
|
||||
+15
-14
@@ -16,20 +16,21 @@
|
||||
// ██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║
|
||||
// ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝
|
||||
|
||||
#define MINIC_TOK_LIST \
|
||||
X(TOK_INT, "'int'") \
|
||||
X(TOK_FLOAT, "'float'") \
|
||||
X(TOK_CHAR, "'char'") \
|
||||
X(TOK_DOUBLE, "'double'") \
|
||||
X(TOK_BOOL, "'bool'") \
|
||||
X(TOK_RETURN, "'return'") \
|
||||
X(TOK_IF, "'if'") X(TOK_ELSE, "'else'") X(TOK_WHILE, "'while'") X(TOK_FOR, "'for'") X(TOK_BREAK, "'break'") X(TOK_CONTINUE, "'continue'") \
|
||||
X(TOK_STRUCT, "'struct'") X(TOK_TYPEDEF, "'typedef'") X(TOK_ENUM, "'enum'") X(TOK_VOID, "'void'") X(TOK_IDENT, "identifier") X(TOK_NUMBER, "number") \
|
||||
X(TOK_CHAR_LIT, "char literal") X(TOK_STR_LIT, "string literal") X(TOK_LPAREN, "'('") X(TOK_RPAREN, "')'") X(TOK_LBRACE, "'{'") \
|
||||
X(TOK_RBRACE, "'}'") X(TOK_LBRACKET, "'['") X(TOK_RBRACKET, "']'") X(TOK_SEMICOLON, "';'") X(TOK_COMMA, "','") X(TOK_ASSIGN, "'='") \
|
||||
X(TOK_PLUS_ASSIGN, "'+='") X(TOK_MINUS_ASSIGN, "'-='") X(TOK_MUL_ASSIGN, "'*='") X(TOK_DIV_ASSIGN, "'/='") X(TOK_EQ, "'=='") \
|
||||
X(TOK_NEQ, "'!='") X(TOK_LT, "'<'") X(TOK_GT, "'>'") X(TOK_LE, "'<='") X(TOK_GE, "'>='") X(TOK_AND, "'&&'") X(TOK_OR, "'||'") \
|
||||
X(TOK_NOT, "'!'") X(TOK_AMP, "'&'") X(TOK_PLUS, "'+'") X(TOK_MINUS, "'-'") X(TOK_INC, "'++'") X(TOK_DEC, "'--'") \
|
||||
#define MINIC_TOK_LIST \
|
||||
X(TOK_INT, "'int'") \
|
||||
X(TOK_FLOAT, "'float'") \
|
||||
X(TOK_CHAR, "'char'") \
|
||||
X(TOK_DOUBLE, "'double'") \
|
||||
X(TOK_BOOL, "'bool'") \
|
||||
X(TOK_RETURN, "'return'") \
|
||||
X(TOK_IF, "'if'") \
|
||||
X(TOK_ELSE, "'else'") X(TOK_WHILE, "'while'") X(TOK_FOR, "'for'") X(TOK_BREAK, "'break'") X(TOK_CONTINUE, "'continue'") X(TOK_STRUCT, "'struct'") \
|
||||
X(TOK_TYPEDEF, "'typedef'") X(TOK_ENUM, "'enum'") X(TOK_VOID, "'void'") X(TOK_IDENT, "identifier") X(TOK_NUMBER, "number") \
|
||||
X(TOK_CHAR_LIT, "char literal") X(TOK_STR_LIT, "string literal") X(TOK_LPAREN, "'('") X(TOK_RPAREN, "')'") X(TOK_LBRACE, "'{'") \
|
||||
X(TOK_RBRACE, "'}'") X(TOK_LBRACKET, "'['") X(TOK_RBRACKET, "']'") X(TOK_SEMICOLON, "';'") X(TOK_COMMA, "','") X(TOK_ASSIGN, "'='") \
|
||||
X(TOK_PLUS_ASSIGN, "'+='") X(TOK_MINUS_ASSIGN, "'-='") X(TOK_MUL_ASSIGN, "'*='") X(TOK_DIV_ASSIGN, "'/='") X(TOK_EQ, "'=='") \
|
||||
X(TOK_NEQ, "'!='") X(TOK_LT, "'<'") X(TOK_GT, "'>'") X(TOK_LE, "'<='") X(TOK_GE, "'>='") X(TOK_AND, "'&&'") X(TOK_OR, "'||'") \
|
||||
X(TOK_NOT, "'!'") X(TOK_AMP, "'&'") X(TOK_PLUS, "'+'") X(TOK_MINUS, "'-'") X(TOK_INC, "'++'") X(TOK_DEC, "'--'") \
|
||||
X(TOK_STAR, "'*'") X(TOK_SLASH, "'/'") X(TOK_DOT, "'.'") X(TOK_ARROW, "'->'") X(TOK_EOF, "end of file")
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -77,7 +77,7 @@ minic_val_t minic_ctx_call_fn(minic_ctx_t *ctx, void *fn_ptr, minic_val_t *args
|
||||
// Call a minic function from native C. fn_ptr is a minic func passed from a script,
|
||||
// valid as long as the owning minic_ctx_t has not been freed
|
||||
minic_val_t minic_call_fn(void *fn_ptr, minic_val_t *args, int argc);
|
||||
void *minic_alloc(int size); // allocate in the active context's arena
|
||||
void *minic_alloc(int size); // allocate in the active context's arena
|
||||
bool minic_in_arena(void *p); // true if p points into the active arena (script value) vs native C memory
|
||||
|
||||
// Host api registration (idempotent, safe to re-run)
|
||||
|
||||
Reference in New Issue
Block a user