From e161d6becb742016d4113ccaec633cc7c3e1061f Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Sat, 24 Feb 2018 21:47:09 +0100 Subject: [PATCH] Just some code cleaning that i stumbled upon --- src/item_builder.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/item_builder.c b/src/item_builder.c index 22f1ccc..6693d3a 100644 --- a/src/item_builder.c +++ b/src/item_builder.c @@ -111,7 +111,7 @@ create_treasure(int current_level) value = get_random(highest_treasure); - SDL_Rect clip = { 0, 0, 16, 16 }; + SDL_Rect clip = CLIP16(0, 0); switch (value) { case COPPER: m_sprintf(&label[0], 50, "%.0f copper", amt); @@ -162,13 +162,13 @@ item_builder_build_item(ItemKey key, int level) break; case FLESH: item = create_item(path_flesh, - (SDL_Rect) { get_random(7) * 16, get_random(1) * 16, 16, 16 }, + CLIP16(get_random(7) * 16, get_random(1) * 16), &eat_flesh); item->value = 1 + get_random(level*2); break; case HEALTH: item = create_item(path_potion, - (SDL_Rect) { 0, 0, 16, 16 }, + CLIP16(0, 0), &drink_health); item->value = 1 + get_random(level*2); break; @@ -184,7 +184,7 @@ Item * item_builder_build_sack(void) { return create_item("Items/Chest0.png", - (SDL_Rect) { 0, 32, 16, 16 }, + CLIP16(0, 32), NULL); }