From 7cd54e5f8038c3b784665098abb56ffc56e42198 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Tue, 21 Nov 2023 06:05:52 -0600 Subject: [PATCH] Inventory refactor completed. Individual monster loot and stage loot inventories now compatible. --- Crawler/DEFINES.h | 2 +- Crawler/InventoryConsumableWindow.cpp | 2 +- Crawler/InventoryScrollableWindowComponent.h | 26 +++++++--- Crawler/Item.cpp | 54 +++++++++++++------- Crawler/Item.h | 8 +-- Crawler/LevelCompleteWindow.cpp | 17 +++++- Crawler/Menu.cpp | 1 - Crawler/MenuItemButton.h | 26 ++++++---- Crawler/Player.cpp | 8 ++- Crawler/Theme.h | 2 +- Crawler/Version.h | 2 +- Crawler/cpp.hint | 8 +++ Crawler/olcPixelGameEngine.h | 2 +- 13 files changed, 110 insertions(+), 48 deletions(-) diff --git a/Crawler/DEFINES.h b/Crawler/DEFINES.h index 29bf1c73..25ac81cb 100644 --- a/Crawler/DEFINES.h +++ b/Crawler/DEFINES.h @@ -56,7 +56,7 @@ SUCH DAMAGE. #define ACCESS_PLAYER Player*p=game->GetPlayer(); #define VARIANTS float,int,std::string,bool,vf2d - +#undef INFINITE #define INFINITE 999999 #define SETUP_CLASS(class) \ diff --git a/Crawler/InventoryConsumableWindow.cpp b/Crawler/InventoryConsumableWindow.cpp index db2416e6..1cf56d9c 100644 --- a/Crawler/InventoryConsumableWindow.cpp +++ b/Crawler/InventoryConsumableWindow.cpp @@ -56,7 +56,7 @@ void Menu::InitializeConsumableInventoryWindow(){ inventoryWindow->I(A::LOADOUT_SLOT)=0; - InventoryScrollableWindowComponent*inventory=NEW InventoryScrollableWindowComponent(INVENTORY,{{1,20},{windowSize.x,float(totalSpacing*3-itemSpacing)}},"Consumables"); + InventoryScrollableWindowComponent*inventory=NEW InventoryScrollableWindowComponent(INVENTORY,{{1,20},{windowSize.x,float(totalSpacing*3-itemSpacing)}},"Consumables","itemName","itemDescription"); inventoryWindow->AddComponent("inventory",inventory); //We don't have to actually populate the inventory list because now when an item gets added, it will automatically add the correct component in for us. diff --git a/Crawler/InventoryScrollableWindowComponent.h b/Crawler/InventoryScrollableWindowComponent.h index f0663d4b..2232e03a 100644 --- a/Crawler/InventoryScrollableWindowComponent.h +++ b/Crawler/InventoryScrollableWindowComponent.h @@ -51,6 +51,20 @@ public: :ScrollableWindowComponent(parent,rect,attributes),inventoryType(invType),itemNameLabelName(itemNameLabelName),itemDescriptionLabelName(itemDescriptionLabelName){ Menu::AddInventoryListener(this,invType); } + virtual inline void Update(Crawler*game)override{ + ScrollableWindowComponent::Update(game); + bool noneHovered=true; + for(MenuComponent*component:components){ + if(component->hovered){ + noneHovered=false; + break; + } + } + if(noneHovered){ + Component(parentMenu,itemNameLabelName)->SetLabel(""); + Component(parentMenu,itemDescriptionLabelName)->SetLabel(""); + } + } protected: virtual inline void RemoveButton(MenuComponent*button){ std::vector&buttonList=Menu::menus[button->parentMenu]->buttons.at(button->GetPos().y); @@ -97,12 +111,12 @@ protected: bounds=CalculateBounds(); //Recalculate the bounds as it's possible the width/height of the component has changed. } virtual inline void OnInventorySlotsUpdate(ITCategory cat)override{ - std::vector&inv=Inventory::get(cat); + size_t invSize=Inventory::get(cat).size(); //We only want to refresh the inventory slots if the component count no longer matches what's actually in our inventory. - if(components.size()inv.size()){ //There are empty spots, so let's clean up. + if(components.size()>invSize){ //There are empty spots, so let's clean up. RemoveEmptySlots(); } } diff --git a/Crawler/Item.cpp b/Crawler/Item.cpp index b033d453..0e553f61 100644 --- a/Crawler/Item.cpp +++ b/Crawler/Item.cpp @@ -46,7 +46,7 @@ safemapITEM_SCRIPTS; safemap>ITEM_CATEGORIES; Item Item::BLANK; std::mapInventory::_inventory; -std::map>Inventory::sortedInv; +std::map>Inventory::sortedInv; ItemInfo::ItemInfo() :customProps({nullptr,nullptr}),img(nullptr){} @@ -151,10 +151,11 @@ void Inventory::AddItem(IT it,uint32_t amt,bool monsterDrop){ //There are two places to manipulate items in (Both the sorted inventory and the actual inventory) if(!_inventory.count(it)){ _inventory[it]=Item{amt,it}; - InsertIntoSortedInv(it,monsterDrop); + InsertIntoSortedInv(it); }else{ _inventory.at(it).amt+=amt; } + InsertIntoStageInventoryCategory(it,amt,monsterDrop); } Item Inventory::GetItem(IT it){ @@ -174,7 +175,7 @@ uint32_t Inventory::GetItemCount(IT it){ bool Inventory::UseItem(IT it,uint32_t amt){ if(!_inventory.count(it))return false; //There are two places to manipulate items in (Both the sorted inventory and the actual inventory) - for(int i=0;i=_inventory.at(it).Amt()){ int count=0; - std::vector&sortedList=sortedInv.at(_inventory.at(it).Category()); - for(std::string&itemName:sortedList){ - if(itemName==it)break; + std::vector&sortedList=sortedInv.at(_inventory.at(it).Category()); + for(Item&item:sortedList){ + if(item.Name()==it)break; count++; } sortedList.erase(sortedList.begin()+count); @@ -205,19 +206,28 @@ bool Inventory::RemoveItem(IT it,uint32_t amt){ } } -std::vector&Inventory::get(ITCategory itemCategory){ +std::vector&Inventory::get(ITCategory itemCategory){ return sortedInv.at(itemCategory); } -void Inventory::InsertIntoSortedInv(IT item,bool monsterDrop){ - sortedInv.at(ITEM_DATA[item].category).push_back(item); +void Inventory::InsertIntoSortedInv(IT item){ + sortedInv.at(ITEM_DATA[item].category).push_back(Item{1,item}); + //This should be a callback to menus that we need to update the interface with another item slot since a new one has appeared. + Menu::InventorySlotsUpdated(ITEM_DATA[item].category); +} + +void Inventory::InsertIntoStageInventoryCategory(IT item,uint32_t amt,bool monsterDrop){ std::string stageInventoryCategory="Stage Loot"; if(monsterDrop){ stageInventoryCategory="Monster Loot"; } - sortedInv.at(stageInventoryCategory).push_back(item); - //This should be a callback to menus that we need to update the interface with another item slot since a new one has appeared. - Menu::InventorySlotsUpdated(ITEM_DATA[item].category); + std::vector&inv=sortedInv.at(stageInventoryCategory); + std::vector::iterator it=std::find(inv.begin(),inv.end(),Item{amt,item}); + if(it!=inv.end()){ + (*it).amt+=amt; + }else{ + inv.push_back(Item{amt,item}); + } Menu::InventorySlotsUpdated(stageInventoryCategory); } @@ -230,14 +240,14 @@ bool Inventory::ExecuteAction(IT item){ } bool Inventory::SwapItems(ITCategory itemCategory,uint32_t slot1,uint32_t slot2){ - std::vector&inv=sortedInv.at(itemCategory); + std::vector&inv=sortedInv.at(itemCategory); int largestSlot=std::max(slot1,slot2); if(inv.size()<=largestSlot){ //The inventory is too small, so expand out blank slots to accomodate. inv.resize(largestSlot+size_t(1)); } - IT&item1=inv.at(slot1); - IT&item2=inv.at(slot2); + Item&item1=inv.at(slot1); + Item&item2=inv.at(slot2); std::swap(item1,item2); return true; } @@ -282,8 +292,16 @@ bool Item::IsBlank(){ } void Inventory::Clear(ITCategory itemCategory){ - std::vectoritemList=get(itemCategory); //We have to make a copy here because RemoveItem() will modify the list provided by get() inline. - for(IT&item:itemList){ - RemoveItem(item,GetItemCount(item)); + std::vectoritemList=get(itemCategory); //We have to make a copy here because RemoveItem() will modify the list provided by get() inline. + for(Item&item:itemList){ + size_t itemQuantity=GetItemCount(item.Name());//Normally we want to clear all the items that are actually in our inventory...But... + if(itemCategory=="Monster Loot"||itemCategory=="Stage Loot"){//These do not affect the actual inventory, we just clear the lists. + itemQuantity=item.Amt(); + } + RemoveItem(item.Name(),itemQuantity); } +} + +bool Item::operator==(const Item&rhs)const{ + return it==rhs.it; } \ No newline at end of file diff --git a/Crawler/Item.h b/Crawler/Item.h index 563cd8f2..65514cf3 100644 --- a/Crawler/Item.h +++ b/Crawler/Item.h @@ -64,6 +64,7 @@ public: ItemScript&OnUseAction(); bool IsBlank(); static Item BLANK; + bool operator==(const Item&rhs)const; }; class Inventory{ @@ -75,7 +76,7 @@ public: //Auto-executes its use function and removes the amt specified from the inventory. Multiple amounts will cause the item to execute its useFunc multiple times. static bool UseItem(IT it,uint32_t amt=1); static bool RemoveItem(IT it,uint32_t amt=1); - static std::vector&get(ITCategory itemCategory); + static std::vector&get(ITCategory itemCategory); static void Clear(ITCategory itemCategory); static bool SwapItems(ITCategory itemCategory,uint32_t slot1,uint32_t slot2); @@ -85,10 +86,11 @@ public: return true; } private: - static void InsertIntoSortedInv(IT item,bool monsterDrop=false); + static void InsertIntoSortedInv(IT item); + static void InsertIntoStageInventoryCategory(IT item,uint32_t amt,bool monsterDrop); static bool ExecuteAction(IT item); static std::map_inventory; - static std::map>sortedInv; + static std::map>sortedInv; }; class ItemProps{ diff --git a/Crawler/LevelCompleteWindow.cpp b/Crawler/LevelCompleteWindow.cpp index 6487e617..c8f061f8 100644 --- a/Crawler/LevelCompleteWindow.cpp +++ b/Crawler/LevelCompleteWindow.cpp @@ -36,6 +36,7 @@ SUCH DAMAGE. #include "MenuLabel.h" #include "MenuComponent.h" #include "InventoryScrollableWindowComponent.h" +#include "PopupMenuLabel.h" INCLUDE_game @@ -50,7 +51,7 @@ void Menu::InitializeLevelCompleteWindow(){ MenuComponent*monsterLootOutline=NEW MenuComponent(LEVEL_COMPLETE,{{0,32},{windowSize.size.x-80.f,72}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE); MenuLabel*monsterLootLabel=NEW MenuLabel(LEVEL_COMPLETE,{{0,32},{windowSize.size.x-80.f,12}},"Monster Loot",1,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE); - InventoryScrollableWindowComponent*monsterLootWindow=NEW InventoryScrollableWindowComponent(LEVEL_COMPLETE,{{0,44},{windowSize.size.x-80.f,60}},"Monster Loot"); + InventoryScrollableWindowComponent*monsterLootWindow=NEW InventoryScrollableWindowComponent(LEVEL_COMPLETE,{{0,44},{windowSize.size.x-80.f,60}},"Monster Loot","Monster Loot Popup Item Name","Monster Loot Popup Item Description"); levelCompleteWindow->AddComponent("Monster Loot Outline",monsterLootOutline); levelCompleteWindow->AddComponent("Monster Loot Label",monsterLootLabel); @@ -58,7 +59,7 @@ void Menu::InitializeLevelCompleteWindow(){ MenuComponent*stageLootOutline=NEW MenuComponent(LEVEL_COMPLETE,{{0,108},{windowSize.size.x-80.f,72}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE); MenuLabel*stageLootLabel=NEW MenuLabel(LEVEL_COMPLETE,{{0,108},{windowSize.size.x-80.f,12}},"Stage Loot",1,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE); - InventoryScrollableWindowComponent*stageLootWindow=NEW InventoryScrollableWindowComponent(LEVEL_COMPLETE,{{0,120},{windowSize.size.x-80.f,60}},"Stage Loot"); + InventoryScrollableWindowComponent*stageLootWindow=NEW InventoryScrollableWindowComponent(LEVEL_COMPLETE,{{0,120},{windowSize.size.x-80.f,60}},"Stage Loot","Stage Loot Popup Item Name","Stage Loot Popup Item Description"); levelCompleteWindow->AddComponent("Stage Loot Outline",stageLootOutline); levelCompleteWindow->AddComponent("Stage Loot Label",stageLootLabel); @@ -71,4 +72,16 @@ void Menu::InitializeLevelCompleteWindow(){ levelCompleteWindow->AddComponent("Level Details Outline",detailsOutline); levelCompleteWindow->AddComponent("Level EXP Gain Outline",detailsExpGain); levelCompleteWindow->AddComponent("Next Button",nextButton); + + PopupMenuLabel*monsterLootPopupItemName=NEW PopupMenuLabel(LEVEL_COMPLETE,{{0,108},{windowSize.size.x-80.f,12}},"",1.0f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND); + PopupMenuLabel*monsterLootPopupItemDescription=NEW PopupMenuLabel(LEVEL_COMPLETE,{{0,120},{windowSize.size.x-80.f,60}},"",1.0f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::BACKGROUND); + + levelCompleteWindow->AddComponent("Monster Loot Popup Item Name",monsterLootPopupItemName); + levelCompleteWindow->AddComponent("Monster Loot Popup Item Description",monsterLootPopupItemDescription); + + PopupMenuLabel*stageLootPopupItemName=NEW PopupMenuLabel(LEVEL_COMPLETE,{{0,32},{windowSize.size.x-80.f,12}},"",1.0f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND); + PopupMenuLabel*stageLootPopupItemDescription=NEW PopupMenuLabel(LEVEL_COMPLETE,{{0,44},{windowSize.size.x-80.f,72}},"",1.0f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::BACKGROUND); + + levelCompleteWindow->AddComponent("Stage Loot Popup Item Name",stageLootPopupItemName); + levelCompleteWindow->AddComponent("Stage Loot Popup Item Description",stageLootPopupItemDescription); } \ No newline at end of file diff --git a/Crawler/Menu.cpp b/Crawler/Menu.cpp index 49eff436..ae5254cc 100644 --- a/Crawler/Menu.cpp +++ b/Crawler/Menu.cpp @@ -641,7 +641,6 @@ void Menu::SetMouseNavigation(bool mouseNavigation){ void Menu::InventorySlotsUpdated(ITCategory cat){ //Update the inventory with a new inventory slot, since there's one additional item to interact with now. - std::vector&inv=Inventory::get(cat); for(MenuComponent*component:inventoryListeners.at(cat)){ component->OnInventorySlotsUpdate(cat); } diff --git a/Crawler/MenuItemButton.h b/Crawler/MenuItemButton.h index b8834692..c8a99bf7 100644 --- a/Crawler/MenuItemButton.h +++ b/Crawler/MenuItemButton.h @@ -47,35 +47,35 @@ INCLUDE_ITEM_DATA class MenuItemButton:public MenuIconButton{ private: - std::vector&invRef; + std::vector&invRef; int inventoryIndex=0; MenuType itemDescriptionMenu; std::string itemNameLabelName; std::string itemDescriptionLabelName; public: int selected=-1; //0-2 representing which loadout slot this item consumes. -1 means not selected. - inline MenuItemButton(MenuType parent,geom2d::rectrect,std::vector&invRef,int invIndex,MenuFunc onClick,MenuType itemDescriptionMenu,std::string itemNameLabelName,std::string itemDescriptionLabelName) - :MenuIconButton(parent,rect,invRef.size()>invIndex?ITEM_DATA.at(invRef[invIndex]).Decal():nullptr,onClick),invRef(invRef),inventoryIndex(invIndex),itemDescriptionMenu(itemDescriptionMenu),itemNameLabelName(itemNameLabelName),itemDescriptionLabelName(itemDescriptionLabelName){ + inline MenuItemButton(MenuType parent,geom2d::rectrect,std::vector&invRef,int invIndex,MenuFunc onClick,MenuType itemDescriptionMenu,std::string itemNameLabelName,std::string itemDescriptionLabelName) + :MenuIconButton(parent,rect,invRef.size()>invIndex?invRef[invIndex].Decal():nullptr,onClick),invRef(invRef),inventoryIndex(invIndex),itemDescriptionMenu(itemDescriptionMenu),itemNameLabelName(itemNameLabelName),itemDescriptionLabelName(itemDescriptionLabelName){ draggable=false; valid=invRef.size()>invIndex; } inline Item GetItem(){ - return Inventory::GetItem(invRef.at(inventoryIndex)); + return Inventory::GetItem(invRef.at(inventoryIndex).Name()); } //Returns true if the item has been consumed completely and there are 0 remaining of that type in our inventory. inline bool UseItem(uint32_t amt=1){ if(invRef.size()<=inventoryIndex)return false; - return Inventory::UseItem(invRef.at(inventoryIndex),amt); + return Inventory::UseItem(invRef.at(inventoryIndex).Name(),amt); } protected: virtual inline void Update(Crawler*game)override{ MenuIconButton::Update(game); - valid=invRef.size()>inventoryIndex&&ITEM_DATA.count(invRef[inventoryIndex]); + valid=invRef.size()>inventoryIndex&&ITEM_DATA.count(invRef[inventoryIndex].Name()); if(valid){ - icon=ITEM_DATA.at(invRef[inventoryIndex]).Decal(); + icon=invRef[inventoryIndex].Decal(); if(hovered){ - Component(itemDescriptionMenu,itemNameLabelName)->label=ITEM_DATA.at(invRef[inventoryIndex]).Name(); - Component(itemDescriptionMenu,itemDescriptionLabelName)->label=ITEM_DATA.at(invRef[inventoryIndex]).Description(); + Component(itemDescriptionMenu,itemNameLabelName)->label=invRef[inventoryIndex].Name(); + Component(itemDescriptionMenu,itemDescriptionLabelName)->label=invRef[inventoryIndex].Description(); } }else{ icon=nullptr; @@ -94,7 +94,11 @@ protected: virtual inline void DrawDecal(Crawler*game,vf2d parentPos,bool focused)override{ MenuIconButton::DrawDecal(game,parentPos,focused); if(valid){ - std::string quantityText="x"+std::to_string(Inventory::GetItemCount(invRef.at(inventoryIndex))); + int itemQuantity=Inventory::GetItemCount(invRef.at(inventoryIndex).Name()); //Normally we'd retrieve how many of this item we have from our inventory...However Monster Loot and Stage Loot inventories are special and hold their own inventory counts... + if(&invRef==&Inventory::get("Monster Loot")||&invRef==&Inventory::get("Stage Loot")){ + itemQuantity=invRef.at(inventoryIndex).Amt(); //So the item quantity comes from the stack itself and not our main inventory. + } + std::string quantityText="x"+std::to_string(itemQuantity); vf2d textSize=vf2d(game->GetTextSizeProp(quantityText))*0.5; vf2d drawPos=parentPos+rect.pos+rect.size-textSize; if(PointWithinParent(this,drawPos)){ @@ -115,7 +119,7 @@ protected: inline bool DropDraggableItem(MenuComponent*draggable)override final{ //HACK Warning! We're making a bold assumption that every component that is draggable is of the same type! This may change in the future.... MenuItemButton*draggedItem=(MenuItemButton*)draggable; - ITCategory cat=ITEM_DATA.at(draggedItem->invRef.at(draggedItem->inventoryIndex)).Category(); + ITCategory cat=draggedItem->invRef.at(draggedItem->inventoryIndex).Category(); return Inventory::SwapItems(cat,draggedItem->inventoryIndex,inventoryIndex); } }; diff --git a/Crawler/Player.cpp b/Crawler/Player.cpp index 5a3a1e12..e80c1e6c 100644 --- a/Crawler/Player.cpp +++ b/Crawler/Player.cpp @@ -278,7 +278,7 @@ void Player::Update(float fElapsedTime){ spin_angle-=spin_spd*fElapsedTime; } if(spin_attack_timer>0){ - z=float("Warrior.Ability 2.SpinMaxHeight"_I)*sin(3.3*(GROUND_SLAM_SPIN_TIME-spin_attack_timer)/GROUND_SLAM_SPIN_TIME); + z=float("Warrior.Ability 2.SpinMaxHeight"_I)*sin(3.3f*(GROUND_SLAM_SPIN_TIME-spin_attack_timer)/GROUND_SLAM_SPIN_TIME); spin_attack_timer=std::max(0.f,spin_attack_timer-fElapsedTime); } else { SetState(State::NORMAL); @@ -771,7 +771,11 @@ float Player::GetEndZoneStandTime(){ } void Player::CheckEndZoneCollision(){ - if(IsOutOfCombat()){ + auto HasZoneData=[&](){ + return game->MAP_DATA[game->GetCurrentLevel()].ZoneData.count("EndZone"); + }; + + if(IsOutOfCombat()&&HasZoneData()){ for(ZoneData&zone:game->MAP_DATA[game->GetCurrentLevel()].ZoneData.at("EndZone")){ if(zone.isUpper==upperLevel&&geom2d::overlaps(GetPos(),zone.zone)){ endZoneStandTime+=game->GetElapsedTime(); diff --git a/Crawler/Theme.h b/Crawler/Theme.h index 124a6cc7..ad098bc5 100644 --- a/Crawler/Theme.h +++ b/Crawler/Theme.h @@ -41,7 +41,7 @@ class Theme{ bool tiled=true; Pixel buttonCol,highlightCol; - Decal*background; + Decal*background=nullptr; public: inline Theme(){} inline Theme(std::string displayName,std::string imgPath,bool tiled,Pixel buttonCol,Pixel highlightCol,Decal*background=nullptr) diff --git a/Crawler/Version.h b/Crawler/Version.h index 92329897..39ac9a36 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -35,7 +35,7 @@ SUCH DAMAGE. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 2962 +#define VERSION_BUILD 2975 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Crawler/cpp.hint b/Crawler/cpp.hint index 964b58aa..ee9cc413 100644 --- a/Crawler/cpp.hint +++ b/Crawler/cpp.hint @@ -7,3 +7,11 @@ #define INCLUDE_game #define INCLUDE_MONSTER_LIST #define INCLUDE_MONSTER_DATA +#define INCLUDE_EMITTER_LIST +#define SETUP_CLASS(class) class::class() :Player::Player(){} class::class(Player*player) :Player::Player(player){} Class class::GetClass(){return cl;} std::string class::GetClassName(){return name;} Ability&class::GetRightClickAbility(){return rightClickAbility;}; Ability&class::GetAbility1(){return ability1;}; Ability&class::GetAbility2(){return ability2;}; Ability&class::GetAbility3(){return ability3;}; Ability&class::GetAbility4(){return ability4;}; std::string&class::GetWalkNAnimation(){return walk_n;}; std::string&class::GetWalkEAnimation(){return walk_e;}; std::string&class::GetWalkSAnimation(){return walk_s;}; std::string&class::GetWalkWAnimation(){return walk_w;}; std::string&class::GetIdleNAnimation(){return idle_n;}; std::string&class::GetIdleEAnimation(){return idle_e;}; std::string&class::GetIdleSAnimation(){return idle_s;}; std::string&class::GetIdleWAnimation(){return idle_w;}; std::string class::name=""; Class class::cl=ANY; Ability class::rightClickAbility=Ability(); Ability class::ability1=Ability(); Ability class::ability2=Ability(); Ability class::ability3=Ability(); Ability class::ability4=Ability(); std::string class::idle_n="WARRIOR_IDLE_N"; std::string class::idle_e="WARRIOR_IDLE_E"; std::string class::idle_s="WARRIOR_IDLE_S"; std::string class::idle_w="WARRIOR_IDLE_W"; std::string class::walk_n="WARRIOR_WALK_N"; std::string class::walk_e="WARRIOR_WALK_E"; std::string class::walk_s="WARRIOR_WALK_S"; std::string class::walk_w="WARRIOR_WALK_W"; +#define INCLUDE_BULLET_LIST +#define INCLUDE_DATA +#define INCLUDE_MONSTER_NAME_DATA +#define INCLUDE_ITEM_DATA +#define INCLUDE_LEVEL_NAMES +#define INCLUDE_GFX diff --git a/Crawler/olcPixelGameEngine.h b/Crawler/olcPixelGameEngine.h index ed133eab..a94337a7 100644 --- a/Crawler/olcPixelGameEngine.h +++ b/Crawler/olcPixelGameEngine.h @@ -869,7 +869,7 @@ namespace olc { public: Renderable() = default; - Renderable(Renderable&& r) : pSprite(std::move(r.pSprite)), pDecal(std::move(r.pDecal)) {} + Renderable(Renderable&& r)noexcept : pSprite(std::move(r.pSprite)), pDecal(std::move(r.pDecal)){} Renderable(const Renderable&) = delete; olc::rcode Load(const std::string& sFile, ResourcePack* pack = nullptr, bool filter = false, bool clamp = true); void Create(uint32_t width, uint32_t height, bool filter = false, bool clamp = true);