Converted a couple more things to shared pointers.
This commit is contained in:
@ -7,9 +7,9 @@
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
DawnGame::DawnGame(DawnHost *host) :
|
||||
DawnGame::DawnGame(const std::weak_ptr<DawnHost> host) :
|
||||
host(host),
|
||||
renderManager(this),
|
||||
renderManager(),
|
||||
inputManager(this),
|
||||
saveManager(this)
|
||||
{
|
||||
@ -17,7 +17,7 @@ DawnGame::DawnGame(DawnHost *host) :
|
||||
|
||||
int32_t DawnGame::init() {
|
||||
this->assetManager.init();
|
||||
this->renderManager.init();
|
||||
this->renderManager.init(weak_from_this());
|
||||
|
||||
this->scene = dawnGameGetInitialScene(this);
|
||||
|
||||
|
@ -22,13 +22,13 @@
|
||||
namespace Dawn {
|
||||
class DawnHost;
|
||||
|
||||
class DawnGame {
|
||||
class DawnGame : public std::enable_shared_from_this<DawnGame> {
|
||||
private:
|
||||
Scene *sceneToCutTo = nullptr;
|
||||
bool_t closeRequested = false;
|
||||
|
||||
public:
|
||||
DawnHost *host;
|
||||
const std::weak_ptr<DawnHost> host;
|
||||
Scene *scene = nullptr;
|
||||
AssetManager assetManager;
|
||||
TimeManager timeManager;
|
||||
@ -41,7 +41,7 @@ namespace Dawn {
|
||||
*
|
||||
* @param host Host that executed this game instantiation.
|
||||
*/
|
||||
DawnGame(DawnHost *host);
|
||||
DawnGame(const std::weak_ptr<DawnHost> host);
|
||||
|
||||
/**
|
||||
* Initialize the game. This is performed by the host at a time that is
|
||||
|
Reference in New Issue
Block a user