Skip to content

Commit 376614a

Browse files
timfoxcursoragent
andauthored
Flux (#12)
* Add FLUX.2 image generation support and texture reload functionality - Introduced a new CMake option `USE_FLUX` to enable FLUX.2 image generation. - Updated `CMakeLists.txt` to conditionally include the cflux2 library based on the new option. - Added FLUX-related cvars and commands in `cl_main.c` for image generation control. - Implemented `R_ReloadTexture` function in both OpenGL and Vulkan renderers to reload textures from disk. - Enhanced documentation in `README.md` to include details about FLUX.2 image generation features and usage. - Updated renderer initialization to support texture reload functionality across both OpenGL and Vulkan backends. * Update README.md and cl_main.c for FLUX model variant support - Enhanced README.md to clarify FLUX.2 and FLUX.1 image generation options, including support for different model variants. - Modified cl_main.c to implement separate directories for FLUX model variants, improving organization and clarity in model path handling. - Updated default FLUX model variant to "flux1-schnell" for better user experience. * Add file existence check and improve FLUX model path handling - Introduced a helper function `CL_FluxFileExists` to verify the existence of model files, enhancing error handling for model loading. - Updated the logic in `CL_FluxGetModelPath` to check for the presence of the "flux2-dev" directory before falling back to the default "flux" directory, improving user experience and clarity. - Enhanced asynchronous job initialization in `CL_FluxGenerate_f` to ensure all parameters are set before marking the job as running, preventing potential race conditions. - Added warnings for missing FLUX.1 model files, guiding users to download them manually or switch to FLUX.2 if necessary. * Add external FLUX CLI support and enhance error handling - Implemented logic in `compile_engine.sh` to copy the `flux_cli` executable from the build directory to the release directory, improving deployment ease. - Introduced new cvars in `cl_main.c` for external FLUX generation, allowing users to choose between in-process and external CLI execution, enhancing stability. - Added helper functions for shell argument escaping and CLI path finding, improving command execution reliability. - Enhanced error handling in the FLUX generation process to provide clearer feedback on failures, improving user experience. * Add cflux2 source management to build workflow - Introduced a new step in the GitHub Actions workflow to ensure the cflux2 sources are available by cloning the repository if the directory does not exist. - This addition enhances the build process by automating the retrieval of necessary external dependencies, improving build reliability and consistency. * Remove cflux2 source management steps from build workflow - Eliminated redundant steps in the GitHub Actions workflow that ensured the availability of cflux2 sources by cloning the repository. This streamlines the build process and reduces unnecessary checks, as the sources are now assumed to be managed externally. * Add cflux2 subproject as a Git submodule - Introduced cflux2 as a new subproject, allowing for better management of external dependencies within the build system. This addition enhances the overall structure and maintainability of the project. * Refactor GitHub Actions workflow to remove submodule checkout steps - Eliminated redundant `submodules: recursive` options from the `actions/checkout@v4` steps in the build workflow. This streamlines the workflow by assuming that submodules are managed externally, improving build efficiency. * add cflux2 sources Co-authored-by: Cursor <cursoragent@cursor.com> * skip flux build on Windows Co-authored-by: Cursor <cursoragent@cursor.com> * Add SDL2 include and library paths to build workflow - Updated the GitHub Actions build workflow to include SDL2 include and library paths, enhancing the configuration for projects that depend on SDL2. This change improves build accuracy and ensures that the necessary SDL2 resources are correctly referenced during the build process. * Implement platform-specific memory mapping and file handling in safetensors - Added Windows-specific file handling and memory mapping functions in `flux_safetensors.c` to support proper file operations on Windows systems. - Introduced a new `safetensors_get_file_size` function for improved file size retrieval. - Updated `safetensors_open` to handle file opening and memory mapping differently based on the platform, enhancing cross-platform compatibility. - Modified `safetensors_file_t` structure to include handles for Windows-specific file management. * Refactor cflux2 build conditions in CMakeLists.txt - Updated the CMake configuration to always include the cflux2 subdirectory when USE_FLUX is enabled, removing the previous Windows-specific skip condition. - Adjusted the linking of the cflux2 library to ensure it is only linked if the target exists, improving build robustness. * Update CMakeLists.txt to use PRIVATE linkage for libraries - Changed the linking of libraries in the CMake configuration to use PRIVATE visibility for qcommon, botlib, client, q3ui, OpenAL, and Vulkan/OpenGL. This improves encapsulation and ensures that these dependencies are not exposed to other targets, enhancing build integrity. * Update CMakeLists.txt to enforce PRIVATE linkage for additional libraries - Modified the CMake configuration to apply PRIVATE visibility for libraries linked to both the dedicated server and client executables, including qcommon, botlib, winmm, comctl32, ws2_32, and m. This change enhances encapsulation and ensures that these dependencies are not exposed to other targets, improving build integrity. * Refactor memory mapping and cleanup in safetensors - Renamed the memory mapping function to `safetensors_mmap_fd` for clarity and updated the handling of file size to use a 64-bit integer for compatibility. - Introduced a new `safetensors_unmap` function to centralize unmapping and resource cleanup, improving code maintainability. - Updated `safetensors_open` and `safetensors_close` to utilize the new unmap function, ensuring proper resource management across platforms. * Enhance build configuration and code quality - Updated the GitHub Actions build workflow to include the `-DCI_BUILD=OFF` flag for all CMake build commands, ensuring consistent behavior across different build types. - Improved type safety in Vulkan renderer by casting size comparisons to `size_t` in `vk_vbo.c`, preventing potential overflow issues. - Added clang diagnostic pragmas in `vm_aarch64.c` to suppress specific warnings, enhancing code clarity and maintainability. - Refined conditional checks in `tr_world.c` to ensure proper type comparison for node contents, improving code robustness. * Enhance CMake configuration and error handling - Added SDL2::Core linkage and include directories for the client target in CMake, improving dependency management. - Updated error messages in `flux.c` to limit the length of file paths displayed, enhancing clarity and preventing potential overflow issues. - Improved file handling in `terminals.c` for Windows compatibility by conditionally using `mkstemp`, ensuring consistent behavior across platforms. - Refactored type handling in `tr_surface.c`, `tr_vbo.c`, and `tr_world.c` to improve code safety and maintainability by using appropriate type casts and const qualifiers. * Refactor CMake configuration and client code for SDL2 compatibility - Enhanced CMakeLists.txt to conditionally include SDL2 directories based on availability, improving flexibility in build configurations. - Added a static variable in cl_curl.c to prevent unused variable warnings when CURL is not used. - Initialized jpeg_decompress_struct in cl_jpeg.c to zero for better safety. - Updated cl_main.c to handle SDL thread management conditionally, ensuring proper cleanup and error handling in flux operations. * Refactor error handling and code quality improvements - Updated error messages in `flux.c` to shorten file path displays, enhancing clarity and preventing overflow issues. - Changed static variable declaration to an enum in `cl_curl.c` for better type safety when CURL is not used. - Added MSVC-specific pragmas in `psy.c` and `vorbisfile.c` to suppress warnings, improving code maintainability. - Marked several functions in `vm_x86.c` as unused to prevent compiler warnings, enhancing code cleanliness. * Enhance flux generation and CMake configuration - Added conditional compilation for SDL support in `cl_main.c`, improving thread management for flux generation. - Updated parameter logging in `CL_FluxGenerationThread` to use `long long` for seed values, enhancing precision. - Modified CMakeLists.txt to improve shader header generation command and suppress specific compiler warnings for better compatibility across compilers. - Added unused parameter suppression in JPEG handling files to clean up warnings and improve code quality. * Add unused parameter suppression in JPEG and OGG codec files * Refactor OGG codec and enhance flux CLI build configuration - Changed the static variable declaration in `snd_codec_ogg.c` to an enum for better type safety. - Updated `CMakeLists.txt` for `flux_cli` to conditionally include `linenoise.c` based on the platform, improving compatibility. - Added custom `linenoise` implementation in `flux_cli.c` when `FLUX_CLI_NO_LINENOISE` is defined, enhancing flexibility in command line input handling. - Improved type safety in `win_syscon.c` by casting buffer lengths to `size_t`, preventing potential overflow issues. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 29dc88b commit 376614a

94 files changed

Lines changed: 31970 additions & 91 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.

.github/workflows/build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ jobs:
5555
cache: false
5656

5757
- uses: actions/checkout@v4
58-
with:
59-
submodules: recursive
6058

6159
- name: Build Vulkan
6260
if: ${{ github.event_name != 'release' || matrix.btype != 'Debug' }} # skip Debug configuration in Release build
@@ -66,6 +64,7 @@ jobs:
6664
mkdir -p build-vk-${{ matrix.btype }}
6765
cmake -S . -B build-vk-${{ matrix.btype }} -G Ninja \
6866
-DCMAKE_BUILD_TYPE=${{ matrix.btype }} \
67+
-DCI_BUILD=OFF \
6968
-DUSE_STB_TRUETYPE=ON \
7069
-DBUILD_FREETYPE=ON \
7170
-DENABLE_FORTIFY_SOURCE=OFF \
@@ -87,6 +86,7 @@ jobs:
8786
mkdir -p build-gl-${{ matrix.btype }}
8887
cmake -S . -B build-gl-${{ matrix.btype }} -G Ninja \
8988
-DCMAKE_BUILD_TYPE=${{ matrix.btype }} \
89+
-DCI_BUILD=OFF \
9090
-DUSE_STB_TRUETYPE=ON \
9191
-DBUILD_FREETYPE=ON \
9292
-DENABLE_FORTIFY_SOURCE=OFF \
@@ -137,8 +137,6 @@ jobs:
137137
- uses: microsoft/setup-msbuild@v2
138138

139139
- uses: actions/checkout@v4
140-
with:
141-
submodules: recursive
142140

143141
- name: Build
144142
if: ${{ github.event_name != 'release' || matrix.btype != 'Debug' }} # skip Debug configuration in Release build
@@ -201,8 +199,6 @@ jobs:
201199
fi
202200
203201
- uses: actions/checkout@v4
204-
with:
205-
submodules: recursive
206202

207203
- name: Build Vulkan
208204
if: ${{ github.event_name != 'release' || matrix.btype != 'Debug' }} # skip in Release builds
@@ -213,6 +209,7 @@ jobs:
213209
mkdir -p build-vk-${{ matrix.btype }}
214210
cmake -S . -B build-vk-${{ matrix.btype }} \
215211
-DCMAKE_BUILD_TYPE=${{ matrix.btype }} \
212+
-DCI_BUILD=OFF \
216213
-DUSE_STB_TRUETYPE=ON \
217214
-DBUILD_FREETYPE=ON \
218215
-DBUILD_FREETYPE=ON \
@@ -236,6 +233,7 @@ jobs:
236233
mkdir -p build-gl-${{ matrix.btype }}
237234
cmake -S . -B build-gl-${{ matrix.btype }} \
238235
-DCMAKE_BUILD_TYPE=${{ matrix.btype }} \
236+
-DCI_BUILD=OFF \
239237
-DUSE_STB_TRUETYPE=ON \
240238
-DBUILD_FREETYPE=ON \
241239
-DBUILD_FREETYPE=ON \
@@ -277,8 +275,6 @@ jobs:
277275

278276
- uses: actions/checkout@v4
279277
if: false
280-
with:
281-
submodules: recursive
282278

283279
- name: Build ${{ matrix.arch }}
284280
#if: ${{ github.event_name != 'release' || matrix.btype != 'Debug' }} # skip Debug configuration in Release build
@@ -328,8 +324,6 @@ jobs:
328324
sudo apt-get -y install libcurl4-openssl-dev mesa-common-dev libxxf86dga-dev libxrandr-dev libxxf86vm-dev libasound-dev libsdl2-dev libopenal-dev libfreetype6-dev
329325
330326
- uses: actions/checkout@v4
331-
with:
332-
submodules: recursive
333327

334328
- name: Build Vulkan
335329
if: ${{ github.event_name != 'release' || matrix.btype != 'Debug' }} # skip Debug configuration in Release build
@@ -339,6 +333,7 @@ jobs:
339333
mkdir -p build-vk-${{ matrix.btype }}
340334
cmake -S . -B build-vk-${{ matrix.btype }} \
341335
-DCMAKE_BUILD_TYPE=${{ matrix.btype }} \
336+
-DCI_BUILD=OFF \
342337
-DUSE_STB_TRUETYPE=ON \
343338
-DENABLE_FORTIFY_SOURCE=OFF \
344339
-DENABLE_ASAN=OFF \
@@ -359,6 +354,7 @@ jobs:
359354
mkdir -p build-gl-${{ matrix.btype }}
360355
cmake -S . -B build-gl-${{ matrix.btype }} \
361356
-DCMAKE_BUILD_TYPE=${{ matrix.btype }} \
357+
-DCI_BUILD=OFF \
362358
-DUSE_STB_TRUETYPE=ON \
363359
-DENABLE_FORTIFY_SOURCE=OFF \
364360
-DENABLE_ASAN=OFF \
@@ -396,8 +392,6 @@ jobs:
396392
run: brew install coreutils sdl2 openal-soft cmake ninja freetype
397393

398394
- uses: actions/checkout@v4
399-
with:
400-
submodules: recursive
401395

402396
- name: Build Vulkan
403397
if: ${{ github.event_name != 'release' || matrix.btype != 'Debug' }} # skip Debug configuration in Release build
@@ -410,8 +404,11 @@ jobs:
410404
mkdir -p build-vk-${{ matrix.btype }}
411405
cmake -S . -B build-vk-${{ matrix.btype }} \
412406
-DCMAKE_BUILD_TYPE=${{ matrix.btype }} \
407+
-DCI_BUILD=OFF \
413408
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }} \
414409
-DSDL2_PATH="${SDL2_PREFIX}" \
410+
-DSDL2_INCLUDE_DIR="${SDL2_PREFIX}/include" \
411+
-DSDL2_LIBRARY="${SDL2_PREFIX}/lib/libSDL2.dylib" \
415412
-DOPENAL_INCLUDE_DIR="${OPENAL_PREFIX}/include" \
416413
-DOPENAL_LIBRARY="${OPENAL_PREFIX}/lib/libopenal.dylib" \
417414
-DUSE_STB_TRUETYPE=ON \
@@ -440,8 +437,11 @@ jobs:
440437
mkdir -p build-gl-${{ matrix.btype }}
441438
cmake -S . -B build-gl-${{ matrix.btype }} \
442439
-DCMAKE_BUILD_TYPE=${{ matrix.btype }} \
440+
-DCI_BUILD=OFF \
443441
-DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch == 'aarch64' && 'arm64' || matrix.arch }} \
444442
-DSDL2_PATH="${SDL2_PREFIX}" \
443+
-DSDL2_INCLUDE_DIR="${SDL2_PREFIX}/include" \
444+
-DSDL2_LIBRARY="${SDL2_PREFIX}/lib/libSDL2.dylib" \
445445
-DOPENAL_INCLUDE_DIR="${OPENAL_PREFIX}/include" \
446446
-DOPENAL_LIBRARY="${OPENAL_PREFIX}/lib/libopenal.dylib" \
447447
-DUSE_STB_TRUETYPE=ON \

