From b1c82fc0458f51760f391199191df82a38580c4e Mon Sep 17 00:00:00 2001 From: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Date: Thu, 30 Sep 2021 10:57:54 -0500 Subject: [PATCH] Updated references to Engine.pak to be lowercase engine.pak (#4397) * Updated references to Engine.pak to be lowercase engine.pak This makes the engine.pak file consistent with naming scheme of other pak files such as assets.pak. It will also help avoid issues with mounting the file on Linux. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Engine.pak now loads correctly in release builds. The check for the file existing was failing in release builds because it was only checking inside packs. OpenPack first checks if the file exists, anyways, so it was safe to remove. Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com> Co-authored-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com> --- .../Application/GameApplication.cpp | 15 ++++++--------- Code/Legacy/CrySystem/SystemInit.cpp | 4 ++-- cmake/Projects.cmake | 6 +++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.cpp b/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.cpp index f759857505..475a7d5504 100644 --- a/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.cpp +++ b/Code/Framework/AzGameFramework/AzGameFramework/Application/GameApplication.cpp @@ -32,17 +32,14 @@ namespace AzGameFramework // at the Assets alias, otherwise to attempting to mount the engine pak // from the Cache folder AZ::IO::FixedMaxPath enginePakPath = AZ::Utils::GetExecutableDirectory(); - enginePakPath /= "Engine.pak"; - if (m_archiveFileIO->Exists(enginePakPath.c_str())) + enginePakPath /= "engine.pak"; + if (!m_archive->OpenPack("@assets@", enginePakPath.Native())) { - m_archive->OpenPack("@assets@", enginePakPath.Native()); - } - else if (enginePakPath.clear(); m_settingsRegistry->Get(enginePakPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) - { - // fall back to checking if there is an Engine.pak in the Asset Cache - enginePakPath /= "Engine.pak"; - if (m_archiveFileIO->Exists(enginePakPath.c_str())) + enginePakPath.clear(); + if (m_settingsRegistry->Get(enginePakPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) { + // fall back to checking Project Cache Root. + enginePakPath /= "engine.pak"; m_archive->OpenPack("@assets@", enginePakPath.Native()); } } diff --git a/Code/Legacy/CrySystem/SystemInit.cpp b/Code/Legacy/CrySystem/SystemInit.cpp index 2c70717e8f..3187095094 100644 --- a/Code/Legacy/CrySystem/SystemInit.cpp +++ b/Code/Legacy/CrySystem/SystemInit.cpp @@ -808,7 +808,7 @@ void CSystem::OpenBasicPaks() const char* const assetsDir = "@assets@"; // After game paks to have same search order as with files on disk - m_env.pCryPak->OpenPack(assetsDir, "Engine.pak"); + m_env.pCryPak->OpenPack(assetsDir, "engine.pak"); #if defined(AZ_RESTRICTED_PLATFORM) #define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_15 @@ -1261,7 +1261,7 @@ AZ_POP_DISABLE_WARNING InlineInitializationProcessing("CSystem::Init Create console"); // Need to load the engine.pak that includes the config files needed during initialization - m_env.pCryPak->OpenPack("@assets@", "Engine.pak"); + m_env.pCryPak->OpenPack("@assets@", "engine.pak"); InitFileSystem_LoadEngineFolders(startupParams); diff --git a/cmake/Projects.cmake b/cmake/Projects.cmake index d3f4b33b03..61cb101909 100644 --- a/cmake/Projects.cmake +++ b/cmake/Projects.cmake @@ -151,18 +151,18 @@ if("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$") if(NOT DEFINED LY_ASSET_DEPLOY_ASSET_TYPE) set(LY_ASSET_DEPLOY_ASSET_TYPE @LY_ASSET_DEPLOY_ASSET_TYPE@) endif() - message(STATUS "Generating ${install_output_folder}/Engine.pak from @full_directory_path@/Cache/${LY_ASSET_DEPLOY_ASSET_TYPE}") + message(STATUS "Generating ${install_output_folder}/engine.pak from @full_directory_path@/Cache/${LY_ASSET_DEPLOY_ASSET_TYPE}") file(MAKE_DIRECTORY "${install_output_folder}") cmake_path(SET cache_product_path "@full_directory_path@/Cache/${LY_ASSET_DEPLOY_ASSET_TYPE}") file(GLOB product_assets "${cache_product_path}/*") if(product_assets) execute_process( - COMMAND ${CMAKE_COMMAND} -E tar "cf" "${install_output_folder}/Engine.pak" --format=zip -- ${product_assets} + COMMAND ${CMAKE_COMMAND} -E tar "cf" "${install_output_folder}/engine.pak" --format=zip -- ${product_assets} WORKING_DIRECTORY "${cache_product_path}" RESULT_VARIABLE archive_creation_result ) if(archive_creation_result EQUAL 0) - message(STATUS "${install_output_folder}/Engine.pak generated") + message(STATUS "${install_output_folder}/engine.pak generated") endif() endif() endif()