Inventory refactor completed. Individual monster loot and stage loot inventories now compatible.

pull/28/head
sigonasr2 1 year ago
parent 8af7afadae
commit 7cd54e5f80
  1. 2
      Crawler/DEFINES.h
  2. 2
      Crawler/InventoryConsumableWindow.cpp
  3. 26
      Crawler/InventoryScrollableWindowComponent.h
  4. 54
      Crawler/Item.cpp
  5. 8
      Crawler/Item.h
  6. 17
      Crawler/LevelCompleteWindow.cpp
  7. 1
      Crawler/Menu.cpp
  8. 26
      Crawler/MenuItemButton.h
  9. 8
      Crawler/Player.cpp
  10. 2
      Crawler/Theme.h
  11. 2
      Crawler/Version.h
  12. 8
      Crawler/cpp.hint
  13. 2
      Crawler/olcPixelGameEngine.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) \

@ -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.

@ -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<MenuLabel>(parentMenu,itemNameLabelName)->SetLabel("");
Component<MenuLabel>(parentMenu,itemDescriptionLabelName)->SetLabel("");
}
}
protected:
virtual inline void RemoveButton(MenuComponent*button){
std::vector<MenuComponent*>&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<std::string>&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()){//We need more space to display our items.
if(components.size()<invSize){//We need more space to display our items.
int invWidth="ThemeGlobal.InventoryWidth"_I;
int x=(inv.size()-1)%invWidth;
int y=(inv.size()-1)/invWidth;
int x=(invSize-1)%invWidth;
int y=(invSize-1)/invWidth;
int itemIndex=y*invWidth+x;
int buttonSize="ThemeGlobal.InventoryButtonSize"_I;
@ -130,10 +144,10 @@ protected:
return true;
};
MenuItemButton*button=NEW MenuItemButton{parentMenu,{{float(totalSpacing*x),float(totalSpacing*y)},{float(buttonSize),float(buttonSize)}},Inventory::get("Consumables"),itemIndex,useItemFunc,parentMenu,"itemName","itemDescription"};
MenuItemButton*button=NEW MenuItemButton{parentMenu,{{float(totalSpacing*x),float(totalSpacing*y)},{float(buttonSize),float(buttonSize)}},Inventory::get(cat),itemIndex,useItemFunc,parentMenu,itemNameLabelName,itemDescriptionLabelName};
AddComponent(Menu::menus[parentMenu],"item_"+cat+"_"+std::to_string(itemIndex),button);
}else
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();
}
}

@ -46,7 +46,7 @@ safemap<std::string,ItemScript>ITEM_SCRIPTS;
safemap<std::string,std::set<std::string>>ITEM_CATEGORIES;
Item Item::BLANK;
std::map<IT,Item>Inventory::_inventory;
std::map<ITCategory,std::vector<IT>>Inventory::sortedInv;
std::map<ITCategory,std::vector<Item>>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<amt;i++){
for(uint32_t i=0;i<amt;i++){
if(ExecuteAction(it)){
return RemoveItem(it);
}
@ -188,9 +189,9 @@ bool Inventory::RemoveItem(IT it,uint32_t amt){
if(!_inventory.count(it))return false;
if(amt>=_inventory.at(it).Amt()){
int count=0;
std::vector<IT>&sortedList=sortedInv.at(_inventory.at(it).Category());
for(std::string&itemName:sortedList){
if(itemName==it)break;
std::vector<Item>&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<IT>&Inventory::get(ITCategory itemCategory){
std::vector<Item>&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<Item>&inv=sortedInv.at(stageInventoryCategory);
std::vector<Item>::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<IT>&inv=sortedInv.at(itemCategory);
std::vector<Item>&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::vector<IT>itemList=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::vector<Item>itemList=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;
}

@ -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<IT>&get(ITCategory itemCategory);
static std::vector<Item>&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<IT,Item>_inventory;
static std::map<ITCategory,std::vector<IT>>sortedInv;
static std::map<ITCategory,std::vector<Item>>sortedInv;
};
class ItemProps{

@ -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);
}

@ -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<std::string>&inv=Inventory::get(cat);
for(MenuComponent*component:inventoryListeners.at(cat)){
component->OnInventorySlotsUpdate(cat);
}

@ -47,35 +47,35 @@ INCLUDE_ITEM_DATA
class MenuItemButton:public MenuIconButton{
private:
std::vector<IT>&invRef;
std::vector<Item>&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::rect<float>rect,std::vector<IT>&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::rect<float>rect,std::vector<Item>&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<MenuLabel>(itemDescriptionMenu,itemNameLabelName)->label=ITEM_DATA.at(invRef[inventoryIndex]).Name();
Component<MenuLabel>(itemDescriptionMenu,itemDescriptionLabelName)->label=ITEM_DATA.at(invRef[inventoryIndex]).Description();
Component<MenuLabel>(itemDescriptionMenu,itemNameLabelName)->label=invRef[inventoryIndex].Name();
Component<MenuLabel>(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);
}
};

@ -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();

@ -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)

@ -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

@ -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

@ -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);

Loading…
Cancel
Save