CMakeLists.txt

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(CMAKE_C_EXTENSIONS OFF)
88

99
option(C_STANDARD_STRICT "Enable the stricter warning set for engine builds" ON)
1010
option(CI_BUILD "Enable CI-specific behaviors such as warnings-as-errors" OFF)
11+
option(USE_FLUX "Enable FLUX.2 image generation support" ON)
1112

1213
if(C_STANDARD_STRICT)
1314
if(MSVC)
@@ -175,7 +176,7 @@ OPTION(USE_MP3 "Enable MP3 codec support" ON)
175176
OPTION(USE_SYSTEM_JPEG "" OFF)
176177
OPTION(USE_RENDERER_DLOPEN "" ON)
177178
OPTION(SKIP_IDPAK_CHECK "Skip checking for original Quake III pak files (pak0.pk3)" ON)
178-
OPTION(BUILD_FREETYPE "Enable FreeType-powered font rendering / font generation" OFF)
179+
OPTION(BUILD_FREETYPE "Enable FreeType-powered font rendering / font generation" ON)
179180

180181
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
181182

@@ -186,6 +187,11 @@ set(EXTERNAL_SDL_INCLUDE_DIR "${EXTERNAL_SRC}/sdl/include/SDL2")
186187
set(EXTERNAL_CURL_WINDOWS_INCLUDE_DIR "${EXTERNAL_SRC}/curl/windows/include")
187188
set(EXTERNAL_JPEG_SRC_DIR "${EXTERNAL_SRC}/jpeg")
188189

