Skip to content

Commit 067b2a2

Browse files
committed
!XI sep/Branch_1.3.1 -> sep/master
!T (Documentation) Added GameSDK dll dist diff note for 5.4 DLL not included in engine distro anymore !T (Readme) Added GameSDK dist diff note for 5.4 !T (Documentation) Removed redundant instruction !B (cryproject) Fixed Fullscreen cvar definitions !T (Documentation) Added binary output limitation !B (cryproject) Fixed incorrect binary path in cryproject !R (Documentation) Updated INSTALL.txt to reflect migration to CE5.4 !T (Documentation) Clarified version !T (Documentation) Updated migration notes !F (Cmake) Added missing 'TestPlatform' feature to cmakelists.txt !R (Plugin) Updated for 5.4 Moved Platform Impl to plugin unit Changed to new plugin macro using guid Removed deleted event enums !R (Cmake) Update cmakelists from auto gen !D (Config) Removed redundant SplashExample.cfg file !D (Config) Removed redundant cryplugin.csv !R (Cryproject) Updated cryproject files for CE5.4 Moved all CVARS into cryproject files
1 parent 8b99d93 commit 067b2a2

15 files changed

+187
-163
lines changed

Assets/SplashExample.cfg

-17
This file was deleted.

Code/CMakeLists.txt

+69-83
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,85 @@
1-
# Copyright (c) 2017, uniflare, see LICENSE.txt for details
2-
# Make sure you set these variables appropriately! (If using a host project)
3-
#
4-
set (USE_TEST_PLATFORM_PROJECT "FALSE")
1+
cmake_minimum_required (VERSION 3.6.2)
2+
set(CRYENGINE_DIR "C:/Program Files (x86)/Crytek/CRYENGINE Launcher/Crytek/CRYENGINE_5.4")
3+
set(TOOLS_CMAKE_DIR "${CRYENGINE_DIR}/Tools/CMake")
4+
5+
set(PROJECT_BUILD 1)
6+
set(PROJECT_DIR "C:/dev/git/sf/SplashExample")
7+
8+
include("${TOOLS_CMAKE_DIR}/CommonOptions.cmake")
9+
10+
add_subdirectory("${CRYENGINE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/CRYENGINE")
11+
12+
include("${TOOLS_CMAKE_DIR}/Configure.cmake")
13+
start_sources()
14+
15+
sources_platform(ALL)
16+
add_sources("Code_uber.cpp"
17+
PROJECTS SplashExamplePlugin
18+
SOURCE_GROUP "Root"
19+
"Plugin.cpp"
20+
"SplashExample.cpp"
21+
"StdAfx.cpp"
22+
"cvars.h"
23+
"Plugin.h"
24+
"SplashExample.h"
25+
"StdAfx.h"
26+
)
527

6-
set (TestPlatformRoot "C:/dev/git/sf/BLANKGAME")
7-
set (TestPlatformPath "${TestPlatformRoot}/bin/win_x64")
8-
set (TestPlatformProject "${TestPlatformRoot}/Game.cryproject")
28+
end_sources()
929

10-
# Default to this project, if no test platform project is used
11-
if (NOT USE_TEST_PLATFORM_PROJECT)
12-
set (TestPlatformProject "${PROJECT_FILE}")
13-
endif()
30+
CryEngineModule(SplashExamplePlugin PCH "StdAfx.cpp" SOLUTION_FOLDER "Project")
1431

15-
set (ProjectName "SplashExample")
32+
target_include_directories(${THIS_PROJECT}
33+
PRIVATE
34+
"${CRYENGINE_DIR}/Code/CryEngine/CryCommon"
35+
"${CRYENGINE_DIR}/Code/CryEngine/CryAction"
36+
"${CRYENGINE_DIR}/Code/CryEngine/CrySchematyc/Core/Interface"
37+
"${CRYENGINE_DIR}/Code/CryPlugins/CryDefaultEntities/Module"
38+
)
1639

17-
cmake_minimum_required (VERSION 3.6.0)
18-
project (${ProjectName} VERSION 1.3.0 LANGUAGES CXX)
40+
# Set StartUp project in Visual Studio
1941

