Skip to content

Commit 6d2eed9

Browse files
committed
Merge branch 'update/swbeta' into develop
2 parents 19e0d17 + e6ddeb1 commit 6d2eed9

105 files changed

Lines changed: 3542 additions & 500 deletions

File tree

Some content is hidden

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

.cmake_linux.cmake

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,23 @@
1-
2-
## PROJECT VAR
3-
## <=====================================>
4-
project( Incaribus
5-
VERSION
6-
0.1
7-
DESCRIPTION
8-
"Example project to test ShipWreckEngine"
9-
)
101
set( EXEC incaribus )
112
set( EXT cpp )
123

13-
## SOURCE FOLDERS
14-
set( SRC_FOLDERS
15-
${CMAKE_SOURCE_DIR}/sources/
16-
${CMAKE_SOURCE_DIR}/sources/scenes/
17-
${CMAKE_SOURCE_DIR}/sources/script/
18-
)
19-
## INCLUDE FOLDERS
20-
set( INC_FOLDERS
21-
${CMAKE_SOURCE_DIR}/libraries/
22-
${CMAKE_SOURCE_DIR}/libraries/module/
23-
${CMAKE_SOURCE_DIR}/libraries/core/
24-
${CMAKE_SOURCE_DIR}/includes/
25-
${CMAKE_SOURCE_DIR}/includes/scenes/
26-
${CMAKE_SOURCE_DIR}/includes/script/
27-
)
284
## IMPORTED SHARED LIBRARY NAME
295
set( SHARED_LIB_NAME
306
Jsnp
31-
SWEngine-Core-Debug
327
SWEngine-OpenGLModule
338
glfw
349
yaml-cpp
10+
openal
11+
sndfile
3512
)
3613
## IMPORTED SHARED LIBRARY LOCATION
3714
set( SHARED_LIB_LOCATION
3815
${CMAKE_SOURCE_DIR}/libraries/libJsnp.so
39-
${CMAKE_SOURCE_DIR}/libraries/libSWEngine-Core-Debug.so
4016
${CMAKE_SOURCE_DIR}/libraries/libSWEngine-OpenGLModule.so
4117
${CMAKE_SOURCE_DIR}/libraries/libglfw.so
4218
${CMAKE_SOURCE_DIR}/libraries/libyaml-cpp.so
19+
${CMAKE_SOURCE_DIR}/libraries/libopenal.so
20+
${CMAKE_SOURCE_DIR}/libraries/libsndfile.so
4321
)
4422
## <=====================================>
4523

@@ -69,6 +47,8 @@ add_executable(${EXEC} ${SRC})
6947
## ADD INCLUDES
7048
## <=====================================>
7149
target_include_directories(${EXEC} PRIVATE ${INC_FOLDERS})
50+
include_directories (/usr/include/freetype2)
51+
target_link_libraries(${EXEC} PUBLIC ${FT})
7252
## <=====================================>
7353

7454
## ADD PARAMETER

.cmake_windows.cmake

Lines changed: 54 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
1-
2-
## PROJECT VAR
3-
## <=====================================>
4-
project( Incaribus
5-
VERSION
6-
0.1
7-
DESCRIPTION
8-
"Example project to test ShipWreckEngine"
9-
LANGUAGES
10-
CXX
11-
)
121
set( EXEC incaribus )
132
set( EXT cpp )
143