190+
# Add cflux2 external library
191+
if(USE_FLUX)
192+
add_subdirectory(src/external/src/cflux2)
193+
endif()
194+
189195
if(BUILD_FREETYPE)
190196
find_package(Freetype REQUIRED)
191197
add_library(idtech3_freetype INTERFACE)
@@ -307,22 +313,39 @@ IF(USE_SYSTEM_JPEG)
307313
ADD_LIBRARY(client OBJECT ${CLIENT_SRCS})
308314
find_package(JPEG REQUIRED)
309315
TARGET_COMPILE_DEFINITIONS(client PRIVATE -DUSE_SYSTEM_JPEG)
316+
if(USE_FLUX)
317+
TARGET_COMPILE_DEFINITIONS(client PRIVATE USE_FLUX)
318+
target_include_directories(client PRIVATE ${EXTERNAL_ROOT}/src/cflux2)
319+
endif()
310320
TARGET_LINK_LIBRARIES(client ${JPEG_LIBRARIES})
311321
ELSE()
312322
AUX_SOURCE_DIRECTORY(${EXTERNAL_JPEG_SRC_DIR} JPEG_SRCS)
313323
#ADD_LIBRARY(jpeg ${JPEG_SRCS})
314324
#TARGET_LINK_LIBRARIES(client jpeg)
315325
ADD_LIBRARY(client OBJECT ${CLIENT_SRCS} ${JPEG_SRCS})
326+
if(USE_FLUX)
327+
TARGET_COMPILE_DEFINITIONS(client PRIVATE USE_FLUX)
328+
target_include_directories(client PRIVATE ${EXTERNAL_ROOT}/src/cflux2)
329+
endif()
316330
# Ensure client can find qcommon headers needed by some client-side modules (eg. mp3)
317331
target_include_directories(client PRIVATE ${CMAKE_SOURCE_DIR}/src/qcommon ${EXTERNAL_JPEG_SRC_DIR})
318332
ENDIF()
319333

