From 54435247e39c01a8b6eeab522ca4e7e61a3bf284 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sat, 2 Sep 2023 20:59:22 -0500 Subject: [PATCH] struct Unit change. make_shared fix. --- olcCodeJam2023Entry/CollectionPoint.h | 2 +- olcCodeJam2023Entry/VirusAttack.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/olcCodeJam2023Entry/CollectionPoint.h b/olcCodeJam2023Entry/CollectionPoint.h index 7340236..bdb9b23 100644 --- a/olcCodeJam2023Entry/CollectionPoint.h +++ b/olcCodeJam2023Entry/CollectionPoint.h @@ -2,7 +2,7 @@ #include "olcPixelGameEngine.h" #include "MemoryType.h" -class Unit; +struct Unit; class CollectionPoint{ public: diff --git a/olcCodeJam2023Entry/VirusAttack.cpp b/olcCodeJam2023Entry/VirusAttack.cpp index 2e4c66f..e02833d 100644 --- a/olcCodeJam2023Entry/VirusAttack.cpp +++ b/olcCodeJam2023Entry/VirusAttack.cpp @@ -5,7 +5,7 @@ #define AUDIO_SOURCE_IMPLEMENTATION #define OLC_PGEX_QUICKGUI -//#define SPLASH_ENABLED +#define SPLASH_ENABLED #ifdef SPLASH_ENABLED #define OLC_PGEX_SPLASHSCREEN #endif @@ -196,7 +196,7 @@ void VirusAttack::LoadLevel(LevelName level){ for(auto&u:selectedLevel.unitPlacement){ #define TranslateUnit(type) \ case UnitType::type:{ \ - units.push_back(std::make_unique(this,u.pos,IMAGES,u.friendly)); \ + units.push_back(std::make_shared(this,u.pos,IMAGES,u.friendly)); \ }break; switch(u.type){ @@ -218,7 +218,7 @@ void VirusAttack::LoadLevel(LevelName level){ } } for(auto&cp:selectedLevel.cpPlacement){ - collectionPoints.push_back(std::make_unique(this,cp.pos,cp.rot,*IMAGES[MEMORY_COLLECTION_POINT],cp.type)); + collectionPoints.push_back(std::make_shared(this,cp.pos,cp.rot,*IMAGES[MEMORY_COLLECTION_POINT],cp.type)); } randomBackgroundOffset={util::random(128),util::random(128)};