15-
## SOURCE FOLDERS
16-
set( SRC_FOLDERS
17-
${CMAKE_SOURCE_DIR}/sources/
18-
${CMAKE_SOURCE_DIR}/sources/scenes/
19-
)
20-
## INCLUDE FOLDERS
21-
set( INC_FOLDERS
22-
${CMAKE_SOURCE_DIR}/libs/
23-
${CMAKE_SOURCE_DIR}/libs/module/opengl/
24-
${CMAKE_SOURCE_DIR}/libs/core/includes/
25-
${CMAKE_SOURCE_DIR}/includes/
26-
${CMAKE_SOURCE_DIR}/includes/scenes/
27-
)
4+
add_definitions(-DYAML_CPP_STATIC_DEFINE)
5+
6+
if (${CMAKE_BUILD_TYPE} STREQUAL Debug)
7+
set(DEBUG_SUFFIX "d")
8+
else()
9+
set(DEBUG_SUFFIX "")
10+
endif()
11+
2812
## IMPORTED SHARED LIBRARY NAME
2913
set( SHARED_LIB_NAME
3014
Jsnp
31-
SWEngine-Core
32-
SWEngine-OpenGLModule
33-
glfw3
15+
SWEngine-OpenGLModule${DEBUG_SUFFIX}
16+
glfw
17+
sndfile
18+
freetype
3419
)
20+
3521
## IMPORTED SHARED LIBRARY LOCATION
3622
set( SHARED_LIB_LOCATION
37-
${CMAKE_SOURCE_DIR}/libs/Jsnp.dll
38-
${CMAKE_SOURCE_DIR}/libs/SWEngine-Core.dll
39-
${CMAKE_SOURCE_DIR}/libs/SWEngine-OpenGLModule.dll
40-
${CMAKE_SOURCE_DIR}/libs/glfw3.dll
23+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/Jsnp.dll
24+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/SWEngine-OpenGLModule${DEBUG_SUFFIX}.dll
25+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/glfw3.dll
26+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/sndfile.dll
27+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/freetype.dll
4128
)
4229
## IMPORTED SHARED LIBRARY lib file
4330
set( SHARED_LIB
44-
${CMAKE_SOURCE_DIR}/libs/Jsnp.lib
45-
${CMAKE_SOURCE_DIR}/libs/SWEngine-Core.lib
46-
${CMAKE_SOURCE_DIR}/libs/SWEngine-OpenGLModule.lib
47-
${CMAKE_SOURCE_DIR}/libs/glfw3.lib
31+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/Jsnp.lib
32+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/SWEngine-OpenGLModule${DEBUG_SUFFIX}.lib
33+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/glfw3.lib
34+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/sndfile.lib
35+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/freetype.lib
36+
)
37+
38+
### IMPORTED STATIC LIBRARY NAME
39+
set( STATIC_LIB_NAME
40+
yaml-cpp${DEBUG_SUFFIX}
41+
)
42+
43+
## IMPORTED STATIC LIBRARY .lib file
44+
set( STATIC_LIB
45+
${CMAKE_SOURCE_DIR}/libraries/${CMAKE_BUILD_TYPE}/yaml-cpp${DEBUG_SUFFIX}.lib
4846
)
4947
## <=====================================>
5048

@@ -94,7 +92,7 @@ foreach(ctr RANGE ${LIST_LEN})
9492
list(GET SHARED_LIB_LOCATION ${ctr} loc)
9593
list(GET SHARED_LIB ${ctr} filelib)
9694
add_library(${lib} SHARED IMPORTED)
97-
file(COPY ${loc} DESTINATION ${CMAKE_SOURCE_DIR}/out/)
95+
file(COPY ${loc} DESTINATION ${CMAKE_SOURCE_DIR}/out/${CMAKE_BUILD_TYPE}/)
9896
set_target_properties(${lib} PROPERTIES
9997
IMPORTED_LOCATION ${loc}
10098
IMPORTED_IMPLIB ${filelib}
@@ -106,6 +104,26 @@ target_link_libraries(${EXEC}
106104
)
107105
## <=====================================>
108106

107+
## STATIC LIBRARY LINKING
108+
## <=====================================>
109+
list(LENGTH STATIC_LIB_NAME list_len)
110+
math(EXPR LIST_LEN "${list_len} - 1")
111+
112+
foreach(ctr RANGE ${LIST_LEN})
113+
list(GET STATIC_LIB_NAME ${ctr} lib)
114+
list(GET STATIC_LIB ${ctr} filelib)
115+
message(${filelib})
116+
add_library(${lib} STATIC IMPORTED)
117+
set_target_properties(${lib} PROPERTIES
118+
IMPORTED_LOCATION ${filelib}
119+
)
120+
endforeach()
121+
target_link_libraries(${EXEC}
122+
PUBLIC
123+
${STATIC_LIB_NAME}
124+
)
125+
## <=====================================>
126+
109127

110128
## PACKAGE LINKING
111129
## <=====================================>

.github/resources/images/Menu1.png

24.6 KB
Loading

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@
3434
.idea
3535
.vscode
3636
cmake-*
37-
libraries
37+
libraries
38+
*.exp
39+
40+
*.pdb

CMakeLists.txt

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
## CMAKE VAR
22
## <=====================================>
3-
cmake_minimum_required( VERSION 3.17...3.20 )
4-
set( CMAKE_BUILD_TYPE Debug ) # Release / RelWithDebInfo / Debug
5-
set( CMAKE_CXX_STANDARD 20 )
6-
set( CMAKE_CXX_STANDARD_REQUIRED True )
7-
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/out/ )
8-
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/out/ )
9-
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/out/ )
10-
## <=====================================>
11-
3+
cmake_minimum_required( VERSION 3.17...3.22 )
124