20-
if (${CMAKE_GENERATOR} MATCHES "^Visual Studio")
21-
# Set startup project properties
22-
configure_file ("${PROJECT_NAME}.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.vcxproj.user")
23-
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
42+
add_library(GameLauncher STATIC "${CRYENGINE_DIR}/Code/CryEngine/CryCommon/CryCore/Platform/platform.h")
43+
set_target_properties(GameLauncher PROPERTIES LINKER_LANGUAGE CXX)
44+
if (WIN32)
45+
set_visual_studio_debugger_command(GameLauncher "${CRYENGINE_DIR}/bin/win_x64/GameLauncher.exe" "-project \"C:/dev/git/sf/SplashExample/SplashExamplePlugin.cryproject\"")
2446
endif()
2547

26-
# Set output directory for executable files
27-
if(CMAKE_CL_64)
28-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x64")
29-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x64_release")
30-
else(CMAKE_CL_64)
31-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x86")
32-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x86_release")
33-
endif(CMAKE_CL_64)
34-
35-
# Set output directory for DLL files
36-
if(CMAKE_CL_64)
37-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x64")
38-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x64_release")
39-
else(CMAKE_CL_64)
40-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x86")
41-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x86_release")
42-
endif(CMAKE_CL_64)
43-
44-
# Set output directory for LIB files
45-
if(CMAKE_CL_64)
46-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x64\\lib")
47-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x64_release\\lib")
48-
else(CMAKE_CL_64)
49-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x86\\lib")
50-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}\\..\\..\\bin\\win_x86_release\\lib")
51-
endif(CMAKE_CL_64)
52-
53-
option(OPTION_PCH "Enable Precompiled headers" ON)
54-
55-
find_package (CryCommon REQUIRED)
56-
find_package (CryAction REQUIRED)
57-
58-
set (SourceGroup_Main
59-
"SplashExample.cpp"
60-
"SplashExample.h"
61-
"Plugin.cpp"
62-
"Plugin.h"
63-
"CVars.h"
64-
"StdAfx.cpp"
65-
"StdAfx.h"
66-
)
67-
source_group("Main" FILES ${SourceGroup_Main})
48+
add_library(Sandbox STATIC "${CRYENGINE_DIR}/Code/CryEngine/CryCommon/CryCore/Platform/platform.h")
49+
set_target_properties(Sandbox PROPERTIES LINKER_LANGUAGE CXX)
50+
if (WIN32)
51+
set_visual_studio_debugger_command(Sandbox "${CRYENGINE_DIR}/bin/win_x64/Sandbox.exe" "-project \"C:/dev/git/sf/SplashExample/SplashExamplePlugin.cryproject\"")
52+
endif()
6853

69-
set (SOURCE
70-
${SourceGroup_Main}
71-
)
72-
if(OPTION_PCH AND MSVC)
73-
set (PRECOMPILED_SOURCE ${SOURCE})
74-
list(REMOVE_ITEM PRECOMPILED_SOURCE "StdAfx.cpp")
54+
add_library(GameServer STATIC "${CRYENGINE_DIR}/Code/CryEngine/CryCommon/CryCore/Platform/platform.h")
55+
set_target_properties(GameServer PROPERTIES LINKER_LANGUAGE CXX)
56+
if (WIN32)
57+
set_visual_studio_debugger_command(GameServer "${CRYENGINE_DIR}/bin/win_x64/Game_Server.exe" "-project \"C:/dev/git/sf/SplashExample/SplashExamplePlugin.cryproject\"")
58+
endif()
7559

76-
set (PRECOMPILED_BINARY ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pch)
77-
set_source_files_properties (${PRECOMPILED_SOURCE} PROPERTIES COMPILE_FLAGS "/Yu\"StdAfx.h\" /Fp\"${PRECOMPILED_BINARY}\"" OBJECT_DEPENDS "${PRECOMPILED_BINARY}")
78-
set_source_files_properties (StdAfx.cpp PROPERTIES COMPILE_FLAGS "/Yc\"StdAfx.h\" /Fp\"${PRECOMPILED_BINARY}\"" OBJECT_OUTPUTS "${PRECOMPILED_BINARY}")
79-
endif (OPTION_PCH AND MSVC)
60+
set_solution_startup_target(GameLauncher)
8061

81-
add_library(${PROJECT_NAME} MODULE ${SOURCE})
82-
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
83-
target_link_libraries(${PROJECT_NAME} PRIVATE CryCommon CryAction)
62+
if (WIN32)
63+
set_visual_studio_debugger_command( ${THIS_PROJECT} "${CRYENGINE_DIR}/bin/win_x64/GameLauncher.exe" "-project \"C:/dev/git/sf/SplashExample/SplashExamplePlugin.cryproject\"" )
64+
endif()
65+
66+
#BEGIN-CUSTOM
67+
set (USE_TEST_PLATFORM_PROJECT "FALSE")
8468

85-
# Add _RELEASE define to release config
86-
target_compile_definitions(${PROJECT_NAME}
87-
PUBLIC $<$<CONFIG:Release>:_RELEASE>)
69+
set (TestPlatformRoot "C:/dev/git/sf/BLANKGAME/")
70+
set (TestPlatformPath "${TestPlatformRoot}bin/win_x64/")
71+
set (TestPlatformProject "${TestPlatformRoot}Game.cryproject")
8872

89-
if(WIN32)
90-
target_link_libraries(${PROJECT_NAME} PRIVATE Ntdll)
91-
endif(WIN32)
73+
# Default to this project, if no test platform project is used
74+
if (NOT USE_TEST_PLATFORM_PROJECT)
75+
set (TestPlatformProject "${PROJECT_FILE}")
76+
endif()
9277

9378
if(USE_TEST_PLATFORM_PROJECT)
94-
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
79+
add_custom_command(TARGET ${THIS_PROJECT} POST_BUILD
9580
COMMAND "${CMAKE_COMMAND}" -E copy
96-
"$<TARGET_FILE:${PROJECT_NAME}>"
97-
"${TestPlatformPath}/$<TARGET_FILE_NAME:${PROJECT_NAME}>"
81+
"$<TARGET_FILE:${THIS_PROJECT}>"
82+
"${TestPlatformPath}/$<TARGET_FILE_NAME:${THIS_PROJECT}>"
9883
COMMENT "Copying to test platform directory")
99-
endif(USE_TEST_PLATFORM_PROJECT)
84+
endif(USE_TEST_PLATFORM_PROJECT)
85+
#END-CUSTOM

Code/Plugin.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Copyright (c) 2017, uniflare, see LICENSE.txt for details
22

33
#include "StdAfx.h"
4+
5+
// Included only once per DLL module.
6+
#include <CryCore/Platform/platform_impl.inl>
7+
48
#include "Plugin.h"
59

610
///////////////////////////////////////////////////////////////////////////

Code/Plugin.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CPlugin_SplashExample
1818
CSplashExample * m_pSplashExample;
1919
public:
2020
CRYINTERFACE_SIMPLE(ICryPlugin)
21-
CRYGENERATE_SINGLETONCLASS(CPlugin_SplashExample, "Plugin_SplashExample", 0x53706C6173682045, 0x78616D706C650000)
21+
CRYGENERATE_SINGLETONCLASS_GUID(CPlugin_SplashExample, "Plugin_SplashExample", "{ 53706C61 - 7368 - 2045 - 7861 - 6D706C650000 }"_cry_guid)
2222

2323
// ICryPlugin
2424
virtual const char* GetName() const override { return "Splash Example Plugin"; }

Code/SplashExample.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) 2017, uniflare, see LICENSE.txt for details
22

33
#include "StdAfx.h"
4+
45
#include "SplashExample.h"
56

67
#include <CryRenderer/IRenderer.h>

Code/SplashExample.h