320334
# renderers
321-
AUX_SOURCE_DIRECTORY(src/renderers/rendercommon RENDERER_COMMON_SRCS)
335+
set(RENDERER_COMMON_SRCS
336+
src/renderers/rendercommon/tr_font_stub.c # placeholder, will be replaced below
337+
src/renderers/rendercommon/tr_image_bmp.c
338+
src/renderers/rendercommon/tr_image_jpg.c
339+
src/renderers/rendercommon/tr_image_pcx.c
340+
src/renderers/rendercommon/tr_image_png.c
341+
src/renderers/rendercommon/tr_image_tga.c
342+
src/renderers/rendercommon/tr_noise.c
343+
)
322344
IF(BUILD_FREETYPE)
345+
list(REMOVE_ITEM RENDERER_COMMON_SRCS src/renderers/rendercommon/tr_font_stub.c)
323346
list(APPEND RENDERER_COMMON_SRCS src/renderers/rendercommon/tr_font.c)
324347
ELSE()
325-
list(APPEND RENDERER_COMMON_SRCS src/renderers/rendercommon/tr_font_stub.c)
348+
# Keep tr_font_stub.c
326349
ENDIF()
327350
AUX_SOURCE_DIRECTORY(src/renderers/openglrenderer RENDERER_GL_SRCS)
328351
AUX_SOURCE_DIRECTORY(src/renderers/vulkanrenderer RENDERER_VK_SRCS)
@@ -466,6 +489,12 @@ IF(NOT MSVC)
466489
message(FATAL_ERROR "SDL2 could not be found. Please install or set SDL2_DIR/SDL2_PATH.")
467490
endif()
468491
TARGET_LINK_LIBRARIES(q3ui SDL2::Main)
492+
TARGET_LINK_LIBRARIES(client PRIVATE SDL2::Core)
493+
if(SDL2_INCLUDE_DIRS)
494+
target_include_directories(client PRIVATE ${SDL2_INCLUDE_DIRS})
495+
elseif(SDL2_INCLUDE_DIR)
496+
target_include_directories(client PRIVATE ${SDL2_INCLUDE_DIR})
497+
endif()
469498
ELSEIF(UNIX)
470499
find_package (X11 REQUIRED)
471500
TARGET_LINK_LIBRARIES(q3ui ${X11_LIBRARIES})
@@ -505,10 +534,16 @@ endif()
505534
# client executable
506535

