Refactor joker selection logic in game shop
This commit is contained in:
@@ -40,7 +40,7 @@ ARCH := -mthumb -mthumb-interwork
|
|||||||
|
|
||||||
CFLAGS := -O3 -Wall \
|
CFLAGS := -O3 -Wall \
|
||||||
-mcpu=arm7tdmi -mtune=arm7tdmi \
|
-mcpu=arm7tdmi -mtune=arm7tdmi \
|
||||||
-ffast-math -fomit-frame-pointer -funroll-loops -flto \
|
-ffast-math -fomit-frame-pointer -funroll-loops \
|
||||||
$(ARCH)
|
$(ARCH)
|
||||||
|
|
||||||
CFLAGS += $(INCLUDE)
|
CFLAGS += $(INCLUDE)
|
||||||
@@ -48,7 +48,7 @@ CFLAGS += $(INCLUDE)
|
|||||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||||
|
|
||||||
ASFLAGS := -g $(ARCH)
|
ASFLAGS := -g $(ARCH)
|
||||||
LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map) -flto
|
LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
# any extra libraries we wish to link with the project
|
# any extra libraries we wish to link with the project
|
||||||
|
|||||||
+2
-18
@@ -2138,33 +2138,17 @@ void game_shop()
|
|||||||
{
|
{
|
||||||
if (i == selection_x - 1 && top_row)
|
if (i == selection_x - 1 && top_row)
|
||||||
{
|
{
|
||||||
shop_jokers[i]->selected = true;
|
shop_jokers[i]->ty = int2fx(61);
|
||||||
|
|
||||||
if (key_hit(KEY_A) && jokers_top < MAX_JOKERS_SIZE - 1)
|
if (key_hit(KEY_A) && jokers_top < MAX_JOKERS_SIZE - 1)
|
||||||
{
|
{
|
||||||
joker_push(shop_jokers[i]);
|
joker_push(shop_jokers[i]);
|
||||||
shop_jokers[i]->selected = false;
|
|
||||||
shop_jokers[i] = NULL; // Remove the joker from the shop
|
shop_jokers[i] = NULL; // Remove the joker from the shop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
shop_jokers[i]->selected = false;
|
shop_jokers[i]->ty = int2fx(71);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < MAX_SHOP_JOKERS; i++)
|
|
||||||
{
|
|
||||||
if (shop_jokers[i] != NULL)
|
|
||||||
{
|
|
||||||
if (shop_jokers[i]->selected)
|
|
||||||
{
|
|
||||||
shop_jokers[i]->ty = int2fx(61);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
shop_jokers[i]->ty = int2fx(71); // Reset the y position to the default position
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user