Commit cef4f3e3 authored by Gerhard Stein's avatar Gerhard Stein

Now all new Pointer are implemented.

parent 538178f9
......@@ -67,7 +67,7 @@ void CBaseMenu::process()
{
if( g_pInput->getPressedCommand(cmd) )
{
SmartPointer<CEvent> command(new CommandEvent( static_cast<InputCommands>(cmd) ));
std::shared_ptr<CEvent> command(new CommandEvent( static_cast<InputCommands>(cmd) ));
sendEvent(command);
break;
}
......
......@@ -41,7 +41,7 @@ public:
// Processes the stuff that the menus have in common
virtual void process();
virtual void sendEvent(SmartPointer<CEvent> &command)
virtual void sendEvent(std::shared_ptr<CEvent> &command)
{
mpMenuDialog->sendEvent(command);
}
......
......@@ -36,7 +36,7 @@ m_overwrite(false)
setMenuLabel("SAVEMENULABEL");
}
void CSaveMenu::sendEvent(SmartPointer<CEvent> command)
void CSaveMenu::sendEvent(std::shared_ptr<CEvent> command)
{
// Before all events are sent to the dialog which handles selection catch some specific events
// required for the saving process.
......
......@@ -15,7 +15,7 @@ class CSaveMenu : public CBaseMenu
public:
CSaveMenu();
void processSpecific(){};
void sendEvent(SmartPointer<CEvent> command);
void sendEvent(std::shared_ptr<CEvent> command);
private:
CConfirmMenu *mp_OverwriteMenu;
......
......@@ -16,7 +16,6 @@
#include <string>
#include <list>
#include "common/direction.h"
#include "SmartPointer.h"
#include "CVec.h"
#include "graphics/CBitmap.h"
#include <vector>
......@@ -110,10 +109,10 @@ struct EventSendBitmapDialogMsg : EventSendDialog
struct EventSendBitmapDialogMessages : CEvent
{
EventSendBitmapDialogMessages( std::vector< SmartPointer<EventSendBitmapDialogMsg> > lMsgs ) :
EventSendBitmapDialogMessages( std::vector< std::shared_ptr<EventSendBitmapDialogMsg> > lMsgs ) :
msgs(lMsgs) {}
std::vector< SmartPointer<EventSendBitmapDialogMsg> > msgs;
std::vector< std::shared_ptr<EventSendBitmapDialogMsg> > msgs;
};
......@@ -126,7 +125,7 @@ struct EventSendBitmapDialogMessages : CEvent
struct TextEventMatchOption
{
std::string text;
SmartPointer<CEvent> event;
std::shared_ptr<CEvent> event;
};
/**
......@@ -148,7 +147,7 @@ struct EventSendSelectionDialogMsg : CEvent {
{
TextEventMatchOption NewOption;
NewOption.text = ltext;
NewOption.event = levent;
NewOption.event.reset( levent );
Options.push_back(NewOption);
}
};
......
......@@ -238,7 +238,7 @@ void CPlayGameGalaxy::process()
if( EventSendBitmapDialogMsg *ev = eventContainer.occurredEvent<EventSendBitmapDialogMsg>() )
{
CMessageBoxBitmapGalaxy *pMsgBox = new CMessageBoxBitmapGalaxy( ev->Msg, ev->BitmapRef, ev->Direction );
std::unique_ptr<CMessageBoxBitmapGalaxy> pMsgBox( new CMessageBoxBitmapGalaxy( ev->Msg, ev->BitmapRef, ev->Direction ) );
pMsgBox->init();
// Create the special merge effect (Fadeout) if requested
......@@ -255,27 +255,26 @@ void CPlayGameGalaxy::process()
}
}
mMessageBoxes.push_back( pMsgBox );
mMessageBoxes.push_back( move(pMsgBox) );
eventContainer.pop_Event();
}
else if( EventSendBitmapDialogMessages *ev = eventContainer.occurredEvent<EventSendBitmapDialogMessages>() )
{
for( auto &it : ev->msgs )
{
CMessageBoxBitmapGalaxy *pMsgBox =
new CMessageBoxBitmapGalaxy( it->Msg, it->BitmapRef, it->Direction );
std::unique_ptr<CMessageBoxBitmapGalaxy> pMsgBox( new CMessageBoxBitmapGalaxy( it->Msg, it->BitmapRef, it->Direction ) );
pMsgBox->init();
mMessageBoxes.push_back( pMsgBox );
mMessageBoxes.push_back( move(pMsgBox) );
}
eventContainer.pop_Event();
}
else if( EventSendDialog *ev = eventContainer.occurredEvent<EventSendDialog>() )
{
CMessageBoxGalaxy *pMsgBox = new CMessageBoxGalaxy( ev->Msg );
std::unique_ptr<CMessageBoxGalaxy> pMsgBox( new CMessageBoxGalaxy( ev->Msg ) );
pMsgBox->init();
mMessageBoxes.push_back( pMsgBox );
mMessageBoxes.push_back( move(pMsgBox) );
eventContainer.pop_Event();
}
/*else if( EventSendSelectionDialogMsg* ev = EventContainer.occurredEvent<EventSendSelectionDialogMsg>() )
......
......@@ -14,7 +14,7 @@
#include "common/CMap.h"
#include "CWorldMap.h"
#include "CLevelPlay.h"
#include "SmartPointer.h"
#include <memory>
#include <vector>
#include <list>
#include <string>
......@@ -49,7 +49,7 @@ private:
CLevelPlay m_LevelPlay;
CSaveGameController &m_SavedGame;
CBitmap m_BackgroundBitmap;
std::list< SmartPointer<CMessageBoxGalaxy> > mMessageBoxes;
std::list< std::shared_ptr<CMessageBoxGalaxy> > mMessageBoxes;
stCheat m_Cheatmode;
};
......
......@@ -115,12 +115,17 @@ void CCouncilMember::performJanitorMode()
elder_text[2] = g_pBehaviorEngine->getString("JANITOR_TEXT3");
elder_text[3] = g_pBehaviorEngine->getString("JANITOR_TEXT4");
std::vector< SmartPointer<EventSendBitmapDialogMsg> > msgs;
std::vector< std::shared_ptr<EventSendBitmapDialogMsg> > msgs;
msgs.push_back( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(104), elder_text[0], LEFT) );
msgs.push_back( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(104), elder_text[1], LEFT) );
msgs.push_back( new EventSendBitmapDialogMsg(*g_pGfxEngine->getBitmap("KEENTALKING"), elder_text[2], RIGHT) );
msgs.push_back( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(104), elder_text[3], LEFT) );
std::unique_ptr<EventSendBitmapDialogMsg> msg1( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(104), elder_text[0], LEFT) );
std::unique_ptr<EventSendBitmapDialogMsg> msg2( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(104), elder_text[1], LEFT) );
std::unique_ptr<EventSendBitmapDialogMsg> msg3( new EventSendBitmapDialogMsg(*g_pGfxEngine->getBitmap("KEENTALKING"), elder_text[2], RIGHT) );
std::unique_ptr<EventSendBitmapDialogMsg> msg4( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(104), elder_text[3], LEFT) );
msgs.push_back( move(msg1) );
msgs.push_back( move(msg2) );
msgs.push_back( move(msg3) );
msgs.push_back( move(msg4) );
EventContainer.add( new EventSendBitmapDialogMessages(msgs) );
......@@ -167,14 +172,19 @@ void CCouncilMember::getTouchedBy(CSpriteObject &theObject)
}
std::vector< SmartPointer<EventSendBitmapDialogMsg> > msgs;
std::vector< std::shared_ptr<EventSendBitmapDialogMsg> > msgs;
msgs.push_back( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(104), elder_text[0], LEFT) );
msgs.push_back( new EventSendBitmapDialogMsg(*g_pGfxEngine->getBitmap("KEENTHUMBSUP"), elder_text[1], RIGHT) );
std::unique_ptr<EventSendBitmapDialogMsg> msg1(new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(104), elder_text[0], LEFT));
std::unique_ptr<EventSendBitmapDialogMsg> msg2(new EventSendBitmapDialogMsg(*g_pGfxEngine->getBitmap("KEENTHUMBSUP"), elder_text[1], RIGHT));
msgs.push_back( move(msg1) );
msgs.push_back( move(msg2) );
if(rescuedelders == 7)
msgs.push_back( new EventSendBitmapDialogMsg(*g_pGfxEngine->getBitmap("KEENTHUMBSUP"), g_pBehaviorEngine->getString(answermap[8]), RIGHT) );
{
std::unique_ptr<EventSendBitmapDialogMsg> msg(new EventSendBitmapDialogMsg(*g_pGfxEngine->getBitmap("KEENTHUMBSUP"), g_pBehaviorEngine->getString(answermap[8]), RIGHT));
msgs.push_back( move(msg) );
}
EventContainer.add( new EventSendBitmapDialogMessages(msgs) );
......
......@@ -82,11 +82,14 @@ void CLindsey::getTouchedBy(CSpriteObject &theObject)
}
std::vector< SmartPointer<EventSendBitmapDialogMsg> > msgs;
msgs.push_back( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(108), lindsey_text[0], LEFT) );
msgs.push_back( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(108), lindsey_text[1], LEFT) );
msgs.push_back( new EventSendBitmapDialogMsg(*g_pGfxEngine->getBitmap("KEENTHUMBSUP"), lindsey_text[2], RIGHT) );
std::vector< std::shared_ptr<EventSendBitmapDialogMsg> > msgs;
std::unique_ptr<EventSendBitmapDialogMsg> msg1( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(108), lindsey_text[0], LEFT) );
std::unique_ptr<EventSendBitmapDialogMsg> msg2( new EventSendBitmapDialogMsg(g_pGfxEngine->getBitmap(108), lindsey_text[1], LEFT) );
std::unique_ptr<EventSendBitmapDialogMsg> msg3( new EventSendBitmapDialogMsg(*g_pGfxEngine->getBitmap("KEENTHUMBSUP"), lindsey_text[2], RIGHT) );
msgs.push_back( move(msg1) );
msgs.push_back( move(msg2) );
msgs.push_back( move(msg3) );
EventContainer.add( new EventSendBitmapDialogMessages(msgs) );
......
......@@ -14,7 +14,7 @@
#include "common/CVorticonMapLoader.h"
#include "common/Playerdefines.h"
CEndingEp1::CEndingEp1(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CEndingEp1::CEndingEp1(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap, std::vector<CPlayer> &Player,
bool &hideobjects, std::vector<CVorticonSpriteObject*> &Object) :
CFinale(messageBoxes, pMap, Object),
......
......@@ -12,14 +12,14 @@
#include "common/CMap.h"
#include "common/CPlayer.h"
#include "engine/vorticon/dialog/CMessageBoxVort.h"
#include "SmartPointer.h"
#include <memory>
#include <vector>
#include <SDL.h>
class CEndingEp1 : public CFinale
{
public:
CEndingEp1(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CEndingEp1(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap,
std::vector<CPlayer> &Player,
bool &hideobjects,
......
......@@ -17,7 +17,7 @@
const int LIMPSHOME_X = 0;
const int LIMPSHOME_Y = 300;
CEndingEp2::CEndingEp2(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CEndingEp2::CEndingEp2(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap, std::vector<CPlayer> &Player, std::vector<CVorticonSpriteObject*> &Object) :
CFinale(messageBoxes, pMap, Object),
m_Player(Player)
......
......@@ -18,7 +18,7 @@
class CEndingEp2 : public CFinale
{
public:
CEndingEp2(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CEndingEp2(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap,
std::vector<CPlayer> &Player, std::vector<CVorticonSpriteObject*> &Object);
......
......@@ -14,7 +14,7 @@
#include "common/CVorticonMapLoader.h"
#include "common/Playerdefines.h"
CEndingEp3::CEndingEp3(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CEndingEp3::CEndingEp3(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap, std::vector<CPlayer> &Player, std::vector<CVorticonSpriteObject*> &Object) :
CFinale(messageBoxes, pMap, Object),
m_Player(Player)
......
......@@ -20,7 +20,7 @@
class CEndingEp3 : public CFinale {
public:
CEndingEp3(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CEndingEp3(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap,
std::vector<CPlayer> &Player, std::vector<CVorticonSpriteObject*> &Object);
......
......@@ -11,7 +11,7 @@
#include "FindFile.h"
#include <fstream>
CFinale::CFinale(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CFinale::CFinale(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap,
std::vector<CVorticonSpriteObject*> &Object) :
m_mustfinishgame(false),
......@@ -22,7 +22,8 @@ m_Object(Object)
void CFinale::addMsgBoxString(const std::string &text)
{
mMessageBoxes.push_back( new CMessageBoxVort(g_pBehaviorEngine->getString(text), true) );
std::unique_ptr<CMessageBoxVort> msg( new CMessageBoxVort(g_pBehaviorEngine->getString(text), true) );
mMessageBoxes.push_back( move(msg) );
}
......
......@@ -12,14 +12,13 @@
#include "common/CMap.h"
#include "CShipFlySys.h"
#include "CFinaleStaticScene.h"
#include "SmartPointer.h"
#include <memory>
#include <string>
class CFinale
{
public:
CFinale(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CFinale(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap,
std::vector<CVorticonSpriteObject*> &Object);
......@@ -36,7 +35,7 @@ protected:
std::unique_ptr<CTextViewer> mpTextViewer; // Used for Epilogue
std::string m_epilogue_text;
int m_Episode;
std::list< SmartPointer<CMessageBoxVort> > &mMessageBoxes;
std::list< std::shared_ptr<CMessageBoxVort> > &mMessageBoxes;
std::shared_ptr<CMap> mpMap;
std::vector<CVorticonSpriteObject*> &m_Object;
};
......
......@@ -31,7 +31,7 @@ const int EARTHCHUNK_BIG_DN = 66;
const int EARTHCHUNK_SMALL_UP = 68;
const int EARTHCHUNK_SMALL_DN = 70;
CTantalusRay::CTantalusRay(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CTantalusRay::CTantalusRay(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap,
std::vector<CVorticonSpriteObject*> &vect_obj,
std::shared_ptr<CVorticonSpriteObjectAI> &objectai) :
......
......@@ -19,7 +19,7 @@
class CTantalusRay : public CFinale
{
public:
CTantalusRay(std::list< SmartPointer<CMessageBoxVort> > &messageBoxes,
CTantalusRay(std::list< std::shared_ptr<CMessageBoxVort> > &messageBoxes,
const std::shared_ptr<CMap> &pMap,
std::vector<CVorticonSpriteObject*> &vect_obj,
std::shared_ptr<CVorticonSpriteObjectAI> &objectai);
......
......@@ -29,7 +29,10 @@ void CPlayGameVorticon::processInLevel()
// If the player touched a hint trigger in which we have to show a Message, do it so
std::string hinttext;
if( (hinttext=m_Player[i].pollHintMessage()) != "")
mMessageBoxes.push_back(new CMessageBoxVort(g_pBehaviorEngine->getString(hinttext), false, true) );
{
std::unique_ptr<CMessageBoxVort> msg( new CMessageBoxVort(g_pBehaviorEngine->getString(hinttext), false, true) );
mMessageBoxes.push_back( move(msg) );
}
// Check if the first player is dead, and if the others also are...
if(i==0) m_alldead = (m_Player[i].pdie == PDIE_DEAD);
......
......@@ -145,13 +145,19 @@ bool CPlayGameVorticon::init()
// In the case that we are in Episode 3 last Level, show Mortimer Messages
if( m_Episode == 3 && m_Level == 16 )
{
mMessageBoxes.push_back(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER"),false, true));
mMessageBoxes.push_back(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER2"),false, true));
mMessageBoxes.push_back(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER3"),false, true));
mMessageBoxes.push_back(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER4"),false, true));
mMessageBoxes.push_back(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER5"),false, true));
mMessageBoxes.push_back(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER6"),false, true));
g_pSound->playSound(SOUND_MORTIMER);
std::unique_ptr<CMessageBoxVort> msg1(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER"),false, true));
std::unique_ptr<CMessageBoxVort> msg2(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER2"),false, true));
std::unique_ptr<CMessageBoxVort> msg3(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER3"),false, true));
std::unique_ptr<CMessageBoxVort> msg4(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER4"),false, true));
std::unique_ptr<CMessageBoxVort> msg5(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER5"),false, true));
std::unique_ptr<CMessageBoxVort> msg6(new CMessageBoxVort(g_pBehaviorEngine->getString("EP3_MORTIMER6"),false, true));
mMessageBoxes.push_back(move(msg1));
mMessageBoxes.push_back(move(msg2));
mMessageBoxes.push_back(move(msg3));
mMessageBoxes.push_back(move(msg4));
mMessageBoxes.push_back(move(msg5));
mMessageBoxes.push_back(move(msg6));
g_pSound->playSound(SOUND_MORTIMER);
}
return true;
......@@ -309,7 +315,9 @@ void CPlayGameVorticon::handleFKeys()
std::string Text = g_pBehaviorEngine->getString("CTSPACECHEAT");
mMessageBoxes.push_back(new CMessageBoxVort(Text));
std::unique_ptr<CMessageBoxVort> msg(new CMessageBoxVort(Text));
mMessageBoxes.push_back( move(msg) );
}
}
g_pVideoDriver->AddConsoleMsg("All items cheat");
......@@ -344,14 +352,16 @@ void CPlayGameVorticon::handleFKeys()
g_pSound->playSound(SOUND_GUN_CLICK, PLAY_FORCE);
// Show a message like in the original game
mMessageBoxes.push_back(new CMessageBoxVort(m_Player[0].godmode ? g_pBehaviorEngine->getString("GODMODEON") : g_pBehaviorEngine->getString("GODMODEOFF")));
std::unique_ptr<CMessageBoxVort> msg(new CMessageBoxVort(m_Player[0].godmode ? g_pBehaviorEngine->getString("GODMODEON") : g_pBehaviorEngine->getString("GODMODEOFF")));
mMessageBoxes.push_back(move(msg));
g_pInput->flushKeys();
}
if(g_pInput->getPressedKey(KP) && mMessageBoxes.empty())
{
g_pSound->playSound(SOUND_GUN_CLICK, PLAY_FORCE);
mMessageBoxes.push_back(new CMessageBoxVort("Game Paused"));
std::unique_ptr<CMessageBoxVort> msg( new CMessageBoxVort("Game Paused") );
mMessageBoxes.push_back(move(msg));
}
// Menus will only open if Keen is solid or in god mode. This means neither dying nor teleporting
......
......@@ -27,7 +27,6 @@
#include "sdl/music/CMusic.h"
#include "engine/infoscenes/CHighScores.h"
#include "engine/playgame/CPlayGame.h"
#include "SmartPointer.h"
#include <SDL.h>
#include <string>
#include <vector>
......@@ -110,7 +109,7 @@ private:
std::shared_ptr<CVorticonSpriteObjectAI> mpObjectAI;
std::unique_ptr<CFinale> mpFinale;
std::unique_ptr<CEGABitmap> mpGameoverBmp;
std::list< SmartPointer<CMessageBoxVort> > mMessageBoxes;
std::list< std::shared_ptr<CMessageBoxVort> > mMessageBoxes;
bool m_showKeensLeft;
std::vector<CVorticonSpriteObject*> m_Object;
std::unique_ptr<CHUD> mp_HUD;
......
......@@ -156,7 +156,7 @@ void CPlayGameVorticon::goBacktoMap()
void CPlayGameVorticon::YourShipNeedsTheseParts()
{
CMessageBoxVort *MessageBox = new CMessageBoxVort(g_pBehaviorEngine->getString("EP1_SHIP"));
std::unique_ptr<CMessageBoxVort> MessageBox( new CMessageBoxVort(g_pBehaviorEngine->getString("EP1_SHIP")) );
bool joy, bat, vac, wis;
joy = bat = vac = wis = false;
......@@ -175,14 +175,15 @@ void CPlayGameVorticon::YourShipNeedsTheseParts()
if (!bat) MessageBox->addTileAt(322,14<<3, 4<<3);
if (!vac) MessageBox->addTileAt(323,23<<3,4<<3);
if (!wis) MessageBox->addTileAt(324,31<<3,4<<3);
mMessageBoxes.push_back(MessageBox);
mMessageBoxes.push_back(move(MessageBox));
}
void CPlayGameVorticon::ShipEp3()
{
// get one of four random strings and display it!!
std::string strname = "EP3_SHIP"+ itoa((rand()%4)+1);
mMessageBoxes.push_back(new CMessageBoxVort(g_pBehaviorEngine->getString(strname)));
std::unique_ptr<CMessageBoxVort> msg( new CMessageBoxVort(g_pBehaviorEngine->getString(strname)) );
mMessageBoxes.push_back( move(msg) );
}
void CPlayGameVorticon::showKeensLeft()
......
......@@ -63,7 +63,7 @@ void CGUIDialog::initBackground()
void CGUIDialog::addControl( SmartPointer<CGUIControl> &newControl,
void CGUIDialog::addControl( std::shared_ptr<CGUIControl> &newControl,
const CRect<float>& RelRect )
{
CRect<float> AbsRect = RelRect;
......@@ -77,7 +77,7 @@ void CGUIDialog::addControl( SmartPointer<CGUIControl> &newControl,
void CGUIDialog::addControl( SmartPointer<CGUIControl> &newControl )
void CGUIDialog::addControl( std::shared_ptr<CGUIControl> &newControl )
{
mControlList.push_back( newControl );
fit();
......@@ -186,7 +186,7 @@ void CGUIDialog::setSelection(const unsigned int sel)
}
}
bool CGUIDialog::sendEvent( const SmartPointer<CEvent> &command )
bool CGUIDialog::sendEvent( const std::shared_ptr<CEvent> &command )
{
if( CommandEvent *ev = dynamic_cast<CommandEvent*>(command.get()) )
{
......
......@@ -14,11 +14,11 @@
#include "CResourceLoader.h"
#include "utils/Geometry.h"
#include "CGUIControl.h"
#include "SmartPointer.h"
#include "engine/CEvent.h"
#include "graphics/CBitmap.h"
#include <sdl/extensions.h>
#include <list>
#include <memory>
class CGUIDialog
{
......@@ -49,10 +49,10 @@ public:
void processRendering();
// Adds a control instance to the list of controls to be processed.
void addControl( SmartPointer<CGUIControl> &newControl,
void addControl( std::shared_ptr<CGUIControl> &newControl,
const CRect<float>& RelRect );
void addControl( SmartPointer<CGUIControl> &newControl );
void addControl( std::shared_ptr<CGUIControl> &newControl );
void addControl( CGUIControl *newControl,
const CRect<float>& RelRect );
......@@ -60,11 +60,11 @@ public:
void addControl( CGUIControl *newControl );
bool sendEvent( const SmartPointer<CEvent> &command );
bool sendEvent( const std::shared_ptr<CEvent> &command );
bool sendEvent( CEvent *pCommand )
{
return sendEvent(SmartPointer<CEvent>(pCommand));
return sendEvent(std::shared_ptr<CEvent>(pCommand));
}
void fit();
......@@ -72,7 +72,7 @@ public:
void setRect(const CRect<float> &rect);
void setPosition(const float x, const float y);
std::list< SmartPointer<CGUIControl> >& getControlList()
std::list< std::shared_ptr<CGUIControl> >& getControlList()
{ return mControlList; }
const int Selection() const
......@@ -95,7 +95,7 @@ protected:
private:
// List of Controls that the Dialog has.
std::list< SmartPointer<CGUIControl> > mControlList;
std::list< std::shared_ptr<CGUIControl> > mControlList;
// SDL_Surface of the Background
std::shared_ptr<SDL_Surface> mpBackgroundSfc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment