Skip to content

Commit 3b7c09b

Browse files
Merge pull request #19 from PolymorphEngine/dev
[merge] dev to master for alpha release
2 parents fef81a5 + 6cb9136 commit 3b7c09b

File tree

414 files changed

+33081
-1974
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

414 files changed

+33081
-1974
lines changed

.idea/PolymorphEngine.iml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 0 additions & 102 deletions
This file was deleted.

CMakeLists.txt

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,40 @@ project(Engine)
44
set(CMAKE_CXX_STANDARD 20)
55

66
include_directories(
7+
lib/myxmlpp/include
78
include
8-
include/Engine
9-
include/Engine/component
10-
include/Engine/entity
11-
include/Engine/config
12-
include/Engine/scene
13-
include/Engine/Utilities
14-
include/Engine/Utilities/Types
9+
include/Core
10+
include/Exceptions
11+
include/Core/component
12+
include/Core/component/builtins
13+
include/Core/component/builtins/drawables
14+
include/Core/component/builtins/colliders
15+
include/Core/entity
16+
include/Config
17+
include/Core/scene
18+
include/Core/settings
19+
include/Utilities
20+
include/Utilities/types
1521
)
1622

23+
add_subdirectory(lib/myxmlpp)
24+
set_target_properties(myxmlpp PROPERTIES POSITION_INDEPENDENT_CODE ON)
25+
1726
file(GLOB_RECURSE SRC src/*.cpp)
1827
file(GLOB_RECURSE ICL include/*.hpp)
28+
file(GLOB_RECURSE ICL_HEADERS include/Polymorph/*.hpp)
1929

20-
add_executable(Engine
30+
add_library(PolymorphEngine
2131
${SRC}
2232
${ICL}
23-
)
33+
${ICL_HEADERS}
34+
)
35+
target_link_libraries(PolymorphEngine myxmlpp dl)
36+
target_link_options(PolymorphEngine PUBLIC "-Wl,--no-undefined")
37+
set_target_properties(PolymorphEngine PROPERTIES POSITION_INDEPENDENT_CODE ON)
38+
39+
add_executable(TestMain EXCLUDE_FROM_ALL
40+
SampleProject/test_main.cpp
41+
)
42+
43+
target_link_libraries(TestMain PolymorphEngine)

Doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ WARN_LOGFILE =
871871
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
872872
# Note: If this tag is empty the current directory is searched.
873873

874-
INPUT = .
874+
INPUT = src include
875875

876876
# This tag can be used to specify the character encoding of the source files
877877
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -960,7 +960,7 @@ RECURSIVE = YES
960960
# Note that relative paths are relative to the directory from which doxygen is
961961
# run.
962962

963-
EXCLUDE = docs clion-utilities
963+
EXCLUDE =
964964

965965
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
966966
# directories that are symbolic links (a Unix file system feature) are excluded

SampleProject/test_main.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
** EPITECH PROJECT, 2020
3+
** test_main.cpp
4+
** File description:
5+
** test_main.cpp
6+
*/
7+
8+
#include <Polymorph/Core.hpp>
9+
#include <Polymorph/Debug.hpp>
10+
11+
int main()
12+
{
13+
std::string path = "./build";
14+
std::string name = "Test";
15+
16+
17+
try
18+
{
19+
Polymorph::Engine e = Polymorph::Engine(path, name);
20+
e.loadGraphicalAPI("./lib/libarcade_sfml.so");
21+
e.loadScriptingAPI(path + "/" +name + ".so");
22+
e.loadEngine();
23+
e.run();
24+
e;
25+
}
26+
catch (ConfigurationException &e)
27+
{
28+
e.what();
29+
return 84;
30+
}
31+
catch (std::exception& e)
32+
{
33+
std::cerr << e.what() << std::endl;
34+
return 84;
35+
}
36+
return 0;
37+
}

include/Engine/component/factory/ComponentInitializer.hpp renamed to include/ComponentsFactory/AComponentInitializer.hpp

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,41 @@
55
** header for IComponentInitializer.c
66
*/
77

8-
#ifndef ENGINE_COMPONENTINITIALIZER_HPP
9-
#define ENGINE_COMPONENTINITIALIZER_HPP
8+
#ifndef ENGINE_ACOMPONENTINITIALIZER_HPP
9+
#define ENGINE_ACOMPONENTINITIALIZER_HPP
10+
11+
#include <iostream>
12+
#include <memory>
1013

11-
#include "config/XmlComponent.hpp"
12-
#include "config/XmlEntityRef.hpp"
13-
#include "Component.hpp"
1414
namespace Polymorph
1515
{
16+
namespace Config {
17+
class XmlComponent;
18+
}
19+
class Entity;
20+
21+
class Component;
1622
class AComponentInitializer {
23+
///////////////////////////////// Constructors /////////////////////////////////
24+
25+
public:
26+
AComponentInitializer(std::string type, Config::XmlComponent &data, Entity &entity);
27+
28+
///////////////////////////--------------------------///////////////////////////
29+
30+
31+
32+
///////////////////////////////// Properties ///////////////////////////////////
33+
34+
protected:
35+
std::shared_ptr<Component> component;
36+
Config::XmlComponent &data;
37+
std::string type;
38+
1739

1840
public:
19-
AComponentInitializer(const std::string &type, Config::XmlComponent &data, Entity &entity)
20-
: data(data), type(type){};
2141
virtual std::shared_ptr<Component> &build() = 0;
42+
2243
virtual void reference() = 0;
2344

2445
std::shared_ptr<Component> &get()
@@ -37,9 +58,10 @@ namespace Polymorph
3758
}
3859

3960
protected:
40-
std::shared_ptr<Component> component;
41-
Config::XmlComponent &data;
42-
std::string type;
61+
void _init();
62+
///////////////////////////--------------------------///////////////////////////
4363
};
64+
65+
4466
}
45-
#endif //ENGINE_COMPONENTINITIALIZER_HPP
67+
#endif //ENGINE_ACOMPONENTINITIALIZER_HPP

0 commit comments

Comments
 (0)