diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-15 17:49:01 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-15 17:49:01 +0000 |
commit | 8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1 (patch) | |
tree | 800d8d02db775b5f263eaee92c5cbf021d800e9f /src/gui/shop.cpp | |
parent | c92d7c1188febd7c5af15fa710ab06c3af4dede5 (diff) | |
download | mana-client-8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1.tar.gz mana-client-8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1.tar.bz2 mana-client-8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1.tar.xz mana-client-8ed926ea15e8f151b8b81f93a5dccd0d53cf7ca1.zip |
Cleaned up includes, separated engine from graphics and single buffer now
used throughout application, cleaned up shop functions.
Diffstat (limited to 'src/gui/shop.cpp')
-rw-r--r-- | src/gui/shop.cpp | 90 |
1 files changed, 11 insertions, 79 deletions
diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp index cc9d80ab..77e33ee0 100644 --- a/src/gui/shop.cpp +++ b/src/gui/shop.cpp @@ -22,85 +22,17 @@ */ #include "shop.h" -#include "../graphic/graphic.h" - -int n_items; -char* selectedItem = "You got 4"; -ITEM_SHOP *shop = NULL; char *item_db[] = { - "Cactus Drink", "Cactus potion", "Casino coins", "Decor Candy", "Maggot Slime", - "Candy Cane", "Scorpion Stinger", "Xmas Cake", "Chocolate", "Candy", "Santa Hat" + "Cactus Drink", + "Cactus potion", + "Casino coins", + "Decor Candy", + "Maggot Slime", + "Candy Cane", + "Scorpion Stinger", + "Xmas Cake", + "Chocolate", + "Candy", + "Santa Hat" }; - -char *shop_list(int index, int *list_size) { - if(index<0) { - *list_size = n_items; - return NULL; - } else { - int iterator = 0; - ITEM_SHOP *item_shop = shop; - while(iterator<index) { - item_shop = item_shop->next; - iterator++; - } - return item_shop->name; - } -} - -void close_shop() { - ITEM_SHOP *temp, *next; - temp = shop; - while(temp) { - next = temp->next; - free(temp); - temp = next; - } - shop = NULL; -} - -short get_item_id(int index) { - int iterator = 0; - ITEM_SHOP *item_shop = shop; - while(iterator<index) { - item_shop = item_shop->next; - iterator++; - } - return item_shop->id; -} - -int get_item_quantity(int index) { - int iterator = 0; - ITEM_SHOP *item_shop = shop; - while(iterator<index) { - item_shop = item_shop->next; - iterator++; - } - if(item_shop)return item_shop->quantity; - else return 0; -} - -int get_item_index(int index) { - int iterator = 0; - ITEM_SHOP *item_shop = shop; - while(iterator<index) { - item_shop = item_shop->next; - iterator++; - } - return item_shop->index; -} - -int get_item_price(int index) { - int iterator = 0; - ITEM_SHOP *item_shop = shop; - while(iterator<index) { - item_shop = item_shop->next; - iterator++; - } - return item_shop->price; -} - -void changeQ(void *dp3, int d2) { - sprintf(itemCurrenyQ,"%i",d2); - printf("%s\n",itemCurrenyQ); -} |