mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Merge pull request #6 from 4ian/tests
Added basic unit tests for GDCore
This commit is contained in:
35
.travis.yml
Normal file
35
.travis.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
language: cpp
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
|
||||
install:
|
||||
#Download and compile dependencies
|
||||
- cd ExtLibs
|
||||
- sudo apt-get install p7zip-full
|
||||
#SFML
|
||||
- sudo apt-get install libopenal-dev libjpeg-dev libglew-dev libudev-dev libxrandr-dev libsndfile1-dev libglu1-mesa-dev libfreetype6-dev
|
||||
- wget http://www.compilgames.net/code/GameDevelopSDK/SFML.7z
|
||||
- 7za x SFML.7z > /dev/null
|
||||
- cd SFML
|
||||
- mkdir build-linux
|
||||
- cd build-linux
|
||||
- cmake ..
|
||||
- make
|
||||
- sudo make install
|
||||
- cd ..
|
||||
- cd ..
|
||||
#Boost
|
||||
- wget http://www.compilgames.net/code/GameDevelopSDK/boost_1_55_0.7z
|
||||
- 7za x boost_1_55_0.7z > /dev/null
|
||||
- mv boost_1_55_0 boost
|
||||
- cd ..
|
||||
#Compile the tests only
|
||||
- mkdir .build-tests
|
||||
- cd .build-tests
|
||||
- cmake -DBUILD_GDCPP=FALSE -DBUILD_GDJS=FALSE -DBUILD_IDE=FALSE -DBUILD_EXTENSIONS=FALSE -DBUILD_TESTS=TRUE -DNO_GUI=TRUE ..
|
||||
- make
|
||||
- cd ..
|
||||
script:
|
||||
- cd .build-tests/Core
|
||||
- ./GDCore_tests
|
@@ -22,6 +22,11 @@ gd_set_option(BUILD_GDCPP TRUE BOOL "TRUE to build Game Develop C++ Platform")
|
||||
gd_set_option(BUILD_GDJS TRUE BOOL "TRUE to build Game Develop JS Platform")
|
||||
gd_set_option(BUILD_IDE TRUE BOOL "TRUE to build the IDE")
|
||||
gd_set_option(BUILD_EXTENSIONS TRUE BOOL "TRUE to build the extensions")
|
||||
gd_set_option(BUILD_TESTS FALSE BOOL "TRUE to build the tests")
|
||||
gd_set_option(NO_GUI FALSE BOOL "TRUE to build without any GUI (no wxWidgets GUI, no SFML)")
|
||||
IF (EMSCRIPTEN)
|
||||
set(NO_GUI TRUE) #Force disable gui when compiling with emscripten.
|
||||
ENDIF()
|
||||
|
||||
#Sanity checks
|
||||
IF ("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
@@ -40,7 +45,7 @@ ELSEIF(WIN32)
|
||||
IF(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ExtLibs/SFML/build-mingw-release/lib")
|
||||
message("It seems that SFML was not built! Make sure that SFML libraries are built into ExtLibs/SFML/build-mingw-release/lib")
|
||||
ENDIF()
|
||||
ELSEIF(NOT EMSCRIPTEN)
|
||||
ELSEIF(NOT NO_GUI)
|
||||
IF(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ExtLibs/SFML/build-linux/lib")
|
||||
message( SEND_ERROR "It seems that SFML was not built! Make sure that SFML libraries are built into ExtLibs/SFML/build-linux/lib")
|
||||
ENDIF()
|
||||
|
@@ -3,11 +3,6 @@ cmake_policy(SET CMP0015 NEW)
|
||||
|
||||
project(GDCore)
|
||||
|
||||
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
|
||||
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
|
||||
SET(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 1)
|
||||
SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 1)
|
||||
|
||||
#Sanity checks
|
||||
IF ("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
message( "CMAKE_BUILD_TYPE is empty, assuming build type is Release" )
|
||||
@@ -52,7 +47,7 @@ include_directories(${boost_include_dir})
|
||||
include_directories(${sfml_include_dir})
|
||||
IF(WIN32) #Special case for wxWidgets on Windows
|
||||
include_directories(${wxwidgets_include_dir})
|
||||
ELSEIF (NOT EMSCRIPTEN)
|
||||
ELSEIF (NOT NO_GUI)
|
||||
find_package(wxWidgets COMPONENTS core base ribbon webview stc aui propgrid richtext html xrc REQUIRED)
|
||||
include( "${wxWidgets_USE_FILE}" )
|
||||
find_package(PkgConfig REQUIRED)
|
||||
@@ -65,10 +60,12 @@ ENDIF(WIN32)
|
||||
#Defines
|
||||
###
|
||||
add_definitions( -DGD_IDE_ONLY )
|
||||
IF (EMSCRIPTEN) #When compiling for the web, we do not want any GUI related feature.
|
||||
add_definitions( -DGD_NO_WX_GUI )
|
||||
IF (EMSCRIPTEN)
|
||||
add_definitions( -DEMSCRIPTEN )
|
||||
ENDIF()
|
||||
IF (NO_GUI)
|
||||
add_definitions( -DGD_NO_WX_GUI )
|
||||
ENDIF()
|
||||
IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
|
||||
add_definitions( -DDEBUG )
|
||||
IF(WIN32)
|
||||
@@ -95,7 +92,9 @@ ELSE()
|
||||
add_definitions( -DLINUX )
|
||||
add_definitions( -DGD_API= )
|
||||
add_definitions( -DGD_CORE_API= )
|
||||
add_definitions(${GTK3_CFLAGS_OTHER})
|
||||
IF (NOT NO_GUI)
|
||||
add_definitions(${GTK3_CFLAGS_OTHER})
|
||||
ENDIF()
|
||||
ENDIF(WIN32)
|
||||
|
||||
#The target
|
||||
@@ -121,7 +120,7 @@ set(RUNTIME_OUTPUT_PATH ${GD_base_dir}/Binaries/Output/${CMAKE_BUILD_TYPE}_${CMA
|
||||
|
||||
#Linker files
|
||||
###
|
||||
IF(WIN32)
|
||||
IF(WIN32 AND NOT NO_GUI)
|
||||
target_link_libraries(GDCore ${sfml_lib_dir}/libsfml-audio.a ${sfml_lib_dir}/libsfml-graphics.a ${sfml_lib_dir}/libsfml-window.a ${sfml_lib_dir}/libsfml-network.a ${sfml_lib_dir}/libsfml-system.a)
|
||||
IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
|
||||
target_link_libraries(GDCore ${wxwidgets_lib_dir}/libwxmsw29ud_xrc.a ${wxwidgets_lib_dir}/libwxmsw29ud_stc.a ${wxwidgets_lib_dir}/libwxmsw29ud_richtext.a ${wxwidgets_lib_dir}/libwxmsw29ud_propgrid.a ${wxwidgets_lib_dir}/libwxmsw29ud_ribbon.a ${wxwidgets_lib_dir}/libwxmsw29ud_aui.a ${wxwidgets_lib_dir}/libwxmsw29ud_adv.a ${wxwidgets_lib_dir}/libwxmsw29ud_html.a ${wxwidgets_lib_dir}/libwxmsw29ud_core.a ${wxwidgets_lib_dir}/libwxbase29ud_xml.a ${wxwidgets_lib_dir}/libwxbase29ud_net.a ${wxwidgets_lib_dir}/libwxexpatd.a ${wxwidgets_lib_dir}/libwxbase29ud.a ${wxwidgets_lib_dir}/libwxpngd.a ${wxwidgets_lib_dir}/libwxjpegd.a ${wxwidgets_lib_dir}/libwxzlibd.a ${wxwidgets_lib_dir}/libwxtiffd.a)
|
||||
@@ -130,8 +129,22 @@ target_link_libraries(GDCore ${sfml_lib_dir}/libsfml-audio.a ${sfml_lib_dir}/lib
|
||||
ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG)
|
||||
|
||||
target_link_libraries(GDCore ws2_32 user32 opengl32 glu32)
|
||||
ELSEIF (NOT EMSCRIPTEN)
|
||||
ELSEIF (NOT NO_GUI)
|
||||
target_link_libraries(GDCore ${sfml_lib_dir}/libsfml-audio.so ${sfml_lib_dir}/libsfml-graphics.so ${sfml_lib_dir}/libsfml-window.so ${sfml_lib_dir}/libsfml-network.so ${sfml_lib_dir}/libsfml-system.so)
|
||||
target_link_libraries(GDCore ${wxWidgets_LIBRARIES})
|
||||
target_link_libraries(GDCore ${GTK3_LIBRARIES})
|
||||
ENDIF(WIN32)
|
||||
ENDIF()
|
||||
|
||||
#Tests
|
||||
###
|
||||
if(BUILD_TESTS)
|
||||
file(
|
||||
GLOB_RECURSE
|
||||
test_source_files
|
||||
tests/*
|
||||
)
|
||||
add_executable(GDCore_tests ${test_source_files})
|
||||
target_link_libraries(GDCore_tests GDCore)
|
||||
target_link_libraries(GDCore_tests ${sfml_lib_dir}/libsfml-audio.so ${sfml_lib_dir}/libsfml-graphics.so ${sfml_lib_dir}/libsfml-window.so ${sfml_lib_dir}/libsfml-network.so ${sfml_lib_dir}/libsfml-system.so)
|
||||
target_link_libraries(GDCore_tests GLU GL)
|
||||
endif()
|
@@ -27,7 +27,7 @@ class GD_CORE_API CommentEvent : public gd::BaseEvent
|
||||
public:
|
||||
CommentEvent() : BaseEvent(), r(255), v(230), b(109), textR(0), textG(0), textB(0) {};
|
||||
virtual ~CommentEvent() {};
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new CommentEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new CommentEvent(*this);}
|
||||
|
||||
virtual void SerializeTo(SerializerElement & element) const;
|
||||
virtual void UnserializeFrom(gd::Project & project, const SerializerElement & element);
|
||||
|
@@ -167,7 +167,7 @@ gd::BaseEvent::EditEventReturnType ForEachEvent::EditEvent(wxWindow* parent_, gd
|
||||
*/
|
||||
void ForEachEvent::Init(const ForEachEvent & event)
|
||||
{
|
||||
events = *event.events.Clone();
|
||||
events = event.events;
|
||||
|
||||
conditions = event.conditions;
|
||||
actions = event.actions;
|
||||
|
@@ -34,7 +34,7 @@ public:
|
||||
virtual ~ForEachEvent() {};
|
||||
|
||||
ForEachEvent& operator=(const ForEachEvent & event);
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new ForEachEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new ForEachEvent(*this);}
|
||||
|
||||
virtual bool IsExecutable() const {return true;}
|
||||
|
||||
|
@@ -20,7 +20,7 @@ class GD_CORE_API LinkEvent : public gd::BaseEvent
|
||||
public:
|
||||
LinkEvent() : BaseEvent(), includeAll(true), includeStart(std::string::npos), includeEnd(std::string::npos), linkWasInvalid(false) {};
|
||||
virtual ~LinkEvent();
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new LinkEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new LinkEvent(*this);}
|
||||
|
||||
/**
|
||||
* Get the link target ( i.e. the scene or external events the link refers to )
|
||||
|
@@ -166,7 +166,7 @@ gd::BaseEvent::EditEventReturnType RepeatEvent::EditEvent(wxWindow* parent_, gd:
|
||||
*/
|
||||
void RepeatEvent::Init(const RepeatEvent & event)
|
||||
{
|
||||
events = *event.events.Clone();
|
||||
events = event.events;
|
||||
|
||||
conditions = event.conditions;
|
||||
actions = event.actions;
|
||||
|
@@ -29,7 +29,7 @@ public:
|
||||
virtual ~RepeatEvent() {};
|
||||
|
||||
RepeatEvent& operator=(const RepeatEvent & event);
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new RepeatEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new RepeatEvent(*this);}
|
||||
|
||||
virtual bool IsExecutable() const {return true;}
|
||||
|
||||
|
@@ -128,7 +128,7 @@ unsigned int StandardEvent::GetRenderedHeight(unsigned int width, const gd::Plat
|
||||
*/
|
||||
void StandardEvent::Init(const StandardEvent & event)
|
||||
{
|
||||
events = *event.events.Clone();
|
||||
events = event.events;
|
||||
|
||||
conditions = event.conditions;
|
||||
actions = event.actions;
|
||||
|
@@ -32,7 +32,7 @@ public:
|
||||
virtual ~StandardEvent();
|
||||
|
||||
StandardEvent& operator=(const StandardEvent & event);
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new StandardEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new StandardEvent(*this);}
|
||||
|
||||
virtual bool IsExecutable() const {return true;}
|
||||
|
||||
|
@@ -182,7 +182,7 @@ gd::BaseEvent::EditEventReturnType WhileEvent::EditEvent(wxWindow* parent_, gd::
|
||||
*/
|
||||
void WhileEvent::Init(const WhileEvent & event)
|
||||
{
|
||||
events = *event.events.Clone();
|
||||
events = event.events;
|
||||
|
||||
whileConditions = event.whileConditions;
|
||||
conditions = event.conditions;
|
||||
|
@@ -32,7 +32,7 @@ public:
|
||||
virtual ~WhileEvent() {};
|
||||
|
||||
WhileEvent& operator=(const WhileEvent & event);
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new WhileEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new WhileEvent(*this);}
|
||||
|
||||
virtual bool IsExecutable() const {return true;}
|
||||
|
||||
|
@@ -109,7 +109,7 @@ void BaseEvent::Preprocess(gd::EventsCodeGenerator & codeGenerator, gd::EventsLi
|
||||
|
||||
BaseEventSPtr GD_CORE_API CloneRememberingOriginalEvent(BaseEventSPtr event)
|
||||
{
|
||||
gd::BaseEventSPtr copy = event->Clone();
|
||||
gd::BaseEventSPtr copy(event->Clone());
|
||||
//Original event is either the original event of the copied event, or the event copied.
|
||||
copy->originalEvent = event->originalEvent.expired() ? event : event->originalEvent;
|
||||
|
||||
|
@@ -53,10 +53,10 @@ public:
|
||||
*
|
||||
* Typical implementation example:
|
||||
* \code
|
||||
* return boost::shared_ptr<gd::BaseEvent>(new MyEventClass(*this));
|
||||
* return new MyEventClass(*this);
|
||||
* \endcode
|
||||
*/
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new BaseEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new BaseEvent(*this);}
|
||||
|
||||
/** \name Event properties
|
||||
* Members functions to be overridden by derived classes to expose the event properties
|
||||
|
@@ -30,11 +30,6 @@ public:
|
||||
virtual ~EventsList() {};
|
||||
EventsList& operator=(const EventsList & rhs);
|
||||
|
||||
/**
|
||||
* \brief Return a pointer to a copy of the layout.
|
||||
*/
|
||||
EventsList * Clone() const { return new EventsList(*this); };
|
||||
|
||||
/**
|
||||
* \brief Insert the specified event to the list
|
||||
* \note The event passed by parameter is copied.
|
||||
|
@@ -188,7 +188,7 @@ void EventsListSerialization::UnserializeEventsFrom(gd::Project & project, Event
|
||||
event->SetDisabled(eventElem.GetBoolAttribute("disabled"));
|
||||
event->folded = eventElem.GetBoolAttribute("folded");
|
||||
|
||||
list.InsertEvent(*event, list.GetEventsCount());
|
||||
list.InsertEvent(event, list.GetEventsCount());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -24,9 +24,12 @@ Clipboard::Clipboard() :
|
||||
objectCopied(NULL),
|
||||
hasObject(false),
|
||||
hasEvents(false),
|
||||
hasExternalEvents(false),
|
||||
hasInstructions(false),
|
||||
instructionsAreConditions(true),
|
||||
externalEventsCopied(NULL),
|
||||
hasExternalEvents(false),
|
||||
externalLayoutCopied(NULL),
|
||||
hasExternalLayout(false),
|
||||
layoutCopied(NULL),
|
||||
hasLayout(false),
|
||||
hasObjectGroup(false),
|
||||
@@ -71,13 +74,13 @@ gd::Object * Clipboard::GetObject()
|
||||
|
||||
void Clipboard::SetEvents( const gd::EventsList & events )
|
||||
{
|
||||
eventsCopied = *events.Clone();
|
||||
eventsCopied = events;
|
||||
hasEvents = true;
|
||||
}
|
||||
|
||||
gd::EventsList Clipboard::GetEvents()
|
||||
{
|
||||
return *eventsCopied.Clone();
|
||||
return eventsCopied;
|
||||
}
|
||||
|
||||
void Clipboard::SetLayout( const gd::Layout * layout )
|
||||
@@ -94,32 +97,28 @@ gd::Layout * Clipboard::GetLayout()
|
||||
return layoutCopied->Clone();
|
||||
}
|
||||
|
||||
void Clipboard::SetExternalEvents( const gd::ExternalEvents * events )
|
||||
void Clipboard::SetExternalEvents( const gd::ExternalEvents & events )
|
||||
{
|
||||
if ( events == NULL ) return;
|
||||
|
||||
externalEventsCopied = events->Clone();
|
||||
if (externalEventsCopied) delete externalEventsCopied;
|
||||
externalEventsCopied = new gd::ExternalEvents(events);
|
||||
hasExternalEvents = true;
|
||||
}
|
||||
|
||||
gd::ExternalEvents * Clipboard::GetExternalEvents()
|
||||
gd::ExternalEvents Clipboard::GetExternalEvents()
|
||||
{
|
||||
if ( externalEventsCopied == NULL ) return NULL;
|
||||
return externalEventsCopied->Clone();
|
||||
return *externalEventsCopied;
|
||||
}
|
||||
|
||||
void Clipboard::SetExternalLayout( const gd::ExternalLayout * layout )
|
||||
void Clipboard::SetExternalLayout( const gd::ExternalLayout & layout )
|
||||
{
|
||||
if ( layout == NULL ) return;
|
||||
|
||||
externalLayoutCopied = layout->Clone();
|
||||
if (externalLayoutCopied) delete externalLayoutCopied;
|
||||
externalLayoutCopied = new gd::ExternalLayout(layout);
|
||||
hasExternalLayout = true;
|
||||
}
|
||||
|
||||
gd::ExternalLayout * Clipboard::GetExternalLayout()
|
||||
gd::ExternalLayout Clipboard::GetExternalLayout()
|
||||
{
|
||||
if ( externalLayoutCopied == NULL ) return NULL;
|
||||
return externalLayoutCopied->Clone();
|
||||
return *externalLayoutCopied;
|
||||
}
|
||||
|
||||
void Clipboard::SetConditions( const std::vector<gd::Instruction> & conditions )
|
||||
|
@@ -22,11 +22,23 @@ namespace gd
|
||||
|
||||
/**
|
||||
* \brief Singleton class which can be used by the IDE and the editors to access to a (fake) clipboard.
|
||||
*
|
||||
* All objects stored in this clipboard are stored by copy. Getter returns a copy of the stored objects,
|
||||
* and can only be called if "Has" method returns true (otherwise, behavior is undefined).
|
||||
*/
|
||||
class GD_CORE_API Clipboard
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Return the unique clipboard instance.
|
||||
*/
|
||||
static Clipboard * Get();
|
||||
|
||||
/**
|
||||
* @brief Destroy the unique clipboard instance.
|
||||
*
|
||||
* No need to call this method except at the end of the application.
|
||||
*/
|
||||
static void DestroySingleton();
|
||||
|
||||
void SetObject( const gd::Object * object );
|
||||
@@ -42,12 +54,12 @@ public:
|
||||
gd::Layout * GetLayout();
|
||||
bool HasLayout() { return hasLayout; };
|
||||
|
||||
void SetExternalEvents( const gd::ExternalEvents * events );
|
||||
gd::ExternalEvents * GetExternalEvents();
|
||||
void SetExternalEvents( const gd::ExternalEvents & events );
|
||||
gd::ExternalEvents GetExternalEvents();
|
||||
bool HasExternalEvents() { return hasExternalEvents; };
|
||||
|
||||
void SetExternalLayout( const gd::ExternalLayout * layout );
|
||||
gd::ExternalLayout * GetExternalLayout();
|
||||
void SetExternalLayout( const gd::ExternalLayout & layout );
|
||||
gd::ExternalLayout GetExternalLayout();
|
||||
bool HasExternalLayout() { return hasExternalLayout; };
|
||||
|
||||
void SetConditions( const std::vector<gd::Instruction> & conditions );
|
||||
@@ -80,13 +92,13 @@ private:
|
||||
bool hasInstructions;
|
||||
bool instructionsAreConditions;
|
||||
|
||||
gd::ExternalEvents * externalEventsCopied;
|
||||
gd::ExternalEvents * externalEventsCopied; ///< Stored using a pointer to avoid including the full header file.
|
||||
bool hasExternalEvents;
|
||||
|
||||
gd::ExternalLayout * externalLayoutCopied;
|
||||
gd::ExternalLayout * externalLayoutCopied; ///< Stored using a pointer to avoid including the full header file.
|
||||
bool hasExternalLayout;
|
||||
|
||||
gd::Layout * layoutCopied;
|
||||
gd::Layout * layoutCopied; ///< Stored using a pointer to avoid including the full header file.
|
||||
bool hasLayout;
|
||||
|
||||
gd::ObjectGroup objectGroupCopied;
|
||||
|
@@ -731,6 +731,7 @@ void LayoutEditorCanvas::UpdateScrollbars()
|
||||
}
|
||||
void LayoutEditorCanvas::UpdateViewAccordingToZoomFactor()
|
||||
{
|
||||
std::cout << "Size:" << GetClientSize().GetWidth()/options.zoomFactor << ";" << GetClientSize().GetHeight()/options.zoomFactor << std::endl;
|
||||
editionView.setSize(GetClientSize().GetWidth()/options.zoomFactor, GetClientSize().GetHeight()/options.zoomFactor);
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ void ExternalEvents::Init(const ExternalEvents & externalEvents)
|
||||
name = externalEvents.GetName();
|
||||
associatedScene = externalEvents.GetAssociatedLayout();
|
||||
lastChangeTimeStamp = externalEvents.GetLastChangeTimeStamp();
|
||||
events = *externalEvents.events.Clone();
|
||||
events = externalEvents.events;
|
||||
}
|
||||
|
||||
void ExternalEvents::SerializeTo(SerializerElement & element) const
|
||||
|
@@ -30,18 +30,6 @@ public:
|
||||
virtual ~ExternalEvents() {};
|
||||
ExternalEvents& operator=(const ExternalEvents & rhs);
|
||||
|
||||
/**
|
||||
* Must return a pointer to a copy of the layout.
|
||||
*
|
||||
* \note A such method is useful when the IDE must store a copy of a ExternalEvents derived class ( e.g. for Clipboard ) so as to avoid slicing
|
||||
*
|
||||
* Typical implementation example:
|
||||
* \code
|
||||
* return new MyExternalEventsClass(*this);
|
||||
* \endcode
|
||||
*/
|
||||
virtual ExternalEvents * Clone() const { return new ExternalEvents(*this); };
|
||||
|
||||
/**
|
||||
* \brief Get external events name
|
||||
*/
|
||||
|
@@ -60,6 +60,7 @@ Layout::Layout() :
|
||||
compilationNeeded(true)
|
||||
#endif
|
||||
{
|
||||
std::cout << " ** Layout ctor " << this << std::endl;
|
||||
gd::Layer layer;
|
||||
layer.SetCameraCount(1);
|
||||
initialLayers.push_back(layer);
|
||||
@@ -337,7 +338,7 @@ void Layout::Init(const Layout & other)
|
||||
}
|
||||
|
||||
#if defined(GD_IDE_ONLY)
|
||||
events = *other.events.Clone();
|
||||
events = other.events;
|
||||
objectGroups = other.objectGroups;
|
||||
|
||||
compiledEventsFile = other.compiledEventsFile;
|
||||
|
@@ -279,7 +279,7 @@ gd::BaseEventSPtr PlatformExtension::CreateEvent(std::string eventType) const
|
||||
return boost::shared_ptr<gd::BaseEvent>();
|
||||
}
|
||||
|
||||
return eventsInfos.find(eventType)->second.instance->Clone();
|
||||
return gd::BaseEventSPtr(eventsInfos.find(eventType)->second.instance->Clone());
|
||||
}
|
||||
|
||||
return boost::shared_ptr<gd::BaseEvent>();
|
||||
|
@@ -102,7 +102,6 @@ Project::Project() :
|
||||
|
||||
Project::~Project()
|
||||
{
|
||||
//dtor
|
||||
}
|
||||
|
||||
boost::shared_ptr<gd::Object> Project::CreateObject(const std::string & type, const std::string & name, const std::string & platformName)
|
||||
@@ -572,7 +571,6 @@ void Project::UnserializeFrom(const SerializerElement & element)
|
||||
|
||||
const SerializerElement & propElement = element.GetChild("properties", 0, "Info");
|
||||
SetName(propElement.GetChild("name", 0, "Nom").GetValue().GetString());
|
||||
std::cout << "Unserializing" << GetName() << "..." << std::endl;
|
||||
SetDefaultWidth(propElement.GetChild("windowWidth", 0, "WindowW").GetValue().GetInt());
|
||||
SetDefaultHeight(propElement.GetChild("windowHeight", 0, "WindowH").GetValue().GetInt());
|
||||
SetMaximumFPS(propElement.GetChild("maxFPS", 0, "FPSmax").GetValue().GetInt());
|
||||
@@ -1070,11 +1068,13 @@ void Project::OnSelectionInPropertyGrid(wxPropertyGrid * grid, wxPropertyGridEve
|
||||
|
||||
Project::Project(const Project & other)
|
||||
{
|
||||
std::cout << "Init" << this << "from " << &other << std::endl;
|
||||
Init(other);
|
||||
}
|
||||
|
||||
Project& Project::operator=(const Project & other)
|
||||
{
|
||||
std::cout << "Init" << this << "from " << &other << std::endl;
|
||||
if ( this != &other )
|
||||
Init(other);
|
||||
|
||||
|
52
Core/GDCore/Tools/SystemStats.cpp
Normal file
52
Core/GDCore/Tools/SystemStats.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Game Develop Core
|
||||
* Copyright 2008-2014 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the GNU Lesser General Public License.
|
||||
*/
|
||||
#include "SystemStats.h"
|
||||
#include "stdlib.h"
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
#if defined(WINDOWS)
|
||||
#include "windows.h"
|
||||
#include "psapi.h"
|
||||
#endif
|
||||
|
||||
namespace gd {
|
||||
|
||||
int parseLine(char* line){
|
||||
int i = strlen(line);
|
||||
while (*line < '0' || *line > '9') line++;
|
||||
line[i-3] = '\0';
|
||||
i = atoi(line);
|
||||
return i;
|
||||
}
|
||||
|
||||
size_t SystemStats::GetUsedVirtualMemory()
|
||||
{
|
||||
#if defined(LINUX)
|
||||
FILE* file = fopen("/proc/self/status", "r");
|
||||
int result = -1;
|
||||
char line[128];
|
||||
|
||||
|
||||
while (fgets(line, 128, file) != NULL){
|
||||
if (strncmp(line, "VmSize:", 7) == 0){
|
||||
result = parseLine(line);
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(file);
|
||||
return result;
|
||||
#elif defined(WINDOWS)
|
||||
PROCESS_MEMORY_COUNTERS_EX pmc;
|
||||
GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc));
|
||||
SIZE_T virtualMemUsedByMe = pmc.PrivateUsage;
|
||||
return virtualMemUsedByMe;
|
||||
#else
|
||||
#warning Memory consumption tracking is not available for your system.
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
35
Core/GDCore/Tools/SystemStats.h
Normal file
35
Core/GDCore/Tools/SystemStats.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Game Develop Core
|
||||
* Copyright 2008-2014 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the GNU Lesser General Public License.
|
||||
*/
|
||||
#if defined(GD_IDE_ONLY)
|
||||
#ifndef GDCORE_SYSTEMSTATS_H
|
||||
#define GDCORE_SYSTEMSTATS_H
|
||||
#include <cstddef>
|
||||
|
||||
namespace gd
|
||||
{
|
||||
|
||||
/**
|
||||
* \brief Tool class to provide information about the system.
|
||||
*
|
||||
* \ingroup Tools
|
||||
*/
|
||||
class GD_CORE_API SystemStats
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Return the virtual memory used by the process, in KB.
|
||||
* @return 0 if the information is not available
|
||||
*/
|
||||
static size_t GetUsedVirtualMemory();
|
||||
|
||||
private:
|
||||
SystemStats() {};
|
||||
virtual ~SystemStats() {};
|
||||
};
|
||||
|
||||
}
|
||||
#endif // GDCORE_SYSTEMSTATS_H
|
||||
#endif
|
51
Core/tests/Clipboard.cpp
Normal file
51
Core/tests/Clipboard.cpp
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Game Develop Core
|
||||
* Copyright 2008-2014 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the GNU Lesser General Public License.
|
||||
*/
|
||||
/**
|
||||
* @file Tests covering the clipboard provided by GDCore.
|
||||
*/
|
||||
#include "catch.hpp"
|
||||
#include "GDCore/CommonTools.h"
|
||||
#include "GDCore/PlatformDefinition/Project.h"
|
||||
#include "GDCore/PlatformDefinition/Layout.h"
|
||||
#include "GDCore/PlatformDefinition/ExternalLayout.h"
|
||||
#include "GDCore/PlatformDefinition/ExternalEvents.h"
|
||||
#include "GDCore/IDE/Clipboard.h"
|
||||
#include "GDCore/Events/EventsList.h"
|
||||
#include "GDCore/Events/Builtin/StandardEvent.h"
|
||||
|
||||
TEST_CASE( "Clipboard", "[common][ide]" ) {
|
||||
gd::Clipboard & clipboard = *gd::Clipboard::Get();
|
||||
REQUIRE(clipboard.HasExternalEvents() == false);
|
||||
REQUIRE(clipboard.HasExternalLayout() == false);
|
||||
REQUIRE(clipboard.HasLayout() == false);
|
||||
REQUIRE(clipboard.HasObject() == false);
|
||||
REQUIRE(clipboard.HasEvents() == false);
|
||||
|
||||
SECTION("Is a singleton") {
|
||||
REQUIRE(&clipboard == gd::Clipboard::Get());
|
||||
}
|
||||
SECTION("Properly store objects") {
|
||||
gd::ExternalEvents ev;
|
||||
ev.SetName("MyExternalEvents");
|
||||
clipboard.SetExternalEvents(ev);
|
||||
REQUIRE(clipboard.HasExternalEvents() == true);
|
||||
REQUIRE(clipboard.GetExternalEvents().GetName() == "MyExternalEvents");
|
||||
|
||||
gd::ExternalLayout el;
|
||||
el.SetName("MyExternalLayout");
|
||||
clipboard.SetExternalLayout(el);
|
||||
REQUIRE(clipboard.HasExternalLayout() == true);
|
||||
REQUIRE(clipboard.GetExternalLayout().GetName() == "MyExternalLayout");
|
||||
|
||||
gd::EventsList eList;
|
||||
gd::StandardEvent evt;
|
||||
eList.InsertEvent(evt);
|
||||
eList.InsertEvent(evt);
|
||||
clipboard.SetEvents(eList);
|
||||
REQUIRE(clipboard.HasEvents() == true);
|
||||
REQUIRE(clipboard.GetEvents().GetEventsCount() == 2);
|
||||
}
|
||||
}
|
86
Core/tests/Common.cpp
Normal file
86
Core/tests/Common.cpp
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Game Develop Core
|
||||
* Copyright 2008-2014 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the GNU Lesser General Public License.
|
||||
*/
|
||||
/**
|
||||
* @file Tests covering common features of Game Develop Core.
|
||||
*/
|
||||
#include "catch.hpp"
|
||||
#include "GDCore/CommonTools.h"
|
||||
#include "GDCore/Tools/SystemStats.h"
|
||||
#include "GDCore/PlatformDefinition/Project.h"
|
||||
#include "GDCore/PlatformDefinition/Layout.h"
|
||||
#include "GDCore/Events/EventsList.h"
|
||||
#include "GDCore/Events/Event.h"
|
||||
#include "GDCore/Events/Builtin/StandardEvent.h"
|
||||
#include "GDCore/Events/Serialization.h"
|
||||
#include "GDCore/Serialization/Serializer.h"
|
||||
|
||||
TEST_CASE( "Common tools", "[common]" ) {
|
||||
REQUIRE( gd::ToInt("1") == 1 );
|
||||
REQUIRE( gd::ToString(2) == "2" );
|
||||
}
|
||||
|
||||
TEST_CASE( "Project", "[common]" ) {
|
||||
SECTION("Basics") {
|
||||
gd::Project project;
|
||||
project.SetName("myname");
|
||||
REQUIRE( project.GetName() == "myname" );
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE( "EventsList", "[common][events]" ) {
|
||||
|
||||
SECTION("Basics") {
|
||||
gd::EventsList list;
|
||||
gd::EmptyEvent event1;
|
||||
boost::shared_ptr<gd::BaseEvent> event2(new gd::EmptyEvent);
|
||||
list.InsertEvent(event1);
|
||||
list.InsertEvent(event2);
|
||||
REQUIRE( &list.GetEvent(0) != &event1 ); //First event inserted by copy
|
||||
REQUIRE( &list.GetEvent(1) == event2.get() ); //Second event not copied
|
||||
}
|
||||
|
||||
SECTION("Subevents") {
|
||||
gd::EventsList list;
|
||||
gd::StandardEvent stdEvent;
|
||||
list.InsertEvent(stdEvent, 0);
|
||||
|
||||
//Create a lots of nested events
|
||||
gd::BaseEvent * lastEvent = &list.GetEvent(0);
|
||||
gd::BaseEvent * oneOfTheSubEvent = NULL;
|
||||
for(unsigned int i=0;i<100;++i) {
|
||||
gd::StandardEvent subEvent;
|
||||
lastEvent = &lastEvent->GetSubEvents().InsertEvent(subEvent);
|
||||
if ( i == 60 ) oneOfTheSubEvent = lastEvent;
|
||||
}
|
||||
|
||||
//Check if Contains method can find the specified sub event.
|
||||
REQUIRE(list.Contains(*oneOfTheSubEvent) == true);
|
||||
REQUIRE(list.Contains(*oneOfTheSubEvent, false) == false);
|
||||
}
|
||||
|
||||
SECTION("Memory consumption") {
|
||||
size_t startMemory = gd::SystemStats::GetUsedVirtualMemory();
|
||||
|
||||
gd::EventsList list;
|
||||
gd::StandardEvent stdEvent;
|
||||
list.InsertEvent(stdEvent, 0);
|
||||
|
||||
//Create a lots of nested events
|
||||
gd::BaseEvent * lastEvent = &list.GetEvent(0);
|
||||
for(unsigned int i=0;i<2000;++i) {
|
||||
gd::StandardEvent subEvent;
|
||||
lastEvent = &lastEvent->GetSubEvents().InsertEvent(subEvent);
|
||||
}
|
||||
|
||||
//Copy the result
|
||||
gd::EventsList copiedList = list;
|
||||
|
||||
size_t endMemory = gd::SystemStats::GetUsedVirtualMemory();
|
||||
INFO("Memory used: " << endMemory-startMemory << "KB");
|
||||
REQUIRE(1500 >= endMemory-startMemory);
|
||||
}
|
||||
|
||||
}
|
8974
Core/tests/catch.hpp
Normal file
8974
Core/tests/catch.hpp
Normal file
File diff suppressed because it is too large
Load Diff
12
Core/tests/main.cpp
Normal file
12
Core/tests/main.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Game Develop Core
|
||||
* Copyright 2008-2014 Florian Rival (Florian.Rival@gmail.com). All rights reserved.
|
||||
* This project is released under the GNU Lesser General Public License.
|
||||
*/
|
||||
/**
|
||||
* @file Main file for Game Develop Core tests
|
||||
*
|
||||
* Please write any new test in a separate file.
|
||||
*/
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch.hpp"
|
@@ -172,7 +172,7 @@ gd::BaseEvent::EditEventReturnType FunctionEvent::EditEvent(wxWindow* parent_, g
|
||||
*/
|
||||
void FunctionEvent::Init(const FunctionEvent & event)
|
||||
{
|
||||
events = *event.events.Clone();
|
||||
events = event.events;
|
||||
name = event.name;
|
||||
objectsPassedAsArgument = event.objectsPassedAsArgument;
|
||||
conditions = event.conditions;
|
||||
|
@@ -53,7 +53,7 @@ public:
|
||||
virtual ~FunctionEvent() {};
|
||||
|
||||
FunctionEvent& operator=(const FunctionEvent & event);
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new FunctionEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new FunctionEvent(*this);}
|
||||
|
||||
virtual bool IsExecutable() const {return true;}
|
||||
|
||||
|
@@ -187,7 +187,7 @@ gd::BaseEvent::EditEventReturnType TimedEvent::EditEvent(wxWindow* parent, gd::P
|
||||
*/
|
||||
void TimedEvent::Init(const TimedEvent & event)
|
||||
{
|
||||
events = *event.events.Clone();
|
||||
events = event.events;
|
||||
|
||||
name = event.name;
|
||||
timeout = event.timeout;
|
||||
|
@@ -53,7 +53,7 @@ public:
|
||||
virtual ~TimedEvent();
|
||||
|
||||
TimedEvent& operator=(const TimedEvent & event);
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new TimedEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new TimedEvent(*this);}
|
||||
|
||||
virtual bool IsExecutable() const {return true;}
|
||||
|
||||
|
@@ -30,7 +30,7 @@ public:
|
||||
virtual ~CppCodeEvent() {};
|
||||
|
||||
CppCodeEvent& operator=(const CppCodeEvent & event);
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new CppCodeEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new CppCodeEvent(*this);}
|
||||
|
||||
virtual bool IsExecutable() const {return true;}
|
||||
virtual bool CanHaveSubEvents() const {return false;}
|
||||
|
@@ -22,7 +22,7 @@ public:
|
||||
virtual ~ProfileEvent();
|
||||
|
||||
ProfileEvent& operator=(const ProfileEvent & event);
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new ProfileEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new ProfileEvent(*this);}
|
||||
|
||||
void SetPreviousProfileEvent( boost::shared_ptr<ProfileEvent> previousProfileEvent_ ) { previousProfileEvent = previousProfileEvent_; }
|
||||
|
||||
|
@@ -29,7 +29,7 @@ public:
|
||||
virtual ~JsCodeEvent() {};
|
||||
|
||||
JsCodeEvent& operator=(const JsCodeEvent & event);
|
||||
virtual gd::BaseEventSPtr Clone() const { return boost::shared_ptr<gd::BaseEvent>(new JsCodeEvent(*this));}
|
||||
virtual gd::BaseEvent * Clone() const { return new JsCodeEvent(*this);}
|
||||
|
||||
virtual bool IsExecutable() const {return true;}
|
||||
virtual bool CanHaveSubEvents() const {return false;}
|
||||
|
@@ -343,7 +343,7 @@ void EventsEditor::Init(wxWindow* parent)
|
||||
listContextPanel->SetSize(5+16+5,listContextPanel->GetSize().y);
|
||||
}
|
||||
|
||||
latestState = *events->Clone();
|
||||
latestState = *events;
|
||||
}
|
||||
|
||||
void EventsEditor::RecreateCustomEventsMenu()
|
||||
@@ -1149,9 +1149,9 @@ void EventsEditor::ChangesMadeOnEvents(bool updateHistory, bool noNeedForSceneRe
|
||||
{
|
||||
if ( updateHistory )
|
||||
{
|
||||
history.push_back(*latestState.Clone());
|
||||
history.push_back(latestState);
|
||||
redoHistory.clear();
|
||||
latestState = *events->Clone();
|
||||
latestState = *events;
|
||||
}
|
||||
|
||||
if ( !noNeedForSceneRecompilation )
|
||||
@@ -1611,7 +1611,6 @@ void EventsEditor::OneventPasteMenuSelected(wxCommandEvent& event)
|
||||
|
||||
//Insert events
|
||||
gd::EventsList eventsToPaste = gd::Clipboard::Get()->GetEvents();
|
||||
std::cout << "EventToPaste" << eventsToPaste.size();
|
||||
eventsList->InsertEvents(eventsToPaste, 0, (size_t)-1, position);
|
||||
|
||||
if ( !eventsToPaste.IsEmpty() ) ChangesMadeOnEvents();
|
||||
@@ -1623,11 +1622,11 @@ void EventsEditor::OnundoMenuSelected(wxCommandEvent& event)
|
||||
{
|
||||
if ( history.empty() ) return;
|
||||
|
||||
redoHistory.push_back(*events->Clone());
|
||||
*events = *history.back().Clone();
|
||||
redoHistory.push_back(*events);
|
||||
*events = history.back();
|
||||
history.pop_back();
|
||||
|
||||
latestState = *events->Clone();
|
||||
latestState = *events;
|
||||
|
||||
Refresh();
|
||||
UpdateRibbonBars();
|
||||
@@ -1638,11 +1637,11 @@ void EventsEditor::OnredoMenuSelected(wxCommandEvent& event)
|
||||
{
|
||||
if ( redoHistory.empty() ) return;
|
||||
|
||||
history.push_back(*events->Clone());
|
||||
*events = *redoHistory.back().Clone();
|
||||
history.push_back(*events);
|
||||
*events = redoHistory.back();
|
||||
redoHistory.pop_back();
|
||||
|
||||
latestState = *events->Clone();
|
||||
latestState = *events;
|
||||
|
||||
Refresh();
|
||||
UpdateRibbonBars();
|
||||
|
@@ -1586,7 +1586,7 @@ void ProjectManager::OnCopyExternalEventsSelected(wxCommandEvent& event)
|
||||
return;
|
||||
}
|
||||
|
||||
gd::Clipboard::Get()->SetExternalEvents(&game->GetExternalEvents(data->GetSecondString()));
|
||||
gd::Clipboard::Get()->SetExternalEvents(game->GetExternalEvents(data->GetSecondString()));
|
||||
}
|
||||
|
||||
void ProjectManager::OnCutExternalEventsSelected(wxCommandEvent& event)
|
||||
@@ -1602,7 +1602,7 @@ void ProjectManager::OnCutExternalEventsSelected(wxCommandEvent& event)
|
||||
return;
|
||||
}
|
||||
|
||||
gd::Clipboard::Get()->SetExternalEvents(&game->GetExternalEvents(data->GetSecondString()));
|
||||
gd::Clipboard::Get()->SetExternalEvents(game->GetExternalEvents(data->GetSecondString()));
|
||||
|
||||
//Updating editors
|
||||
for (unsigned int k =0;k<static_cast<unsigned>(mainEditor.GetEditorsNotebook()->GetPageCount()) ;k++ )
|
||||
@@ -1631,8 +1631,9 @@ void ProjectManager::OnPasteExternalEventsSelected(wxCommandEvent& event)
|
||||
gd::Project * game;
|
||||
gdTreeItemProjectData * data;
|
||||
if ( !GetGameOfSelectedItem(game, data) ) return;
|
||||
if (!Clipboard::Get()->HasExternalEvents()) return;
|
||||
|
||||
gd::ExternalEvents & newEvents = *Clipboard::Get()->GetExternalEvents();
|
||||
gd::ExternalEvents newEvents = Clipboard::Get()->GetExternalEvents();
|
||||
|
||||
//Finding a new, unique name for the events
|
||||
string newName = newEvents.GetName();
|
||||
@@ -1791,7 +1792,7 @@ void ProjectManager::OnCopyExternalLayoutSelected(wxCommandEvent& event)
|
||||
return;
|
||||
}
|
||||
|
||||
gd::Clipboard::Get()->SetExternalLayout(&game->GetExternalLayout(data->GetSecondString()));
|
||||
gd::Clipboard::Get()->SetExternalLayout(game->GetExternalLayout(data->GetSecondString()));
|
||||
}
|
||||
|
||||
void ProjectManager::OnCutExternalLayoutSelected(wxCommandEvent& event)
|
||||
@@ -1807,7 +1808,7 @@ void ProjectManager::OnCutExternalLayoutSelected(wxCommandEvent& event)
|
||||
return;
|
||||
}
|
||||
|
||||
gd::Clipboard::Get()->SetExternalLayout(&game->GetExternalLayout(data->GetSecondString()));
|
||||
gd::Clipboard::Get()->SetExternalLayout(game->GetExternalLayout(data->GetSecondString()));
|
||||
|
||||
//Updating editors
|
||||
for (unsigned int k =0;k<static_cast<unsigned>(mainEditor.GetEditorsNotebook()->GetPageCount()) ;k++ )
|
||||
@@ -1836,8 +1837,9 @@ void ProjectManager::OnPasteExternalLayoutSelected(wxCommandEvent& event)
|
||||
gd::Project * game;
|
||||
gdTreeItemProjectData * data;
|
||||
if ( !GetGameOfSelectedItem(game, data) ) return;
|
||||
if (!Clipboard::Get()->HasExternalLayout()) return;
|
||||
|
||||
gd::ExternalLayout & newExternalLayout = *Clipboard::Get()->GetExternalLayout();
|
||||
gd::ExternalLayout newExternalLayout = Clipboard::Get()->GetExternalLayout();
|
||||
|
||||
//Finding a new, unique name for the events
|
||||
string newName = newExternalLayout.GetName();
|
||||
|
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
void TemplateEvents::Init(const TemplateEvents & other)
|
||||
{
|
||||
events = *other.events.Clone();
|
||||
events = other.events;
|
||||
name = other.name;
|
||||
desc = other.desc;
|
||||
parameters = other.parameters;
|
||||
|
Reference in New Issue
Block a user