507536
ADD_EXECUTABLE(${CNAME}${BINEXT} ${EXE_TYPE} ${Q3_SRCS})
508-
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} qcommon botlib client q3ui)
537+
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} PRIVATE qcommon botlib client q3ui)
538+
if(USE_FLUX)
539+
TARGET_COMPILE_DEFINITIONS(${CNAME}${BINEXT} PRIVATE USE_FLUX)
540+
if(TARGET cflux2)
541+
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} PRIVATE cflux2)
542+
endif()
543+
endif()
509544
# Link OpenAL only when enabled
510545
IF(USE_OPENAL)
511-
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} OpenAL::OpenAL)
546+
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} PRIVATE OpenAL::OpenAL)
512547
ENDIF()
513548
#TARGET_LINK_OPTIONS(${CNAME} PRIVATE -fno-pie) # v3.13+
514549

@@ -520,26 +555,26 @@ endif()
520555

521556
IF(NOT USE_RENDERER_DLOPEN)
522557
IF(USE_VULKAN)
523-
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} ${RENDERER_PREFIX}_vulkan)
558+
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} PRIVATE ${RENDERER_PREFIX}_vulkan)
524559
ELSE()
525-
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} ${RENDERER_PREFIX}_opengl)
560+
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} PRIVATE ${RENDERER_PREFIX}_opengl)
526561
ENDIF()
527562
ENDIF()
528563

