From c10b2bb87be0eb85aacd4dc634f4294336101d4d Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 24 Jan 2020 07:32:52 +1100 Subject: [PATCH] Give some better variable names in HotbarWidget --- src/Widgets.c | 18 +++++++++--------- src/Widgets.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Widgets.c b/src/Widgets.c index e789b24fa..427febc2b 100644 --- a/src/Widgets.c +++ b/src/Widgets.c @@ -387,11 +387,11 @@ static void HotbarWidget_RenderHotbarOutline(struct HotbarWidget* w) { Texture_Render(&w->backTex); i = Inventory.SelectedIndex; - width = w->elemSize + w->borderSize; + width = w->elemSize + w->borderWidth; x = (int)(w->x + w->barXOffset + width * i + w->elemSize / 2); w->selTex.ID = tex; - w->selTex.X = (int)(x - w->selBlockSize / 2); + w->selTex.X = (int)(x - w->selBlockWidth / 2); Gfx_Draw2DTexture(&w->selTex, white); } @@ -402,7 +402,7 @@ static void HotbarWidget_RenderHotbarBlocks(struct HotbarWidget* w) { int i, x, y; IsometricDrawer_BeginBatch(vertices, Models.Vb); - width = w->elemSize + w->borderSize; + width = w->elemSize + w->borderWidth; scale = (w->elemSize * 13.5f/16.0f) / 2.0f; for (i = 0; i < INVENTORY_BLOCKS_PER_HOTBAR; i++) { @@ -420,7 +420,7 @@ static void HotbarWidget_RepositonBackgroundTexture(struct HotbarWidget* w) { static void HotbarWidget_RepositionSelectionTexture(struct HotbarWidget* w) { float scale = Game_GetHotbarScale(); - int hSize = (int)w->selBlockSize; + int hSize = (int)w->selBlockWidth; int vSize = (int)(22.0f * scale); int y = w->y + (w->height - (int)(23.0f * scale)); @@ -447,10 +447,10 @@ static void HotbarWidget_Reposition(void* widget) { w->width = (int)(182 * scale); w->height = (int)w->barHeight; - w->selBlockSize = (float)Math_Ceil(24.0f * scale); - w->elemSize = 16.0f * scale; - w->barXOffset = 3.1f * scale; - w->borderSize = 4.0f * scale; + w->selBlockWidth = (float)Math_Ceil(24.0f * scale); + w->elemSize = 16.0f * scale; + w->barXOffset = 3.1f * scale; + w->borderWidth = 4.0f * scale; Widget_CalcPosition(w); HotbarWidget_RepositonBackgroundTexture(w); @@ -506,7 +506,7 @@ static int HotbarWidget_PointerDown(void* widget, int id, int x, int y) { if (!Widget_Contains(w, x, y)) return false; - width = (int)(w->elemSize + w->borderSize); + width = (int)(w->elemSize + w->borderWidth); height = Math_Ceil(w->barHeight); for (i = 0; i < INVENTORY_BLOCKS_PER_HOTBAR; i++) { diff --git a/src/Widgets.h b/src/Widgets.h index 0e1dbae5d..b27706797 100644 --- a/src/Widgets.h +++ b/src/Widgets.h @@ -62,8 +62,8 @@ CC_NOINLINE void ScrollbarWidget_Create(struct ScrollbarWidget* w); struct HotbarWidget { Widget_Body struct Texture selTex, backTex; - float barHeight, selBlockSize, elemSize; - float barXOffset, borderSize; + float barHeight, selBlockWidth, elemSize; + float barXOffset, borderWidth; float scrollAcc; cc_bool altHandled; };