This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository elimine.

View the commit online.

commit 78199f9380a5495dc81f057a51a3a6d37858953b
Author: Vincent Torri <vto...@outlook.fr>
AuthorDate: Sat Jul 12 21:07:33 2025 +0200

    add some debug printf
---
 src/bin/elimine.c | 47 +++++++++++++++++++++++++++--------------------
 src/bin/score.c   |  3 +++
 2 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/src/bin/elimine.c b/src/bin/elimine.c
index 2bee80e..c61f9ea 100644
--- a/src/bin/elimine.c
+++ b/src/bin/elimine.c
@@ -31,10 +31,11 @@ typedef enum
 
 typedef struct
 {
-    Evas_Object *grd;
     Evas_Object *remain; /* nbr of remaing bombs */
+    Evas_Object *time;
     Evas_Object *smiley;
-    Eina_List *tiles;
+    Evas_Object *grd;
+    Eina_Array *tiles;
 
     int *state;
     int *known;
@@ -108,20 +109,17 @@ Ctx *ctx_new(Difficulty d, int pixel_sz)
             return NULL;
     }
 
+    ctx->tiles = eina_array_new(ctx->nl * ctx->nc);
+    if (!ctx->tiles)
+        goto free_ctx;
+
     ctx->state = (int *)calloc(ctx->nl * ctx->nc, sizeof(int));
     if (!ctx->state)
-    {
-        free(ctx);
-        return NULL;
-    }
+        goto free_tiles;
 
     ctx->known = (int *)calloc(ctx->nl * ctx->nc, sizeof(int));
     if (!ctx->known)
-    {
-        free(ctx->state);
-        free(ctx);
-        return NULL;
-    }
+        goto free_state;
 
     /* state */
 
@@ -179,9 +177,15 @@ Ctx *ctx_new(Difficulty d, int pixel_sz)
         }
     }
 
-    ctx->tiles = elm_grid_children_get(ctx->grd);
-
     return ctx;
+
+  free_state:
+    free(ctx->state);
+  free_tiles:
+    eina_array_free(ctx->tiles);
+  free_ctx:
+    free(ctx);
+    return NULL;
 }
 
 void ctx_del(Ctx *ctx)
@@ -189,17 +193,18 @@ void ctx_del(Ctx *ctx)
     if (!ctx)
         return;
 
-    free(ctx->state);
     free(ctx->known);
+    free(ctx->state);
+    eina_array_free(ctx->tiles);
     free(ctx);
 }
 
 
 #define TILE(t, l, c) \
 do { \
-    Evas_Object *o = eina_list_nth(ctx->tiles, l * ctx->nc + c);    \
-    evas_object_image_data_set(o, tile_bmp_get(t));                 \
-    evas_object_image_pixels_dirty_set(o, EINA_TRUE);               \
+    Evas_Object *o = eina_array_data_get(ctx->tiles, l * ctx->nc + c);  \
+    evas_object_image_data_set(o, tile_bmp_get(t));                     \
+    evas_object_image_pixels_dirty_set(o, EINA_TRUE);                   \
 } while (0)
 
 static inline int in_bounds(Ctx *ctx, int l, int c)
@@ -381,6 +386,7 @@ elm_main(int argc, char **argv)
     ctx = ctx_new(BEGINNER, 3);
     if (!ctx)
         return 1;
+    printf(" $$ ctx %p %d\n", (void *)ctx, ctx->pixel_sz);
 
     elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
     elm_app_name_set("elimine");
@@ -418,7 +424,9 @@ elm_main(int argc, char **argv)
     o = score_add(win);
     score_set(o, ctx->nm);
     //evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    //evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, 0);
     elm_box_pack_end(hbox, o);
     evas_object_show(o);
     ctx->remain = o;
@@ -496,11 +504,10 @@ elm_main(int argc, char **argv)
             evas_object_size_hint_max_set(o, icon_w, icon_h);
             elm_grid_pack(ctx->grd, o, c, l, 1, 1);
             evas_object_show(o);
+            eina_array_push(ctx->tiles, o);
         }
     }
 
-    ctx->tiles = elm_grid_children_get(ctx->grd);
-
     o = evas_object_rectangle_add(evas_object_evas_get(win));
     evas_object_color_set(o, 0, 0, 0, 0);
     evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
diff --git a/src/bin/score.c b/src/bin/score.c
index f0150e4..0ab61c4 100644
--- a/src/bin/score.c
+++ b/src/bin/score.c
@@ -213,6 +213,7 @@ score_set(Evas_Object *obj, int val)
 
     ctx = evas_object_data_get(obj, "ctx");
     EINA_SAFETY_ON_NULL_RETURN(ctx);
+    printf(" $$ pixel_sz: %p %d\n", (void *)ctx, ctx->pixel_sz);
 
     if (!sd->pixel_sz)
     {
@@ -222,8 +223,10 @@ score_set(Evas_Object *obj, int val)
 
         sd->pixel_sz = ctx->pixel_sz;
         cipher_size_get(&icon_w, &icon_h);
+        printf(" $$ %d %d %d\n", icon_w, icon_h, sd->pixel_sz);
         icon_w *= sd->pixel_sz;
         icon_h *= sd->pixel_sz;
+        printf(" $$ %d %d\n", icon_w, icon_h);
 
         for (int i = 0; i < 3; i++)
         {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to