529564
# dedicated server executable
530565

531566
ADD_EXECUTABLE(${DNAME}${BINEXT} ${EXE_TYPE} ${Q3_SRCS})
532-
TARGET_LINK_LIBRARIES(${DNAME}${BINEXT} qcommon_ded botlib)
567+
TARGET_LINK_LIBRARIES(${DNAME}${BINEXT} PRIVATE qcommon_ded botlib)
533568
#TARGET_LINK_OPTIONS(${DNAME} PRIVATE -fno-pie) # v3.13+
534569

535570
if(UNIX AND NOT MSVC AND NOT APPLE)
536571
target_link_options(${DNAME}${BINEXT} PRIVATE "-Wl,--export-dynamic")
537572
endif()
538573

539574
IF(WIN32)
540-
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} winmm comctl32 ws2_32)
541-
TARGET_LINK_LIBRARIES(${DNAME}${BINEXT} winmm comctl32 ws2_32)
575+
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} PRIVATE winmm comctl32 ws2_32)
576+
TARGET_LINK_LIBRARIES(${DNAME}${BINEXT} PRIVATE winmm comctl32 ws2_32)
542577
ELSE()
543-
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} m ${CMAKE_DL_LIBS})
544-
TARGET_LINK_LIBRARIES(${DNAME}${BINEXT} m ${CMAKE_DL_LIBS})
578+
TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} PRIVATE m ${CMAKE_DL_LIBS})
579+
TARGET_LINK_LIBRARIES(${DNAME}${BINEXT} PRIVATE m ${CMAKE_DL_LIBS})
545580
ENDIF()

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ Go to [Releases](../../releases) section to download latest binaries for your pl
1313
**Rendering**:
1414
* OpenGL renderer
1515
* Vulkan renderer
16-
* Physical Based Rendering
16+
* Physically Based Rendering
17+
18+
**Image Generation**:
19+
* FLUX.2/FLUX.1 C image generation (optional, text-to-image from console with **real-time hot-reloading** and device selection; supports flux1-schnell/fast, flux1-dev/balanced, flux2-dev/high-quality variants; requires model files in game directory; Metal, BLAS, or pure C backend, with graceful fallback)
1720