-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ EEvent == ESYSTEM_EVENT_BEAM_PLAYER_TO_CAMERA_POS? "ESYSTEM_EVENT_BEAM_PLAYER_TO
7575
EEvent == ESYSTEM_EVENT_CRYSYSTEM_INIT_DONE? "ESYSTEM_EVENT_CRYSYSTEM_INIT_DONE" : \
7676
EEvent == ESYSTEM_EVENT_PRE_RENDERER_INIT? "ESYSTEM_EVENT_PRE_RENDERER_INIT" : \
7777
EEvent == ESYSTEM_EVENT_GAMEWINDOW_ACTIVATE? "ESYSTEM_EVENT_GAMEWINDOW_ACTIVATE" : \
78-
EEvent == ESYSTEM_EVENT_CVAR_REGISTERED? "ESYSTEM_EVENT_CVAR_REGISTERED" : \
79-
EEvent == ESYSTEM_EVENT_CVAR_UNREGISTERED? "ESYSTEM_EVENT_CVAR_UNREGISTERED" : \
8078
EEvent == ESYSTEM_EVENT_REGISTER_FLOWNODES? "ESYSTEM_EVENT_REGISTER_FLOWNODES" : \
8179
EEvent == ESYSTEM_EVENT_CRYSYSTEM_INIT_DONE? "ESYSTEM_EVENT_CRYSYSTEM_INIT_DONE" : \
8280
EEvent == ESYSTEM_EVENT_GAME_FRAMEWORK_INIT_DONE? "ESYSTEM_EVENT_GAME_FRAMEWORK_INIT_DONE" : "UNKNOWN"

Code/StdAfx.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
// Copyright (c) 2017, uniflare, see LICENSE.txt for details
22

3-
#include "StdAfx.h"
4-
5-
// Included only once per DLL module.
6-
#include <CryCore/Platform/platform_impl.inl>
3+
#include "StdAfx.h"

Docs/CONCEPT.txt

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ as well as an overview of the internal implementation details.
3030
- Uses the player profile attributes system to store data for GameSDK compatibility**
3131
- Untested with multi-display single-desktop span configurations. Probably will not work in these cases.
3232
- Initial splash is limited to a minimum size of 512x300, the minimum resolution used by the engine.
33+
- Cannot specify custom dll binary output path for release builds - building from source.
3334

3435
# Initialization
3536
Uses system events to try to determine the earliest point in engine init to init required data

Docs/INSTALL.txt

+14-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Splash Example Plugin
77
Project templates
88

99
# Pre-requisites
10-
CRYENGINE version 5.3.x
10+
CRYENGINE version 5.4.x
1111

1212
1. Compatible and working CRYENGINE installation either,
1313
by the official CRYENGINE Launcher, or
@@ -35,9 +35,14 @@ Splash Example Plugin
3535
|----game.cfg
3636
|----gamedata.cryasset.pak
3737
|----...
38-
4. For best results, copy the contents of the supplied 'Assets/SplashExample.cfg' into your GameZero/GameSDK game.cfg file.
38+
39+
3b. (GameSDK Only)
40+
For 5.4, you will need to copy the GameSDK dll from the sample project to the matcvhing engine folder, eg
41+
C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\gamesdk_5.4\GameSDK\bin\win_x64\CryGameSDK.dll
42+
to
43+
C:\Program Files (x86)\Crytek\CRYENGINE Launcher\Crytek\CRYENGINE_5.4\bin\win_x64\CryGameSDK.dll
3944

40-
5. (Right-Click) Launch Game using one of the provided cryproject files
45+
4. (Right-Click) Launch Game using one of the provided cryproject files
4146
'SplashExamplePlugin_GameZero', or 'SplashExamplePlugin_GameSDK'
4247

4348
Note: By default these projects are set to use the official engine
@@ -46,19 +51,14 @@ Splash Example Plugin
4651
# Installation/Integration into your project
4752

4853
# Using pre-built binary for windows (x64 only)
49-
1. CE 5.3 makes use of cryplugin.csv file to load required plugins for the project,
50-
you must make sure the line from the supplied file is added to the cryplugin.csv
51-
responsible for your desired project.
54+
1. CE 5.4 removes the cryplugin.csv file and takes CVARS in the respective cryproject file,
55+
be sure to copy necessary cvar entries (look to the supplied cryproject files for reference).
5256

