| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 
 |  
 
//------------------------------------------------------------------------------
// Macros pour définir la structure des resources
//
#define BEGIN_GROUP(__GROUP_NAME__) \
    struct __s_##__GROUP_NAME__ {
 
#define END_GROUP(__GROUP_NAME__) \
    }; \
    __s_##__GROUP_NAME__ __GROUP_NAME__;
 
#define BEGIN_RESOURCES \
   struct __s_resources { \
    NEW_RESOURCE(resources_begin, 0)
 
#define END_RESOURCES \
        NEW_RESOURCE(resources_end, 0) \
    }; \
    static __s_resources resources;
 
#define NEW_RESOURCE(__RESOURCE_NAME__, __RESOURCE_PATH__) \
    const char * const __RESOURCE_NAME__ = __RESOURCE_PATH__;
 
 
#define NEW_BUTTON(__BUTON_NAME__, __NORMAL__, __SELECTED__, __DISABLED__) \
    BEGIN_GROUP(__BUTON_NAME__)    \
        NEW_RESOURCE(normal, __NORMAL__);      \
        NEW_RESOURCE(selected, __SELECTED__);    \
        NEW_RESOURCE(disabled,__DISABLED__);    \
    END_GROUP(__BUTON_NAME__)
 
 
//------------------------------------------------------------------------------
// Création de la structure des ressources
//
BEGIN_RESOURCES
    BEGIN_GROUP(fonts)
        NEW_RESOURCE(game_typo, "fonts/game_typosletters_nogrid.png");
        NEW_RESOURCE(arista_2, "fonts/arista_2/arista_2.fnt");
    END_GROUP(fonts)
 
    BEGIN_GROUP(images)
        BEGIN_GROUP(backgrounds)
            NEW_RESOURCE(blue, "images/background_blue.png");
        END_GROUP(backgrounds)
 
        BEGIN_GROUP(buttons)
            NEW_BUTTON(
                       back,
                       "images/button_back_normal.png",
                       "images/button_back_selected.png",
                       0);
            NEW_BUTTON(
                       game_normal,
                       "images/button_game_normal_normal.png",
                       "images/button_game_normal_selected.png",
                       0);
            NEW_BUTTON(
                       game_pro_enable,
                       "images/button_game_pro_enable_normal.png",
                       "images/button_game_pro_enable_selected.png",
                       0);
            NEW_BUTTON(
                       game_pro_disable,
                       "images/button_game_pro_disable_normal.png",
                       "images/button_game_pro_disable_selected.png",
                       0);
            NEW_BUTTON(
                       play,
                       "images/button_play_normal.png",
                       "images/button_play_selected.png",
                       0);
            NEW_BUTTON(
                       reward,
                       "images/button_reward_normal.png",
                       "images/button_reward_selected.png",
                       0);
        END_GROUP(buttons)
 
        NEW_RESOURCE(element_block_green, "images/element_block_green.png");
    END_GROUP(images)
 
 
END_RESOURCES | 
Partager