Skip to content

Commit e05ef00

Browse files
committed
engine: embed media files '*daemon-client' builtin pak
1 parent 1958b03 commit e05ef00

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,9 @@ if (BUILD_CLIENT)
929929

930930
# Generate GLSL include files.
931931
daemon_embed_files("EngineShaders" "${GLSL_EMBED_DIR}" "${GLSL_EMBED_LIST}" "TEXT" "client-objects")
932+
933+
# Generate media include files.
934+
daemon_embed_files("EngineMedia" "${MEDIA_EMBED_DIR}" "${MEDIA_EMBED_LIST}" "BINARY" "client-objects")
932935
endif()
933936

934937
if (BUILD_SERVER)

src.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ else()
8686
include (${ENGINE_DIR}/renderer/src.cmake)
8787
endif()
8888

89+
set(MEDIA_EMBED_DIR ${ENGINE_DIR}/media)
90+
set(MEDIA_EMBED_LIST
91+
gfx/2d/bigchars.png
92+
scripts/engine.shader
93+
)
94+
8995
set(GLSL_EMBED_DIR "${ENGINE_DIR}/renderer/glsl_source")
9096
set(GLSL_EMBED_LIST
9197
# Common shader libraries
@@ -271,6 +277,8 @@ set(CLIENTBASELIST
271277
)
272278

273279
set(CLIENTLIST
280+
${DAEMON_EMBEDDED_DIR}/EngineMedia.cpp
281+
${DAEMON_EMBEDDED_DIR}/EngineMedia.h
274282
${ENGINE_DIR}/audio/ALObjects.cpp
275283
${ENGINE_DIR}/audio/ALObjects.h
276284
${ENGINE_DIR}/audio/Audio.cpp
File renamed without changes.

src/engine/qcommon/files.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ along with Daemon Source Code. If not, see <http://www.gnu.org/licenses/>.
2727
#include "qcommon.h"
2828
#include "common/Defs.h"
2929

30+
#if defined(BUILD_GRAPHICAL_CLIENT) || defined(BUILD_TTY_CLIENT)
31+
#include "DaemonEmbeddedFiles/EngineMedia.h"
32+
#endif
33+
3034
extern Log::Logger fsLogs;
3135

3236
// There must be some limit for the APIs in this file since they use 'int' for lengths which can be overflowed by large files.
@@ -667,6 +671,10 @@ void FS_LoadBasePak()
667671
{
668672
FS::AddBuiltinPak("daemon", ENGINE_VERSION, engineBasePak);
669673

674+
#if defined(BUILD_GRAPHICAL_CLIENT) || defined(BUILD_TTY_CLIENT)
675+
FS::AddBuiltinPak("daemon-client", ENGINE_VERSION, EngineMedia::FileMap);
676+
#endif
677+
670678
Cmd::Args extrapaks(fs_extrapaks.Get());
671679
for (auto& x: extrapaks) {
672680
if (!FS_LoadPak(x)) {

0 commit comments

Comments
 (0)