13-
## PROJECT VAR
14-
## <=====================================>
155
project( Incaribus
166
VERSION
177
0.1
@@ -21,11 +11,45 @@ project( Incaribus
2111
CXX
2212
)
2313

14+
set( CMAKE_CXX_STANDARD 20 )
15+
set( CMAKE_CXX_STANDARD_REQUIRED True )
16+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/out/ )
17+
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/out/ )
18+
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/out/ )
19+
set(PREFIX_MESSAGE "[${PROJECT_NAME}] ")
20+
## <=====================================>
21+
22+
23+
## SOURCE FOLDERS
24+
set( SRC_FOLDERS
25+
${CMAKE_SOURCE_DIR}/sources/
26+
${CMAKE_SOURCE_DIR}/sources/scenes/
27+
${CMAKE_SOURCE_DIR}/sources/script/
28+
${CMAKE_SOURCE_DIR}/sources/script/props/
29+
${CMAKE_SOURCE_DIR}/sources/script/character/
30+
)
31+
## INCLUDE FOLDERS
32+
set( INC_FOLDERS
33+
${CMAKE_SOURCE_DIR}/libraries/
34+
${CMAKE_SOURCE_DIR}/libraries/module/
35+
${CMAKE_SOURCE_DIR}/libraries/core/
36+
${CMAKE_SOURCE_DIR}/libraries/freetype/
37+
${CMAKE_SOURCE_DIR}/includes/
38+
${CMAKE_SOURCE_DIR}/includes/scenes/
39+
${CMAKE_SOURCE_DIR}/includes/script/
40+
${CMAKE_SOURCE_DIR}/includes/script/props/
41+
${CMAKE_SOURCE_DIR}/includes/script/character/
42+
)
43+
44+
message(${PREFIX_MESSAGE} "Build type set to: " ${CMAKE_BUILD_TYPE})
45+
message(${PREFIX_MESSAGE} "Current cmake location: " ${CMAKE_CURRENT_SOURCE_DIR})
46+
message(${PREFIX_MESSAGE} "Project location: " ${CMAKE_SOURCE_DIR})
47+
2448
if (WIN32)
25-
message("Windows system detected, prepare project...")
49+
message(${PREFIX_MESSAGE} "Windows system detected, prepare project...")
2650
include(.cmake_windows.cmake)
2751
elseif(UNIX)
28-
message("Linux system detected, prepare project...")
52+
message(${PREFIX_MESSAGE} "Linux system detected, prepare project...")
2953
include(.cmake_linux.cmake)
3054
else()
3155
message(FATAL_ERROR "System not supported!")

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
1-
# Incaribus
1+
<p align="center">
2+
<img src=".github/resources/images/Menu1.png">
3+
</p>
4+
5+
# Incaribus
6+
7+
## Description
8+
This project provide an example designed with [ShipWreck](https://docs.creative-rift.com/) Engine.
9+
You follow a little fox and travel around the world to collect all gems. </br>
10+
WARNING: This project may contain experimental feature.
11+
Please if an issue occur, report them on the [issue tracker](https://github.com/Creative-Rift/Incaribus/issues).
12+
13+
## Compilation
14+
15+
To build the project simply use these commands:
16+
17+
```bash
18+
mkdir build ; cd build
19+
cmake -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=[Debug/Release] ..
20+
cmake --build . --target Incaribus --config [Debug/Release]
21+
```
22+
23+
The output program will be in `Incaribus/out/[Debug/Release]/incaribus.exe` \
24+
PS: Run the game directly from the folder, or resources will not be found.
25+
26+
# Asset Pack
27+
28+
In this project we use the awesome [Sunny Land](https://ansimuz.itch.io/sunny-land-pixel-game-art) asset pack.
29+
30+
## Author
31+
32+
Made on our ship with :heart: \
33+
34+
[Guillaume Soisson](https://github.com/Alvarwow69)

includes/scenes/Game.hpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
** Society: Creative Rift
3+
** SHIPWRECK ENGINE, 2022
4+
** Author: Guillaume S.
5+
** File name: Game.hpp
6+
** Description: [CHANGE]
7+
*/
8+
9+
#ifndef INCARIBUS_GAME_HPP
10+
#define INCARIBUS_GAME_HPP
11+
12+
#include "event/EventInfo.hpp"
13+
14+
class Game
15+
{
16+
public:
17+
std::string name() {return ("ye");}
18+
void onLoad(sw::EventInfo& info);
19+
};
20+
21+
#endif //INCARIBUS_GAME_HPP

includes/scenes/Main.hpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@
66
** Description: [CHANGE]
77
*/
88

9-
#include "SW/Scene.hpp"
10-
119
#ifndef INCARIBUS_MAIN_HPP
1210
#define INCARIBUS_MAIN_HPP
1311

14-
class Main : public sw::AScene {
15-
public:
16-
using sw::AScene::AScene;
12+
#include "event/EventInfo.hpp"
1713

18-
void onLoad() override;
19-
void onUpdate() override;
20-
void onUnload() override;
21-
std::string type() const override { return (""); }
14+
class Main{
15+
public:
16+
std::string name() {return ("ye");}
17+
void onLoad(sw::EventInfo& info);
2218
};
2319

2420
#endif //INCARIBUS_MAIN_HPP

includes/scenes/MainFile.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
** Society: Creative Rift
3+
** SHIPWRECK ENGINE, 2021
4+
** Author: Guillaume S.
5+
** File name: Main.hpp
6+
** Description: [CHANGE]
7+
*/
8+
9+
#ifndef INCARIBUS_MAINFILE_HPP
10+
#define INCARIBUS_MAINFILE_HPP
11+
12+
#include "event/EventInfo.hpp"
13+
14+
class MainFile{
15+
public:
16+
std::string name() {return ("ye");}
17+
void onLoad(sw::EventInfo& info);
18+
};
19+
20+
#endif //INCARIBUS_MAINFILE_HPP

includes/script/Background.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef INCARIBUS_BACKGROUND_HPP
1010
#define INCARIBUS_BACKGROUND_HPP
1111

12-
#include "SW/Component.hpp"
12+
#include "components/Components.hpp"
1313
#include "resources/OpenResources.hpp"
1414

1515
namespace inc
@@ -19,7 +19,7 @@ namespace inc
1919
private:
2020
std::string m_texture;
2121
public:
22-
explicit Background(sw::Entity& entity, std::string textureName);
22+
explicit Background(sw::GameObject& gameObject, std::string textureName);
2323
void start();
2424
void update();
2525
}; // class BackGround

0 commit comments

Comments
 (0)