5357
2. This package contains custom texture assets that must be bundled with your desired
54-
project assets, a simple 'drag & drop' from `Assets/SplashExample` to
55-
to your `Project/Assets/SplashExample` will suffice.
56-
57-
3. Due to compatiblity reasons with the player profiles manager certain CVARS should
58-
be set in either your system.cfg or game.cfg files in use by your project. To begin,
59-
some example CVARS are provided in the `Assets/SplashExample.cfg` file.
58+
project assets, a simple 'drag & drop' from `Assets/SplashExamplePlugin` to
59+
to your `Project/Assets/SplashExamplePlugin` will suffice.
6060

61-
4. Make sure the binary (SplashExample.dll) is bundled with your own project binary,
61+
3. Make sure the binary (SplashExamplePlugin.dll) is bundled with your own project binary,
6262
this should reside in `Project/bin/win_x64` directory next to any 'Game' dll.
6363

6464
# Building Splash Example from source
@@ -81,4 +81,4 @@ Splash Example Plugin
8181
# WARNING
8282
It is not reccommended to use the "Switch engine version" feature of the cryproject context menu
8383
for moving from or to different engine versions. Rather, only use this feature to swtich between
84-
locally registered engines of the same version, ie, 'Official 5.3.x' and 'Custom Built-From-Source 5.3.x'.
84+
locally registered engines of the same version, ie, 'Official 5.4.x' and 'Custom Built-From-Source 5.4.x'.

Docs/MIGRATION_NOTES.txt

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
Copyright (c) 2017, uniflare, see LICENSE.txt for details
22
Splash Example Plugin
33

4-
Some changes were made during a technical difficulty that resulted in the account associated with this plugin
5-
on the marketplace to remove the submitted project. These changes are more on the technical side although
6-
some further compatibility was ensured for 5.3 GameSDK project and end-user usage of the plugin was
7-
generally made easier.
4+
Since 1.3.0 for 5.3, migration to 5.4 resulted in a new limitation for building from source -
5+
you cannot specify a custom output directory for release builds in the projects cmakelists file.
6+
Yet, inherited the more robust and compatible cmake system from 5.4. Minor tweaks to code base.
87

98
# Usage differences
10-
1. The project now comes with two test projects that use GameZero/GameSDK as "Host" projects.
11-
2. Further documentation was added in 'Docs' folder.
9+
1. CVARS are now put into the respective cryproject files. (No more .cfg editing).
10+
2. Necessary data from cryplugin.csv moved into respective cryproject files., csv deleted.
11+
3. Renamed DLL name.
1212

1313
# Technical changes
1414
*Some things may be missed, check github commits for more detailed information.
1515

16-
1. The TestPlatform feature from the cmakelists file was defaulted to disabled to
17-
prevent unwanted folders being created when building from source.
16+
No significant technical differences.

SplashExamplePlugin.cryproject

+22-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
{
2+
"version": 1,
3+
"type": "CRYENGINE Project",
4+
"info": { "name": "Splash Example Plugin" },
25
"content": {
3-
"assets": [
4-
"Assets"
5-
],
6-
"code": [
7-
"Code"
8-
]
9-
},
10-
"info": {
11-
"name": "Splash Example Plugin"
6+
"assets": [ "Assets" ],
7+
"code": [ "Code" ]
128
},
139
"require": {
14-
"engine": "engine-5.3"
15-
}
10+
"engine": "engine-5.4",
11+
"plugins": [
12+
{ "type": "EPluginType::Native", "path": "bin/win_x64/SplashExamplePlugin" }
13+
]
14+
},
15+
"console_variables": [
16+
{ "name": "splash_show", "value": "1" },
17+
{ "name": "splash_minimumPlaybackTime", "value": "3.0" },
18+
{ "name": "splash_show_initial", "value": "1" },
19+
{ "name": "splash_minimumPlaybackTime_initial", "value": "3.0" },
20+
{ "name": "splash_texture", "value": "SplashExample/textures/Splash.dds" },
21+
{ "name": "splash_texture_initial", "value": "SplashExample/textures/InitialSplash.dds" },
22+
{ "name": "r_width", "value": "512" },
23+
{ "name": "r_height", "value": "300" },
24+
{ "name": "r_fullscreenwindow", "value": "1" },
25+
{ "name": "r_fullscreen", "value": "0" }
26+
]
1627
}

0 commit comments

Comments
 (0)