diff --git a/.clang_complete b/.clang_complete
index 3be508a9a..39c0a4185 100644
--- a/.clang_complete
+++ b/.clang_complete
@@ -13,6 +13,5 @@
-fPIC
-I./ExtLibs/SFML/include
-I./Core
--I./GDCpp/.
-I./GDJS/.
-F./ExtLibs/SFML/extlibs/libs-osx/Frameworks
diff --git a/.gitattributes b/.gitattributes
index 825093809..2b89e2b5d 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,6 +1,5 @@
Core/GDCore/Serialization/rapidjson/rapidjson.h/* linguist-vendored
Core/GDCore/TinyXml/* linguist-vendored
-GDCpp/GDCpp/Runtime/TinyXml/* linguist-vendored
Extensions/ParticleSystem/SPARK/* linguist-vendored
Extensions/PhysicsBehavior/Box2D/* linguist-vendored
Extensions/PhysicsBehavior/box2djs/* linguist-vendored
diff --git a/.gitignore b/.gitignore
index f627f3e84..625200faf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
-/Core/GDCore/Tools/VersionPriv.h
/docs
/docs-wiki
/ExtLibs/SFML
@@ -16,7 +15,6 @@
*.bc
/Binaries/Output
*.autosave
-!/GDCpp/scripts/bcp.exe
!/scripts/libgettextlib-0-17.dll
!/scripts/libgettextsrc-0-17.dll
!/xgettext.exe
diff --git a/.travis.yml b/.travis.yml
index 1a19d9cb2..690f021f7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
# Travis CI configuration to build and run all tests
-# (and typing/formatting) for the Core, newIDE, GDJS (and even GDCpp).
+# (and typing/formatting) for the Core, newIDE, GDJS.
#
# This builds GDevelop.js and store it on a S3 so it can be used to run
# GDevelop without building it.
@@ -62,7 +62,7 @@ before_install:
install:
#Get the correct version of gcc/g++
- if [ "$CXX" = "g++" ]; then export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}"; fi
-#Compile the tests only for GDCore and GDCpp
+#Compile the tests only for GDCore
- mkdir .build-tests
- cd .build-tests
- cmake -DBUILD_GDJS=FALSE -DBUILD_TESTS=TRUE -DCMAKE_CXX_COMPILER=$(which $CXX) -DCMAKE_C_COMPILER=$(which $CC) ..
@@ -89,12 +89,9 @@ install:
- cd ../..
script:
-# GDCore and GDCpp game engine tests:
+# GDCore tests:
- cd .build-tests
- Core/GDCore_tests
- - GDCpp/GDCpp_tests
- - Extensions/PathfindingBehavior/PathfindingBehavior_Runtime_tests
- - Extensions/LinkedObjects/LinkedObjects_Runtime_tests
- cd ..
# GDevelop.js tests
- cd GDevelop.js
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
index 310f58aa1..8bff7bbc8 100644
--- a/.vscode/c_cpp_properties.json
+++ b/.vscode/c_cpp_properties.json
@@ -4,7 +4,6 @@
"name": "Mac",
"includePath": [
"${workspaceRoot}",
- "${workspaceRoot}/GDCpp",
"${workspaceRoot}/GDJS",
"${workspaceRoot}/Extensions",
"${workspaceRoot}/Core",
@@ -43,7 +42,6 @@
"name": "Linux",
"includePath": [
"${workspaceRoot}",
- "${workspaceRoot}/GDCpp",
"${workspaceRoot}/GDJS",
"${workspaceRoot}/Extensions",
"${workspaceRoot}/Core",
@@ -70,7 +68,6 @@
"name": "Win32",
"includePath": [
"${workspaceRoot}",
- "${workspaceRoot}/GDCpp",
"${workspaceRoot}/GDJS",
"${workspaceRoot}/Extensions",
"${workspaceRoot}/Core",
diff --git a/Binaries/README.md b/Binaries/README.md
index 93bf080f5..436e498f7 100644
--- a/Binaries/README.md
+++ b/Binaries/README.md
@@ -1,3 +1,3 @@
-This is the directory where native or WebAssembly binaries of the C++ code of GDCore, GDCpp and GDJS are produced.
+This is the directory where native or WebAssembly binaries of the C++ code of GDCore and GDJS are produced.
See GDevelop.js README for the instructions to compile after a change in the C++ source code.
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a4f83c61d..d4461a6a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,12 +14,10 @@ macro(gd_set_option var default type docstring)
endif()
set(${var} ${${var}} CACHE ${type} ${docstring} FORCE)
endmacro()
-gd_set_option(BUILD_CORE TRUE BOOL "TRUE to build GDevelop Core library, FALSE to use the already compiled binaries")
-gd_set_option(BUILD_GDCPP TRUE BOOL "TRUE to build GDevelop C++ Platform")
+gd_set_option(BUILD_CORE TRUE BOOL "TRUE to build GDevelop Core library")
gd_set_option(BUILD_GDJS TRUE BOOL "TRUE to build GDevelop JS Platform")
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(FULL_VERSION_NUMBER TRUE BOOL "TRUE to build GDevelop with its full version number (lastest tag + commit hash), FALSE to only use the lastest tag (avoid rebulding many source file when developping)")
# Disable deprecated code
set(NO_GUI TRUE CACHE BOOL "" FORCE) #Force disable old GUI related code.
@@ -55,9 +53,6 @@ IF ("${CMAKE_BUILD_TYPE}" STREQUAL "")
message( "CMAKE_BUILD_TYPE is empty, assuming build type is Release" )
set(CMAKE_BUILD_TYPE Release)
ENDIF()
-IF (EMSCRIPTEN)
- set(BUILD_GDCPP FALSE CACHE BOOL "" FORCE) #Force disable GDC++ when compiling with emscripten.
-ENDIF()
IF("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT WIN32 AND CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_SHARED_LINKER_FLAGS "-s") #Force stripping to avoid errors when packaging for linux.
@@ -84,7 +79,6 @@ endif()
set(GD_base_dir ${CMAKE_CURRENT_SOURCE_DIR})
#Add all the CMakeLists:
-ADD_SUBDIRECTORY(Version)
ADD_SUBDIRECTORY(ExtLibs)
IF(BUILD_CORE)
ADD_SUBDIRECTORY(Core)
@@ -92,10 +86,7 @@ ENDIF()
IF(BUILD_GDJS)
ADD_SUBDIRECTORY(GDJS)
ENDIF()
-IF(BUILD_GDCPP)
- ADD_SUBDIRECTORY(GDCpp)
-ENDIF()
-IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/GDevelop.js/CMakeLists.txt" AND EMSCRIPTEN)
+IF(EMSCRIPTEN)
ADD_SUBDIRECTORY(GDevelop.js)
ENDIF()
IF(BUILD_EXTENSIONS)
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt
index 40a73413b..adbff2cf2 100644
--- a/Core/CMakeLists.txt
+++ b/Core/CMakeLists.txt
@@ -57,7 +57,6 @@ IF(EMSCRIPTEN)
ELSE()
add_library(GDCore SHARED ${source_files})
ENDIF()
-add_dependencies(GDCore GDVersion)
IF(EMSCRIPTEN)
set_target_properties(GDCore PROPERTIES SUFFIX ".bc")
ELSEIF(WIN32)
diff --git a/Core/GDCore/DocMainPage.h b/Core/GDCore/DocMainPage.h
index 2f8ad2dd6..8ba296e8e 100644
--- a/Core/GDCore/DocMainPage.h
+++ b/Core/GDCore/DocMainPage.h
@@ -14,9 +14,8 @@
*
* \section other Other documentations
*
- * GDevelop is architectured around a `Core` (this library), platforms (`GDJS`, `GDCpp`) and extensions (`Extensions` folder). The editor (`newIDE` folder) is using all of these libraries.
+ * GDevelop is architectured around a `Core` (this library), a game engine (`GDJS`) and extensions (`Extensions` folder). The editor (`newIDE` folder) is using all of these libraries.
*
- * - [Open GDevelop C++ Platform documentation](../GDCpp Documentation/index.html)
* - [Open GDevelop JS Platform documentation](../GDJS Documentation/index.html)
* - Getting started with the editor
* - Getting started with the extensions
diff --git a/Core/GDCore/Events/CodeGeneration/EventsCodeGenerator.h b/Core/GDCore/Events/CodeGeneration/EventsCodeGenerator.h
index 9f4f177b6..8a52344c2 100644
--- a/Core/GDCore/Events/CodeGeneration/EventsCodeGenerator.h
+++ b/Core/GDCore/Events/CodeGeneration/EventsCodeGenerator.h
@@ -462,24 +462,21 @@ class GD_CORE_API EventsCodeGenerator {
* Other standard parameters type that should be implemented by platforms:
* - currentScene: Reference to the current runtime scene.
* - objectList : a map containing lists of objects which are specified by the
- object name in another parameter. (C++: std::map *>). Example:
+ object name in another parameter. Example:
* \code
AddExpression("Count", _("Object count"), _("Count the number of picked
objects"), _("Objects"), "res/conditions/nbObjet.png")
.AddParameter("objectList", _("Object"))
- .SetFunctionName("PickedObjectsCount").SetIncludeFile("GDCpp/Extensions/Builtin/ObjectTools.h");
+ .SetFunctionName("getPickedObjectsCount");
* \endcode
* - objectListWithoutPicking : Same as objectList but do not pick object if
they are not already picked.
- * - objectPtr : Return a pointer to object specified by the object name in
- another parameter ( C++: RuntimeObject* ). Example:
+ * - objectPtr : Return a reference to the object specified by the object name in
+ another parameter. Example:
* \code
.AddParameter("object", _("Object"))
.AddParameter("objectPtr", _("Target object"))
- //The called function will be called with this signature on the C++ platform:
- Function(gd::String, RuntimeObject*)
* \endcode
*/
virtual gd::String GenerateParameterCodes(
diff --git a/Core/GDCore/Events/Event.h b/Core/GDCore/Events/Event.h
index 69e0d05a5..563cfd7ff 100644
--- a/Core/GDCore/Events/Event.h
+++ b/Core/GDCore/Events/Event.h
@@ -16,7 +16,6 @@
#include "GDCore/String.h"
namespace gd {
class EventsList;
-class MainFrameWrapper;
class Project;
class Layout;
class EventsCodeGenerator;
diff --git a/Core/GDCore/Extensions/Builtin/AllBuiltinExtensions.h b/Core/GDCore/Extensions/Builtin/AllBuiltinExtensions.h
index edf7681aa..dcf905391 100644
--- a/Core/GDCore/Extensions/Builtin/AllBuiltinExtensions.h
+++ b/Core/GDCore/Extensions/Builtin/AllBuiltinExtensions.h
@@ -32,7 +32,6 @@ class GD_CORE_API BuiltinExtensionsImplementer {
static void ImplementsExternalLayoutsExtension(
gd::PlatformExtension& extension);
static void ImplementsFileExtension(gd::PlatformExtension& extension);
- static void ImplementsJoystickExtension(gd::PlatformExtension& extension);
static void ImplementsKeyboardExtension(gd::PlatformExtension& extension);
static void ImplementsMathematicalToolsExtension(
gd::PlatformExtension& extension);
diff --git a/Core/GDCore/Extensions/Builtin/JoystickExtension.cpp b/Core/GDCore/Extensions/Builtin/JoystickExtension.cpp
deleted file mode 100644
index 23a3659f0..000000000
--- a/Core/GDCore/Extensions/Builtin/JoystickExtension.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * GDevelop Core
- * Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
- * reserved. This project is released under the MIT License.
- */
-#include "AllBuiltinExtensions.h"
-#include "GDCore/Tools/Localization.h"
-
-using namespace std;
-namespace gd {
-
-void GD_CORE_API BuiltinExtensionsImplementer::ImplementsJoystickExtension(
- gd::PlatformExtension& extension) {
- extension
- .SetExtensionInformation(
- "BuiltinJoystick",
- _("Joysticks features"),
- "Built-in extension that enables the use of joysticks.",
- "Florian Rival",
- "Open source (MIT License)")
- .SetExtensionHelpPath("" /*TODO: Add a documentation page for this */);
-
-#if defined(GD_IDE_ONLY)
- extension
- .AddCondition("JoystickButtonDown",
- _("A button on a joystick is pressed"),
- _("Test if a button on a joystick is pressed."),
- _("The button _PARAM2_ of joystick _PARAM1_ is pressed"),
- _("Joystick"),
- "res/conditions/joystick24.png",
- "res/conditions/joystick.png")
- .AddCodeOnlyParameter("currentScene", "")
- .AddParameter("expression", _("Joystick number (first joystick: 0)"))
- .AddParameter("expression", _("Button"));
-
- extension
- .AddCondition("JoystickAxis",
- _("Value of an axis of a joystick"),
- _("Test the value of an axis of a joystick."),
- _("the value of the axis _PARAM2_ of joystick _PARAM1_"),
- _("Joystick"),
- "res/conditions/joystick24.png",
- "res/conditions/joystick.png")
- .AddCodeOnlyParameter("currentScene", "")
- .AddParameter("expression", _("Joystick number (first joystick: 0)"))
- .AddParameter("joyaxis", _("Axis"))
- .UseStandardRelationalOperatorParameters("number");
-
- extension
- .AddAction(
- "GetJoystickAxis",
- _("Get the value of the axis of a joystick"),
- _("Save the value of the axis of the joystick (from -100 to 100)."),
- _("Save in _PARAM3_ the value of axis _PARAM2_ of joystick _PARAM1_"),
- _("Joystick"),
- "res/actions/joystick24.png",
- "res/actions/joystick.png")
- .AddCodeOnlyParameter("currentScene", "")
- .AddParameter("expression", _("Joystick number (first joystick: 0)"))
- .AddParameter("joyaxis", _("Axis"))
- .AddParameter("scenevar", _("Save the result to the scene variable"))
- .SetManipulatedType("number");
-
- extension
- .AddExpression("GetJoystickAxis",
- _("Joystick axis"),
- _("Value of an axis of a joystick"),
- _("Joystick"),
- "res/conditions/joystick.png")
-
- .AddCodeOnlyParameter("currentScene", "")
- .AddParameter("expression", _("Joystick number (first joystick: 0)"))
- .AddParameter("joyaxis", _("Axis"));
-#endif
-}
-
-} // namespace gd
diff --git a/Core/GDCore/Extensions/Builtin/SpriteExtension/Sprite.cpp b/Core/GDCore/Extensions/Builtin/SpriteExtension/Sprite.cpp
index 74e74041a..5e247b2a1 100644
--- a/Core/GDCore/Extensions/Builtin/SpriteExtension/Sprite.cpp
+++ b/Core/GDCore/Extensions/Builtin/SpriteExtension/Sprite.cpp
@@ -7,7 +7,6 @@
#include
#include
#include "GDCore/Extensions/Builtin/SpriteExtension/Polygon2d.h"
-#include "GDCore/Project/ImageManager.h"
using namespace std;
@@ -16,11 +15,7 @@ namespace gd {
Point Sprite::badPoint("");
Sprite::Sprite()
- :
-#if !defined(EMSCRIPTEN)
- hasItsOwnImage(false),
-#endif
- automaticCollisionMask(true),
+ : automaticCollisionMask(true),
origine("origine"),
centre("centre"),
automaticCentre(true) {
@@ -73,36 +68,10 @@ Point& Sprite::GetPoint(const gd::String& name) {
bool Sprite::SetDefaultCenterPoint(bool enabled) {
automaticCentre = enabled;
-
-#if !defined(EMSCRIPTEN)
- if (automaticCentre)
- centre.SetXY(sfmlSprite.getLocalBounds().width / 2,
- sfmlSprite.getLocalBounds().height / 2);
-#endif
-
return true;
}
std::vector Sprite::GetCollisionMask() const {
- // TODO(perf): Cache to avoid re-creating a mask at every call
-#if !defined(EMSCRIPTEN)
- if (automaticCollisionMask) {
- std::vector mask;
-
- Polygon2d rectangle;
- rectangle.vertices.push_back(sf::Vector2f(0, 0));
- rectangle.vertices.push_back(
- sf::Vector2f(sfmlSprite.getLocalBounds().width, 0));
- rectangle.vertices.push_back(sf::Vector2f(
- sfmlSprite.getLocalBounds().width, sfmlSprite.getLocalBounds().height));
- rectangle.vertices.push_back(
- sf::Vector2f(0, sfmlSprite.getLocalBounds().height));
-
- mask.push_back(rectangle);
- return mask;
- }
-#endif
-
return customCollisionMask;
}
@@ -111,25 +80,4 @@ void Sprite::SetCustomCollisionMask(
customCollisionMask = collisionMask;
}
-#if !defined(EMSCRIPTEN)
-void Sprite::LoadImage(std::shared_ptr image_) {
- sfmlImage = image_;
- sfmlSprite.setTexture(sfmlImage->texture, true);
- hasItsOwnImage = false;
-
- if (automaticCentre)
- centre.SetXY(sfmlSprite.getLocalBounds().width / 2,
- sfmlSprite.getLocalBounds().height / 2);
-}
-
-void Sprite::MakeSpriteOwnsItsImage() {
- if (!hasItsOwnImage || sfmlImage == std::shared_ptr()) {
- sfmlImage = std::make_shared(
- sfmlImage->texture); // Copy the texture.
- sfmlSprite.setTexture(sfmlImage->texture);
- hasItsOwnImage = true;
- }
-}
-#endif
-
} // namespace gd
diff --git a/Core/GDCore/Extensions/Builtin/SpriteExtension/Sprite.h b/Core/GDCore/Extensions/Builtin/SpriteExtension/Sprite.h
index 47aa84fb3..93d637688 100644
--- a/Core/GDCore/Extensions/Builtin/SpriteExtension/Sprite.h
+++ b/Core/GDCore/Extensions/Builtin/SpriteExtension/Sprite.h
@@ -11,7 +11,6 @@
#include "GDCore/Extensions/Builtin/SpriteExtension/Point.h"
#include "GDCore/Extensions/Builtin/SpriteExtension/Polygon2d.h"
#include "GDCore/String.h"
-class SFMLTextureWrapper;
#undef LoadImage // prevent windows.h to be polluting everything
namespace gd {
@@ -19,9 +18,6 @@ namespace gd {
/**
* \brief Represents a sprite to be displayed on the screen.
*
- * A sprite contains a SFML sprite to be displayed, some points,
- * and can also have its own texture (rather than a texture from ImageManager).
- *
* \see Direction
* \see SpriteObject
* \ingroup SpriteObjectExtension
@@ -163,53 +159,7 @@ class GD_CORE_API Sprite {
*/
bool SetDefaultCenterPoint(bool enabled);
-#if !defined(EMSCRIPTEN)
- /** \name Sprite runtime management
- * Functions used by the C++ game engine.
- */
- ///@{
- /**
- * \brief Get the SFML sprite associated with the sprite
- */
- inline const sf::Sprite& GetSFMLSprite() const { return sfmlSprite; }
-
- /**
- * \brief Get the SFML sprite associated with the sprite
- */
- inline sf::Sprite& GetSFMLSprite() { return sfmlSprite; }
-
- /**
- * \brief Set the SFML texture of the sprite
- */
- void LoadImage(std::shared_ptr image);
-
- /**
- * \brief Get SFML texture used by the sprite
- */
- std::shared_ptr GetSFMLTexture() { return sfmlImage; };
-
- /**
- * \brief Get SFML texture used by the sprite
- */
- const std::shared_ptr GetSFMLTexture() const {
- return sfmlImage;
- };
-
- /**
- * \brief Make the sprite, if it uses a texture from ImageManager,
- * copy this texture and take ownership of it.
- */
- void MakeSpriteOwnsItsImage();
-///@}
-#endif
-
private:
-#if !defined(EMSCRIPTEN)
- sf::Sprite sfmlSprite; ///< Displayed SFML sprite
- std::shared_ptr
- sfmlImage; ///< Pointer to the image displayed by the sprite.
- bool hasItsOwnImage; ///< True if sfmlImage is only owned by this Sprite.
-#endif
gd::String image; ///< Name of the image to be loaded in Image Manager.
bool automaticCollisionMask; ///< True to use the custom collision mask.
diff --git a/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteExtension.cpp b/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteExtension.cpp
index 2617ed6dd..d0fcea8f6 100644
--- a/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteExtension.cpp
+++ b/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteExtension.cpp
@@ -334,39 +334,6 @@ void GD_CORE_API BuiltinExtensionsImplementer::ImplementsSpriteExtension(
.UseStandardRelationalOperatorParameters("number")
.MarkAsAdvanced();
- obj.AddAction("CopyImageOnImageOfSprite",
- _("Copy an image on the current one of an object"),
- _("Copy an image on the current image of an object.\nNote that "
- "the source image must be preferably kept loaded in memory."),
- _("Copy image _PARAM2_ on the current of _PARAM0_ at "
- "_PARAM3_;_PARAM4_"),
- _("Effects"),
- "res/copy24.png",
- "res/copyicon.png")
-
- .AddParameter("object", _("Object"), "Sprite")
- .AddCodeOnlyParameter("currentScene", "")
- .AddParameter("string", _("Name of the source image"))
- .AddParameter("expression", _("X position"))
- .AddParameter("expression", _("Y position"))
- .AddParameter(
- "yesorno",
- _("Should the copy take in account the source transparency\?"));
-
- obj.AddAction(
- "CreateMaskFromColorOnActualImage", // Actual is indeed a mistake :
- // Current should have been
- // chosen.
- _("Make a color of the image of an object transparent"),
- _("Make a color of the image of an object transparent."),
- _("Make color _PARAM1_ of the current image of _PARAM0_ transparent"),
- _("Effects"),
- "res/actions/opacity24.png",
- "res/actions/opacity.png")
-
- .AddParameter("object", _("Object"), "Sprite")
- .AddParameter("color", _("Color to make transparent"));
-
obj.AddAction("ChangeColor",
_("Tint color"),
_("Change the tint of an object. The default color is white."),
diff --git a/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.cpp b/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.cpp
index baf64d405..3890e6dc2 100644
--- a/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.cpp
+++ b/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.cpp
@@ -10,7 +10,6 @@
#include "GDCore/Extensions/Builtin/SpriteExtension/Direction.h"
#include "GDCore/Extensions/Builtin/SpriteExtension/Sprite.h"
#include "GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.h"
-#include "GDCore/Project/ImageManager.h"
#include "GDCore/Project/InitialInstance.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Project/Object.h"
diff --git a/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.h b/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.h
index 6b27631a3..f27cb60f6 100644
--- a/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.h
+++ b/Core/GDCore/Extensions/Builtin/SpriteExtension/SpriteObject.h
@@ -16,7 +16,6 @@ class Object;
class Layout;
class Sprite;
class Animation;
-class MainFrameWrapper;
class SerializerElement;
class PropertyDescriptor;
} // namespace gd
diff --git a/Core/GDCore/IDE/PlatformLoader.cpp b/Core/GDCore/IDE/PlatformLoader.cpp
index 30e094abe..442f22207 100644
--- a/Core/GDCore/IDE/PlatformLoader.cpp
+++ b/Core/GDCore/IDE/PlatformLoader.cpp
@@ -27,50 +27,6 @@ namespace gd {
PlatformLoader::PlatformLoader() {}
-void PlatformLoader::LoadAllPlatformsInManager(gd::String dir) {
- {
-#if defined(WINDOWS)
- std::shared_ptr platform = LoadPlatformInManager("GDCpp.dll");
-#elif defined(LINUX)
- std::shared_ptr platform =
- LoadPlatformInManager("libGDCpp.so");
-#elif defined(MACOS)
- std::shared_ptr platform =
- LoadPlatformInManager("libGDCpp.dylib");
-#else
-#warning Add the appropriate filename here for the C++ Platform!
- std::shared_ptr platform;
-#endif
- if (platform)
- gd::ExtensionsLoader::LoadAllExtensions("./CppPlatform/Extensions/",
- *platform);
- }
-
- {
-#if defined(WINDOWS)
- std::shared_ptr platform =
- LoadPlatformInManager("./JsPlatform/GDJS.dll");
-#elif defined(LINUX)
- std::shared_ptr platform =
- LoadPlatformInManager("./JsPlatform/libGDJS.so");
-#elif defined(MACOS)
- std::shared_ptr platform =
- LoadPlatformInManager("./JsPlatform/libGDJS.dylib");
-#else
-#warning Add the appropriate filename here for the Js Platform!
- std::shared_ptr platform;
-#endif
- if (platform)
- gd::ExtensionsLoader::LoadAllExtensions("./JsPlatform/Extensions/",
- *platform);
- if (platform)
- gd::ExtensionsLoader::LoadAllExtensions(
- "./CppPlatform/Extensions/", *platform, true);
- }
-
- gd::ExtensionsLoader::ExtensionsLoadingDone("./CppPlatform/Extensions/");
-}
-
std::shared_ptr PlatformLoader::LoadPlatformInManager(
gd::String fullpath) {
std::cout << "Loading platform " << fullpath << "..." << std::endl;
diff --git a/Core/GDCore/IDE/PlatformLoader.h b/Core/GDCore/IDE/PlatformLoader.h
index 2977c6203..ed9c494ed 100644
--- a/Core/GDCore/IDE/PlatformLoader.h
+++ b/Core/GDCore/IDE/PlatformLoader.h
@@ -30,15 +30,6 @@ passing
*/
class GD_CORE_API PlatformLoader {
public:
- /**
- * Load all the platforms available in a directory.
- *
- * \param dir The directory where platforms must be searched for.
- *
- * \todo For now, only GDCpp.dll and GDJS.dll are loaded.
- */
- static void LoadAllPlatformsInManager(gd::String dir);
-
/**
* Load a specific platform.
*
diff --git a/Core/GDCore/Project/ImageManager.cpp b/Core/GDCore/Project/ImageManager.cpp
deleted file mode 100644
index c97446ce1..000000000
--- a/Core/GDCore/Project/ImageManager.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * GDevelop Core
- * Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
- * reserved. This project is released under the MIT License.
- */
-#include "GDCore/Project/ImageManager.h"
-#include
-#include "GDCore/Project/ResourcesLoader.h"
-#include "GDCore/Project/ResourcesManager.h"
-#include "GDCore/Tools/InvalidImage.h"
-#if !defined(ANDROID) && !defined(MACOS)
-#include
-#endif
-#undef LoadImage // thx windows.h
-
-namespace gd {
-
-ImageManager::ImageManager() : resourcesManager(NULL) {
-#if !defined(EMSCRIPTEN)
- badTexture = std::make_shared();
- badTexture->texture.loadFromMemory(gd::InvalidImageData,
- sizeof(gd::InvalidImageData));
- badTexture->texture.setSmooth(false);
- badTexture->image = badTexture->texture.copyToImage();
-#endif
-}
-
-std::shared_ptr ImageManager::GetSFMLTexture(
- const gd::String& name) const {
- if (!resourcesManager) {
- std::cout << "ImageManager has no ResourcesManager associated with.";
- return badTexture;
- }
-
- if (alreadyLoadedImages.find(name) != alreadyLoadedImages.end() &&
- !alreadyLoadedImages.find(name)->second.expired())
- return alreadyLoadedImages.find(name)->second.lock();
-
- std::cout << "ImageManager: Loading " << name << ".";
-
- // Load only an image when necessary
- try {
- ImageResource& image =
- dynamic_cast(resourcesManager->GetResource(name));
-
- auto texture = std::make_shared();
- ResourcesLoader::Get()->LoadSFMLImage(image.GetFile(), texture->image);
- texture->texture.loadFromImage(texture->image);
- texture->texture.setSmooth(image.smooth);
-
- alreadyLoadedImages[name] = texture;
-#if defined(GD_IDE_ONLY)
- if (preventUnloading)
- unloadingPreventer.push_back(
- texture); // If unload prevention is activated, add the image to the
- // list dedicated to prevent images from being unloaded.
-#endif
-
- return texture;
- } catch (...) {
- }
-
- std::cout << " Resource not found." << std::endl;
-
- return badTexture;
-}
-
-bool ImageManager::HasLoadedSFMLTexture(const gd::String& name) const {
- if (alreadyLoadedImages.find(name) != alreadyLoadedImages.end() &&
- !alreadyLoadedImages.find(name)->second.expired())
- return true;
-
- return false;
-}
-
-void ImageManager::SetSFMLTextureAsPermanentlyLoaded(
- const gd::String& name,
- std::shared_ptr& texture) const {
- if (alreadyLoadedImages.find(name) == alreadyLoadedImages.end() ||
- alreadyLoadedImages.find(name)->second.expired())
- alreadyLoadedImages[name] = texture;
-
- if (permanentlyLoadedImages.find(name) == permanentlyLoadedImages.end())
- permanentlyLoadedImages[name] = texture;
-}
-
-void ImageManager::ReloadImage(const gd::String& name) const {
- if (!resourcesManager) {
- std::cout << "ImageManager has no ResourcesManager associated with.";
- return;
- }
-
- // Verify if image is in memory. If not, it will be automatically reloaded
- // when necessary.
- if (alreadyLoadedImages.find(name) == alreadyLoadedImages.end() ||
- alreadyLoadedImages.find(name)->second.expired())
- return;
-
- // Image still in memory, get it and update it.
- std::shared_ptr oldTexture =
- alreadyLoadedImages.find(name)->second.lock();
-
- try {
- ImageResource& image =
- dynamic_cast(resourcesManager->GetResource(name));
-
- std::cout << "ImageManager: Reload " << name << std::endl;
-
- ResourcesLoader::Get()->LoadSFMLImage(image.GetFile(), oldTexture->image);
- oldTexture->texture.loadFromImage(oldTexture->image);
- oldTexture->texture.setSmooth(image.smooth);
-
- return;
- } catch (...) { /*The ressource is not an image*/
- }
-
- // Image not present anymore in image list.
- std::cout << "ImageManager: " << name << " is not available anymore."
- << std::endl;
- *oldTexture = *badTexture;
-}
-
-std::shared_ptr ImageManager::GetOpenGLTexture(
- const gd::String& name) const {
- if (alreadyLoadedOpenGLTextures.find(name) !=
- alreadyLoadedOpenGLTextures.end() &&
- !alreadyLoadedOpenGLTextures.find(name)->second.expired())
- return alreadyLoadedOpenGLTextures.find(name)->second.lock();
-
- std::cout << "Load OpenGL Texture" << name << std::endl;
-
- std::shared_ptr texture =
- std::make_shared(GetSFMLTexture(name));
- alreadyLoadedOpenGLTextures[name] = texture;
- return texture;
-}
-
-void ImageManager::LoadPermanentImages() {
- if (!resourcesManager) {
- std::cout << "ImageManager has no ResourcesManager associated with.";
- return;
- }
-
- // Create a new list of permanently loaded images but do not delete now the
- // old list so as not to unload images that could be still present.
- std::map >
- newPermanentlyLoadedImages;
-
- std::vector resources = resourcesManager->GetAllResourceNames();
- for (std::size_t i = 0; i < resources.size(); i++) {
- try {
- ImageResource& image = dynamic_cast(
- resourcesManager->GetResource(resources[i]));
-
- if (image.alwaysLoaded)
- newPermanentlyLoadedImages[image.GetName()] =
- GetSFMLTexture(image.GetName());
- } catch (...) { /*The resource is not an image, we don't care about it.*/
- }
- }
-
- permanentlyLoadedImages = newPermanentlyLoadedImages;
-}
-
-#if defined(GD_IDE_ONLY)
-void ImageManager::PreventImagesUnloading() {
- preventUnloading = true;
- for (auto it = alreadyLoadedImages.begin(); it != alreadyLoadedImages.end();
- ++it) {
- std::shared_ptr image = (it->second).lock();
- if (image != std::shared_ptr())
- unloadingPreventer.push_back(image);
- }
-}
-
-void ImageManager::EnableImagesUnloading() {
- preventUnloading = false;
- unloadingPreventer
- .clear(); // Images which are not used anymore will thus be destroyed (As
- // no shared pointer will be pointing to them).
-}
-#endif
-
-} // namespace gd
-
-SFMLTextureWrapper::SFMLTextureWrapper(const sf::Texture& texture_)
- : texture(texture_), image(texture.copyToImage()) {}
-
-SFMLTextureWrapper::SFMLTextureWrapper() {}
-
-SFMLTextureWrapper::~SFMLTextureWrapper() {}
-
-OpenGLTextureWrapper::OpenGLTextureWrapper(
- std::shared_ptr sfmlTexture_) {
- sfmlTexture = sfmlTexture_;
-
-#if !defined(ANDROID) // TODO: OpenGL
- glGenTextures(1, &texture);
- glBindTexture(GL_TEXTURE_2D, texture);
- // glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, sfmlTexture->image.getSize().x,
- // sfmlTexture->image.getSize().y, 0, GL_RGBA, GL_UNSIGNED_BYTE,
- // sfmlTexture->image.getPixelsPtr()); glGenerateMipmap(GL_TEXTURE_2D);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(
- GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
-#endif
-}
-
-OpenGLTextureWrapper::~OpenGLTextureWrapper() {
-#if !defined(ANDROID) // TODO: OpenGL
- glDeleteTextures(1, &texture);
-#endif
-};
diff --git a/Core/GDCore/Project/ImageManager.h b/Core/GDCore/Project/ImageManager.h
deleted file mode 100644
index 0d1eb5b0f..000000000
--- a/Core/GDCore/Project/ImageManager.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * GDevelop Core
- * Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
- * reserved. This project is released under the MIT License.
- */
-
-#ifndef ImageManager_H
-#define ImageManager_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include "GDCore/String.h"
-namespace gd {
-class ResourcesManager;
-}
-class OpenGLTextureWrapper;
-class SFMLTextureWrapper;
-#undef LoadImage // thx windows.h
-
-namespace gd {
-
-/**
- * \brief Manage images for the IDE as well as at runtime for GD C++ Platform,
- * providing an easy way to get SFML images or OpenGL textures.
- *
- * Image manager is used by objects to obtain their images from the image name.
- *
- * Images are loaded dynamically when necessary, and are unloaded if there is no
- * more shared_ptr pointing on an image.
- *
- * You should in particular be interested by gd::ImageManager::GetOpenGLTexture
- * and gd::ImageManager::GetSFMLTexture.
- *
- * \see SFMLTextureWrapper
- * \see OpenGLTextureWrapper
- *
- * \ingroup ResourcesManagement
- */
-class GD_CORE_API ImageManager {
- public:
- ImageManager();
- virtual ~ImageManager(){};
-
- /**
- * \brief Get a shared pointer to an OpenGL texture. The shared pointer must
- * be kept alive as long as the texture is used.
- */
- std::shared_ptr GetOpenGLTexture(
- const gd::String& name) const;
-
- /**
- * \brief Get a shared pointer to a SFML texture. The shared pointer must be
- * kept alive as long as the texture is used.
- *
- * For example, if the texture is used in an object, you should store the
- * shared pointer in a member to make sure the texture is available as long as
- * the object is alive.
- */
- std::shared_ptr GetSFMLTexture(
- const gd::String& name) const;
-
- /**
- * \brief Set the gd::ResourcesManager used by the ImageManager.
- */
- void SetResourcesManager(gd::ResourcesManager* resourcesManager_) {
- resourcesManager = resourcesManager_;
- }
-
- /**
- * \brief Load all images of the project which are flagged as alwaysLoaded.
- * \see ImageResource
- */
- void LoadPermanentImages();
-
- /**
- * \brief Check if a SFML texture with the specified name is available and
- * loaded in memory. \return true if the texture called \a name if available
- * and loaded in memory.
- */
- bool HasLoadedSFMLTexture(const gd::String& name) const;
-
- /**
- * \brief Add the SFMLTextureWrapper to loaded images ( so that it can be
- * accessed thanks to ImageManager::GetSFMLTexture ) with the specified name
- * and mark it as permanently loaded ( so that is is unloaded only when the
- * layout is unloaded ).
- */
- void SetSFMLTextureAsPermanentlyLoaded(
- const gd::String& name,
- std::shared_ptr& texture) const;
-
- /**
- * \brief Reload a single image from the game resources
- */
- void ReloadImage(const gd::String& name) const;
-
-#if defined(GD_IDE_ONLY)
- /**
- * \brief When called, images won't be unloaded from memory until
- * EnableImagesUnloading is called. Can be used when reloading a layout so as
- * to prevent images from being unloaded and then immediately reloaded.
- */
- void PreventImagesUnloading();
-
- /**
- * \brief Enable again unused images to be unloaded from memory.
- */
- void EnableImagesUnloading();
-#endif
-
- private:
- mutable std::map >
- alreadyLoadedImages; ///< Reference all images loaded in memory.
- mutable std::map >
- permanentlyLoadedImages; ///< Contains (smart) pointers to images which
- ///< should stay loaded even if they are not
- ///< (currently) used.
-
-#if defined(GD_IDE_ONLY)
-
- /** This list is filled, when PreventImagesUnloading is called, with images
- * already loaded in memory ( and any image loaded after the call to
- * PreventImagesUnloading ). It will thus prevent these images from being
- * unloaded. This list is destroyed when EnableImagesUnloading is called.
- *
- * \see PreventImagesUnloading
- * \see EnableImagesUnloading
- */
- mutable std::vector > unloadingPreventer;
- bool preventUnloading; ///< True if no images must be currently unloaded.
-#endif
-
- mutable std::map >
- alreadyLoadedOpenGLTextures; ///< Reference all OpenGL textures loaded in
- ///< memory.
-
- mutable std::shared_ptr badTexture;
- mutable std::shared_ptr badOpenGLTexture;
-
- gd::ResourcesManager* resourcesManager;
-};
-
-} // namespace gd
-
-/**
- * \brief Class wrapping an SFML texture.
- *
- * \see gd::ImageManager
- * \ingroup ResourcesManagement
- */
-class GD_CORE_API SFMLTextureWrapper {
- public:
- SFMLTextureWrapper(const sf::Texture& texture);
- SFMLTextureWrapper();
- ~SFMLTextureWrapper();
-
- sf::Texture texture;
- sf::Image image; ///< Associated sfml image, used for pixel perfect collision
- ///< for example. If you update the image, call
- ///< LoadFromImage on texture to update it also.
-};
-
-/**
- * \brief Class wrapping an OpenGL texture.
- *
- * \see gd::ImageManager
- * \ingroup ResourcesManagement
- */
-class GD_CORE_API OpenGLTextureWrapper {
- public:
- OpenGLTextureWrapper(std::shared_ptr sfmlTexture_);
- OpenGLTextureWrapper() : texture(0){};
- ~OpenGLTextureWrapper();
- inline GLuint GetOpenGLTexture() const { return texture; }
-
- private:
- std::shared_ptr sfmlTexture;
- GLuint texture;
-};
-
-#endif // ImageManager_H
diff --git a/Core/GDCore/Project/Project.cpp b/Core/GDCore/Project/Project.cpp
index 440c2a6a3..4e0b48279 100644
--- a/Core/GDCore/Project/Project.cpp
+++ b/Core/GDCore/Project/Project.cpp
@@ -26,7 +26,6 @@
#include "GDCore/Project/EventsFunctionsExtension.h"
#include "GDCore/Project/ExternalEvents.h"
#include "GDCore/Project/ExternalLayout.h"
-#include "GDCore/Project/ImageManager.h"
#include "GDCore/Project/Layout.h"
#include "GDCore/Project/Object.h"
#include "GDCore/Project/ObjectGroupsContainer.h"
@@ -67,23 +66,16 @@ Project::Project()
adaptGameResolutionAtRuntime(true),
sizeOnStartupMode("adaptWidth"),
projectUuid(""),
- useDeprecatedZeroAsDefaultZOrder(false),
- imageManager(std::make_shared())
+ useDeprecatedZeroAsDefaultZOrder(false)
#if defined(GD_IDE_ONLY)
,
useExternalSourceFiles(false),
currentPlatform(NULL),
gdMajorVersion(gd::VersionWrapper::Major()),
gdMinorVersion(gd::VersionWrapper::Minor()),
- gdBuildVersion(gd::VersionWrapper::Build()),
- dirty(false)
+ gdBuildVersion(gd::VersionWrapper::Build())
#endif
{
- imageManager->SetResourcesManager(&resourcesManager);
-
-#if !defined(GD_IDE_ONLY)
- platforms.push_back(&CppPlatform::Get());
-#endif
}
Project::~Project() {}
@@ -823,10 +815,6 @@ void Project::SerializeTo(SerializerElement& element) const {
for (std::size_t i = 0; i < externalSourceFiles.size(); ++i)
externalSourceFiles[i]->SerializeTo(
externalSourceFilesElement.AddChild("sourceFile"));
-
-#if defined(GD_IDE_ONLY)
- dirty = false;
-#endif
}
bool Project::ValidateName(const gd::String& name) {
@@ -969,9 +957,7 @@ void Project::Init(const gd::Project& game) {
platforms = game.platforms;
resourcesManager = game.resourcesManager;
- imageManager = std::make_shared(*game.imageManager);
- imageManager->SetResourcesManager(&resourcesManager);
-
+
initialObjects = gd::Clone(game.initialObjects);
scenes = gd::Clone(game.scenes);
@@ -993,7 +979,6 @@ void Project::Init(const gd::Project& game) {
#if defined(GD_IDE_ONLY)
projectFile = game.GetProjectFile();
- imagesChanged = game.imagesChanged;
#endif
}
diff --git a/Core/GDCore/Project/Project.h b/Core/GDCore/Project/Project.h
index 4cc85a6ae..e3e0310b7 100644
--- a/Core/GDCore/Project/Project.h
+++ b/Core/GDCore/Project/Project.h
@@ -28,7 +28,6 @@ class Object;
class VariablesContainer;
class ArbitraryResourceWorker;
class SourceFile;
-class ImageManager;
class Behavior;
class BehaviorsSharedData;
class BaseEvent;
@@ -498,19 +497,6 @@ class GD_CORE_API Project : public ObjectsContainer {
*/
void SerializeTo(SerializerElement& element) const;
- /**
- * \brief Return true if the project is marked as being modified (The IDE or
- * application using the project should ask to save the project if the project
- * is closed).
- */
- bool IsDirty() { return dirty; }
-
- /**
- * \brief Mark the project as being modified (The IDE or application
- * using the project should ask to save the project if the project is closed).
- */
- void SetDirty(bool enable = true) { dirty = enable; }
-
/**
* Get the major version of GDevelop used to save the project.
*/
@@ -792,28 +778,6 @@ class GD_CORE_API Project : public ObjectsContainer {
*/
ResourcesManager& GetResourcesManager() { return resourcesManager; }
- /**
- * \brief Provide access to the ImageManager allowing to load SFML or OpenGL
- * textures for the IDE ( or at runtime for the GD C++ Platform ).
- */
- const std::shared_ptr& GetImageManager() const {
- return imageManager;
- }
-
- /**
- * \brief Provide access to the ImageManager allowing to load SFML or OpenGL
- * textures for the IDE ( or at runtime for the GD C++ Platform ).
- */
- std::shared_ptr& GetImageManager() { return imageManager; }
-
- /**
- * \brief Provide access to the ImageManager allowing to load SFML or OpenGL
- * textures for the IDE ( or at runtime for the GD C++ Platform ).
- */
- void SetImageManager(std::shared_ptr imageManager_) {
- imageManager = imageManager_;
- }
-
/**
* \brief Called ( e.g. during compilation ) so as to inventory internal
* resources, sometimes update their filename or any other work or resources.
@@ -910,12 +874,6 @@ class GD_CORE_API Project : public ObjectsContainer {
#endif
///@}
-// TODO: Put this in private part
-#if defined(GD_IDE_ONLY)
- std::vector imagesChanged; ///< Images that have been changed and
- ///< which have to be reloaded
-#endif
-
private:
/**
* Initialize from another game. Used by copy-ctor and assign-op.
@@ -954,9 +912,6 @@ class GD_CORE_API Project : public ObjectsContainer {
#endif
gd::ResourcesManager
resourcesManager; ///< Contains all resources used by the project
- std::shared_ptr
- imageManager; ///< Image manager is accessed thanks to a (smart) ptr as
- ///< it can be shared with GD C++ Platform projects.
std::vector
platforms; ///< Pointers to the platforms this project supports.
gd::String firstLayout;
@@ -987,7 +942,6 @@ class GD_CORE_API Project : public ObjectsContainer {
///< time the project was saved.
mutable unsigned int gdBuildVersion; ///< The GD build version used the last
///< time the project was saved.
- mutable bool dirty; ///< True to flag the project as being modified.
#endif
};
diff --git a/Core/GDCore/Project/ResourcesLoader.cpp b/Core/GDCore/Project/ResourcesLoader.cpp
deleted file mode 100644
index 26ac72fe6..000000000
--- a/Core/GDCore/Project/ResourcesLoader.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-#include "GDCore/Project/ResourcesLoader.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include "GDCore/String.h"
-#include "GDCore/Tools/FileStream.h"
-#undef LoadImage // Undef a macro from windows.h
-
-using namespace std;
-
-namespace gd {
-
-ResourcesLoader *ResourcesLoader::_singleton = NULL;
-
-void ResourcesLoader::LoadSFMLImage(const gd::String &filename,
- sf::Image &image) {
- gd::SFMLFileStream stream;
- if (!stream.open(filename) || !image.loadFromStream(stream))
- cout << "Failed to load a SFML image: " << filename << endl;
-}
-
-sf::Texture ResourcesLoader::LoadSFMLTexture(const gd::String &filename) {
- sf::Texture texture;
- LoadSFMLTexture(filename, texture);
-
- return texture;
-}
-
-void ResourcesLoader::LoadSFMLTexture(const gd::String &filename,
- sf::Texture &texture) {
- gd::SFMLFileStream stream;
- if (!stream.open(filename) || !texture.loadFromStream(stream))
- cout << "Failed to load a SFML texture: " << filename << endl;
-}
-
-std::pair ResourcesLoader::LoadFont(
- const gd::String &filename) {
- sf::Font *font = new sf::Font();
- StreamHolder *streamHolder = new StreamHolder();
-
- if (!streamHolder->stream.open(filename) ||
- !font->loadFromStream(streamHolder->stream)) {
- cout << "Failed to load a font from a file: " << filename << endl;
- delete font;
- delete streamHolder;
- return std::make_pair((sf::Font *)nullptr, (StreamHolder *)nullptr);
- }
-
- return std::make_pair(font, streamHolder);
-}
-
-sf::SoundBuffer ResourcesLoader::LoadSoundBuffer(const gd::String &filename) {
- sf::SoundBuffer sbuffer;
- gd::SFMLFileStream stream;
- if (!stream.open(filename) || !sbuffer.loadFromStream(stream))
- cout << "Failed to load a sound buffer: " << filename << endl;
-
- return sbuffer;
-}
-
-gd::String ResourcesLoader::LoadPlainText(const gd::String &filename) {
- gd::String text;
- gd::FileStream file(filename, ios::in);
-
- if (!file.fail()) {
- std::string ligne;
- while (getline(file, ligne)) text += gd::String::FromUTF8(ligne) + "\n";
-
- file.close();
- } else
- cout << "Failed to read a file: " << filename << endl;
-
- return text;
-}
-
-/**
- * Load a binary text file
- */
-char *ResourcesLoader::LoadBinaryFile(const gd::String &filename) {
- gd::FileStream file(filename, ios::in | ios::binary | ios::ate);
- if (file.is_open()) {
- iostream::pos_type size = file.tellg();
- char *memblock = new char[size];
- file.seekg(0, ios::beg);
- file.read(memblock, size);
- file.close();
-
- return memblock;
- }
-
- cout << "Binary file " << filename << " can't be loaded into memory " << endl;
- return NULL;
-}
-
-long int ResourcesLoader::GetBinaryFileSize(const gd::String &filename) {
- gd::FileStream file(filename, ios::in | ios::binary | ios::ate);
- if (file.is_open()) {
- return file.tellg();
- }
-
- std::cout << "Binary file " << filename << " cannot be read. " << std::endl;
- return 0;
-}
-
-} // namespace gd
diff --git a/Core/GDCore/Project/ResourcesLoader.h b/Core/GDCore/Project/ResourcesLoader.h
deleted file mode 100644
index 7a46ea34a..000000000
--- a/Core/GDCore/Project/ResourcesLoader.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * GDevelop Core
- * Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
- * reserved. This project is released under the MIT License.
- */
-#ifndef RESSOURCESLOADER_H
-#define RESSOURCESLOADER_H
-#include
-#include
-#include "GDCore/String.h"
-#include "GDCore/Tools/FileStream.h"
-#undef LoadImage // Undef macro from windows.h
-
-namespace gd {
-
-/**
- * \brief A class holding a buffer and/or a file stream (useful for SFML classes
- * that needs their buffer/stream continuously opened)
- */
-struct StreamHolder {
- StreamHolder() : buffer(nullptr), stream() {}
- ~StreamHolder() {
- if (buffer) delete buffer;
- }
-
- char *buffer;
- gd::SFMLFileStream stream;
-};
-
-/**
- * \brief Class used by games to load resources from files: this is purely an
- * abstraction to most SFML loadFrom* functions.
- *
- * This class is replaced in GDCpp by an equivalent that can load also from
- * memory.
- *
- * \ingroup ResourcesManagement
- */
-class GD_CORE_API ResourcesLoader {
- public:
- void LoadSFMLImage(const gd::String &filename, sf::Image &image);
-
- /**
- * Load a SFML texture.
- */
- sf::Texture LoadSFMLTexture(const gd::String &filename);
- void LoadSFMLTexture(const gd::String &filename, sf::Texture &texture);
-
- /**
- * Load a SFML Font.
- * \warning The function calling LoadFont is the owner of the returned font
- * and buffer (if any): Don't forget to delete them after use.
- *
- * \return A pair containing the loaded font, or NULL if loading failed, and
- * the buffer that need to be kept alive while the font is used (can be NULL
- * if the font was loaded from a file).
- */
- std::pair LoadFont(const gd::String &filename);
-
- /**
- * Load a SFML Sound Buffer
- */
- sf::SoundBuffer LoadSoundBuffer(const gd::String &filename);
-
- /**
- * Load a plain text file
- */
- gd::String LoadPlainText(const gd::String &filename);
-
- /**
- * Get a buffer for file.
- * Be careful, the buffer will be invalided by any subsequent call to
- * Load[Something]. Make a copy of the buffer if you want it to stay alive
- * longer.
- */
- char *LoadBinaryFile(const gd::String &filename);
-
- /**
- * Get the size of a file
- */
- long int GetBinaryFileSize(const gd::String &filename);
-
- static ResourcesLoader *Get() {
- if (NULL == _singleton) {
- _singleton = new ResourcesLoader;
- }
-
- return (static_cast(_singleton));
- }
-
- static void DestroySingleton() {
- if (NULL != _singleton) {
- delete _singleton;
- _singleton = NULL;
- }
- }
-
- private:
- ResourcesLoader(){};
- virtual ~ResourcesLoader(){};
-
- static ResourcesLoader *_singleton;
-};
-
-} // namespace gd
-#endif // RESSOURCESLOADER_H
diff --git a/Core/GDCore/Tools/Localization.h b/Core/GDCore/Tools/Localization.h
index 1ac82d600..7997f2e03 100644
--- a/Core/GDCore/Tools/Localization.h
+++ b/Core/GDCore/Tools/Localization.h
@@ -9,12 +9,11 @@
/** @file
* Provide a way to mark strings to be translated.
*
- * Strings to be translated in GDevelop Core codebase (and GDCpp),
+ * Strings to be translated in GDevelop Core codebase
* are marked with the underscore macro, for example: _("Hello World").
*
* The macro is then defined to be using the translation function
- * of the underlying platform (Emscripten for GDevelop 5,
- * no translation for GDCpp Runtime).
+ * of the underlying platform (Emscripten for GDevelop 5).
*/
#if defined(EMSCRIPTEN)
@@ -33,7 +32,7 @@ gd::String GetTranslation(const char* str);
#define _(s) gd::GetTranslation(u8##s)
#else
-// When compiling without Emscripten (typically for GDC++ Runtime),
+// When compiling without Emscripten,
// just return an untranslated gd::String.
// Create a new macro to return UTF8 gd::String from a translation
diff --git a/Core/GDCore/Tools/VersionPriv.h b/Core/GDCore/Tools/VersionPriv.h
new file mode 100644
index 000000000..35e33b6d7
--- /dev/null
+++ b/Core/GDCore/Tools/VersionPriv.h
@@ -0,0 +1,8 @@
+// Deprecated version number that was used for GDevelop 4, but still
+// used to version the project files.
+// Might be a good idea to refactor this at some point to make it
+// clearer this is used for the versioning of the project files.
+#define GD_VERSION_STRING "4.0.99-0-release"
+#define GD_VERSION_RC 4,0,99,0-0-release
+#define GD_VERSION_RC_STRING "4, 0, 99, 0-0-release\0"
+#define GD_DATE_STRING __DATE__
diff --git a/Core/GDCore/Tools/VersionWrapper.cpp b/Core/GDCore/Tools/VersionWrapper.cpp
index f08ea8ab8..4a4f6e459 100644
--- a/Core/GDCore/Tools/VersionWrapper.cpp
+++ b/Core/GDCore/Tools/VersionWrapper.cpp
@@ -5,6 +5,7 @@
*/
#include "GDCore/Tools/VersionWrapper.h"
+#include "GDCore/Tools/VersionPriv.h"
namespace gd {
@@ -35,13 +36,6 @@ gd::String VersionWrapper::Year() {
gd::String VersionWrapper::Status() {
return Revision() == 0 ? "Release" : "Dev";
}
-bool VersionWrapper::CompiledForEdittime() {
-#if defined(GD_IDE_ONLY)
- return true;
-#else
- return false;
-#endif
-}
bool VersionWrapper::IsOlder(int major,
int minor,
diff --git a/Core/GDCore/Tools/VersionWrapper.h b/Core/GDCore/Tools/VersionWrapper.h
index 572db243b..f6b9127dd 100644
--- a/Core/GDCore/Tools/VersionWrapper.h
+++ b/Core/GDCore/Tools/VersionWrapper.h
@@ -7,8 +7,6 @@
#define GDCORE_VERSIONWRAPPER_H
#include "GDCore/String.h"
-#include "GDCore/Tools/VersionPriv.h"
-
namespace gd {
/**
@@ -48,11 +46,6 @@ class GD_CORE_API VersionWrapper {
*/
static gd::String Status();
- /**
- * \brief Return true if GDCpp is compiled with edittime support.
- */
- static bool CompiledForEdittime();
-
/**
* \brief Get Year of the release
*/
diff --git a/Core/GDevelop-Architecture-Overview.md b/Core/GDevelop-Architecture-Overview.md
index 58ca30854..5281138f8 100644
--- a/Core/GDevelop-Architecture-Overview.md
+++ b/Core/GDevelop-Architecture-Overview.md
@@ -1,13 +1,12 @@
# GDevelop Architecture Overview
-GDevelop is architectured around a `Core` library, platforms (`GDJS`, `GDCpp`) and extensions (`Extensions` folder). The editor (`newIDE` folder) is using all of these libraries. This is a recap table of the main folders:
+GDevelop is architectured around a `Core` library, the game engine (`GDJS`) and extensions (`Extensions` folder). The editor (`newIDE` folder) is using all of these libraries. This is a recap table of the main folders:
| Directory | ℹ� Description |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| `Core` | GDevelop core library, containing common tools to implement the IDE and work with GDevelop games. |
-| `GDCpp` | The C++ game engine, used to build native games (_not used in GDevelop 5_). |
| `GDJS` | The game engine, written in TypeScript, using PixiJS (WebGL), powering all GDevelop games. |
-| `GDevelop.js` | Bindings of `Core`/`GDCpp`/`GDJS` and `Extensions` to JavaScript (with WebAssembly), used by the IDE. |
+| `GDevelop.js` | Bindings of `Core`, `GDJS` and `Extensions` to JavaScript (with WebAssembly), used by the IDE. |
| `newIDE` | The game editor, written in JavaScript with React, Electron and PixiJS. |
| `Extensions` | Extensions for the game engine, providing objects, behaviors, events and new features. |
@@ -17,11 +16,11 @@ The rest of this page is an introduction to the main concepts of GDevelop archit
**IDE** stands for "Integrated Development Environment". A synonym for it is also simply "editor". In GDevelop, the software itself, that is used to create games and running as an app or a web-app, is called the "GDevelop Editor" or the "GDevelop IDE"
-> The term "IDE" is also used in some folders. When you browse `Core`, `GDCpp` or `GDJS` subfolders, some folders are called `IDE`. They contain classes and tools that are **only useful for the editor** (they are not per se mandatory to describe the structure of a game).
+> The term "IDE" is also used in some folders. When you browse `Core` or `GDJS` subfolders, some folders are called `IDE`. They contain classes and tools that are **only useful for the editor** (they are not per se mandatory to describe the structure of a game).
**Runtime** is a word used to describe classes, tools and source files being used during a game. This could also be called "in-game" or a "game engine".
-> When you browse `GDCpp` or `GDJS` subfolders, you can find folders called `Runtime`. They contain the **game engine** of GDevelop.
+> When you browse `GDJS` subfolder, you can find a folder called `Runtime`. It's the **game engine** of GDevelop.
Extensions do have the same distinction between the "**IDE**" part and the "**Runtime**" part. For example, most extensions have:
@@ -79,7 +78,7 @@ You're welcome to do so! Please get in touch :)
The idea of the GDevelop editor and game engine is to have a lean game engine, supporting almost nothing. Then, one can add "mods", "plugins", "modules" for GDevelop. We chose to call them "**Extensions**" in GDevelop.
- `GDevelop/Core/GDCore/Extensions` is the **declaration** of default (we say "builtin") extensions, that are available for any game and are "mandatory". They are called Extensions but they could be named "Extensions that will always be in your game". In programming languages, this is called a "[Standard Library](https://en.wikipedia.org/wiki/Standard_library)" (but don't get too distracted by this naming).
-- `GDevelop/GDJS/GDJS/Extensions/` and `GDevelop/GDCpp/GDCpp/Extensions/` are reusing these **declarations** and **adding** their own declarations. Mainly, they are setting the name of the functions to be called (either in TypeScript or in C++) for each action, condition or expression.
+- `GDevelop/GDJS/GDJS/Extensions/` is reusing these **declarations** and **adding** their own declarations. Mainly, they are setting the name of the functions to be called (either in TypeScript or in C++) for each action, condition or expression.
- `GDevelop/Extensions/` is the folder for the "mods"/"plugins" for GDevelop - the ones that are not mandatory. They are not part of GDCore - they work on their own.
> In theory, all extensions could be moved to `GDevelop/Extensions/`. In practice, it's more pragmatic to have a set of "built-in" extensions with basic features.
diff --git a/Extensions/AnchorBehavior/AnchorBehavior.h b/Extensions/AnchorBehavior/AnchorBehavior.h
index 637550ce2..b0216259b 100644
--- a/Extensions/AnchorBehavior/AnchorBehavior.h
+++ b/Extensions/AnchorBehavior/AnchorBehavior.h
@@ -6,8 +6,8 @@ This project is released under the MIT License.
#ifndef ANCHORBEHAVIOR_H
#define ANCHORBEHAVIOR_H
#include
-#include "GDCpp/Runtime/Project/Behavior.h"
-#include "GDCpp/Runtime/Project/Object.h"
+#include "GDCore/Project/Behavior.h"
+#include "GDCore/Project/Object.h"
namespace gd {
class SerializerElement;
class Project;
@@ -16,7 +16,7 @@ class Project;
/**
* \brief Allow to anchor objects to the window's bounds.
*/
-class GD_EXTENSION_API AnchorBehavior : public Behavior {
+class GD_EXTENSION_API AnchorBehavior : public gd::Behavior {
public:
enum HorizontalAnchor {
ANCHOR_HORIZONTAL_NONE = 0,
diff --git a/Extensions/AnchorBehavior/AnchorRuntimeBehavior.cpp b/Extensions/AnchorBehavior/AnchorRuntimeBehavior.cpp
deleted file mode 100644
index 4005d6a3d..000000000
--- a/Extensions/AnchorBehavior/AnchorRuntimeBehavior.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-/**
-
-GDevelop - Anchor Behavior Extension
-Copyright (c) 2016 Victor Levasseur (victorlevasseur52@gmail.com)
-This project is released under the MIT License.
-*/
-
-#include "AnchorRuntimeBehavior.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include "GDCore/CommonTools.h"
-#include "GDCore/Tools/Localization.h"
-#include "GDCpp/Extensions/Builtin/MathematicalTools.h"
-#include "GDCpp/Runtime/CommonTools.h"
-#include "GDCpp/Runtime/Project/Layout.h"
-#include "GDCpp/Runtime/RuntimeGame.h"
-#include "GDCpp/Runtime/RuntimeObject.h"
-#include "GDCpp/Runtime/RuntimeScene.h"
-#include "GDCpp/Runtime/Serialization/SerializerElement.h"
-#if defined(GD_IDE_ONLY)
-#include