Wed, 31 Dec 2025 17:50:20 +0100
update uwproj and ucx
| configure | file | annotate | diff | comparison | revisions | |
| demo/snake/snake.c | file | annotate | diff | comparison | revisions | |
| make/configure.vm | file | annotate | diff | comparison | revisions | |
| make/project.xml | file | annotate | diff | comparison | revisions | |
| src/ascension/scene_node.h | file | annotate | diff | comparison | revisions | |
| src/behavior.c | file | annotate | diff | comparison | revisions | |
| src/context.c | file | annotate | diff | comparison | revisions | |
| src/filesystem.c | file | annotate | diff | comparison | revisions | |
| src/font.c | file | annotate | diff | comparison | revisions | |
| src/glcontext.c | file | annotate | diff | comparison | revisions | |
| src/scene.c | file | annotate | diff | comparison | revisions | |
| src/scene_node.c | file | annotate | diff | comparison | revisions | |
| src/shader.c | file | annotate | diff | comparison | revisions | |
| src/sprite.c | file | annotate | diff | comparison | revisions | |
| src/text.c | file | annotate | diff | comparison | revisions |
--- a/configure Sun Nov 30 16:52:33 2025 +0100 +++ b/configure Wed Dec 31 17:50:20 2025 +0100 @@ -85,11 +85,14 @@ printhelp() { echo "Usage: $0 [OPTIONS]..." - echo 'Configuration:' + if [ $has_overridable_config_vars__ -eq 1 ] ; then + echo + echo "Configuration:" + fi if true \ ; then : - if test -z "$TOOLKIT_HOME__described__"; then + if [ -z "$TOOLKIT_HOME__described__" ] ; then TOOLKIT_HOME__described__=1 cat << '__EOF__' --toolkit-home location of the toolkit installation (default: /usr) @@ -124,14 +127,16 @@ touch "$TEMP_DIR/features" # config variables +has_overridable_config_vars__=0 if true \ ; then : - if test -z "$srcdir__initialized__"; then + if [ -z "$srcdir__initialized__" ] ; then srcdir__initialized__=1 srcdir=`pwd` fi - if test -z "$TOOLKIT_HOME__initialized__"; then + if [ -z "$TOOLKIT_HOME__initialized__" ] ; then + has_overridable_config_vars__=1 TOOLKIT_HOME__initialized__=1 TOOLKIT_HOME='/usr' fi @@ -254,18 +259,15 @@ # generate vars.mk -cat > "$TEMP_DIR/vars.mk" << __EOF__ -srcdir=$srcdir -TOOLKIT_HOME=$TOOLKIT_HOME -__EOF__ - +echo '# configuration' > "$TEMP_DIR/vars.mk" +echo "srcdir=$srcdir" >> "$TEMP_DIR/vars.mk" +echo "TOOLKIT_HOME=$TOOLKIT_HOME" >> "$TEMP_DIR/vars.mk" +echo >> "$TEMP_DIR/vars.mk" # # DEPENDENCIES # - - # create buffer for make variables required by dependencies echo > "$TEMP_DIR/make.mk" @@ -449,7 +451,7 @@ if [ -z "$PKG_CONFIG" ]; then break fi - if test_pkg_config "ucx" "3.2" "" "" ; then + if test_pkg_config "ucx" "4.0" "" "" ; then TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags ucx`" TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs ucx`" else @@ -693,10 +695,14 @@ if [ -n "$TOOLCHAIN_CSTD" ]; then echo " default C std: $TOOLCHAIN_CSTD" fi -echo -echo "Config:" - printf ' %-16s' 'toolkit-home:' - echo "$TOOLKIT_HOME" +if [ $has_overridable_config_vars__ -eq 1 ]; then + echo + echo "Config:" + if [ -n "$TOOLKIT_HOME__initialized__" ]; then + printf ' %-16s' 'toolkit-home:' + echo "$TOOLKIT_HOME" + fi +fi echo echo "Features:" printf ' %-16s' 'asan:'
--- a/demo/snake/snake.c Sun Nov 30 16:52:33 2025 +0100 +++ b/demo/snake/snake.c Wed Dec 31 17:50:20 2025 +0100 @@ -256,7 +256,7 @@ game.field->tile_data[x][y] = GAME_FIELD_TILE_EXISTS_FLAG; game.field->nodes[x][y] = tile; - asc_scene_node_link(node, tile); + asc_scene_node_add(node, tile); } } asc_scene_node_set_zindex(node, -2); @@ -274,13 +274,13 @@ asc_uniform_loc color; } PlayerShader; -static void player_shader_init(AscShaderProgram *p, cx_attr_unused int flags) { +static void player_shader_init(AscShaderProgram *p, CX_UNUSED int flags) { asc_shader_set_uniform_loc_by_name(p, PlayerShader, map_albedo); asc_shader_set_uniform_loc_by_name(p, PlayerShader, map_color); asc_shader_set_uniform_loc_by_name(p, PlayerShader, color); } -static AscShaderProgram *player_shader_create(cx_attr_unused int unused) { +static AscShaderProgram *player_shader_create(CX_UNUSED int unused) { return asc_shader_create((AscShaderCodes) { .vtx = {.source_file = "sprite_vtx.glsl"}, .frag = {.source_file = "player.glsl",}, @@ -484,8 +484,8 @@ player->number = 1; player->health = 100; player->color = ASC_RGB(1, 0, 0); - player->trace = cxLinkedListCreateSimple(sizeof(asc_vec2u)); - cxDefineDestructor(player->trace, player_trace_release_tile); + player->trace = cxLinkedListCreate(NULL, sizeof(asc_vec2u)); + cxSetDestructor(player->trace, player_trace_release_tile); node->draw_func = player_draw; node->user_data_free_func = (cx_destructor_func2)player_destroy;
--- a/make/configure.vm Sun Nov 30 16:52:33 2025 +0100 +++ b/make/configure.vm Wed Dec 31 17:50:20 2025 +0100 @@ -86,7 +86,10 @@ printhelp() { echo "Usage: $0 [OPTIONS]..." - echo 'Configuration:' + if [ $has_overridable_config_vars__ -eq 1 ] ; then + echo + echo "Configuration:" + fi #foreach( $cfg in $config ) if true \ #if( $cfg.platform ) @@ -99,7 +102,7 @@ : #foreach( $var in $cfg.vars ) #if( $var.overridable ) - if test -z "${D}${var.varName}__described__"; then + if [ -z "${D}${var.varName}__described__" ] ; then ${var.varName}__described__=1 cat << '__EOF__' ${var.helpText} @@ -147,6 +150,7 @@ touch "$TEMP_DIR/features" # config variables +has_overridable_config_vars__=0 #foreach( $cfg in $config ) if true \ #if( $cfg.platform ) @@ -158,7 +162,10 @@ ; then : #foreach( $var in $cfg.vars ) - if test -z "${D}${var.varName}__initialized__"; then + if [ -z "${D}${var.varName}__initialized__" ] ; then + #if( $var.overridable ) + has_overridable_config_vars__=1 + #end ${var.varName}__initialized__=1 #if( $var.exec ) ${var.varName}=`${var.value}` @@ -304,19 +311,16 @@ ## End of unparsed content ** # generate vars.mk -cat > "$TEMP_DIR/vars.mk" << __EOF__ +echo '# configuration' > "$TEMP_DIR/vars.mk" #foreach( $var in $vars ) -${var.varName}=${D}${var.varName} +echo "${var.varName}=${D}${var.varName}" >> "$TEMP_DIR/vars.mk" #end -__EOF__ - +echo >> "$TEMP_DIR/vars.mk" # # DEPENDENCIES # - - # create buffer for make variables required by dependencies echo > "$TEMP_DIR/make.mk" @@ -714,14 +718,18 @@ if [ -n "$TOOLCHAIN_CSTD" ]; then echo " default C std: $TOOLCHAIN_CSTD" fi -echo -echo "Config:" +if [ ${D}has_overridable_config_vars__ -eq 1 ]; then + echo + echo "Config:" #foreach( $var in $vars ) #if ($var.overridable) - printf ' %-16s' '${var.arg}:' - echo "${D}${var.varName}" + if [ -n "${D}${var.varName}__initialized__" ]; then + printf ' %-16s' '${var.arg}:' + echo "${D}${var.varName}" + fi #end #end +fi #if ( $options.size() > 0 ) echo echo "Options:"
--- a/make/project.xml Sun Nov 30 16:52:33 2025 +0100 +++ b/make/project.xml Wed Dec 31 17:50:20 2025 +0100 @@ -10,7 +10,7 @@ </dependency> <dependency name="ucx"> - <pkgconfig atleast="3.2">ucx</pkgconfig> + <pkgconfig atleast="4.0">ucx</pkgconfig> </dependency> <dependency name="sdl3">
--- a/src/ascension/scene_node.h Sun Nov 30 16:52:33 2025 +0100 +++ b/src/ascension/scene_node.h Wed Dec 31 17:50:20 2025 +0100 @@ -205,7 +205,7 @@ * @param parent the (new) parent * @param node the node to link */ -void asc_scene_node_link( +void asc_scene_node_add( AscSceneNode *restrict parent, AscSceneNode *restrict node ); @@ -218,7 +218,7 @@ * * @param node the node to unlink */ -void asc_scene_node_unlink(AscSceneNode *node); +void asc_scene_node_remove(AscSceneNode *node); void asc_scene_node_update(AscSceneNode *node);
--- a/src/behavior.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/behavior.c Wed Dec 31 17:50:20 2025 +0100 @@ -46,8 +46,8 @@ } static CxList *asc_behavior_new_list(void) { - CxList *list = cxLinkedListCreateSimple(sizeof(AscBehavior)); - cxDefineDestructor(list, asc_behavior_destroy); + CxList *list = cxLinkedListCreate(NULL, sizeof(AscBehavior)); + cxSetDestructor(list, asc_behavior_destroy); return list; }
--- a/src/context.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/context.c Wed Dec 31 17:50:20 2025 +0100 @@ -53,9 +53,9 @@ memset(&asc_context, 0, sizeof(AscContext)); // initialize default paths - asc_context.font_path = cx_strdup(CX_STR("./fonts")); - asc_context.shader_path = cx_strdup(CX_STR("./shader")); - asc_context.texture_path = cx_strdup(CX_STR("./textures")); + asc_context.font_path = cx_strdup("./fonts"); + asc_context.shader_path = cx_strdup("./shader"); + asc_context.texture_path = cx_strdup("./textures"); // initialize the font cache asc_font_cache_init(); @@ -66,9 +66,7 @@ // initialize error buffer cxBufferInit( &asc_context.error_buffer, - NULL, - 256, - NULL, + NULL, NULL, 256, CX_BUFFER_AUTO_EXTEND );
--- a/src/filesystem.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/filesystem.c Wed Dec 31 17:50:20 2025 +0100 @@ -46,9 +46,9 @@ if (base.ptr[base.length - 1] == '/') base.length--; - if (cx_strprefix(path, CX_STR("./"))) { + if (cx_strprefix(path, "./")) { path = cx_strsubs(path, 2); } - return cx_strcat(3, base, CX_STR("/"), path); + return cx_strcat(CX_NULLSTR, 3, base, cx_str("/"), path); }
--- a/src/font.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/font.c Wed Dec 31 17:50:20 2025 +0100 @@ -66,10 +66,10 @@ void asc_font_cache_init(void) { assert(asc_font_cache == NULL); - asc_font_cache = cxArrayListCreateSimple( - sizeof(struct asc_font_cache_entry), 16 + asc_font_cache = cxArrayListCreate( + NULL, sizeof(struct asc_font_cache_entry), 16 ); - cxDefineDestructor(asc_font_cache, asc_font_unload); + cxSetDestructor(asc_font_cache, asc_font_unload); } void asc_font_cache_destroy(void) {
--- a/src/glcontext.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/glcontext.c Wed Dec 31 17:50:20 2025 +0100 @@ -108,12 +108,12 @@ glDebugMessageCallback(asc_gl_debug_callback, NULL); // Create the cleanup functions array - ctx->cleanup_funcs = cxArrayListCreateSimple(sizeof(struct asc_gl_context_cleanup_data), 8); - cxDefineDestructor(ctx->cleanup_funcs, asc_gl_context_cleanup); + ctx->cleanup_funcs = cxArrayListCreate(NULL, sizeof(struct asc_gl_context_cleanup_data), 8); + cxSetDestructor(ctx->cleanup_funcs, asc_gl_context_cleanup); // Create the shaders array - ctx->shaders = cxArrayListCreateSimple(CX_STORE_POINTERS, 32); - cxDefineDestructor(ctx->shaders, asc_shader_free); + ctx->shaders = cxArrayListCreate(NULL, CX_STORE_POINTERS, 32); + cxSetDestructor(ctx->shaders, asc_shader_free); ctx->active_program = 0; return true;
--- a/src/scene.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/scene.c Wed Dec 31 17:50:20 2025 +0100 @@ -45,7 +45,7 @@ scene->camera = camera; scene->root = asc_scene_node_empty(); for (unsigned i = 0 ; i < ASC_RENDER_GROUP_COUNT ; i++) { - scene->internal.render_groups[i] = cxArrayListCreateSimple(CX_STORE_POINTERS, 32); + scene->internal.render_groups[i] = cxArrayListCreate(NULL, CX_STORE_POINTERS, 32); } if (name == NULL) { scene->name = asc_util_gen_name("scene"); @@ -69,7 +69,7 @@ } void asc_scene_execute_behaviors(AscScene *scene) { - CxTreeVisitor iter = cx_tree_visitor(scene->root, + CxTreeIterator iter = cx_tree_visitor(scene->root, offsetof(AscSceneNode, children), offsetof(AscSceneNode, next) ); @@ -134,14 +134,14 @@ } // update the scene graph and add nodes to their render groups - CxTreeVisitor iter = cx_tree_visitor(scene->root, + CxTreeIterator iter = cx_tree_visitor(scene->root, offsetof(AscSceneNode, children), offsetof(AscSceneNode, next) ); cx_foreach(AscSceneNode*, node, iter) { // skip hidden nodes (and all their children) if (asc_scene_node_is_hidden(node)) { - cxTreeVisitorContinue(iter); + cxTreeIteratorContinue(iter); } // TODO: implement culling @@ -219,9 +219,9 @@ } void asc_scene_add_node(AscScene *scene, AscSceneNode *node) { - asc_scene_node_link(scene->root, node); + asc_scene_node_add(scene->root, node); } void asc_scene_remove_node(AscSceneNode *node) { - asc_scene_node_unlink(node); + asc_scene_node_remove(node); }
--- a/src/scene_node.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/scene_node.c Wed Dec 31 17:50:20 2025 +0100 @@ -70,7 +70,7 @@ if (node == NULL) return; // remove this node from its parent - asc_scene_node_unlink(node); + asc_scene_node_remove(node); // free the entire subtree CxTreeIterator iter = asc_scene_node_iterator(node, true); @@ -171,8 +171,8 @@ return cx_strcast(node->name); } -void asc_scene_node_link(AscSceneNode * restrict parent, AscSceneNode * restrict node) { - cx_tree_link( +void asc_scene_node_add(AscSceneNode * restrict parent, AscSceneNode * restrict node) { + cx_tree_add( parent, node, offsetof(AscSceneNode, parent), offsetof(AscSceneNode, children), @@ -183,8 +183,8 @@ asc_scene_node_update_transform(node); } -void asc_scene_node_unlink(AscSceneNode *node) { - cx_tree_unlink( +void asc_scene_node_remove(AscSceneNode *node) { + cx_tree_remove( node, offsetof(AscSceneNode, parent), offsetof(AscSceneNode, children),
--- a/src/shader.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/shader.c Wed Dec 31 17:50:20 2025 +0100 @@ -43,7 +43,7 @@ FILE *f = fopen(fpath.ptr, "r"); cx_strfree(&fpath); CxBuffer buffer; - if (f == NULL || cxBufferInit(&buffer, NULL, 1024, cxDefaultAllocator, CX_BUFFER_AUTO_EXTEND)) { + if (f == NULL || cxBufferInit(&buffer, NULL, NULL, 1024, CX_BUFFER_AUTO_EXTEND)) { return NULL; } cx_stream_copy(f, &buffer, (cx_read_func) fread, cxBufferWriteFunc);
--- a/src/sprite.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/sprite.c Wed Dec 31 17:50:20 2025 +0100 @@ -40,7 +40,7 @@ asc_uniform_loc tex; } AscSpriteShader; -static void asc_sprite_shader_init(AscShaderProgram *p, cx_attr_unused int flags) { +static void asc_sprite_shader_init(AscShaderProgram *p, CX_UNUSED int flags) { asc_shader_set_uniform_loc_by_name(p, AscSpriteShader, tex); }
--- a/src/text.c Sun Nov 30 16:52:33 2025 +0100 +++ b/src/text.c Wed Dec 31 17:50:20 2025 +0100 @@ -41,7 +41,7 @@ asc_uniform_loc tex; } AscTextShader; -static void asc_text_shader_init(AscShaderProgram *p, cx_attr_unused int flags) { +static void asc_text_shader_init(AscShaderProgram *p, CX_UNUSED int flags) { asc_shader_set_uniform_loc_by_name(p, AscTextShader, tex); }