From ce6e5d6f081891e73df39f14322339a2cae0c551 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 1 Sep 2020 00:25:35 +0200 Subject: [PATCH] Reorder structs, alignment --- gfx/widgets/gfx_widget_screenshot.c | 48 ++++++++++++++--------------- gfx/widgets/gfx_widget_volume.c | 37 ++++++++++------------ 2 files changed, 40 insertions(+), 45 deletions(-) diff --git a/gfx/widgets/gfx_widget_screenshot.c b/gfx/widgets/gfx_widget_screenshot.c index 82daef0250..f252fe86b2 100644 --- a/gfx/widgets/gfx_widget_screenshot.c +++ b/gfx/widgets/gfx_widget_screenshot.c @@ -26,45 +26,45 @@ struct gfx_widget_screenshot_state { - float alpha; uintptr_t texture; unsigned texture_width; unsigned texture_height; - char shotname[256]; - char filename[256]; - bool loaded; - float scale_factor; - float y; unsigned height; unsigned width; unsigned thumbnail_width; unsigned thumbnail_height; - gfx_timer_t timer; - unsigned shotname_length; + + float scale_factor; + float y; + float alpha; + gfx_timer_t timer; /* float alignment */ + + char shotname[256]; + char filename[256]; + bool loaded; }; typedef struct gfx_widget_screenshot_state gfx_widget_screenshot_state_t; static gfx_widget_screenshot_state_t p_w_screenshot_st = { - 0.0f, - 0, - 0, - 0, - {0}, - {0}, - false, + 0, /* texture */ + 0, /* texture_width */ + 0, /* texture_height */ + 0, /* height */ + 0, /* width */ + 0, /* thumbnail_width */ + 0, /* thumbnail_height */ + 0, /* shotname_length */ + 0.0f, /* scale_factor */ + 0.0f, /* y */ + 0.0f, /* alpha */ + 0.0f, /* timer */ - 0.0f, - 0.0f, - 0, - 0, - 0, - 0, - 0.0f, - - 0 + {0}, /* shotname */ + {0}, /* filename */ + false /* loaded */ }; static gfx_widget_screenshot_state_t* gfx_widget_screenshot_get_ptr(void) diff --git a/gfx/widgets/gfx_widget_volume.c b/gfx/widgets/gfx_widget_volume.c index c059ea0e42..4ecf53b875 100644 --- a/gfx/widgets/gfx_widget_volume.c +++ b/gfx/widgets/gfx_widget_volume.c @@ -43,14 +43,8 @@ static const char* const ICONS_NAMES[ICON_LAST] = { /* Widget state */ struct gfx_widget_volume_state { - float db; - float percent; - gfx_timer_t timer; - - float alpha; - float text_alpha; uintptr_t tag; - bool mute; + uintptr_t textures[ICON_LAST]; unsigned widget_width; unsigned widget_height; @@ -59,31 +53,32 @@ struct gfx_widget_volume_state float bar_normal[16]; float bar_loud[16]; float bar_loudest[16]; + float alpha; + float text_alpha; + float db; + float percent; + gfx_timer_t timer; /* float alignment */ - uintptr_t textures[ICON_LAST]; + bool mute; }; typedef struct gfx_widget_volume_state gfx_widget_volume_state_t; static gfx_widget_volume_state_t p_w_volume_st = { - 0.0f, - 1.0f, - 0.0f, - - 0.0f, - 0.0f, (uintptr_t) &p_w_volume_st, - false, - + {0}, 0, 0, - COLOR_HEX_TO_FLOAT(0x1A1A1A, 1.0f), COLOR_HEX_TO_FLOAT(0x198AC6, 1.0f), COLOR_HEX_TO_FLOAT(0xF5DD19, 1.0f), COLOR_HEX_TO_FLOAT(0xC23B22, 1.0f), - - {0}, + 0.0f, + 0.0f, + 0.0f, + 1.0f, + 0.0f, + false }; gfx_widget_volume_state_t* gfx_widget_volume_get_ptr(void) @@ -93,13 +88,13 @@ gfx_widget_volume_state_t* gfx_widget_volume_get_ptr(void) static void gfx_widget_volume_frame(void* data, void *user_data) { - static float pure_white[16] = { + static float pure_white[16] = { 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, }; - gfx_widget_volume_state_t* state = gfx_widget_volume_get_ptr(); + gfx_widget_volume_state_t* state = gfx_widget_volume_get_ptr(); if (state->alpha > 0.0f) {