1821
**Audio**:
19-
* OpenAL backend with HRTF for true 3D positional audio.
20-
* Heuristic acoustics: real-time reverb/occlusion using OpenAL EFX.
22+
* OpenAL backend with HRTF for 3D positional audio
23+
* Heuristic acoustics: real-time reverb/occlusion using OpenAL EFX
2124

2225
### Standards
2326

2427
- Engine code targets **C23**, with incremental modernization for safety and portability.
2528
- Engine-internal code prefers native C `bool`; legacy `qboolean` is retained where required for compatibility.
2629

30+
2731
### Links
2832

2933
* https://idtech3.com
30-
* https://bitbucket.org/CPMADevs/cnq3
31-
* https://github.com/ioquake/ioq3
32-
* https://github.com/kennyalive/Quake-III-Arena-Kenny-Edition
3334
* https://github.com/jksunny/quake3e
34-
* https://github.com/OpenArena/engine

scripts/compile_engine.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,19 @@ for sofile in "$BUILD_DIR"/idtech3_*_*.so; do
186186
done
187187
shopt -u nullglob
188188

189+
# FLUX CLI helper (external generation)
190+
if [ -f "$BUILD_DIR/flux_cli" ]; then
191+
cp -f "$BUILD_DIR/flux_cli" "$RELEASE_DIR/flux_cli"
192+
echo "Copied flux_cli -> $RELEASE_DIR/flux_cli"
193+
elif [ -f "$BUILD_DIR/src/external/src/cflux2/flux_cli" ]; then
194+
cp -f "$BUILD_DIR/src/external/src/cflux2/flux_cli" "$RELEASE_DIR/flux_cli"
195+
echo "Copied flux_cli -> $RELEASE_DIR/flux_cli"
196+
fi
197+
if [ -f "$BUILD_DIR/flux_cli.x86_64" ]; then
198+
cp -f "$BUILD_DIR/flux_cli.x86_64" "$RELEASE_DIR/flux_cli.x86_64"
199+
echo "Copied flux_cli -> $RELEASE_DIR/flux_cli.x86_64"
200+
fi
201+
189202
# ImGui shared
190203
if [ -f "$BUILD_DIR/libimgui_shared.so" ]; then
191204
cp -f "$BUILD_DIR/libimgui_shared.so" "$RELEASE_DIR/"

src/client/cl_curl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,3 +1147,7 @@ qboolean Com_DL_Perform( download_t *dl )
11471147
}
11481148

11491149
#endif /* USE_CURL */
1150+
1151+
#ifndef USE_CURL
1152+
enum { cl_curl_unused = 0 };
1153+
#endif

src/client/cl_jpeg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void CL_LoadJPG( const char *filename, unsigned char **pic, int *width, int *hei
8484
/* This struct contains the JPEG decompression parameters and pointers to
8585
* working space (which is allocated as needed by the JPEG library).
8686
*/
87-
struct jpeg_decompress_struct cinfo = {NULL};
87+
struct jpeg_decompress_struct cinfo = {0};
8888
/* We use our private extension JPEG error handler.
8989
* Note that this struct must live as long as the main JPEG parameter
9090
* struct, to avoid dangling-pointer problems.

0 commit comments

Comments
 (0)