├── libs ├── .gitattributes ├── unifont │ └── unifont.otf ├── nacl │ └── native_client │ │ └── src │ │ ├── shared │ │ ├── platform │ │ │ ├── nacl_log.h │ │ │ └── nacl_check.h │ │ └── imc │ │ │ └── nacl_imc_common.cc │ │ ├── trusted │ │ └── service_runtime │ │ │ └── include │ │ │ ├── sys │ │ │ ├── nacl_kernel_service.h │ │ │ ├── nacl_nice.h │ │ │ ├── nacl_test_crash.h │ │ │ ├── nacl_list_mappings.h │ │ │ ├── mman.h │ │ │ ├── time.h │ │ │ ├── dirent.h │ │ │ └── stat.h │ │ │ └── bits │ │ │ ├── limits.h │ │ │ ├── wordsize.h │ │ │ └── mman.h │ │ ├── untrusted │ │ └── nacl │ │ │ ├── imc_accept.c │ │ │ ├── imc_connect.c │ │ │ ├── imc_makeboundsock.c │ │ │ ├── imc_mem_obj_create.c │ │ │ ├── imc_socketpair.c │ │ │ ├── imc_recvmsg.c │ │ │ └── imc_sendmsg.c │ │ ├── include │ │ ├── elf_auxv.h │ │ ├── nacl_platform.h │ │ ├── portability_sockets.h │ │ ├── win │ │ │ └── mman.h │ │ ├── gcc │ │ │ └── atomic_ops.h │ │ ├── nacl_asm.h │ │ ├── portability_io.h │ │ ├── nacl_string.h │ │ ├── portability_process.h │ │ ├── portability_string.h │ │ ├── arm_sandbox.h │ │ └── nacl │ │ │ └── nacl_minidump.h │ │ └── public │ │ └── secure_service.h ├── findlocale │ ├── VERSION │ ├── README.findlocale │ ├── findlocale.h │ └── LICENSE └── mumblelink │ └── libmumblelink.h ├── pkg ├── testdata_src.dpkdir │ ├── TEst1.txt │ └── maps │ │ └── plat23_1.13.4.bsp ├── testdpk_src.dpk └── daemon_src.dpkdir │ └── scripts │ └── engine.shader ├── src ├── engine │ ├── renderer-vulkan │ │ └── src.cmake │ ├── sys │ │ ├── README.md │ │ ├── windows-resource │ │ │ ├── unvanquished.ico │ │ │ ├── icon.rc │ │ │ ├── manifest.rc │ │ │ └── supported-os.manifest │ │ ├── con_common.h │ │ ├── DisableAccentMenu.m │ │ └── con_passive.cpp │ ├── crash_server │ │ └── README.md │ ├── qcommon │ │ ├── README.md │ │ ├── crypto.cpp │ │ ├── q_unicode.h │ │ ├── crypto.h │ │ ├── sys.h │ │ └── net_types.h │ ├── renderer │ │ ├── .gitignore │ │ ├── glsl_source │ │ │ ├── README.md │ │ │ ├── skybox_vp.glsl │ │ │ ├── screen_vp.glsl │ │ │ ├── screen_fp.glsl │ │ │ ├── portal_fp.glsl │ │ │ ├── portal_vp.glsl │ │ │ ├── fogQuake3_fp.glsl │ │ │ ├── fogGlobal_fp.glsl │ │ │ ├── blur_fp.glsl │ │ │ ├── lighttile_vp.glsl │ │ │ ├── material_vp.glsl │ │ │ ├── fogEquation_fp.glsl │ │ │ ├── motionblur_fp.glsl │ │ │ ├── contrast_fp.glsl │ │ │ ├── vertexSimple_vp.glsl │ │ │ ├── liquid_vp.glsl │ │ │ ├── screenSpace_vp.glsl │ │ │ ├── heatHaze_fp.glsl │ │ │ ├── depthtile1_vp.glsl │ │ │ ├── shaderProfiler_vp.glsl │ │ │ ├── material_cp.glsl │ │ │ ├── clearSurfaces_cp.glsl │ │ │ ├── depthtile2_fp.glsl │ │ │ ├── vertexAnimation_vp.glsl │ │ │ ├── fogQuake3_vp.glsl │ │ │ └── reflection_CB_fp.glsl │ │ ├── tr_model_skel.h │ │ ├── tr_image.h │ │ ├── InternalImage.h │ │ ├── tr_image_webp.cpp │ │ ├── BufferBind.h │ │ ├── iqm.h │ │ └── TextureManager.h │ ├── framework │ │ ├── README.md │ │ ├── System.h │ │ ├── BaseCommands.h │ │ ├── CrashDump.h │ │ ├── ConsoleField.h │ │ ├── Resource.cpp │ │ └── CommandBufferHost.h │ ├── README.md │ ├── server │ │ └── README.md │ ├── null │ │ ├── README.md │ │ ├── null_input.cpp │ │ └── null_client.cpp │ ├── audio │ │ ├── SoundCodec.h │ │ └── AudioData.h │ ├── botlib │ │ └── bot_debug.h │ └── client │ │ └── key_identification.h ├── shared │ ├── README.md │ └── VMMain.h ├── common │ ├── README.md │ ├── IPC │ │ └── README.md │ ├── cm │ │ ├── README.md │ │ └── cm_polylib.h │ ├── Type.h │ ├── Common.h │ ├── Util.cpp │ └── ColorTest.cpp └── dummygame │ └── CMakeLists.txt ├── GPL.txt ├── cmake ├── DaemonCompiler │ ├── DaemonCompiler.cpp │ └── DaemonCompiler.sh ├── FindNettle.cmake ├── cross-toolchain-mingw32.cmake ├── cross-toolchain-mingw64.cmake ├── FindGMP.cmake ├── DaemonFileEmbedder.cmake ├── FindWasmtime.cmake ├── DaemonPlatform.cmake ├── DaemonBuildTypeGeneratorExpression.cmake ├── FindOgg.cmake └── FindGLEW.cmake ├── .gitattributes ├── .gitmodules ├── .gitignore ├── LICENSE.txt ├── freetype.cmake ├── .appveyor.yml └── tools └── nacl_helper_bootstrap-armhf └── nacl_helper_bootstrap-armhf.cpp /libs/.gitattributes: -------------------------------------------------------------------------------- 1 | * !text !eol 2 | -------------------------------------------------------------------------------- /pkg/testdata_src.dpkdir/TEst1.txt: -------------------------------------------------------------------------------- 1 | test1 -------------------------------------------------------------------------------- /src/engine/renderer-vulkan/src.cmake: -------------------------------------------------------------------------------- 1 | set(RENDERERLIST 2 | ) -------------------------------------------------------------------------------- /GPL.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaemonEngine/Daemon/HEAD/GPL.txt -------------------------------------------------------------------------------- /cmake/DaemonCompiler/DaemonCompiler.cpp: -------------------------------------------------------------------------------- 1 | #include "DaemonCompiler.c" 2 | -------------------------------------------------------------------------------- /pkg/testdpk_src.dpk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaemonEngine/Daemon/HEAD/pkg/testdpk_src.dpk -------------------------------------------------------------------------------- /src/shared/README.md: -------------------------------------------------------------------------------- 1 | This directory contains code which is used only by the gamelogic. 2 | -------------------------------------------------------------------------------- /src/common/README.md: -------------------------------------------------------------------------------- 1 | This directory contains libraries used by both the engine and gamelogic. 2 | -------------------------------------------------------------------------------- /libs/unifont/unifont.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaemonEngine/Daemon/HEAD/libs/unifont/unifont.otf -------------------------------------------------------------------------------- /src/engine/sys/README.md: -------------------------------------------------------------------------------- 1 | This directory contains some resource files and miscellaneous legacy engine code. 2 | -------------------------------------------------------------------------------- /pkg/testdata_src.dpkdir/maps/plat23_1.13.4.bsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaemonEngine/Daemon/HEAD/pkg/testdata_src.dpkdir/maps/plat23_1.13.4.bsp -------------------------------------------------------------------------------- /src/common/IPC/README.md: -------------------------------------------------------------------------------- 1 | This directory contains code relating to Inter-Process Communication (i.e. between the engine and a 2 | gamelogic VM). 3 | -------------------------------------------------------------------------------- /src/engine/crash_server/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the binaries which perform crash logging for engine crashes when Breakpad is 2 | enabled. 3 | -------------------------------------------------------------------------------- /src/engine/sys/windows-resource/unvanquished.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaemonEngine/Daemon/HEAD/src/engine/sys/windows-resource/unvanquished.ico -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.sh eol=lf 4 | *.pl eol=lf 5 | external_deps/cygtar.py eol=lf 6 | *.vcxproj eol=crlf 7 | *.vcxproj.filter eol=crlf 8 | -------------------------------------------------------------------------------- /src/engine/qcommon/README.md: -------------------------------------------------------------------------------- 1 | This directory contains various legacy code. The .cpp files are built only in the engine, but the 2 | headers are heavily used by gamelogic. 3 | -------------------------------------------------------------------------------- /src/engine/renderer/.gitignore: -------------------------------------------------------------------------------- 1 | # glsl/ contained generated headers for embedding GLSL before the switch to 2 | # the new method with cmake/EmbedText.cmake. 3 | glsl/ 4 | -------------------------------------------------------------------------------- /src/dummygame/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(DaemonGame) 2 | 3 | GAMEMODULE(NAME cgame 4 | FLAGS 5 | ${WARNINGS} 6 | FILES 7 | src/dummygame/cgame.cpp 8 | ) 9 | -------------------------------------------------------------------------------- /pkg/daemon_src.dpkdir/scripts/engine.shader: -------------------------------------------------------------------------------- 1 | white 2 | { 3 | cull none 4 | { 5 | map $whiteimage 6 | blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA 7 | rgbgen vertex 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/engine/framework/README.md: -------------------------------------------------------------------------------- 1 | This directory contains engine code. It can be distinguished from sys/ or qcommon/ by the fact that 2 | it is all "new" code under the BSD license rather than GPL. 3 | -------------------------------------------------------------------------------- /src/engine/README.md: -------------------------------------------------------------------------------- 1 | This directory primarily contains code for the engine. That is, the main program that runs 2 | directly on the user's machine, as opposed to the sandboxed gamelogic programs. 3 | -------------------------------------------------------------------------------- /src/engine/server/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the server component of the engine. Note that this is built into client 2 | executables too (so that you can play by yourself or host LAN games). 3 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/shared/platform/nacl_log.h: -------------------------------------------------------------------------------- 1 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_LOG_H__ 2 | #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_LOG_H__ 3 | #define NaClLog(...) 4 | #endif 5 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/README.md: -------------------------------------------------------------------------------- 1 | This directory contains GLSL shader language sources. At build time, they are converted to headers 2 | containing byte arrays, which are included from C++ (search "embed_data"). 3 | -------------------------------------------------------------------------------- /src/engine/sys/windows-resource/icon.rc: -------------------------------------------------------------------------------- 1 | // Icon with lowest ID value placed first to ensure application icon 2 | // remains consistent on all systems. 3 | IDI_ICON1 ICON "unvanquished.ico" -------------------------------------------------------------------------------- /src/common/cm/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the library for loading, traversing, and querying BSPs. A .bsp file is the 2 | compiled form of a map. The renderer, the server, and the server and client gamelogics all use it. 3 | Apparently, CM stands for "clipmap". 4 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/shared/platform/nacl_check.h: -------------------------------------------------------------------------------- 1 | #ifndef NATIVE_CLIENT_SRC_SHARED_PLATFORM_NACL_CHECK_H_ 2 | #define NATIVE_CLIENT_SRC_SHARED_PLATFORM_NACL_CHECK_H_ 3 | #define CHECK(bool_expr) do { (void)(bool_expr); } while (0) 4 | #define DCHECK(bool_expr) do { (void)(bool_expr); } while (0) 5 | #endif 6 | -------------------------------------------------------------------------------- /src/engine/sys/windows-resource/manifest.rc: -------------------------------------------------------------------------------- 1 | // The constants below can supposedly be #included from "winuser.h", but this just seems 2 | // like an invitation to get errors about it not being found on other people's machines 3 | /*CREATEPROCESS_MANIFEST_RESOURCE_ID*/1 /*RT_MANIFEST*/24 "supported-os.manifest" 4 | -------------------------------------------------------------------------------- /libs/findlocale/VERSION: -------------------------------------------------------------------------------- 1 | v0.46 -- 2005-04-06 2 | 3 | * example.c crash-avoidance for C runtimes who hate printfing 4 | NULL strings. 5 | 6 | v0.45 -- 2004-10-19 7 | 8 | * considerably more comprehensive LCID/LANGID to 9 | (language,country,variant) mapping on win32. 10 | 11 | v0.4 -- 2004-10-01 12 | 13 | * initial release 14 | 15 | -------------------------------------------------------------------------------- /src/engine/null/README.md: -------------------------------------------------------------------------------- 1 | This directory contains no-op implementations of functionality which may not be included in a given 2 | binary. For example, the TTY client does not have sound, so it uses NullAudio.cpp. It is a kind of 3 | link-time polymorphism - a given function prototype may have a real or a no-op implementation, 4 | depending on which definition is linked in. 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libs/breakpad"] 2 | path = libs/breakpad 3 | url = https://github.com/DaemonEngine/breakpad.git 4 | [submodule "libs/crunch"] 5 | path = libs/crunch 6 | url = https://github.com/DaemonEngine/crunch.git 7 | [submodule "libs/freetype"] 8 | path = libs/freetype 9 | url = https://github.com/DaemonEngine/freetype.git 10 | [submodule "libs/googletest"] 11 | path = libs/googletest 12 | url = https://github.com/DaemonEngine/googletest.git 13 | [submodule "libs/pdcursesmod"] 14 | path = libs/pdcursesmod 15 | url = https://github.com/DaemonEngine/PDCursesMod.git 16 | -------------------------------------------------------------------------------- /cmake/FindNettle.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH( NETTLE_INCLUDE_DIR NAMES nettle/rsa.h ) 2 | MARK_AS_ADVANCED( NETTLE_INCLUDE_DIR) 3 | 4 | FIND_LIBRARY( NETTLE_LIBRARY NAMES nettle ) 5 | MARK_AS_ADVANCED( NETTLE_LIBRARY ) 6 | 7 | FIND_LIBRARY( HOGWEED_LIBRARY NAMES hogweed ) 8 | MARK_AS_ADVANCED( HOGWEED_LIBRARY ) 9 | 10 | INCLUDE( ${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake ) 11 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( Nettle DEFAULT_MSG NETTLE_LIBRARY HOGWEED_LIBRARY NETTLE_INCLUDE_DIR ) 12 | 13 | SET( NETTLE_LIBRARIES ${HOGWEED_LIBRARY} ${NETTLE_LIBRARY} ) 14 | SET( NETTLE_INCLUDE_DIRS ${NETTLE_INCLUDE_DIR} ) 15 | -------------------------------------------------------------------------------- /cmake/cross-toolchain-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Target operating system and architecture 2 | set( CMAKE_SYSTEM_NAME Windows ) 3 | set( CMAKE_SYSTEM_PROCESSOR x86 ) 4 | 5 | # C/C++ compilers 6 | set( CMAKE_C_COMPILER i686-w64-mingw32-gcc ) 7 | set( CMAKE_CXX_COMPILER i686-w64-mingw32-g++ ) 8 | set( CMAKE_RC_COMPILER i686-w64-mingw32-windres ) 9 | 10 | # Find programs using host paths and headers/libraries using target paths 11 | # FIXME: not respected when cmake invokes pkg-config 12 | set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) 13 | set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) 14 | set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) 15 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/sys/nacl_kernel_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_NACL_KERNEL_SERVICE_H_ 7 | #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_NACL_KERNEL_SERVICE_H_ 8 | 9 | #define NACL_KERNEL_SERVICE_INITIALIZATION_COMPLETE "init_done::" 10 | #define NACL_KERNEL_SERVICE_CREATE_PROCESS "create_process::ihh" 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /cmake/cross-toolchain-mingw64.cmake: -------------------------------------------------------------------------------- 1 | # Target operating system and architecture 2 | set( CMAKE_SYSTEM_NAME Windows ) 3 | set( CMAKE_SYSTEM_PROCESSOR x86_64 ) 4 | 5 | # C/C++ compilers 6 | set( CMAKE_C_COMPILER x86_64-w64-mingw32-gcc ) 7 | set( CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++ ) 8 | set( CMAKE_RC_COMPILER x86_64-w64-mingw32-windres ) 9 | 10 | # Find programs using host paths and headers/libraries using target paths 11 | # FIXME: not respected when cmake invokes pkg-config 12 | set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) 13 | set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) 14 | set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) 15 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/sys/nacl_nice.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can 4 | * be found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * Constants for nacl_thread_nice system call and friends. 9 | */ 10 | 11 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_NACL_NICE_H__ 12 | #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_NACL_NICE_H__ 13 | 14 | #define NICE_REALTIME -5 15 | #define NICE_NORMAL 0 16 | #define NICE_BACKGROUND 5 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/sys/nacl_test_crash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #ifndef NATIVE_CLIENT_SRC_SERVICE_RUNTIME_INCLUDE_SYS_NACL_TEST_CRASH_H_ 8 | #define NATIVE_CLIENT_SRC_SERVICE_RUNTIME_INCLUDE_SYS_NACL_TEST_CRASH_H_ 1 9 | 10 | /* Argument values for use with the test_crash syscall. */ 11 | #define NACL_TEST_CRASH_MEMORY 1 12 | #define NACL_TEST_CRASH_LOG_FATAL 2 13 | #define NACL_TEST_CRASH_CHECK_FAILURE 3 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/bits/limits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can 4 | * be found in the LICENSE file. 5 | */ 6 | 7 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_LIMITS_H_ 8 | #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_LIMITS_H_ 9 | 10 | #define NAME_MAX 255 /* does not include trailing ASCII NUL character */ 11 | #define PATH_MAX 4096 /* includes NUL termination */ 12 | 13 | #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_LIMITS_H_ */ 14 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/untrusted/nacl/imc_accept.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * Wrapper for syscall. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "native_client/src/public/imc_syscalls.h" 15 | #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" 16 | 17 | int imc_accept(int d) { 18 | int retval = NACL_SYSCALL(imc_accept)(d); 19 | if (retval < 0) { 20 | errno = -retval; 21 | return -1; 22 | } 23 | return retval; 24 | } 25 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/untrusted/nacl/imc_connect.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * Wrapper for syscall. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "native_client/src/public/imc_syscalls.h" 15 | #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" 16 | 17 | int imc_connect(int d) { 18 | int retval = NACL_SYSCALL(imc_connect)(d); 19 | if (retval < 0) { 20 | errno = -retval; 21 | return -1; 22 | } 23 | return retval; 24 | } 25 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/untrusted/nacl/imc_makeboundsock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * Wrapper for syscall. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "native_client/src/public/imc_syscalls.h" 15 | #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" 16 | 17 | int imc_makeboundsock(int *dp) { 18 | int retval = NACL_SYSCALL(imc_makeboundsock)(dp); 19 | if (retval < 0) { 20 | errno = -retval; 21 | return -1; 22 | } 23 | return retval; 24 | } 25 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/untrusted/nacl/imc_mem_obj_create.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * Wrapper for syscall. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "native_client/src/public/imc_syscalls.h" 15 | #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" 16 | 17 | int imc_mem_obj_create(size_t nbytes) { 18 | int retval = NACL_SYSCALL(imc_mem_obj_create)(nbytes); 19 | if (retval < 0) { 20 | errno = -retval; 21 | return -1; 22 | } 23 | return retval; 24 | } 25 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/untrusted/nacl/imc_socketpair.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * Wrapper for syscall. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "native_client/src/public/imc_syscalls.h" 15 | #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" 16 | 17 | int imc_socketpair(int *d2) { 18 | int retval; 19 | retval = NACL_SYSCALL(imc_socketpair)(d2); 20 | 21 | if (retval < 0) { 22 | errno = -retval; 23 | return -1; 24 | } 25 | return retval; 26 | } 27 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/untrusted/nacl/imc_recvmsg.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * Wrapper for syscall. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "native_client/src/public/imc_syscalls.h" 15 | #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" 16 | 17 | int imc_recvmsg(int desc, struct NaClAbiNaClImcMsgHdr *nmhp, int flags) { 18 | int retval = NACL_SYSCALL(imc_recvmsg)(desc, nmhp, flags); 19 | if (retval < 0) { 20 | errno = -retval; 21 | return -1; 22 | } 23 | return retval; 24 | } 25 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/untrusted/nacl/imc_sendmsg.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * Wrapper for syscall. 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #include "native_client/src/public/imc_syscalls.h" 15 | #include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" 16 | 17 | int imc_sendmsg(int desc, struct NaClAbiNaClImcMsgHdr const *nmhp, int flags) { 18 | int retval = NACL_SYSCALL(imc_sendmsg)(desc, nmhp, flags); 19 | if (retval < 0) { 20 | errno = -retval; 21 | return -1; 22 | } 23 | return retval; 24 | } 25 | -------------------------------------------------------------------------------- /libs/findlocale/README.findlocale: -------------------------------------------------------------------------------- 1 | FindLocale -- a cross-platform C module for detecting the user's language 2 | Adam D. Moss / adam at steambird.com / adam at gimp.org 3 | 4 | This is an early release of a straightforward API which can be used to 5 | detect the user's current preferred (language,country,variant) setting 6 | in a uniform manner across multiple platforms. It is not intended 7 | to provide localization functions, but rather it is a basis on which to 8 | make localization decisions. 9 | 10 | Currently, win32 (win95+) and unix-alikes are supported. 11 | 12 | Please see example.c and findlocale.h for illumination of this API. 13 | 14 | Ports and patches are always welcome. 15 | 16 | License: Completely free; see the LICENSE file. 17 | 18 | --adam 19 | 20 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/bits/wordsize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can 4 | * be found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * NaCl Service Runtime API. 9 | */ 10 | 11 | 12 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_WORDSIZE_H_ 13 | #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_WORDSIZE_H_ 14 | 15 | #if !defined(__WORDSIZE) 16 | # if defined(__powerpc64__) || defined(__s390x__) || defined(__arch64__) || \ 17 | defined(__sparcv9) || defined(__x86_64__) || defined(_AMD64_) || \ 18 | defined(_M_AMD64) 19 | # define __WORDSIZE 64 20 | # else 21 | # define __WORDSIZE 32 22 | # endif 23 | #endif 24 | 25 | #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_WORDSIZE_H_ */ 26 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/sys/nacl_list_mappings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * NaCl Memory Region 9 | */ 10 | 11 | #ifndef _NATIVE_CLIENT_SRC_SERVICE_RUNTIME_INCLUDE_SYS_NACL_LIST_MAPPINGS_H_ 12 | #define _NATIVE_CLIENT_SRC_SERVICE_RUNTIME_INCLUDE_SYS_NACL_LIST_MAPPINGS_H_ 1 13 | 14 | #if defined(__native_client__) 15 | # include 16 | #else 17 | # include "native_client/src/include/portability.h" 18 | #endif 19 | 20 | struct NaClMemMappingInfo { 21 | uint32_t start; 22 | uint32_t size; 23 | uint32_t prot; 24 | uint32_t max_prot; 25 | uint32_t vmmap_type; 26 | }; 27 | 28 | #endif /* _NATIVE_CLIENT_SRC_SERVICE_RUNTIME_INCLUDE_SYS_NACL_LIST_MAPPINGS_H_ */ 29 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/elf_auxv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_ELF_AUXV_H_ 8 | #define NATIVE_CLIENT_SRC_INCLUDE_ELF_AUXV_H_ 1 9 | 10 | /* 11 | * This is only in a separate file from elf.h and elf_constants.h 12 | * because these two contains #ifs which depend on 13 | * architecture-specific #defines which are supplied by the build 14 | * system. These #defines are not normally set when building 15 | * untrusted code. 16 | */ 17 | 18 | /* Keys for auxiliary vector (auxv). */ 19 | #define AT_NULL 0 /* Terminating item in auxv array */ 20 | #define AT_ENTRY 9 /* Entry point of the executable */ 21 | #define AT_SYSINFO 32 /* System call entry point */ 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/public/secure_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #ifndef NATIVE_CLIENT_SRC_PUBLIC_SECURE_SERVICE_H_ 8 | #define NATIVE_CLIENT_SRC_PUBLIC_SECURE_SERVICE_H_ 9 | 10 | #define NACL_SECURE_SERVICE_LOAD_MODULE "load_module:hs:" 11 | /* nexe to load, auxiliary vector */ 12 | 13 | #define NACL_SECURE_SERVICE_START_MODULE "start_module::i" 14 | /* -> load module status */ 15 | 16 | #define NACL_SECURE_SERVICE_REVERSE_SETUP "reverse_setup::h" 17 | /* -> reverse service address */ 18 | 19 | #define NACL_SECURE_SERVICE_LOG "log:is:" 20 | /* severity and message to log */ 21 | 22 | #define NACL_SECURE_SERVICE_HARD_SHUTDOWN "hard_shutdown::" 23 | /* shutdown module */ 24 | 25 | #endif /* NATIVE_CLIENT_SRC_PUBLIC_SECURE_SERVICE_H_ */ 26 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/nacl_platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_NACL_PLATFORM_H_ 8 | #define NATIVE_CLIENT_SRC_INCLUDE_NACL_PLATFORM_H_ 1 9 | 10 | /* elf stuff */ 11 | /* ... */ 12 | 13 | #include "native_client/src/include/elf.h" 14 | 15 | #if NACL_LINUX || NACL_FREEBSD || NACL_OSX 16 | #include 17 | #include 18 | #include 19 | #endif 20 | 21 | /* mmap enums, e.g. PROT_READ, PROT_WRITE*/ 22 | #if NACL_WINDOWS 23 | #include "native_client/src/include/win/mman.h" 24 | #elif NACL_OSX 25 | # include 26 | #ifndef MAP_ANONYMOUS 27 | #define MAP_ANONYMOUS MAP_ANON 28 | #endif 29 | #elif NACL_LINUX || NACL_FREEBSD 30 | # include 31 | #endif 32 | 33 | #endif /* NATIVE_CLIENT_SRC_INCLUDE_NACL_PLATFORM_H_ */ 34 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/portability_sockets.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_SOCKETS_H_ 8 | #define NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_SOCKETS_H_ 1 9 | 10 | #if NACL_WINDOWS 11 | # include 12 | # include 13 | 14 | typedef SOCKET NaClSocketHandle; 15 | 16 | # define NaClCloseSocket closesocket 17 | # define NACL_INVALID_SOCKET INVALID_SOCKET 18 | # define NaClSocketGetLastError() WSAGetLastError() 19 | #else 20 | 21 | # include 22 | # include 23 | # include 24 | # include 25 | # include 26 | 27 | typedef int NaClSocketHandle; 28 | 29 | # define NaClCloseSocket close 30 | # define NACL_INVALID_SOCKET (-1) 31 | # define NaClSocketGetLastError() errno 32 | 33 | #endif 34 | 35 | #endif // NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_SOCKETS_H_ 36 | -------------------------------------------------------------------------------- /libs/findlocale/findlocale.h: -------------------------------------------------------------------------------- 1 | #ifndef __findlocale_h_ 2 | #define __findlocale_h_ 3 | 4 | typedef const char* FL_Lang; 5 | typedef const char* FL_Country; 6 | typedef const char* FL_Variant; 7 | 8 | typedef struct { 9 | FL_Lang lang; 10 | FL_Country country; 11 | FL_Variant variant; 12 | } FL_Locale; 13 | 14 | typedef enum { 15 | /* for some reason we failed to even guess: this should never happen */ 16 | FL_FAILED = 0, 17 | /* couldn't query locale -- returning a guess (almost always English) */ 18 | FL_DEFAULT_GUESS = 1, 19 | /* the returned locale type was found by successfully asking the system */ 20 | FL_CONFIDENT = 2 21 | } FL_Success; 22 | 23 | typedef enum { 24 | FL_MESSAGES = 0 25 | } FL_Domain; 26 | 27 | /* This allocates/fills in a FL_Locale structure with pointers to 28 | strings (which should be treated as static), or NULL for inappropriate / 29 | undetected fields. */ 30 | FL_Success FL_FindLocale(FL_Locale **locale, FL_Domain domain); 31 | /* This should be used to free the struct written by FL_FindLocale */ 32 | void FL_FreeLocale(FL_Locale **locale); 33 | 34 | #endif /*__findlocale_h_*/ 35 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/win/mman.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can 4 | * be found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * mman.h for windows. since we only use #define constants for the 9 | * virtual memory map data structure, the values do not have to be 10 | * compatible with linux or osx values. 11 | */ 12 | 13 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_WIN_MMAN_H_ 14 | #define NATIVE_CLIENT_SRC_INCLUDE_WIN_MMAN_H_ 15 | 16 | #include "native_client/src/include/nacl_base.h" 17 | 18 | EXTERN_C_BEGIN 19 | 20 | #define PROT_NONE 0 21 | #define PROT_READ 1 22 | #define PROT_WRITE 2 23 | #define PROT_EXEC 4 24 | 25 | #define MAP_SHARED 1 26 | #define MAP_PRIVATE 2 27 | #define MAP_ANONYMOUS 4 28 | #define MAP_FIXED 8 29 | 30 | #define MAP_FAILED ((void *) -1) 31 | 32 | #define MADV_NORMAL 0 33 | #define MADV_RANDOM 1 34 | #define MADV_SEQUENTIAL 2 35 | #define MADV_WILLNEED 3 36 | #define MADV_DONTNEED 4 37 | 38 | EXTERN_C_END 39 | 40 | #endif /* NATIVE_CLIENT_SRC_INCLUDE_WIN_MMAN_H_ */ 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # use 'git ls-files -i --exclude-standard' for checking 2 | # which already committed files are matched against these rules 3 | 4 | *~ 5 | *.DS_Store 6 | CMakeCache.txt 7 | CMakeFiles 8 | Makefile 9 | cmake_install.cmake 10 | daemon 11 | daemonded 12 | daemon-tty 13 | vm 14 | Release 15 | Debug 16 | build 17 | *.kdev4 18 | *.dll 19 | *.exe 20 | *.dylib 21 | *.so 22 | *.a 23 | 24 | #ignore editor temporary files 25 | .*.swp 26 | .#* 27 | 28 | #ignore patch-generated 29 | *.orig 30 | *.rej 31 | 32 | #ignore eclipse cdt project files 33 | .project 34 | .cproject 35 | .settings 36 | 37 | #ignore clion project files 38 | .idea/ 39 | 40 | #ignore external deps 41 | external_deps/* 42 | !external_deps/build.sh 43 | !external_deps/cygtar.py 44 | !external_deps/*.patch 45 | 46 | #never ignore these in subdirectories by accident 47 | !.gitattributes 48 | !.gitignore 49 | 50 | #ignore Visual Studio generated project files 51 | *.vcxproj 52 | *.vcxproj.filters 53 | *.vcxproj.user 54 | *.sln 55 | 56 | #ignore Visual Studio / Visual Studio Code settings 57 | .vs 58 | .vscode 59 | 60 | #ignore removed recastnavigation submodule 61 | libs/recastnavigation 62 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/sys/mman.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * NaCl Service Runtime. IMC API. 9 | */ 10 | 11 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_MMAN_H_ 12 | #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_MMAN_H_ 13 | 14 | #include 15 | 16 | #include "native_client/src/trusted/service_runtime/include/bits/mman.h" 17 | 18 | #ifdef __native_client__ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /** Description of mmap. More details... */ 25 | extern void *mmap(void *start, size_t length, int prot, int flags, 26 | int desc, off_t offset); 27 | 28 | /** Description of munmap. More details... */ 29 | extern int munmap(void *start, size_t length); 30 | 31 | /** Description of mprotect. More details... */ 32 | extern int mprotect(void *start, size_t length, int prot); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif // __native_client__ 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/gcc/atomic_ops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_NACL_ATOMIC_OPS_H_ 7 | #define NATIVE_CLIENT_SRC_INCLUDE_NACL_ATOMIC_OPS_H_ 1 8 | 9 | #include "native_client/src/include/portability.h" 10 | #include 11 | 12 | typedef int32_t Atomic32; 13 | 14 | static INLINE Atomic32 CompareAndSwap(volatile Atomic32* ptr, 15 | Atomic32 old_value, 16 | Atomic32 new_value) { 17 | return __sync_val_compare_and_swap(ptr, old_value, new_value); 18 | } 19 | 20 | static INLINE Atomic32 AtomicExchange(volatile Atomic32* ptr, 21 | Atomic32 new_value) { 22 | return __sync_lock_test_and_set(ptr, new_value); 23 | } 24 | 25 | static INLINE Atomic32 AtomicIncrement(volatile Atomic32* ptr, 26 | Atomic32 increment) { 27 | return __sync_add_and_fetch(ptr, increment); 28 | } 29 | 30 | #endif /* NATIVE_CLIENT_SRC_INCLUDE_NACL_ATOMIC_OPS_H_ */ 31 | -------------------------------------------------------------------------------- /src/engine/qcommon/crypto.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon GPL Source Code 5 | Copyright (C) 2007-2008 Amanieu d'Antras (amanieu@gmail.com) 6 | Copyright (C) 2012 Dusan Jocic 7 | 8 | Daemon is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | Daemon is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see . 20 | 21 | =========================================================================== 22 | */ 23 | 24 | // Public-key identification 25 | 26 | #include "q_shared.h" 27 | #include "qcommon.h" 28 | #include "crypto.h" 29 | 30 | void qnettle_random( void*, NettleLength length, uint8_t *dst ) 31 | { 32 | Sys::GenRandomBytes( dst, length ); 33 | } 34 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/shared/imc/nacl_imc_common.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | 8 | /* NaCl inter-module communication primitives. */ 9 | 10 | /* Used for UINT32_MAX */ 11 | #if !NACL_WINDOWS 12 | # ifndef __STDC_LIMIT_MACROS 13 | # define __STDC_LIMIT_MACROS 14 | # endif 15 | #include 16 | #endif 17 | 18 | /* TODO(robertm): stdio.h is included for NULL only - find a better way */ 19 | #include 20 | 21 | #include "native_client/src/include/portability.h" 22 | 23 | #include "native_client/src/shared/imc/nacl_imc_c.h" 24 | #include "native_client/src/shared/platform/nacl_log.h" 25 | 26 | 27 | int NaClMessageSizeIsValid(const NaClMessageHeader *message) { 28 | size_t cur_bytes = 0; 29 | static size_t const kMax = ~(uint32_t) 0; 30 | size_t ix; 31 | /* we assume that sizeof(uint32_t) <= sizeof(size_t) */ 32 | 33 | for (ix = 0; ix < message->iov_length; ++ix) { 34 | if (kMax - cur_bytes < message->iov[ix].length) { 35 | return 0; 36 | } 37 | cur_bytes += message->iov[ix].length; /* no overflow is possible */ 38 | } 39 | return 1; 40 | } 41 | -------------------------------------------------------------------------------- /src/engine/sys/windows-resource/supported-os.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 11 | 12 | 14 | 15 | 17 | 18 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /cmake/FindGMP.cmake: -------------------------------------------------------------------------------- 1 | # - Find gmp 2 | # Find the native GMP includes and library 3 | # 4 | # GMP_INCLUDE_DIR - where to find gmp.h, etc. 5 | # GMP_LIBRARIES - List of libraries when using gmp. 6 | # GMP_FOUND - True if gmp found. 7 | 8 | 9 | IF (GMP_INCLUDE_DIR) 10 | # Already in cache, be silent 11 | SET(GMP_FIND_QUIETLY TRUE) 12 | ENDIF (GMP_INCLUDE_DIR) 13 | 14 | FIND_PATH(GMP_INCLUDE_DIR gmp.h 15 | /usr/local/include 16 | /usr/include 17 | /opt/local/include 18 | ) 19 | 20 | SET(GMP_NAMES gmp) 21 | FIND_LIBRARY(GMP_LIBRARY 22 | NAMES ${GMP_NAMES} 23 | PATHS /usr/lib /usr/local/lib /opt/local/lib 24 | ) 25 | 26 | IF (GMP_INCLUDE_DIR AND GMP_LIBRARY) 27 | SET(GMP_FOUND TRUE) 28 | SET( GMP_LIBRARIES ${GMP_LIBRARY} ) 29 | ELSE (GMP_INCLUDE_DIR AND GMP_LIBRARY) 30 | SET(GMP_FOUND FALSE) 31 | SET( GMP_LIBRARIES ) 32 | ENDIF (GMP_INCLUDE_DIR AND GMP_LIBRARY) 33 | 34 | IF (GMP_FOUND) 35 | IF (NOT GMP_FIND_QUIETLY) 36 | MESSAGE(STATUS "Found GMP: ${GMP_LIBRARY}") 37 | ENDIF (NOT GMP_FIND_QUIETLY) 38 | ELSE (GMP_FOUND) 39 | IF (GMP_FIND_REQUIRED) 40 | MESSAGE(STATUS "Looked for gmp libraries named ${GMPS_NAMES}.") 41 | MESSAGE(FATAL_ERROR "Could NOT find gmp library") 42 | ENDIF (GMP_FIND_REQUIRED) 43 | ENDIF (GMP_FOUND) 44 | 45 | MARK_AS_ADVANCED ( 46 | GMP_LIBRARY 47 | GMP_INCLUDE_DIR 48 | ) 49 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/bits/mman.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * NaCl Service Runtime API. 9 | */ 10 | 11 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_MMAN_H_ 12 | #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_MMAN_H_ 13 | 14 | #define NACL_ABI_PROT_READ 0x1 /* Page can be read. */ 15 | #define NACL_ABI_PROT_WRITE 0x2 /* Page can be written. */ 16 | #define NACL_ABI_PROT_EXEC 0x4 /* Page can be executed. */ 17 | #define NACL_ABI_PROT_NONE 0x0 /* Page can not be accessed. */ 18 | 19 | #define NACL_ABI_PROT_MASK 0x7 20 | 21 | #define NACL_ABI_MAP_SHARED 0x01 /* Share changes. */ 22 | #define NACL_ABI_MAP_PRIVATE 0x02 /* Changes are private. */ 23 | 24 | #define NACL_ABI_MAP_SHARING_MASK 0x03 25 | 26 | #define NACL_ABI_MAP_FIXED 0x10 /* Interpret addr exactly. */ 27 | #define NACL_ABI_MAP_ANON 0x20 /* Don't use a file. */ 28 | #define NACL_ABI_MAP_ANONYMOUS NACL_ABI_MAP_ANON /* Linux alias. */ 29 | 30 | #define NACL_ABI_MAP_FAILED ((void *) -1) 31 | 32 | #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_BITS_MMAN_H_ */ 33 | -------------------------------------------------------------------------------- /libs/findlocale/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2004 Adam D. Moss (the "Author"). All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is fur- 8 | nished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- 15 | NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- 18 | NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | Except as contained in this notice, the name of the Author of the 21 | Software shall not be used in advertising or otherwise to promote the sale, 22 | use or other dealings in this Software without prior written authorization 23 | from the Author. 24 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/nacl_asm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_NACL_ASM_H_ 8 | #define NATIVE_CLIENT_SRC_INCLUDE_NACL_ASM_H_ 9 | 10 | /* 11 | * macros to provide uniform access to identifiers from assembly due 12 | * to different C -> asm name mangling conventions and other platform-specific 13 | * requirements 14 | */ 15 | #if NACL_OSX 16 | # define IDENTIFIER(n) _##n 17 | #elif NACL_LINUX || NACL_FREEBSD 18 | # define IDENTIFIER(n) n 19 | #elif NACL_WINDOWS 20 | # if defined(_WIN64) 21 | # define IDENTIFIER(n) n 22 | # else 23 | # define IDENTIFIER(n) _##n 24 | # endif 25 | #elif defined(__native_client__) 26 | # define IDENTIFIER(n) n 27 | #else 28 | # error "Unrecognized OS" 29 | #endif 30 | 31 | #if NACL_OSX 32 | # define HIDDEN(n) .private_extern IDENTIFIER(n) 33 | #elif NACL_LINUX || NACL_FREEBSD 34 | # define HIDDEN(n) .hidden IDENTIFIER(n) 35 | #elif NACL_WINDOWS 36 | /* On Windows, symbols are hidden by default. */ 37 | # define HIDDEN(n) 38 | #elif defined(__native_client__) 39 | # define HIDDEN(n) .hidden IDENTIFIER(n) 40 | #else 41 | # error "Unrecognized OS" 42 | #endif 43 | 44 | #define DEFINE_GLOBAL_HIDDEN_IDENTIFIER(n) \ 45 | .globl IDENTIFIER(n); HIDDEN(n); IDENTIFIER(n) 46 | 47 | #endif /* NATIVE_CLIENT_SRC_INCLUDE_NACL_ASM_H_ */ 48 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/skybox_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2006-2009 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* skybox_vp.glsl */ 24 | 25 | IN vec3 attr_Position; 26 | 27 | uniform mat4 u_ModelViewProjectionMatrix; 28 | 29 | OUT(smooth) vec3 var_Position; 30 | 31 | void main() 32 | { 33 | #insert material_vp 34 | 35 | // transform vertex position into homogenous clip-space 36 | gl_Position = u_ModelViewProjectionMatrix * vec4(attr_Position, 1.0); 37 | 38 | var_Position = attr_Position; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/screen_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2006-2008 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* screen_vp.glsl */ 24 | 25 | IN vec3 attr_Position; 26 | IN vec4 attr_Color; 27 | 28 | uniform mat4 u_ModelViewProjectionMatrix; 29 | 30 | OUT(smooth) vec4 var_Color; 31 | 32 | void main() 33 | { 34 | #insert material_vp 35 | 36 | // transform vertex position into homogenous clip-space 37 | gl_Position = u_ModelViewProjectionMatrix * vec4(attr_Position, 1.0); 38 | 39 | // assign color 40 | var_Color = attr_Color; 41 | } 42 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/screen_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2006 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* screen_fp.glsl */ 24 | 25 | #define SCREEN_GLSL 26 | 27 | uniform sampler2D u_CurrentMap; 28 | 29 | IN(smooth) vec4 var_Color; 30 | 31 | DECLARE_OUTPUT(vec4) 32 | 33 | void main() 34 | { 35 | #insert material_fp 36 | 37 | // calculate the screen texcoord in the 0.0 to 1.0 range 38 | vec2 st = gl_FragCoord.st / r_FBufSize; 39 | 40 | vec4 color = texture2D(u_CurrentMap, st); 41 | color *= var_Color; 42 | 43 | outputColor = color; 44 | } 45 | -------------------------------------------------------------------------------- /src/engine/renderer/tr_model_skel.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2009-2010 Robert Beckebans 4 | 5 | This file is part of Daemon source code. 6 | 7 | Daemon source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | Daemon source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Daemon source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | #ifndef TR_MODEL_SKEL_H 24 | #define TR_MODEL_SKEL_H 25 | 26 | #include "tr_local.h" 27 | 28 | bool R_AddTriangleToVBOTriangleList( 29 | const skelTriangle_t *tri, int *numBoneReferences, int boneReferences[ MAX_BONES ] ); 30 | 31 | srfVBOMD5Mesh_t *R_GenerateMD5VBOSurface( 32 | Str::StringRef surfName, const std::vector &vboTriangles, 33 | md5Model_t *md5, md5Surface_t *surf, int skinIndex, int boneReferences[ MAX_BONES ] ); 34 | 35 | #endif // TR_MODEL_SKEL_H 36 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Daemon Developers 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of Daemon nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /cmake/DaemonFileEmbedder.cmake: -------------------------------------------------------------------------------- 1 | # Converts a text file into a C-language char array definition. 2 | # For use in CMake script mode (cmake -P). 3 | # Required definitions on command line: 4 | # INPUT_FILE, OUTPUT_FILE, FILE_FORMAT, VARIABLE_NAME 5 | 6 | # Inspired by: 7 | # https://stackoverflow.com/questions/11813271/embed-resources-eg-shader-code-images-into-executable-library-with-cmake/27206982#27206982 8 | 9 | file(READ ${INPUT_FILE} contents HEX) 10 | 11 | # Translate the file content. 12 | if ("${FILE_FORMAT}" STREQUAL "TEXT") 13 | # Strip \r for consistency. 14 | string(REGEX REPLACE "(0d)?(..)" "0x\\2," contents "${contents}") 15 | elseif("${FILE_FORMAT}" STREQUAL "BINARY") 16 | string(REGEX REPLACE "(..)" "0x\\1," contents "${contents}") 17 | else() 18 | message(FATAL_ERROR "Unknown file format: ${FILE_FORMAT}") 19 | endif() 20 | 21 | # Add null terminator. 22 | set(contents "${contents}0x00,") 23 | 24 | # Split long lines. 25 | string(REGEX REPLACE 26 | "(0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,0x..,)" "\\1\n" 27 | contents "${contents}" 28 | ) 29 | 30 | # A bit more of beautification. 31 | string(REGEX REPLACE ",$" ",\n" contents "${contents}") 32 | set(DATA_VARIABLE_NAME "data_${VARIABLE_NAME}") 33 | 34 | file(WRITE ${OUTPUT_FILE} 35 | "constexpr unsigned char ${DATA_VARIABLE_NAME}[] =\n" 36 | "{\n" 37 | "${contents}" 38 | "};\n" 39 | "const embeddedFileMapEntry_t ${VARIABLE_NAME} =\n" 40 | "{\n" 41 | "reinterpret_cast( ${DATA_VARIABLE_NAME} ),\n" 42 | "sizeof( ${DATA_VARIABLE_NAME} ) - 1,\n" 43 | "};\n" 44 | ) 45 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/portal_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2008 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* portal_fp.glsl */ 24 | 25 | uniform sampler2D u_CurrentMap; 26 | uniform float u_InversePortalRange; 27 | 28 | IN(smooth) vec3 var_Position; 29 | IN(smooth) vec4 var_Color; 30 | IN(smooth) vec2 var_TexCoords; 31 | 32 | DECLARE_OUTPUT(vec4) 33 | 34 | void main() 35 | { 36 | vec4 color = texture2D(u_CurrentMap, var_TexCoords); 37 | color *= var_Color; 38 | 39 | float len = length(var_Position); 40 | 41 | len *= u_InversePortalRange; 42 | color.a = clamp(len, 0.0, 1.0); 43 | 44 | outputColor = color; 45 | } 46 | -------------------------------------------------------------------------------- /freetype.cmake: -------------------------------------------------------------------------------- 1 | set(FREETYPE_DIR ${DAEMON_DIR}/libs/freetype) 2 | set(FREETYPE_INCLUDE_DIRS ${FREETYPE_DIR}/include) 3 | set(FREETYPE_LIBRARIES freetype) 4 | 5 | if (NACL) 6 | # Using Freetype's own zlib prevents the need for a zlib submodule when building the nexe cgame. 7 | set(FREETYPE_INTERNAL_ZLIB ON) 8 | else() 9 | # Even if we can build an engine with Freetype using its internal zlib, we better rely on the 10 | # external zlib even if PREFER_EXTERNAL_LIBS is OFF, because then it will avoid zlib duplication 11 | # and share the same zlib between Freetype and the libpng. 12 | set(FREETYPE_INTERNAL_ZLIB OFF) 13 | endif() 14 | 15 | if (NOT FREETYPE_INTERNAL_ZLIB) 16 | find_package(ZLIB REQUIRED) 17 | set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} ${ZLIB_LIBRARIES}) 18 | endif() 19 | 20 | # Do not re-add the target if already set to be built. 21 | # For example both the engine and a native game may request Freetype 22 | # to be built, but we need to only build once for both. 23 | if (NOT TARGET freetype) 24 | option(FT_DISABLE_BROTLI "Disable Brotli" ON) 25 | option(FT_DISABLE_BZIP2 "Disable bzip2" ON) 26 | option(FT_DISABLE_HARFBUZZ "Disable HarfBuzz" ON) 27 | option(FT_DISABLE_PNG "Disable PNG" ON) 28 | set(FT_DISABLE_ZLIB ${FREETYPE_INTERNAL_ZLIB} CACHE BOOL "Disable external zlib" FORCE) 29 | 30 | add_subdirectory(${FREETYPE_DIR}) 31 | 32 | mark_as_advanced(FT_DISABLE_BROTLI) 33 | mark_as_advanced(FT_DISABLE_BZIP2) 34 | mark_as_advanced(FT_DISABLE_HARFBUZZ) 35 | mark_as_advanced(FT_DISABLE_PNG) 36 | mark_as_advanced(FT_DISABLE_ZLIB) 37 | mark_as_advanced(FT_ENABLE_ERROR_STRINGS) 38 | endif() 39 | -------------------------------------------------------------------------------- /libs/mumblelink/libmumblelink.h: -------------------------------------------------------------------------------- 1 | /* libmumblelink.h -- mumble link interface 2 | 3 | Copyright (C) 2008 Ludwig Nussel 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | */ 22 | 23 | int mumble_link( const char *name ); 24 | int mumble_islinked(); 25 | 26 | void mumble_update_coordinates( float fPosition[ 3 ], float fFront[ 3 ], float fTop[ 3 ] ); 27 | 28 | /* new for mumble 1.2: also set camera position */ 29 | void mumble_update_coordinates2( float fAvatarPosition[ 3 ], float fAvatarFront[ 3 ], float fAvatarTop[ 3 ], 30 | float fCameraPosition[ 3 ], float fCameraFront[ 3 ], float fCameraTop[ 3 ] ); 31 | 32 | void mumble_set_description( const char *description ); 33 | void mumble_set_context( const unsigned char *context, size_t len ); 34 | void mumble_set_identity( const char *identity ); 35 | 36 | void mumble_unlink(); 37 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/portability_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * portability macros for file descriptors, read, write, open, etc. 9 | */ 10 | 11 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_IO_H_ 12 | #define NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_IO_H_ 1 13 | 14 | #include 15 | 16 | #if NACL_WINDOWS 17 | /* disable warnings for deprecated _snprintf */ 18 | #pragma warning(disable : 4996) 19 | 20 | #include 21 | #include 22 | 23 | #define DUP _dup 24 | #define DUP2 _dup2 25 | #define OPEN _open 26 | #define CLOSE _close 27 | #define FDOPEN _fdopen 28 | #define PORTABLE_DEV_NULL "nul" 29 | #define SNPRINTF _snprintf 30 | #define VSNPRINTF _vsnprintf 31 | #define UNLINK _unlink 32 | #define MKDIR(p, m) _mkdir(p) /* BEWARE MODE BITS ARE DROPPED! */ 33 | #define RMDIR _rmdir 34 | #define WRITE _write 35 | 36 | /* Seek method constants */ 37 | #define SEEK_CUR 1 38 | #define SEEK_END 2 39 | #define SEEK_SET 0 40 | 41 | /* missing from win stdio.h and fcntl.h */ 42 | 43 | /* from bits/fcntl.h */ 44 | #define O_ACCMODE 0003 45 | 46 | #else 47 | 48 | #include 49 | #include 50 | 51 | #define OPEN open 52 | #define CLOSE close 53 | #define DUP dup 54 | #define DUP2 dup2 55 | #define FDOPEN fdopen 56 | #define PORTABLE_DEV_NULL "/dev/null" 57 | #define SNPRINTF snprintf 58 | #define VSNPRINTF vsnprintf 59 | #define UNLINK unlink 60 | #define MKDIR(p, m) mkdir(p, m) 61 | #define RMDIR rmdir 62 | #define _O_BINARY 0 63 | #define WRITE write 64 | #endif 65 | 66 | #endif /* NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_IO_H_ */ 67 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/portal_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2008 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* portal_vp.glsl */ 24 | 25 | IN vec3 attr_Position; 26 | IN vec4 attr_Color; 27 | IN vec4 attr_TexCoord0; 28 | 29 | uniform mat4 u_ModelViewMatrix; 30 | uniform mat4 u_ModelViewProjectionMatrix; 31 | 32 | OUT(smooth) vec3 var_Position; 33 | OUT(smooth) vec4 var_Color; 34 | OUT(smooth) vec2 var_TexCoords; 35 | 36 | void main() 37 | { 38 | vec2 texCoord = attr_TexCoord0.xy; 39 | 40 | // transform vertex position into homogenous clip-space 41 | gl_Position = u_ModelViewProjectionMatrix * vec4(attr_Position, 1.0); 42 | 43 | // transform vertex position into camera space 44 | var_Position = (u_ModelViewMatrix * vec4(attr_Position, 1.0)).xyz; 45 | 46 | // assign color 47 | var_Color = attr_Color; 48 | 49 | var_TexCoords = texCoord; 50 | } 51 | -------------------------------------------------------------------------------- /src/engine/qcommon/q_unicode.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2012-2013 Unvanquished Developers 4 | 5 | This file is part of Daemon source code. 6 | 7 | Daemon Source Code is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | Daemon Source Code is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Daemon Source Code. If not, see . 19 | =========================================================================== 20 | */ 21 | 22 | #ifndef Q_UNICODE_H_ 23 | #define Q_UNICODE_H_ 24 | 25 | constexpr int MIN_PRINTABLE_ASCII = 32; 26 | constexpr int MAX_PRINTABLE_ASCII = 126; 27 | constexpr int UNICODE_MAX_CODE_POINT = 0x10FFFF; 28 | 29 | int Q_UTF8_Width( const char *str ); 30 | int Q_UTF8_WidthCP( int ch ); 31 | int Q_UTF8_Strlen( const char *str ); 32 | bool Q_UTF8_ContByte( char c ); 33 | unsigned long Q_UTF8_CodePoint( const char *str ); 34 | char *Q_UTF8_Encode( unsigned long codepoint ); 35 | 36 | bool Q_Unicode_IsAlpha( int ch ); 37 | bool Q_Unicode_IsUpper( int ch ); 38 | bool Q_Unicode_IsLower( int ch ); 39 | bool Q_Unicode_IsIdeo( int ch ); 40 | bool Q_Unicode_IsAlphaOrIdeo( int ch ); 41 | bool Q_Unicode_IsAlphaOrIdeoOrDigit( int ch ); 42 | bool Q_Unicode_IsPrivateUse( int ch ); 43 | 44 | int Q_Unicode_ToUpper( int ch ); 45 | int Q_Unicode_ToLower( int ch ); 46 | 47 | #endif /* Q_UNICODE_H_ */ 48 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/fogQuake3_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2011 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* fogQuake3_fp.glsl */ 24 | 25 | #insert fogEquation_fp 26 | 27 | #define FOGQUAKE3_GLSL 28 | 29 | uniform float u_FogEyeT; 30 | 31 | IN(smooth) float var_FogPlaneDistance; 32 | IN(smooth) vec3 var_ScaledViewerOffset; 33 | IN(smooth) vec4 var_Color; 34 | 35 | DECLARE_OUTPUT(vec4) 36 | 37 | void main() 38 | { 39 | #insert material_fp 40 | 41 | float s = length(var_ScaledViewerOffset); 42 | float t = step( 0, var_FogPlaneDistance ); 43 | 44 | if ( u_FogEyeT < 0 ) // eye outside fog 45 | { 46 | // fraction of the viewer-to-vertex ray which is inside fog 47 | t *= var_FogPlaneDistance / ( max( 0, var_FogPlaneDistance ) - u_FogEyeT ); 48 | } 49 | 50 | vec4 color = vec4(1, 1, 1, GetFogAlpha(s, t)); 51 | 52 | color *= var_Color; 53 | 54 | outputColor = color; 55 | } 56 | -------------------------------------------------------------------------------- /src/engine/renderer/tr_image.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 1999-2005 Id Software, Inc. 4 | Copyright (C) 2006-2009 Robert Beckebans 5 | 6 | This file is part of Daemon source code. 7 | 8 | Daemon source code is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU General Public License as 10 | published by the Free Software Foundation; either version 2 of the License, 11 | or (at your option) any later version. 12 | 13 | Daemon source code is distributed in the hope that it will be 14 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Daemon source code; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | =========================================================================== 22 | */ 23 | 24 | #ifndef TR_IMAGE_H 25 | #define TR_IMAGE_H 26 | 27 | /* 28 | * Include file for users of JPEG library. 29 | * You will need to have included system headers that define at least 30 | * the typedefs FILE and size_t before you can include jpeglib.h. 31 | * (stdio.h is sufficient on ANSI-conforming systems.) 32 | * You may also wish to include "jerror.h". 33 | */ 34 | #include 35 | #include 36 | 37 | #if JPEG_LIB_VERSION < 80 38 | // jpeg-6 deals with 4 byte / pixel, in RGBA order 39 | #define JPEG_PIXEL_SIZE 4 40 | #define JPEG_HAS_ALPHA 41 | // ugly, if it's not jpeg-8, we need the internal stuff too 42 | #include 43 | #else 44 | // jpeg-8 uses 3 byte/pixel, in RGB order 45 | #define JPEG_PIXEL_SIZE 3 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/engine/sys/con_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon GPL Source Code 5 | 6 | This file is part of the Daemon GPL Source Code (Daemon Source Code). 7 | 8 | Daemon Source Code is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | Daemon Source Code is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with Daemon Source Code. If not, see . 20 | 21 | In addition, the Daemon Source Code is also subject to certain additional terms. 22 | You should have received a copy of these additional terms immediately following the 23 | terms and conditions of the GNU General Public License which accompanied the Daemon 24 | Source Code. If not, please request a copy in writing from id Software at the address 25 | below. 26 | 27 | If you have questions concerning this license or the applicable additional terms, you 28 | may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, 29 | Maryland 20850 USA. 30 | 31 | =========================================================================== 32 | */ 33 | 34 | #include "common/Color.h" 35 | #include "qcommon/q_shared.h" 36 | #include "qcommon/qcommon.h" 37 | #include "qcommon/q_unicode.h" 38 | 39 | namespace Color { 40 | 41 | /* 42 | * Returns a 4 bit integer with the bits following this pattern: 43 | * 1 red 44 | * 2 green 45 | * 4 blue 46 | * 8 bright 47 | */ 48 | int To4bit( const Color& color ) NOEXCEPT; 49 | 50 | } // namespace Color 51 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/fogGlobal_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2011 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* fogGlobal_fp.glsl */ 24 | 25 | #insert common 26 | #insert fogEquation_fp 27 | 28 | uniform sampler2D u_DepthMap; 29 | 30 | uniform colorPack u_Color; 31 | 32 | uniform vec3 u_ViewOrigin; 33 | uniform float u_FogDensity; 34 | uniform mat4 u_UnprojectMatrix; 35 | 36 | DECLARE_OUTPUT(vec4) 37 | 38 | void main() 39 | { 40 | // calculate the screen texcoord in the 0.0 to 1.0 range 41 | vec2 st = gl_FragCoord.st / r_FBufSize; 42 | 43 | // reconstruct vertex position in world space 44 | float depth = texture2D(u_DepthMap, st).r; 45 | vec4 P = u_UnprojectMatrix * vec4(gl_FragCoord.xy, depth, 1.0); 46 | P.xyz /= P.w; 47 | 48 | // calculate the length in fog (t is always 1 if eye is in fog) 49 | float s = distance(u_ViewOrigin, P.xyz) * u_FogDensity; 50 | 51 | vec4 color = vec4(1, 1, 1, GetFogAlpha(s, 1.0)); 52 | 53 | outputColor = UnpackColor( u_Color ) * color; 54 | } 55 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/sys/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * NaCl Service Runtime API. Time types. 9 | */ 10 | 11 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_TIME_H_ 12 | #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_TIME_H_ 13 | 14 | #include "native_client/src/trusted/service_runtime/include/machine/_types.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | #ifdef __native_client__ 21 | #ifndef nacl_abi___susecond_t_defined 22 | #define nacl_abi___susecond_t_defined 23 | typedef long int nacl_abi_suseconds_t; 24 | #endif 25 | #else 26 | typedef int32_t nacl_abi_suseconds_t; 27 | #endif 28 | 29 | #ifndef nacl_abi___clock_t_defined 30 | #define nacl_abi___clock_t_defined 31 | typedef long int nacl_abi_clock_t; /* to be deprecated */ 32 | #endif 33 | 34 | struct nacl_abi_timeval { 35 | nacl_abi_time_t nacl_abi_tv_sec; 36 | nacl_abi_suseconds_t nacl_abi_tv_usec; 37 | }; 38 | 39 | /* obsolete. should not be used */ 40 | struct nacl_abi_timezone { 41 | int tz_minuteswest; 42 | int tz_dsttime; 43 | }; 44 | 45 | /* 46 | * In some places (e.g., the linux man page) the second parameter is defined 47 | * as a struct timezone *. The header file says this struct type should 48 | * never be used, and defines it by default as void *. The Mac man page says 49 | * it is void *. 50 | */ 51 | extern int nacl_abi_gettimeofday(struct nacl_abi_timeval *tv, void *tz); 52 | 53 | /* 54 | * POSIX defined clock id values for clock_getres andn clock_gettime. 55 | */ 56 | 57 | #define NACL_ABI_CLOCK_REALTIME (0) 58 | #define NACL_ABI_CLOCK_MONOTONIC (1) 59 | #define NACL_ABI_CLOCK_PROCESS_CPUTIME_ID (2) 60 | #define NACL_ABI_CLOCK_THREAD_CPUTIME_ID (3) 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/nacl_string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010, Google Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above 12 | * copyright notice, this list of conditions and the following disclaimer 13 | * in the documentation and/or other materials provided with the 14 | * distribution. 15 | * * Neither the name of Google Inc. nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | // This file defines nacl::string and nacl::stringstream to use across trusted 33 | // and shared parts of NaCl. It's useful if you want to use other string than 34 | // std::string. 35 | 36 | #include 37 | #include 38 | 39 | namespace nacl { 40 | typedef std::string string; 41 | 42 | typedef std::stringstream stringstream; 43 | } 44 | -------------------------------------------------------------------------------- /src/engine/qcommon/crypto.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon GPL Source Code 5 | Copyright (C) 2007-2008 Amanieu d'Antras (amanieu@gmail.com) 6 | Copyright (C) 2012 Dusan Jocic 7 | 8 | Daemon is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | Daemon is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see . 20 | 21 | =========================================================================== 22 | */ 23 | 24 | #ifndef __CRYPTO_H__ 25 | #define __CRYPTO_H__ 26 | 27 | #include "q_shared.h" 28 | #include "qcommon.h" 29 | 30 | /* The Nettle headers include the GMP header, this disables the warning 31 | on GMP alone, not the whole Nettle. We don't use GMP directly ourselves. */ 32 | #if defined(_MSC_VER) 33 | #pragma warning(push) 34 | #pragma warning(disable : 4146) // "unary minus operator applied to unsigned type, result still unsigned" 35 | #include 36 | #pragma warning(pop) 37 | #endif 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | // Old versions of nettle have nettle_random_func taking an unsigned parameter 44 | // instead of a size_t parameter. Detect this and use the appropriate type. 45 | using NettleLength = std::conditional::value, size_t, unsigned>::type; 46 | 47 | // Random function used for key generation and encryption 48 | void qnettle_random( void *ctx, NettleLength length, uint8_t *dst ); 49 | 50 | #endif /* __CRYPTO_H__ */ 51 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/sys/dirent.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_DIRENT_H 8 | #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_DIRENT_H 9 | 10 | #ifdef __native_client__ 11 | #include "native_client/src/trusted/service_runtime/include/sys/types.h" 12 | #else 13 | #include "native_client/src/trusted/service_runtime/include/machine/_types.h" 14 | #endif 15 | 16 | #ifdef __native_client__ 17 | /* check the compiler toolchain */ 18 | # ifdef NACL_ABI_MAXNAMLEN 19 | # if NACL_ABI_MAXNAMLEN != 255 20 | # error "MAXNAMLEN inconsistent" 21 | # endif 22 | # ifdef NAME_MAX 23 | # if NAME_MAX != 255 24 | # error "NAME_MAX inconsistent" 25 | # endif 26 | # endif 27 | # else 28 | # define NACL_ABI_MAXNAMLEN 255 29 | # endif 30 | #else /* __native_client__ */ 31 | # define NACL_ABI_MAXNAMLEN 255 32 | #endif 33 | 34 | /* 35 | * _dirdesc contains the state used by opendir/readdir/closedir. 36 | */ 37 | typedef struct nacl_abi__dirdesc { 38 | int nacl_abi_dd_fd; 39 | long nacl_abi_dd_loc; 40 | long nacl_abi_dd_size; 41 | char *nacl_abi_dd_buf; 42 | int nacl_abi_dd_len; 43 | long nacl_abi_dd_seek; 44 | } nacl_abi_DIR; 45 | 46 | /* 47 | * dirent represents a single directory entry. 48 | */ 49 | struct nacl_abi_dirent { 50 | nacl_abi_ino_t nacl_abi_d_ino; 51 | nacl_abi_off_t nacl_abi_d_off; 52 | uint16_t nacl_abi_d_reclen; 53 | char nacl_abi_d_name[NACL_ABI_MAXNAMLEN + 1]; 54 | }; 55 | 56 | /* 57 | * external function declarations 58 | */ 59 | extern nacl_abi_DIR *nacl_abi_opendir(const char *dirpath); 60 | extern struct nacl_abi_dirent *nacl_abi_readdir(nacl_abi_DIR *direntry); 61 | extern int nacl_abi_closedir(nacl_abi_DIR *direntry); 62 | extern void nacl_abi_rewinddir(nacl_abi_DIR *direntry); 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /.appveyor.yml: -------------------------------------------------------------------------------- 1 | # Documentation: https://wiki.unvanquished.net/wiki/Continuous_integration 2 | 3 | skip_branch_with_pr: true 4 | 5 | only_commits: 6 | files: 7 | - .appveyor.yml 8 | # The rest of this list should stay in sync with azure-pipelines.yml 9 | - src/ 10 | - libs/ 11 | - cmake/ 12 | - CMakeLists.txt 13 | - '*.cmake' 14 | - .gitmodules 15 | 16 | branches: 17 | except: 18 | - debian 19 | 20 | environment: 21 | matrix: 22 | # see 96d5c1f3ed77b09c64ce7c3c7cbd37c70456b3db 23 | # for NMake template 24 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 25 | generator: Visual Studio 17 2022 26 | platform: x64 27 | 28 | build: 29 | parallel: true 30 | 31 | before_build: 32 | - curl -sS https://gitlab.com/illwieckz/git-checkout-modules/raw/master/git-checkout-modules -o git-checkout-modules 33 | # The git-checkout-modules command below is normally equivalent to 'git submodule update --init --recursive', 34 | # but in the case that the branch name ends with '/sync' it tries to find branches with the same name. 35 | - bash git-checkout-modules 36 | --update 37 | --sub-ref=%APPVEYOR_REPO_BRANCH%:has=/sync$ 38 | --sub-ref=%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH%:has=/sync$ 39 | --print 40 | 41 | build_script: 42 | # simple line break: space 43 | # double line break: line break 44 | - cmd: > 45 | cmake --version 46 | 47 | :: These env vars *prepend* to CMAKE__FLAGS rather than overwriting. 48 | :: /Wv pins warnings to a specific compiler version so that new ones 49 | :: don't make the build error after Appveyor updates the compiler. 50 | 51 | set CFLAGS=/Wv:19.34 52 | 53 | set CXXFLAGS=/Wv:19.34 54 | 55 | cmake 56 | -Wdev -Wdeprecated 57 | -G"%generator%" -A"%platform%" 58 | -DUSE_PRECOMPILED_HEADER=0 -DUSE_WERROR=1 -DBE_VERBOSE=1 59 | -DUSE_CPP23=1 60 | -DBUILD_DUMMY_APP=1 -DBUILD_TESTS=1 61 | -S. -Bbuild 62 | 63 | cmake --build build --config Release 64 | 65 | build\Release\test-dummyapp -pakpath pkg 66 | -------------------------------------------------------------------------------- /src/common/Type.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #ifndef COMMON_TYPE_H_ 32 | #define COMMON_TYPE_H_ 33 | 34 | #include 35 | 36 | template 37 | constexpr bool IsPod = std::is_standard_layout::value && std::is_trivially_copyable::value && std::is_trivially_default_constructible::value; 38 | 39 | #endif // COMMON_TYPE_H_ 40 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/blur_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2006-2011 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* blur_fp.glsl */ 24 | 25 | uniform sampler2D u_ColorMap; 26 | uniform float u_DeformMagnitude; 27 | uniform vec2 u_TexScale; 28 | uniform bool u_Horizontal; 29 | 30 | DECLARE_OUTPUT( vec4 ) 31 | 32 | void main() { 33 | vec2 st = gl_FragCoord.st * u_TexScale; 34 | 35 | #if 0 36 | float gaussFact[3] = float[3] ( 1.0, 2.0, 1.0 ); 37 | float gaussSum = 4; 38 | const int tap = 1; 39 | #elif 0 40 | float gaussFact[5] = float[5] ( 1.0, 4.0, 6.0, 4.0, 1.0 ); 41 | float gaussSum = 16.0; 42 | const int tap = 2; 43 | #elif 1 44 | float gaussFact[7] = float[7] ( 1.0, 6.0, 15.0, 20.0, 15.0, 6.0, 1.0 ); 45 | float gaussSum = 64.0; 46 | const int tap = 3; 47 | #endif 48 | 49 | // do a full gaussian blur 50 | vec4 sumColors = vec4( 0.0 ); 51 | 52 | for( int t = -tap; t <= tap; t++ ) { 53 | float weight = gaussFact[t + tap]; 54 | sumColors += texture2D( u_ColorMap, st + vec2( u_Horizontal ? t : 0, u_Horizontal ? 0 : t ) * u_TexScale * u_DeformMagnitude ) * weight; 55 | } 56 | 57 | outputColor = sumColors * ( 1.0 / gaussSum ); 58 | } 59 | -------------------------------------------------------------------------------- /cmake/FindWasmtime.cmake: -------------------------------------------------------------------------------- 1 | # Daemon BSD Source Code 2 | # Copyright (c) 2021, Daemon Developers 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of the nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # Find Wasmtime (C API), defines: 28 | # 29 | # - Wasmtime_FOUND, true iff Wasmtime was found 30 | # - Wasmtime_LIBRARIES, the libraries to link against for Wasmtime 31 | # Wasmtime_INCLUDE_DIRS, the include directories for Wasmtime 32 | find_path(Wasmtime_INCLUDE_DIRS NAMES wasm.h wasi.h wasmtime.h) 33 | find_library(Wasmtime_LIBRARIES NAMES wasmtime) 34 | 35 | include(FindPackageHandleStandardArgs) 36 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Wasmtime DEFAULT_MSG Wasmtime_LIBRARIES Wasmtime_INCLUDE_DIRS) 37 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/lighttile_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2013-2016 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | /* lighttile_vp.glsl */ 36 | 37 | IN vec2 attr_Position; 38 | 39 | OUT(smooth) vec2 vPosition; 40 | 41 | void main() { 42 | gl_Position = vec4( attr_Position, 0.0, 1.0 ); 43 | gl_PointSize = 1.0; 44 | 45 | vPosition = attr_Position; 46 | } 47 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/material_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2024 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | /* material_vp.glsl */ 36 | 37 | #if defined(USE_MATERIAL_SYSTEM) 38 | 39 | #ifdef HAVE_ARB_shader_draw_parameters 40 | in_drawID = drawID; 41 | in_baseInstance = baseInstance; 42 | #endif // !HAVE_ARB_shader_draw_parameters 43 | 44 | #endif // !USE_MATERIAL_SYSTEM 45 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/fogEquation_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2025 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | float GetFogAlpha(float s, float t) 36 | { 37 | t = clamp(t, 0.0, 1.0); 38 | 39 | float x = min(1, s * t); 40 | 41 | // sqrt(x) is bad near 0 because it increases too quickly resulting in sharp edges. 42 | // x ≤ 1/32: √32 * x 43 | // x ≥ 1/32: √x 44 | return min(sqrt(32.0) * x, sqrt(x)); 45 | } 46 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/motionblur_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2006-2011 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* motionblur_fp.glsl */ 24 | 25 | uniform sampler2D u_ColorMap; 26 | uniform sampler2D u_DepthMap; 27 | 28 | uniform vec3 u_blurVec; 29 | 30 | #if __VERSION__ > 120 31 | out vec4 outputColor; 32 | #else 33 | #define outputColor gl_FragColor 34 | #endif 35 | 36 | void main() 37 | { 38 | vec4 color = vec4( 0.0 ); 39 | 40 | // calculate the screen texcoord in the 0.0 to 1.0 range 41 | vec2 st = gl_FragCoord.st / r_FBufSize; 42 | 43 | float depth = texture2D( u_DepthMap, st ).r; 44 | 45 | if( depth >= 1.0 ) { 46 | // keep the original color 47 | outputColor = texture2D( u_ColorMap, st ); 48 | return; 49 | } 50 | 51 | depth /= 1.0 - depth; 52 | 53 | vec3 start = vec3(st * 2.0 - 1.0, 1.0) * depth; 54 | vec3 end = start + u_blurVec.xyz; 55 | 56 | float weight = 1.0; 57 | float total = 0.0; 58 | 59 | for( int i = 0; i < 6; i ++ ) { 60 | vec3 pos = mix( start, end, float(i) * 0.1 ); 61 | pos /= pos.z; 62 | 63 | color += weight * texture2D( u_ColorMap, 0.5 * pos.xy + 0.5 ); 64 | total += weight; 65 | weight *= 0.5; 66 | } 67 | 68 | outputColor = color / total; 69 | } 70 | -------------------------------------------------------------------------------- /src/engine/sys/DisableAccentMenu.m: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2025, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #import 32 | 33 | void DisableAccentMenu() { 34 | // Don't do this: https://forums.factorio.com/download/file.php?id=46540 35 | NSDictionary *appDefaults = [[NSDictionary alloc] initWithObjectsAndKeys: 36 | [NSNumber numberWithBool:NO], @"ApplePressAndHoldEnabled", nil]; 37 | [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; 38 | } 39 | -------------------------------------------------------------------------------- /src/engine/audio/SoundCodec.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #ifndef SOUND_CODEC_H 32 | #define SOUND_CODEC_H 33 | 34 | #include "AudioData.h" 35 | #include 36 | 37 | namespace Audio { 38 | 39 | AudioData LoadSoundCodec(std::string filename); 40 | 41 | AudioData LoadWavCodec(std::string filename); 42 | 43 | AudioData LoadOggCodec(std::string filename); 44 | 45 | AudioData LoadOpusCodec(std::string filename); 46 | 47 | } // namespace Audio 48 | #endif 49 | -------------------------------------------------------------------------------- /src/engine/null/null_input.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Wolfenstein: Enemy Territory GPL Source Code 5 | Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. 6 | 7 | This file is part of the Wolfenstein: Enemy Territory GPL Source Code (Wolf ET Source Code). 8 | 9 | Wolf ET Source Code is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Wolf ET Source Code is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Wolf ET Source Code. If not, see . 21 | 22 | In addition, the Wolf: ET Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Wolf ET Source Code. If not, please request a copy in writing from id Software at the address below. 23 | 24 | If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. 25 | 26 | =========================================================================== 27 | */ 28 | 29 | #include "qcommon/q_shared.h" 30 | #include "qcommon/qcommon.h" 31 | #include "client/client.h" 32 | 33 | void IN_Init( void* ) 34 | { 35 | } 36 | 37 | void IN_Frame() 38 | { 39 | } 40 | 41 | void IN_FrameEnd() 42 | { 43 | } 44 | 45 | void IN_Restart() 46 | { 47 | } 48 | 49 | void IN_Shutdown() 50 | { 51 | } 52 | 53 | void IN_ShutdownJoystick() 54 | { 55 | } 56 | 57 | void IN_CenterMouse() 58 | { 59 | } 60 | 61 | void IN_DropInputsForFrame() 62 | { 63 | } 64 | 65 | bool IN_IsNumLockOn() 66 | { 67 | return false; 68 | } 69 | 70 | void IN_SetMouseMode(MouseMode) 71 | { 72 | } 73 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/contrast_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2006-2009 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* contrast_fp.glsl */ 24 | 25 | uniform sampler2D u_ColorMap; 26 | 27 | const vec4 LUMINANCE_VECTOR = vec4(0.2125, 0.7154, 0.0721, 0.0); 28 | 29 | #if __VERSION__ > 120 30 | out vec4 outputColor; 31 | #else 32 | #define outputColor gl_FragColor 33 | #endif 34 | 35 | // contrast adjustment function 36 | vec4 f(vec4 color) { 37 | float L = dot(LUMINANCE_VECTOR, color); 38 | L = max(L - 0.71, 0.0) * (1.0 / (1.0 - 0.71)); 39 | //L = pow(L, 8.0); 40 | return color * L; 41 | } 42 | 43 | void main() 44 | { 45 | // calculate the screen texcoord in the 0.0 to 1.0 range 46 | vec2 st = gl_FragCoord.st / r_FBufSize; 47 | 48 | // multiply with 4 because the FBO is only 1/4th of the screen resolution 49 | st *= vec2(4.0, 4.0); 50 | 51 | vec2 scale = 1 / r_FBufSize; 52 | 53 | // perform a box filter for the downsample 54 | vec4 color = f(texture2D(u_ColorMap, st + vec2(-1.0, -1.0) * scale)); 55 | color += f(texture2D(u_ColorMap, st + vec2(-1.0, 1.0) * scale)); 56 | color += f(texture2D(u_ColorMap, st + vec2(1.0, -1.0) * scale)); 57 | color += f(texture2D(u_ColorMap, st + vec2(1.0, 1.0) * scale)); 58 | color *= 0.25; 59 | 60 | outputColor = color; 61 | } 62 | -------------------------------------------------------------------------------- /src/engine/framework/System.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #include "qcommon/qcommon.h" 32 | 33 | #ifndef FRAMEWORK_SYSTEM_H_ 34 | #define FRAMEWORK_SYSTEM_H_ 35 | 36 | // Low-level system functions 37 | namespace Sys { 38 | 39 | // Cleanly exit the engine, shutting down all subsystems. 40 | NORETURN void Quit(Str::StringRef message); 41 | 42 | // Get the path of a singleton socket 43 | std::string GetSingletonSocketPath(); 44 | 45 | } // namespace Sys 46 | 47 | #endif // FRAMEWORK_SYSTEM_H_ 48 | -------------------------------------------------------------------------------- /src/engine/framework/BaseCommands.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #ifndef FRAMEWORK_BASE_COMMANDS_H_ 32 | #define FRAMEWORK_BASE_COMMANDS_H_ 33 | 34 | /** 35 | * Function related to basic commands such as aliases and delays 36 | */ 37 | 38 | namespace Cmd { 39 | 40 | // Executes delayed commands that are ready. 41 | void DelayFrame(); 42 | 43 | //Saves the aliases in a configuration file 44 | std::string GetAliasConfigText(); 45 | } 46 | 47 | #endif // FRAMEWORK_BASE_COMMANDS_H_ 48 | -------------------------------------------------------------------------------- /src/engine/botlib/bot_debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2013 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | 31 | =========================================================================== 32 | */ 33 | 34 | #ifndef BOT_DEBUG_H 35 | #define BOT_DEBUG_H 36 | 37 | enum class debugDrawMode_t : uint8_t 38 | { 39 | D_DRAW_POINTS, 40 | D_DRAW_LINES, 41 | D_DRAW_TRIS, 42 | D_DRAW_QUADS 43 | }; 44 | 45 | enum class debugDrawCommand_t : uint8_t 46 | { 47 | BEGIN, 48 | END, 49 | DEPTHMASK, 50 | VERTEX, 51 | VERTEX_UV, // WTF is the meaning of a texture coordinate when you are drawing in one color? 52 | EOC 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/engine/sys/con_passive.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon GPL Source Code 5 | Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. 6 | 7 | This file is part of the Daemon GPL Source Code (Daemon Source Code). 8 | 9 | Daemon Source Code is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Daemon Source Code is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Daemon Source Code. If not, see . 21 | 22 | In addition, the Daemon Source Code is also subject to certain additional terms. 23 | You should have received a copy of these additional terms immediately following the 24 | terms and conditions of the GNU General Public License which accompanied the Daemon 25 | Source Code. If not, please request a copy in writing from id Software at the address 26 | below. 27 | 28 | If you have questions concerning this license or the applicable additional terms, you 29 | may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, 30 | Maryland 20850 USA. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | #include "qcommon/q_shared.h" 36 | #include "qcommon/qcommon.h" 37 | 38 | /* 39 | ================== 40 | CON_Shutdown 41 | ================== 42 | */ 43 | void CON_Shutdown_TTY() 44 | { 45 | } 46 | 47 | /* 48 | ================== 49 | CON_Init 50 | ================== 51 | */ 52 | void CON_Init_TTY() 53 | { 54 | } 55 | 56 | /* 57 | ================== 58 | CON_Input 59 | ================== 60 | */ 61 | char *CON_Input_TTY() 62 | { 63 | return nullptr; 64 | } 65 | 66 | /* 67 | ================== 68 | CON_Print 69 | ================== 70 | */ 71 | void CON_Print_TTY( const char *msg ) 72 | { 73 | fputs( msg, stderr ); 74 | } 75 | -------------------------------------------------------------------------------- /src/engine/qcommon/sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon GPL Source Code 5 | Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. 6 | 7 | This file is part of the Daemon GPL Source Code (Daemon Source Code). 8 | 9 | Daemon Source Code is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Daemon Source Code is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Daemon Source Code. If not, see . 21 | 22 | In addition, the Daemon Source Code is also subject to certain additional terms. 23 | You should have received a copy of these additional terms immediately following the 24 | terms and conditions of the GNU General Public License which accompanied the Daemon 25 | Source Code. If not, please request a copy in writing from id Software at the address 26 | below. 27 | 28 | If you have questions concerning this license or the applicable additional terms, you 29 | may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, 30 | Maryland 20850 USA. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | #ifndef ENGINE_QCOMMON_SYS_H_ 36 | #define ENGINE_QCOMMON_SYS_H_ 37 | 38 | #include "engine/qcommon/net_types.h" 39 | 40 | // server->client bandwidth limits in bytes/sec 41 | #define NETWORK_MIN_RATE 1000 42 | #define NETWORK_DEFAULT_RATE 25000 43 | #define NETWORK_MAX_RATE 90000 44 | #define NETWORK_LAN_RATE 99999 45 | 46 | void Sys_SendPacket(int length, const void *data, const netadr_t& to); 47 | bool Sys_GetPacket(netadr_t *net_from, msg_t *net_message); 48 | 49 | bool Sys_StringToAdr(const char *s, netadr_t *a, netadrtype_t family); 50 | 51 | bool Sys_IsLANAddress(const netadr_t& adr); 52 | 53 | #endif // ENGINE_QCOMMON_SYS_H_ 54 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/vertexSimple_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2010 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | // vertexSimple_vp.glsl - simple vertex fetch 23 | 24 | struct localBasis { 25 | vec3 normal; 26 | vec3 tangent, binormal; 27 | }; 28 | 29 | vec3 QuatTransVec(in vec4 quat, in vec3 vec) { 30 | vec3 tmp = 2.0 * cross( quat.xyz, vec ); 31 | return vec + quat.w * tmp + cross( quat.xyz, tmp ); 32 | } 33 | 34 | void QTangentToLocalBasis( in vec4 qtangent, out localBasis LB ) { 35 | LB.normal = QuatTransVec( qtangent, vec3( 0.0, 0.0, 1.0 ) ); 36 | LB.tangent = QuatTransVec( qtangent, vec3( 1.0, 0.0, 0.0 ) ); 37 | LB.tangent *= sign( qtangent.w ); 38 | LB.binormal = QuatTransVec( qtangent, vec3( 0.0, 1.0, 0.0 ) ); 39 | } 40 | 41 | #if !defined(USE_VERTEX_ANIMATION) && !defined(USE_VERTEX_SKINNING) 42 | 43 | IN vec3 attr_Position; 44 | IN vec4 attr_Color; 45 | IN vec4 attr_QTangent; 46 | IN vec4 attr_TexCoord0; 47 | 48 | void VertexFetch(out vec4 position, 49 | out localBasis normalBasis, 50 | out vec4 color, 51 | out vec2 texCoord, 52 | out vec2 lmCoord) 53 | { 54 | position = vec4( attr_Position, 1.0 ); 55 | QTangentToLocalBasis( attr_QTangent, normalBasis ); 56 | color = attr_Color; 57 | texCoord = attr_TexCoord0.xy; 58 | lmCoord = attr_TexCoord0.zw; 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/portability_process.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009, Google Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above 12 | * copyright notice, this list of conditions and the following disclaimer 13 | * in the documentation and/or other materials provided with the 14 | * distribution. 15 | * * Neither the name of Google Inc. nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | 33 | /* 34 | * This file should be at the top of the #include group, followed by 35 | * standard system #include files, then by native client specific 36 | * includes. 37 | */ 38 | 39 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_PROCESS_H_ 40 | #define NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_PROCESS_H_ 1 41 | 42 | #if NACL_WINDOWS 43 | 44 | #include 45 | #define GETPID _getpid 46 | 47 | #else 48 | 49 | #include 50 | #define GETPID getpid 51 | 52 | #endif 53 | 54 | #endif /* NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_PROCESS_H_ */ 55 | -------------------------------------------------------------------------------- /src/engine/renderer/InternalImage.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2013-2016 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | // InternalImage.h 35 | 36 | #ifndef INTERNAL_IMAGE_H 37 | #define INTERNAL_IMAGE_H 38 | #include "tr_local.h" 39 | 40 | int R_GetImageCustomScalingStep( const image_t *image, const imageParams_t &imageParams ); 41 | void R_DownscaleImageDimensions( int scalingStep, int *scaledWidth, int *scaledHeight, const byte ***dataArray, int numLayers, int *numMips ); 42 | 43 | #endif // INTERNAL_IMAGE_H 44 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/liquid_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2007-2009 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* liquid_vp.glsl */ 24 | 25 | IN vec3 attr_Position; 26 | IN vec2 attr_TexCoord0; 27 | IN vec3 attr_Tangent; 28 | IN vec3 attr_Binormal; 29 | IN vec3 attr_Normal; 30 | 31 | #if !defined(USE_MATERIAL_SYSTEM) 32 | uniform mat3x2 u_TextureMatrix; 33 | #endif 34 | 35 | uniform mat4 u_ModelMatrix; 36 | uniform mat4 u_ModelViewProjectionMatrix; 37 | 38 | OUT(smooth) vec3 var_Position; 39 | OUT(smooth) vec2 var_TexCoords; 40 | OUT(smooth) vec3 var_Tangent; 41 | OUT(smooth) vec3 var_Binormal; 42 | OUT(smooth) vec3 var_Normal; 43 | 44 | void main() 45 | { 46 | #insert material_vp 47 | 48 | // transform vertex position into homogenous clip-space 49 | gl_Position = u_ModelViewProjectionMatrix * vec4(attr_Position, 1.0); 50 | 51 | // transform position into world space 52 | var_Position = (u_ModelMatrix * vec4(attr_Position, 1.0)).xyz; 53 | 54 | // transform normalmap texcoords 55 | var_TexCoords = (u_TextureMatrix * vec3(attr_TexCoord0, 1.0)).st; 56 | 57 | var_Tangent.xyz = (u_ModelMatrix * vec4(attr_Tangent, 0.0)).xyz; 58 | var_Binormal.xyz = (u_ModelMatrix * vec4(attr_Binormal, 0.0)).xyz; 59 | 60 | // transform normal into world space 61 | var_Normal = (u_ModelMatrix * vec4(attr_Normal, 0.0)).xyz; 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/screenSpace_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2025 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | /* screenSpace_vp.glsl */ 36 | 37 | #if defined(HAVE_EXT_gpu_shader4) 38 | const vec2 vertices[3] = vec2[3] ( vec2( -1.0f, -1.0f ), vec2( 3.0f, -1.0f ), vec2( -1.0f, 3.0f ) ); 39 | 40 | void main() { 41 | gl_Position = vec4( vertices[gl_VertexID], 0.0f, 1.0f ); 42 | } 43 | #else 44 | IN vec3 attr_Position; 45 | 46 | void main() { 47 | gl_Position = vec4( attr_Position, 1.0f ); 48 | } 49 | #endif 50 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/heatHaze_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2006-2011 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* heatHaze_fp.glsl */ 24 | 25 | #insert reliefMapping_fp 26 | 27 | #define HEATHAZE_GLSL 28 | 29 | uniform sampler2D u_CurrentMap; 30 | 31 | #if defined(USE_MATERIAL_SYSTEM) 32 | uniform float u_DeformEnable; 33 | #endif 34 | 35 | IN(smooth) vec2 var_TexCoords; 36 | IN(smooth) float var_Deform; 37 | 38 | DECLARE_OUTPUT(vec4) 39 | 40 | void main() 41 | { 42 | #insert material_fp 43 | 44 | vec4 color; 45 | 46 | // compute normal in tangent space from normalmap 47 | #if defined(r_normalMapping) 48 | vec3 normal = NormalInTangentSpace(var_TexCoords, u_NormalMap); 49 | #else // !r_normalMapping 50 | vec3 normal = NormalInTangentSpace(var_TexCoords); 51 | #endif // !r_normalMapping 52 | 53 | // calculate the screen texcoord in the 0.0 to 1.0 range 54 | vec2 st = gl_FragCoord.st / r_FBufSize; 55 | 56 | // offset by the scaled normal and clamp it to 0.0 - 1.0 57 | 58 | #if defined(USE_MATERIAL_SYSTEM) 59 | // Use a global uniform for heatHaze with material system to avoid duplicating all of the shader stage data 60 | st += normal.xy * var_Deform * u_DeformEnable; 61 | #else 62 | st += normal.xy * var_Deform; 63 | #endif 64 | 65 | st = clamp(st, 0.0, 1.0); 66 | 67 | color = texture2D(u_CurrentMap, st); 68 | 69 | outputColor = color; 70 | } 71 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/depthtile1_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2013-2016 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | /* depthtile1_vp.glsl */ 36 | 37 | IN vec3 attr_Position; 38 | 39 | uniform mat4 u_ModelViewProjectionMatrix; 40 | uniform vec3 u_zFar; 41 | OUT(flat) vec3 unprojectionParams; 42 | 43 | void main() 44 | { 45 | unprojectionParams.x = - r_zNear * u_zFar.z; 46 | unprojectionParams.y = 2.0 * (u_zFar.z - r_zNear); 47 | unprojectionParams.z = 2.0 * u_zFar.z - r_zNear; 48 | 49 | gl_Position = u_ModelViewProjectionMatrix * vec4( attr_Position, 1.0f ); 50 | } 51 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/shaderProfiler_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2024 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | /* shaderProfiler_vp.glsl */ 36 | 37 | #if defined(r_profilerRenderSubGroups) && defined(HAVE_KHR_shader_subgroup_basic) && defined(HAVE_KHR_shader_subgroup_arithmetic) 38 | uniform uint u_ProfilerRenderSubGroups; 39 | OUT(flat) float var_SubGroupCount; 40 | 41 | #define SHADER_PROFILER_SET \ 42 | if( u_ProfilerRenderSubGroups == 1 ) {\ 43 | var_SubGroupCount = subgroupAdd( 1.0 ) / float( gl_SubgroupSize );\ 44 | } 45 | #else 46 | #define SHADER_PROFILER_OUT 47 | #define SHADER_PROFILER_SET 48 | #endif 49 | -------------------------------------------------------------------------------- /src/engine/framework/CrashDump.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #ifndef FRAMEWORK_CRASHDUMP_H_ 32 | #define FRAMEWORK_CRASHDUMP_H_ 33 | 34 | #include 35 | #include 36 | 37 | namespace Sys { 38 | // Ensure existence of the subdirectory of homepath used for crash dumps. Return true if successful 39 | bool CreateCrashDumpPath(); 40 | 41 | // Launch the Breakpad server, if enabled in CMake and cvars. 42 | void BreakpadInit(); 43 | 44 | // Write a crash dump that came from an NaCl VM. 45 | void NaclCrashDump(const std::vector& dump, Str::StringRef vmName); 46 | } 47 | 48 | #endif // FRAMEWORK_CRASHDUMP_H_ 49 | -------------------------------------------------------------------------------- /src/engine/null/null_client.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Wolfenstein: Enemy Territory GPL Source Code 5 | Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. 6 | 7 | This file is part of the Wolfenstein: Enemy Territory GPL Source Code (Wolf ET Source Code). 8 | 9 | Wolf ET Source Code is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Wolf ET Source Code is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Wolf ET Source Code. If not, see . 21 | 22 | In addition, the Wolf: ET Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Wolf ET Source Code. If not, please request a copy in writing from id Software at the address below. 23 | 24 | If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. 25 | 26 | =========================================================================== 27 | */ 28 | 29 | // null_client.cpp: no-op client functions built with the dedicated server 30 | 31 | #include "qcommon/q_shared.h" 32 | #include "qcommon/qcommon.h" 33 | 34 | cvar_t *cl_shownet; 35 | 36 | void CL_Shutdown() 37 | { 38 | } 39 | 40 | void CL_Init() 41 | { 42 | cl_shownet = Cvar_Get( "cl_shownet", "0", CVAR_TEMP ); 43 | // TTimo: localisation, prolly not any use in dedicated / null client 44 | } 45 | 46 | void CL_MouseEvent( int, int ) 47 | { 48 | } 49 | 50 | void CL_MousePosEvent( int, int ) 51 | { 52 | } 53 | 54 | void CL_FocusEvent( bool ) 55 | { 56 | } 57 | 58 | void CL_Frame( int ) 59 | { 60 | } 61 | 62 | void CL_PacketEvent( const netadr_t& , msg_t* ) 63 | { 64 | } 65 | 66 | void CL_MapLoading() 67 | { 68 | } 69 | 70 | void CL_JoystickEvent( int, int ) 71 | { 72 | } 73 | -------------------------------------------------------------------------------- /src/common/Common.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #ifndef COMMON_COMMON_H_ 32 | #define COMMON_COMMON_H_ 33 | 34 | // Compiler.h, Platform.h and Endian.h are included by q_shared.h 35 | #include "engine/qcommon/q_shared.h" 36 | 37 | // Common headers 38 | #include "String.h" 39 | #include "Util.h" 40 | #include "Optional.h" 41 | #include "Command.h" 42 | #include "Cvar.h" 43 | #include "Log.h" 44 | #include "LineEditData.h" 45 | #include "System.h" 46 | #include "Assert.h" 47 | #include "Math.h" 48 | #include "Color.h" 49 | #include "Serialize.h" 50 | #include "DisjointSets.h" 51 | 52 | using Math::Vec2; 53 | using Math::Vec3; 54 | using Math::Vec4; 55 | 56 | #endif // COMMON_COMMON_H_ 57 | -------------------------------------------------------------------------------- /src/engine/framework/ConsoleField.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #ifndef FRAMEWORK_CONSOLE_FIELD_H_ 32 | #define FRAMEWORK_CONSOLE_FIELD_H_ 33 | 34 | #include "ConsoleHistory.h" 35 | #include "common/LineEditData.h" 36 | #include "common/String.h" 37 | 38 | namespace Console { 39 | 40 | class Field : public Util::LineEditData { 41 | public: 42 | Field(int size); 43 | 44 | void HistoryPrev(); 45 | void HistoryNext(); 46 | 47 | void RunCommand(Str::StringRef defaultCommand = ""); 48 | void AutoComplete(); 49 | 50 | private: 51 | History hist; 52 | }; 53 | 54 | } 55 | 56 | #endif // FRAMEWORK_CONSOLE_FIELD_H_ 57 | -------------------------------------------------------------------------------- /src/engine/framework/Resource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #include "Resource.h" 32 | 33 | namespace Resource { 34 | 35 | Resource::Resource(std::string name) : name(std::move(name)), 36 | loaded(false), failed(false), keep(true) { 37 | } 38 | 39 | Resource::~Resource() = default; 40 | 41 | bool Resource::TagDependencies() { 42 | return true; 43 | } 44 | 45 | bool Resource::IsStillValid() { 46 | return true; 47 | } 48 | 49 | const std::string& Resource::GetName() const { 50 | return name; 51 | } 52 | 53 | bool Resource::TryLoad() { 54 | loaded = Load(); 55 | if (not loaded) { 56 | failed = true; 57 | } 58 | return loaded; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/material_cp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2025 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | /* material_cp.glsl */ 36 | 37 | struct BoundingSphere { 38 | vec3 origin; 39 | float radius; 40 | }; 41 | 42 | struct PortalSurface { 43 | BoundingSphere boundingSphere; 44 | 45 | uint drawSurfID; 46 | float distance; 47 | vec2 padding; 48 | }; 49 | 50 | struct GLIndirectCommand { 51 | uint count; 52 | uint instanceCount; 53 | uint firstIndex; 54 | int baseVertex; 55 | uint baseInstance; 56 | }; 57 | 58 | struct IndirectCompactCommand { 59 | uint count; 60 | uint firstIndex; 61 | uint baseInstance; 62 | }; 63 | 64 | struct SurfaceCommand { 65 | bool enabled; 66 | IndirectCompactCommand drawCommand; 67 | }; 68 | -------------------------------------------------------------------------------- /src/engine/renderer/tr_image_webp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2011 Matthias Bentrup 4 | 5 | This file is part of Daemon source code. 6 | 7 | Daemon source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | Daemon source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Daemon source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | #include "tr_local.h" 24 | #include 25 | 26 | namespace { 27 | bool LoadInMemoryWEBP( const char *path, const uint8_t* webpData, size_t webpSize, byte **pic, int *width, 28 | int *height ) { 29 | // Validate data and query image size. 30 | if ( !WebPGetInfo( webpData, webpSize, width, height ) ) 31 | { 32 | Log::Warn( "WebP image '%s' has an invalid format", path ); 33 | return false; 34 | } 35 | 36 | const size_t stride{ *width * sizeof( u8vec4_t ) }; 37 | const size_t size{ *height * stride }; 38 | auto *out = (byte*)Z_Malloc( size ); 39 | 40 | // Decode into RGBA. 41 | if ( !WebPDecodeRGBAInto( webpData, webpSize, out, size, stride ) ) 42 | { 43 | Log::Warn( "WebP image '%s' has bad header or data", path ); 44 | return false; 45 | } 46 | 47 | *pic = out; 48 | return true; 49 | } 50 | } 51 | 52 | /* 53 | ========================================================= 54 | 55 | LoadWEBP 56 | 57 | ========================================================= 58 | */ 59 | void LoadWEBP( const char *path, byte **pic, int *width, int *height, int *, int *, int *, byte ) 60 | { 61 | *pic = nullptr; 62 | 63 | std::error_code err; 64 | std::string webpData = FS::PakPath::ReadFile( path, err ); 65 | 66 | if ( err ) { 67 | return; 68 | } 69 | 70 | if ( !LoadInMemoryWEBP( path, reinterpret_cast(webpData.data()), webpData.size(), pic, width, height ) ) { 71 | Z_Free( *pic ); 72 | *pic = nullptr; // This signals failure. 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /tools/nacl_helper_bootstrap-armhf/nacl_helper_bootstrap-armhf.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2022, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | int main(int argc, char *argv[]) { 39 | char *directory = dirname(strdup(argv[0])); 40 | 41 | int err = chdir(directory); 42 | 43 | if (err != 0) { 44 | return err; 45 | } 46 | 47 | err = putenv(strdup("LD_LIBRARY_PATH=lib-armhf")); 48 | 49 | if (err != 0) { 50 | return err; 51 | } 52 | 53 | char *helper = strdup("./nacl_helper_bootstrap"); 54 | argv[0] = helper; 55 | 56 | execv(helper, argv); 57 | 58 | // The execv() function returns only if an error has occurred. 59 | printf("nacl_helper_bootstrap-armhf: %s\n", strerror(errno)); 60 | 61 | return 1; 62 | } 63 | -------------------------------------------------------------------------------- /cmake/DaemonCompiler/DaemonCompiler.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # Daemon BSD Source Code 4 | # Copyright (c) 2024, Daemon Developers 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above copyright 12 | # notice, this list of conditions and the following disclaimer in the 13 | # documentation and/or other materials provided with the distribution. 14 | # * Neither the name of the nor the 15 | # names of its contributors may be used to endorse or promote products 16 | # derived from this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | # DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 22 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | # Test script not used by the CMake build system. Usage example: 30 | # ./DaemonCompiler.sh gcc 31 | 32 | set -ueo pipefail 33 | 34 | script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" 35 | file_path="${script_dir}/DaemonCompiler.c" 36 | 37 | # PNaCl doesn't work with “-o /dev/null” as it uses the output path as a 38 | # pattern for temporary files and then the parent folder should be writable. 39 | # Zig caches the build if both the source and the output don't change. Since 40 | # the /dev/null file never changes, Zig skips the compilation once done once. 41 | # So we need to use a randomly named path in a writable directory. 42 | temp_file="$(mktemp)" 43 | 44 | "${@}" "${file_path}" -o "${temp_file}" 2>&1 \ 45 | | grep 'REPORT>.*//' \ 47 | || "${@}" "${file_path}" -o "${temp_file}" 48 | 49 | rm "${temp_file}" 50 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/clearSurfaces_cp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2024 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | /* clearSurfaces_cp.glsl */ 36 | 37 | #insert common_cp 38 | 39 | layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in; 40 | 41 | layout(std430, binding = BIND_COMMAND_COUNTERS_STORAGE) writeonly buffer atomicCommandCountersBuffer { 42 | uint atomicCommandCounters[MAX_COMMAND_COUNTERS * MAX_VIEWFRAMES]; 43 | }; 44 | 45 | uniform uint u_Frame; 46 | 47 | void main() { 48 | const uint globalInvocationID = GLOBAL_INVOCATION_ID; 49 | if( globalInvocationID >= MAX_COMMAND_COUNTERS * MAX_VIEWS ) { 50 | return; 51 | } 52 | atomicCommandCounters[globalInvocationID + MAX_COMMAND_COUNTERS * MAX_VIEWS * u_Frame] = 0; 53 | } 54 | -------------------------------------------------------------------------------- /cmake/DaemonPlatform.cmake: -------------------------------------------------------------------------------- 1 | # Daemon BSD Source Code 2 | # Copyright (c) 2013-2016, Daemon Developers 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of the nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | ################################################################################ 28 | # Determine platform 29 | ################################################################################ 30 | 31 | # When adding a new platform, look at all the places WIN32, APPLE and LINUX are used 32 | if( CMAKE_SYSTEM_NAME MATCHES "Linux" ) 33 | set( LINUX ON ) 34 | elseif( CMAKE_SYSTEM_NAME MATCHES "FreeBSD" ) 35 | set( FREEBSD ON ) 36 | elseif( WIN32 ) 37 | elseif( APPLE ) 38 | elseif( NACL ) 39 | else() 40 | message( FATAL_ERROR "Platform not supported" ) 41 | endif() 42 | 43 | if (NACL AND USE_NACL_SAIGO) 44 | # Saigo clang reports weird errors when building some cgame and sgame arm nexe with PIE. 45 | # Saigo clang crashes when building amd64 cgame with PIE, sgame builds properly though. 46 | set(GAME_PIE 0) 47 | else() 48 | set(GAME_PIE 1) 49 | endif() 50 | 51 | 52 | include(DaemonArchitecture) 53 | include(DaemonCompiler) 54 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/portability_string.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008, Google Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above 12 | * copyright notice, this list of conditions and the following disclaimer 13 | * in the documentation and/or other materials provided with the 14 | * distribution. 15 | * * Neither the name of Google Inc. nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | 33 | /* 34 | * portability macros, etc. for string related stuff 35 | */ 36 | 37 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_STRING_H_ 38 | #define NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_STRING_H_ 1 39 | 40 | #include 41 | 42 | typedef char utf8char_t; 43 | 44 | #if NACL_OSX 45 | /* NOTE:: Mac doesn't define strnlen in the headers. */ 46 | #if defined( __cplusplus) 47 | extern "C" 48 | #endif 49 | size_t strnlen(const char* str, size_t max); 50 | #endif 51 | 52 | #if NACL_WINDOWS 53 | /* disable warnings for deprecated strncpy */ 54 | #pragma warning(disable : 4996) 55 | 56 | #define STRDUP _strdup 57 | #define STRTOLL _strtoi64 58 | #define STRTOULL _strtoui64 59 | 60 | #else 61 | 62 | #define STRDUP strdup 63 | #define STRTOLL strtoll 64 | #define STRTOULL strtoull 65 | 66 | #endif 67 | 68 | #endif /* NATIVE_CLIENT_SRC_INCLUDE_PORTABILITY_STRING_H_ */ 69 | -------------------------------------------------------------------------------- /src/engine/renderer/BufferBind.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2025 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | // BufferBind.h 35 | 36 | #ifndef BUFFERBIND_H 37 | #define BUFFERBIND_H 38 | 39 | namespace BufferBind { 40 | enum : uint32_t { 41 | // UBO 42 | MATERIALS = 0, 43 | TEX_DATA = 1, 44 | LIGHTMAP_DATA = 2, 45 | LIGHTS = 3, 46 | 47 | SURFACE_BATCHES = 4, 48 | 49 | // SSBO 50 | SURFACE_DESCRIPTORS = 0, 51 | SURFACE_COMMANDS = 1, 52 | CULLED_COMMANDS = 2, 53 | PORTAL_SURFACES = 4, 54 | 55 | GEOMETRY_CACHE_INPUT_VBO = 5, 56 | GEOMETRY_CACHE_VBO = 6, 57 | GEOMETRY_CACHE_IBO = 7, 58 | 59 | COMMAND_COUNTERS_STORAGE = 9, 60 | TEX_DATA_STORAGE = 11, 61 | STAGING = 12, 62 | 63 | DEBUG = 10, 64 | 65 | // Atomic 66 | COMMAND_COUNTERS_ATOMIC = 0 67 | }; 68 | }; 69 | 70 | #endif // BUFFERBIND_H 71 | -------------------------------------------------------------------------------- /src/engine/client/key_identification.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2017, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | #ifndef ENGINE_CLIENT_KEY_IDENTIFICATION_H_ 31 | #define ENGINE_CLIENT_KEY_IDENTIFICATION_H_ 32 | 33 | #include "common/KeyIdentification.h" 34 | #include "common/String.h" 35 | #include "engine/framework/CommandSystem.h" 36 | 37 | 38 | namespace Keyboard { 39 | 40 | Key StringToKey(Str::StringRef name); 41 | std::string KeyToString(Key key); 42 | 43 | // Returns the code point of a character typed by the given key, or 0 if none is found. 44 | int GetCharForScancode(int scancode); 45 | 46 | // Returns the character corresponding to scancode sc in the QWERTY layout, if any, otherwise 0. 47 | char ScancodeToAscii(int sc); 48 | 49 | void CompleteKeyName(Cmd::CompletionResult& completions, Str::StringRef prefix); 50 | 51 | } // namespace Keyboard 52 | 53 | #endif // ENGINE_CLIENT_KEY_IDENTIFICATION_H_ 54 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/depthtile2_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2013-2016 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | /* depthtile2_fp.glsl */ 36 | 37 | uniform sampler2D u_DepthTile1; 38 | 39 | #if __VERSION__ > 120 40 | out vec4 outputColor; 41 | #else 42 | #define outputColor gl_FragColor 43 | #endif 44 | 45 | void main() 46 | { 47 | vec2 st = gl_FragCoord.st * r_tileStep; 48 | float x, y; 49 | vec4 accum = vec4( 0.0, 99999.0, 0.0, 0.0 ); 50 | 51 | for( x = -0.375; x < 0.5; x += 0.25 ) { 52 | for( y = -0.375; y < 0.5; y += 0.25 ) { 53 | vec4 data = texture2D( u_DepthTile1, st + vec2(x, y) * r_tileStep ); 54 | if( data.y < 99999.0 ) { 55 | accum.x = max( accum.x, data.x ); 56 | accum.y = min( accum.y, data.y ); 57 | } 58 | } 59 | } 60 | 61 | outputColor = accum; 62 | } 63 | -------------------------------------------------------------------------------- /src/engine/renderer/iqm.h: -------------------------------------------------------------------------------- 1 | #ifndef __IQM_H__ 2 | #define __IQM_H__ 3 | 4 | #define IQM_MAGIC "INTERQUAKEMODEL" 5 | #define IQM_VERSION 2 6 | 7 | struct iqmheader 8 | { 9 | char magic[16]; 10 | unsigned int version; 11 | unsigned int filesize; 12 | unsigned int flags; 13 | unsigned int num_text, ofs_text; 14 | unsigned int num_meshes, ofs_meshes; 15 | unsigned int num_vertexarrays, num_vertexes, ofs_vertexarrays; 16 | unsigned int num_triangles, ofs_triangles, ofs_adjacency; 17 | unsigned int num_joints, ofs_joints; 18 | unsigned int num_poses, ofs_poses; 19 | unsigned int num_anims, ofs_anims; 20 | unsigned int num_frames, num_framechannels, ofs_frames, ofs_bounds; 21 | unsigned int num_comment, ofs_comment; 22 | unsigned int num_extensions, ofs_extensions; 23 | }; 24 | 25 | struct iqmmesh 26 | { 27 | unsigned int name; 28 | unsigned int material; 29 | unsigned int first_vertex, num_vertexes; 30 | unsigned int first_triangle, num_triangles; 31 | }; 32 | 33 | enum 34 | { 35 | IQM_POSITION = 0, 36 | IQM_TEXCOORD = 1, 37 | IQM_NORMAL = 2, 38 | IQM_TANGENT = 3, 39 | IQM_BLENDINDEXES = 4, 40 | IQM_BLENDWEIGHTS = 5, 41 | IQM_COLOR = 6, 42 | IQM_CUSTOM = 0x10 43 | }; 44 | 45 | enum 46 | { 47 | IQM_BYTE = 0, 48 | IQM_UBYTE = 1, 49 | IQM_SHORT = 2, 50 | IQM_USHORT = 3, 51 | IQM_INT = 4, 52 | IQM_UINT = 5, 53 | IQM_HALF = 6, 54 | IQM_FLOAT = 7, 55 | IQM_DOUBLE = 8, 56 | }; 57 | 58 | struct iqmtriangle 59 | { 60 | unsigned int vertex[3]; 61 | }; 62 | 63 | struct iqmadjacency 64 | { 65 | unsigned int triangle[3]; 66 | }; 67 | 68 | struct iqmjoint 69 | { 70 | unsigned int name; 71 | int parent; 72 | float translate[3], rotate[4], scale[3]; 73 | }; 74 | 75 | struct iqmpose 76 | { 77 | int parent; 78 | unsigned int mask; 79 | float channeloffset[10]; 80 | float channelscale[10]; 81 | }; 82 | 83 | struct iqmanim 84 | { 85 | unsigned int name; 86 | unsigned int first_frame, num_frames; 87 | float framerate; 88 | unsigned int flags; 89 | }; 90 | 91 | enum 92 | { 93 | IQM_LOOP = 1<<0 94 | }; 95 | 96 | struct iqmvertexarray 97 | { 98 | unsigned int type; 99 | unsigned int flags; 100 | unsigned int format; 101 | unsigned int size; 102 | unsigned int offset; 103 | }; 104 | 105 | struct iqmbounds 106 | { 107 | float bbmin[3], bbmax[3]; 108 | float xyradius, radius; 109 | }; 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /cmake/DaemonBuildTypeGeneratorExpression.cmake: -------------------------------------------------------------------------------- 1 | # Daemon BSD Source Code 2 | # Copyright (c) 2025, Daemon Developers 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of the nor the 13 | # names of its contributors may be used to endorse or promote products 14 | # derived from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 20 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # Work around https://github.com/DaemonEngine/Daemon/issues/398. The Visual Studio CMake 28 | # integration, which uses a (single-config) Ninja generator, sets the configuration name 29 | # to an arbitrary name instead of "Release", "Debug" etc. So then $ etc. 30 | # doesn't work since it doesn't correspond to CMAKE_BUILD_TYPE. 31 | get_property(are_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 32 | if (are_multi_config) 33 | set(DEBUG_GENEXP_COND "$") 34 | set(MINSIZEREL_GENEXP_COND "$") 35 | set(RELWITHDEBINFO_GENEXP_COND "$") 36 | set(RELEASE_GENEXP_COND "$") 37 | else() 38 | set(DEBUG_GENEXP_COND "0") 39 | set(MINSIZEREL_GENEXP_COND "0") 40 | set(RELWITHDEBINFO_GENEXP_COND "0") 41 | set(RELEASE_GENEXP_COND "0") 42 | string(TOUPPER ${CMAKE_BUILD_TYPE} build_type_upper) 43 | set(${build_type_upper}_GENEXP_COND "1") 44 | endif() 45 | -------------------------------------------------------------------------------- /src/common/Util.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2023, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #include "Common.h" 32 | 33 | namespace Util { 34 | 35 | // Exponential moving average FPS counter 36 | // 37 | // weight t seconds ago = e^-at 38 | // weight of the last q seconds: integral from 0 to q of e^-at 39 | // antiderivative -1/a e^-at 40 | // -1/a (e^-aq - e^0) = (1 - e^-aq)/a 41 | void UpdateFPSCounter(float halfLife, int frameMs, float& fps) 42 | { 43 | if (frameMs <= 0) { 44 | // act as if we have found out that a frame was processed 0.5 ms in the past 45 | // to avoid the discontinuity of a 0-length frame 46 | float weight = 1.0f - exp2f(-0.0005f / halfLife); 47 | fps += weight / 0.0005f; 48 | } 49 | else { 50 | float frameLen = frameMs * 0.001f; 51 | float oldWeight = exp2f(-frameLen / halfLife); 52 | float newWeight = 1.0f - oldWeight; 53 | fps = oldWeight * fps + newWeight / frameLen; 54 | } 55 | } 56 | 57 | } // namespace Util 58 | -------------------------------------------------------------------------------- /cmake/FindOgg.cmake: -------------------------------------------------------------------------------- 1 | # - Find ogg library 2 | # Find the native Ogg headers and libraries. 3 | # 4 | # OGG_INCLUDE_DIRS - where to find ogg/ogg.h, etc. 5 | # OGG_LIBRARIES - List of libraries when using ogg. 6 | # OGG_FOUND - True if ogg is found. 7 | 8 | #============================================================================= 9 | #Copyright 2000-2009 Kitware, Inc., Insight Software Consortium 10 | #All rights reserved. 11 | # 12 | #Redistribution and use in source and binary forms, with or without 13 | # modification, are permitted provided that the following conditions are met: 14 | # 15 | #* Redistributions of source code must retain the above copyright notice, 16 | #this list of conditions and the following disclaimer. 17 | # 18 | #* Redistributions in binary form must reproduce the above copyright notice, 19 | #this list of conditions and the following disclaimer in the documentation 20 | #and/or other materials provided with the distribution. 21 | # 22 | #* Neither the names of Kitware, Inc., the Insight Software Consortium, nor 23 | #the names of their contributors may be used to endorse or promote products 24 | #derived from this software without specific prior written permission. 25 | # 26 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 27 | #AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | #IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29 | #ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 30 | #LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | #CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 | #SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 | #INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 | #CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35 | #ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | #POSSIBILITY OF SUCH DAMAGE. 37 | #============================================================================= 38 | 39 | # Look for the header file. 40 | FIND_PATH(OGG_INCLUDE_DIR NAMES ogg/ogg.h) 41 | MARK_AS_ADVANCED(OGG_INCLUDE_DIR) 42 | 43 | # Look for the library. 44 | FIND_LIBRARY(OGG_LIBRARY NAMES ogg) 45 | MARK_AS_ADVANCED(OGG_LIBRARY) 46 | 47 | # handle the QUIETLY and REQUIRED arguments and set OGG_FOUND to TRUE if 48 | # all listed variables are TRUE 49 | INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) 50 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ogg DEFAULT_MSG OGG_LIBRARY OGG_INCLUDE_DIR) 51 | 52 | SET(OGG_LIBRARIES ${OGG_LIBRARY}) 53 | SET(OGG_INCLUDE_DIRS ${OGG_INCLUDE_DIR}) 54 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/vertexAnimation_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2010 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | // vertexAnimation_vp.glsl - interpolates .md3/.mdc vertex animations 23 | 24 | #if defined(USE_VERTEX_ANIMATION) 25 | 26 | IN vec3 attr_Position; 27 | IN vec4 attr_Color; 28 | IN vec4 attr_QTangent; 29 | IN vec2 attr_TexCoord0; 30 | IN vec3 attr_Position2; 31 | IN vec4 attr_QTangent2; 32 | 33 | uniform float u_VertexInterpolation; 34 | 35 | void VertexAnimation_P_N( vec3 fromPosition, vec3 toPosition, 36 | vec4 fromQTangent, vec4 toQTangent, 37 | float frac, 38 | inout vec4 position, inout vec3 normal) 39 | { 40 | vec3 fromNormal = QuatTransVec( fromQTangent, vec3( 0.0, 0.0, 1.0 ) ); 41 | vec3 toNormal = QuatTransVec( toQTangent, vec3( 0.0, 0.0, 1.0 ) ); 42 | 43 | position.xyz = 512.0 * mix(fromPosition, toPosition, frac); 44 | position.w = 1; 45 | 46 | normal = normalize(mix(fromNormal, toNormal, frac)); 47 | } 48 | 49 | void VertexFetch(out vec4 position, 50 | out localBasis LB, 51 | out vec4 color, 52 | out vec2 texCoord, 53 | out vec2 lmCoord) 54 | { 55 | localBasis fromLB, toLB; 56 | 57 | QTangentToLocalBasis( attr_QTangent, fromLB ); 58 | QTangentToLocalBasis( attr_QTangent2, toLB ); 59 | 60 | position.xyz = 512.0 * mix(attr_Position, attr_Position2, u_VertexInterpolation); 61 | position.w = 1; 62 | 63 | LB.normal = normalize(mix(fromLB.normal, toLB.normal, u_VertexInterpolation)); 64 | LB.tangent = normalize(mix(fromLB.tangent, toLB.tangent, u_VertexInterpolation)); 65 | LB.binormal = normalize(mix(fromLB.binormal, toLB.binormal, u_VertexInterpolation)); 66 | 67 | color = attr_Color; 68 | texCoord = attr_TexCoord0; 69 | lmCoord = attr_TexCoord0; 70 | } 71 | #endif 72 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/arm_sandbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * Minimal ARM sandbox constants. 9 | * 10 | * These constants are used in C code as well as assembly, hence the use of 11 | * the preprocessor. 12 | * 13 | * nacl_qualify_sandbox_instrs.c validates that these instructions trap 14 | * as expected. 15 | */ 16 | 17 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ 18 | #define NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ 1 19 | 20 | /* 21 | * Specially chosen BKPT and UDF instructions that also correspond to 22 | * BKPT and UDF when decoded as Thumb instructions. 23 | * All other BKPT/UDF values are disallowed by the validator out of paranoia. 24 | */ 25 | 26 | /* 27 | * BKPT #0x5BE0: literal pool head. 28 | * 29 | * Treated as a roadblock by the validator: all words that follow it in 30 | * a bundle aren't validated and can't be branched to. 31 | */ 32 | #define NACL_INSTR_ARM_LITERAL_POOL_HEAD 0xE125BE70 33 | 34 | /* 35 | * NACL_INSTR_ARM_BREAKPOINT, NACL_INSTR_ARM_HALT_FILL and 36 | * NACL_INSTR_ARM_ABORT_NOW are intended to be equivalent from a 37 | * security point of view. We provide the distinction between them just 38 | * for debugging purposes. They might also generate different POSIX 39 | * signals. In principle it should be safe for a debugger to skip past 40 | * one of these (unlike NACL_INSTR_ARM_POOL_HEAD), because the validator 41 | * validates the instructions that follow. 42 | */ 43 | 44 | /* 45 | * BKPT #0x5BEF: generic breakpoint. 46 | * 47 | * Usable statically by users or dynamically by the runtime. 48 | */ 49 | #define NACL_INSTR_ARM_BREAKPOINT 0xE125BE7F 50 | 51 | /* 52 | * UDF #0xEDEF: halt-fill. 53 | * 54 | * Generated at load time. 55 | */ 56 | #define NACL_INSTR_ARM_HALT_FILL 0xE7FEDEFF 57 | 58 | /* 59 | * UDF #0xEDE0: abort-now. 60 | * 61 | * Required by some language constructs such as __builtin_trap. 62 | */ 63 | #define NACL_INSTR_ARM_ABORT_NOW 0xE7FEDEF0 64 | 65 | /* 66 | * UDF #0xEDE1: always fail validation. 67 | * 68 | * It's guaranteed to always fail, and can be used to initialize buffers 69 | * that are expected to be filled later. 70 | */ 71 | #define NACL_INSTR_ARM_FAIL_VALIDATION 0xE7FEDEF1 72 | 73 | /* 74 | * NOP. 75 | * 76 | * This NOP encoding is the newer NOP instead of being the one that aliases 77 | * to MOV. Note: It can actually decrease performance compared to MOV. 78 | */ 79 | #define NACL_INSTR_ARM_NOP 0xE320F000 80 | 81 | #endif /* NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ */ 82 | -------------------------------------------------------------------------------- /src/engine/audio/AudioData.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #ifndef AUDIO_DATA_H 32 | #define AUDIO_DATA_H 33 | #include 34 | #include 35 | 36 | namespace Audio { 37 | 38 | struct AudioData { 39 | AudioData() 40 | : sampleRate{0} 41 | , byteDepth{0} 42 | , numberOfChannels{0} 43 | {} 44 | 45 | AudioData(int sampleRate, int byteDepth, int numberOfChannels ) 46 | : sampleRate{sampleRate} 47 | , byteDepth{byteDepth} 48 | , numberOfChannels{numberOfChannels} 49 | {} 50 | 51 | AudioData(AudioData&& that) 52 | : sampleRate{that.sampleRate} 53 | , byteDepth{that.byteDepth} 54 | , numberOfChannels{that.numberOfChannels} 55 | , rawSamples{std::move(that.rawSamples)} 56 | {} 57 | 58 | AudioData(const AudioData& that) = delete; 59 | 60 | const int sampleRate; 61 | const int byteDepth; 62 | const int numberOfChannels; 63 | std::vector rawSamples; 64 | }; 65 | } // namespace Audio 66 | #endif 67 | -------------------------------------------------------------------------------- /src/shared/VMMain.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #ifndef SHARED_VM_MAIN_H_ 32 | #define SHARED_VM_MAIN_H_ 33 | 34 | #include "common/IPC/Channel.h" 35 | 36 | namespace VM { 37 | 38 | // Root channel used to communicate with the engine 39 | extern IPC::Channel rootChannel; 40 | 41 | #ifdef BUILD_VM_NATIVE_EXE 42 | extern Cvar::Cvar useNativeExeCrashHandler; 43 | #endif 44 | 45 | // Functions each specific gamelogic should implement 46 | void VMInit(); 47 | void VMHandleSyscall(uint32_t id, Util::Reader reader); 48 | void GetNetcodeTables(NetcodeTable& playerStateTable, int& playerStateSize); 49 | 50 | // Send a message to the engine 51 | template void SendMsg(Args&&... args) { 52 | if (!Sys::OnMainThread()) { 53 | Sys::Error("SendMsg from non-main VM thread"); 54 | } 55 | IPC::SendMsg(rootChannel, VMHandleSyscall, std::forward(args)...); 56 | } 57 | 58 | } 59 | 60 | #endif // SHARED_VM_MAIN_H_ 61 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/fogQuake3_vp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2011 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* fogQuake3_vp.glsl */ 24 | 25 | #insert common 26 | #insert vertexSimple_vp 27 | #insert vertexSkinning_vp 28 | #insert vertexAnimation_vp 29 | 30 | uniform float u_Time; 31 | 32 | uniform colorPack u_ColorGlobal; 33 | 34 | uniform mat4 u_ModelMatrix; 35 | uniform mat4 u_ModelViewProjectionMatrix; 36 | uniform vec3 u_ViewOrigin; 37 | 38 | uniform float u_FogDensity; 39 | uniform vec4 u_FogDepthVector; // fog plane 40 | 41 | // how far the vertex is under the fog plane 42 | OUT(smooth) float var_FogPlaneDistance; 43 | 44 | OUT(smooth) vec3 var_ScaledViewerOffset; 45 | OUT(smooth) vec4 var_Color; 46 | 47 | void DeformVertex( inout vec4 pos, 48 | inout vec3 normal, 49 | inout vec2 st, 50 | inout vec4 color, 51 | in float time ); 52 | 53 | void main() 54 | { 55 | #insert material_vp 56 | 57 | vec4 position; 58 | localBasis LB; 59 | vec2 texCoord, lmCoord; 60 | vec4 color; 61 | 62 | VertexFetch( position, LB, color, texCoord, lmCoord ); 63 | 64 | color = UnpackColor( u_ColorGlobal ); 65 | 66 | DeformVertex( position, 67 | LB.normal, 68 | texCoord, 69 | color, 70 | u_Time ); 71 | 72 | // transform vertex position into homogenous clip-space 73 | gl_Position = u_ModelViewProjectionMatrix * position; 74 | 75 | // transform position into world space 76 | position = u_ModelMatrix * position; 77 | position.xyz /= position.w; 78 | 79 | var_ScaledViewerOffset = u_FogDensity * (position.xyz - u_ViewOrigin); 80 | 81 | // calculate the length in fog 82 | var_FogPlaneDistance = dot(position.xyz, u_FogDepthVector.xyz) + u_FogDepthVector.w; 83 | 84 | var_Color = color; 85 | } 86 | -------------------------------------------------------------------------------- /src/engine/renderer/glsl_source/reflection_CB_fp.glsl: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 2006-2011 Robert Beckebans 4 | 5 | This file is part of XreaL source code. 6 | 7 | XreaL source code is free software; you can redistribute it 8 | and/or modify it under the terms of the GNU General Public License as 9 | published by the Free Software Foundation; either version 2 of the License, 10 | or (at your option) any later version. 11 | 12 | XreaL source code is distributed in the hope that it will be 13 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with XreaL source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /* reflection_CB_fp.glsl */ 24 | 25 | #insert reliefMapping_fp 26 | 27 | #define REFLECTION_CB_GLSL 28 | 29 | uniform samplerCube u_ColorMapCube; 30 | uniform vec3 u_ViewOrigin; 31 | 32 | IN(smooth) vec3 var_Position; 33 | IN(smooth) vec2 var_TexCoords; 34 | IN(smooth) vec4 var_Tangent; 35 | IN(smooth) vec4 var_Binormal; 36 | IN(smooth) vec4 var_Normal; 37 | 38 | DECLARE_OUTPUT(vec4) 39 | 40 | void main() 41 | { 42 | #insert material_fp 43 | 44 | // compute view direction in world space 45 | vec3 viewDir = normalize(var_Position - u_ViewOrigin); 46 | 47 | mat3 tangentToWorldMatrix = mat3(var_Tangent.xyz, var_Binormal.xyz, var_Normal.xyz); 48 | 49 | vec2 texNormal = var_TexCoords; 50 | 51 | #if defined(USE_RELIEF_MAPPING) 52 | // compute texcoords offset from heightmap 53 | vec2 texOffset = ReliefTexOffset(texNormal, viewDir, tangentToWorldMatrix, u_HeightMap); 54 | 55 | texNormal += texOffset; 56 | #endif // USE_RELIEF_MAPPING 57 | 58 | // compute normal in tangent space from normal map 59 | #if defined(r_normalMapping) 60 | vec3 normal = NormalInWorldSpace(texNormal, tangentToWorldMatrix, u_NormalMap); 61 | #else // !r_normalMapping 62 | vec3 normal = NormalInWorldSpace(texNormal, tangentToWorldMatrix); 63 | #endif // !r_normalMapping 64 | 65 | // compute reflection ray 66 | vec3 reflectionRay = reflect(viewDir, normal); 67 | 68 | outputColor = textureCube(u_ColorMapCube, reflectionRay).rgba; 69 | 70 | #if defined(r_showCubeProbes) 71 | viewDir = normalize(var_Position); 72 | outputColor = textureCube(u_ColorMapCube, viewDir); 73 | #endif 74 | // outputColor = vec4(1.0, 0.0, 0.0, 1.0); 75 | } 76 | -------------------------------------------------------------------------------- /cmake/FindGLEW.cmake: -------------------------------------------------------------------------------- 1 | # - Find GLEW library 2 | # Find the native GLEW headers and libraries. 3 | # 4 | # GLEW_INCLUDE_DIRS - where to find glew.h, etc. 5 | # GLEW_LIBRARIES - List of libraries when using GLEW. 6 | # GLEW_FOUND - True if GLEW is found. 7 | 8 | #============================================================================= 9 | #Copyright 2000-2009 Kitware, Inc., Insight Software Consortium 10 | #All rights reserved. 11 | # 12 | #Redistribution and use in source and binary forms, with or without 13 | # modification, are permitted provided that the following conditions are met: 14 | # 15 | #* Redistributions of source code must retain the above copyright notice, 16 | #this list of conditions and the following disclaimer. 17 | # 18 | #* Redistributions in binary form must reproduce the above copyright notice, 19 | #this list of conditions and the following disclaimer in the documentation 20 | #and/or other materials provided with the distribution. 21 | # 22 | #* Neither the names of Kitware, Inc., the Insight Software Consortium, nor 23 | #the names of their contributors may be used to endorse or promote products 24 | #derived from this software without specific prior written permission. 25 | # 26 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 27 | #AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | #IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29 | #ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 30 | #LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | #CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 | #SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 | #INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 | #CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35 | #ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | #POSSIBILITY OF SUCH DAMAGE. 37 | #============================================================================= 38 | # Look for the header file. 39 | FIND_PATH(GLEW_INCLUDE_DIR NAMES GL/glew.h) 40 | MARK_AS_ADVANCED(GLEW_INCLUDE_DIR) 41 | 42 | # Look for the library. 43 | FIND_LIBRARY(GLEW_LIBRARY NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64 lib) 44 | MARK_AS_ADVANCED(GLEW_LIBRARY) 45 | 46 | # handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if 47 | # all listed variables are TRUE 48 | INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) 49 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG GLEW_LIBRARY GLEW_INCLUDE_DIR) 50 | 51 | SET(GLEW_LIBRARIES ${GLEW_LIBRARY}) 52 | SET(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR}) 53 | -------------------------------------------------------------------------------- /src/common/cm/cm_polylib.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon GPL Source Code 5 | Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. 6 | 7 | This file is part of the Daemon GPL Source Code (Daemon Source Code). 8 | 9 | Daemon Source Code is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Daemon Source Code is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Daemon Source Code. If not, see . 21 | 22 | In addition, the Daemon Source Code is also subject to certain additional terms. 23 | You should have received a copy of these additional terms immediately following the 24 | terms and conditions of the GNU General Public License which accompanied the Daemon 25 | Source Code. If not, please request a copy in writing from id Software at the address 26 | below. 27 | 28 | If you have questions concerning this license or the applicable additional terms, you 29 | may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, 30 | Maryland 20850 USA. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | // this is only used for visualization tools in cm_ debug functions 36 | 37 | struct winding_t 38 | { 39 | int numpoints; 40 | vec3_t p[ 4 ]; // variable sized 41 | }; 42 | 43 | #define MAX_POINTS_ON_WINDING 64 44 | 45 | #define CLIP_EPSILON 0.1f 46 | 47 | #define MAX_MAP_BOUNDS 65535 48 | 49 | // you can define on_epsilon in the makefile as tighter 50 | #ifndef ON_EPSILON 51 | #define ON_EPSILON 0.1f 52 | #endif 53 | 54 | winding_t *AllocWinding( int points ); 55 | winding_t *CopyWinding( winding_t *w ); 56 | winding_t *BaseWindingForPlane( const plane_t &plane ); 57 | // Backward compatibility with game. 58 | winding_t *BaseWindingForPlane( const vec3_t normal, const vec_t dist ); 59 | void FreeWinding( winding_t *w ); 60 | void WindingBounds( winding_t *w, vec3_t mins, vec3_t maxs ); 61 | 62 | void ChopWindingInPlace( winding_t **w, const plane_t &plane, const vec_t epsilon ); 63 | // Backward compatibility with game. 64 | void ChopWindingInPlace( winding_t **w, const vec3_t normal, const vec_t dist, const vec_t epsilon ); 65 | 66 | // frees the original if clipped 67 | 68 | void pw( winding_t *w ); 69 | -------------------------------------------------------------------------------- /src/engine/renderer/TextureManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon BSD Source Code 5 | Copyright (c) 2024 Daemon Developers 6 | All rights reserved. 7 | 8 | This file is part of the Daemon BSD Source Code (Daemon Source Code). 9 | 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | * Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | * Neither the name of the Daemon developers nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | =========================================================================== 33 | */ 34 | // TextureManager.h 35 | 36 | #ifndef TEXTURE_MANAGER_H 37 | #define TEXTURE_MANAGER_H 38 | 39 | class Texture { 40 | public: 41 | GLuint textureHandle = 0; 42 | GLuint64 bindlessTextureHandle = 0; 43 | bool hasBindlessHandle = false; 44 | 45 | GLenum target = GL_TEXTURE_2D; 46 | 47 | Texture(); 48 | ~Texture(); 49 | 50 | bool IsResident() const; 51 | void MakeResident(); 52 | void MakeNonResident(); 53 | 54 | void GenBindlessHandle();; 55 | 56 | private: 57 | bool bindlessTextureResident = false; 58 | }; 59 | 60 | class TextureManager { 61 | public: 62 | TextureManager(); 63 | ~TextureManager(); 64 | 65 | GLuint64 BindTexture( const GLint location, Texture* texture ); 66 | void BindReservedTexture( const GLenum target, const GLuint handle ); 67 | void FreeTextures(); 68 | 69 | private: 70 | std::vector textures; 71 | }; 72 | 73 | #endif // TEXTURE_MANAGER_H 74 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/include/nacl/nacl_minidump.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #ifndef NATIVE_CLIENT_SRC_INCLUDE_NACL_NACL_MINIDUMP_H_ 8 | #define NATIVE_CLIENT_SRC_INCLUDE_NACL_NACL_MINIDUMP_H_ 1 9 | 10 | #include 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /* 18 | * This is the type of callback function to be registered with 19 | * nacl_minidump_set_callback(). Such a callback will be called when 20 | * a crash occurs. The callback is passed the minidump crash dump 21 | * data, which the callback may choose to report by saving the data to 22 | * a file, sending it via IPC, etc. 23 | */ 24 | typedef void (*nacl_minidump_callback_t)(const void *minidump_data, 25 | size_t size); 26 | 27 | /* 28 | * Initialize crash reporting by registering an exception handler. 29 | */ 30 | void nacl_minidump_register_crash_handler(void); 31 | 32 | /* 33 | * Set the function to be called when a crash occurs. 34 | */ 35 | void nacl_minidump_set_callback(nacl_minidump_callback_t callback); 36 | 37 | /* 38 | * nacl_minidump_set_module_name() allows setting the name of the nexe 39 | * to be reported in the minidump, since otherwise it is usually not 40 | * possible to determine this name at run time. This is typically the 41 | * filename without the path, e.g. "foo.nexe". Breakpad's 42 | * minidump_stackwalk tool uses this information to look up debugging 43 | * info when reading the minidump. 44 | * 45 | * Note that this function does not make a copy of module_name, so the 46 | * string must remain valid after the call to this function. 47 | */ 48 | void nacl_minidump_set_module_name(const char *module_name); 49 | 50 | /* 51 | * Traversing the module set may fail in the midst of a crash. However, 52 | * capturing the module set ahead of time may yield an incomplete snapshot. 53 | * This function captures the module list to be used in place of a live 54 | * traversal during a crash. 55 | */ 56 | void nacl_minidump_snapshot_module_list(void); 57 | 58 | /* 59 | * This function clears any current snapshot of the module list, switching to 60 | * live traversal of modules when a crash occurs. 61 | */ 62 | void nacl_minidump_clear_module_list(void); 63 | 64 | #define NACL_MINIDUMP_BUILD_ID_SIZE 16 65 | 66 | /* 67 | * nacl_minidump_set_module_build_id() allows setting the build ID of 68 | * the nexe to be reported in the minidump. 69 | */ 70 | void nacl_minidump_set_module_build_id( 71 | const uint8_t data[NACL_MINIDUMP_BUILD_ID_SIZE]); 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/common/ColorTest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2023, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #include 32 | #include "Common.h" 33 | 34 | namespace Color { 35 | namespace { 36 | 37 | TEST(StripColorTest, ReturningString) 38 | { 39 | std::string noValidCodes = 40 | "^Q^q^~^xgff^x1$3^xa1W^##23456^#1j3456^#12 456^#123.56^#1234m6^#12345G^"; 41 | EXPECT_EQ(noValidCodes, StripColors(noValidCodes)); 42 | 43 | std::string onlyColors = "^xF1A^1^0^O^9^a^;^*^xeE2^#123Aa5^#3903ff"; 44 | EXPECT_EQ("", StripColors(onlyColors)); 45 | } 46 | 47 | TEST(StripColorTest, ToBuffer) 48 | { 49 | char bigbuf[99]; 50 | StripColors("^6foo^^bar", bigbuf, sizeof(bigbuf)); 51 | EXPECT_EQ("foo^bar", std::string(bigbuf)); 52 | 53 | char smallbuf[3]; 54 | StripColors("ab^x123c", smallbuf, sizeof(smallbuf)); 55 | EXPECT_EQ("ab", std::string(smallbuf)); 56 | 57 | char justright[7]; 58 | StripColors("dretc^#123456h", justright, sizeof(justright)); 59 | EXPECT_EQ("dretch", std::string(justright)); 60 | } 61 | 62 | } // namespace 63 | } // namespace Color 64 | 65 | -------------------------------------------------------------------------------- /src/engine/qcommon/net_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | 4 | Daemon GPL Source Code 5 | Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. 6 | 7 | This file is part of the Daemon GPL Source Code (Daemon Source Code). 8 | 9 | Daemon Source Code is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | Daemon Source Code is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with Daemon Source Code. If not, see . 21 | 22 | In addition, the Daemon Source Code is also subject to certain additional terms. 23 | You should have received a copy of these additional terms immediately following the 24 | terms and conditions of the GNU General Public License which accompanied the Daemon 25 | Source Code. If not, please request a copy in writing from id Software at the address 26 | below. 27 | 28 | If you have questions concerning this license or the applicable additional terms, you 29 | may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, 30 | Maryland 20850 USA. 31 | 32 | =========================================================================== 33 | */ 34 | 35 | #ifndef ENGINE_QCOMMON_NET_TYPES_H_ 36 | #define ENGINE_QCOMMON_NET_TYPES_H_ 37 | 38 | #include "./q_shared.h" 39 | 40 | enum class netadrtype_t : int 41 | { 42 | NA_BOT, 43 | NA_BAD, // an address lookup failed 44 | NA_LOOPBACK, 45 | NA_BROADCAST, 46 | NA_IP, 47 | NA_IP6, 48 | NA_IP_DUAL, 49 | NA_MULTICAST6, 50 | NA_UNSPEC 51 | }; 52 | 53 | enum class netsrc_t 54 | { 55 | NS_CLIENT, 56 | NS_SERVER 57 | }; 58 | 59 | struct netadr_t 60 | { 61 | netadrtype_t type; 62 | 63 | byte ip[ 4 ]; 64 | byte ip6[ 16 ]; 65 | 66 | unsigned short port; // port which is in use 67 | unsigned short port4, port6; // ports to choose from 68 | uint32_t scope_id; // Needed for IPv6 link-local addresses 69 | }; 70 | 71 | struct msg_t 72 | { 73 | bool overflowed; // set to true if the buffer size failed 74 | bool oob; 75 | byte *data; 76 | int maxsize; 77 | int cursize; 78 | int uncompsize; // NERVE - SMF - net debugging 79 | int readcount; 80 | int bit; // for bitwise reads and writes 81 | }; 82 | 83 | #endif // ENGINE_QCOMMON_NET_TYPES_H_ 84 | -------------------------------------------------------------------------------- /src/engine/framework/CommandBufferHost.h: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Daemon BSD Source Code 4 | Copyright (c) 2013-2016, Daemon Developers 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the Daemon developers nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | =========================================================================== 29 | */ 30 | 31 | #ifndef FRAMEWORK_COMMAND_BUFFER_HOST_H_ 32 | #define FRAMEWORK_COMMAND_BUFFER_HOST_H_ 33 | 34 | #include "common/IPC/CommandBuffer.h" 35 | #include "common/Serialize.h" 36 | 37 | namespace IPC { 38 | 39 | class CommandBufferHost { 40 | public: 41 | CommandBufferHost(std::string name); 42 | virtual ~CommandBufferHost() = default; 43 | 44 | void Syscall(int index, Util::Reader& reader, IPC::Channel& channel); 45 | void Close(); 46 | 47 | private: 48 | std::string name; 49 | Log::Logger logs; 50 | IPC::CommandBuffer buffer; 51 | IPC::SharedMemory shm; 52 | 53 | virtual void HandleCommandBufferSyscall(int major, int minor, Util::Reader& reader) = 0; 54 | 55 | void Init(IPC::SharedMemory mem); 56 | 57 | void Consume(); 58 | bool ConsumeOne(Util::Reader& reader); 59 | }; 60 | } 61 | 62 | #endif // FRAMEWORK_COMMAND_BUFFER_HOST_H_ 63 | -------------------------------------------------------------------------------- /libs/nacl/native_client/src/trusted/service_runtime/include/sys/stat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008 The Native Client Authors. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can 4 | * be found in the LICENSE file. 5 | */ 6 | 7 | /* 8 | * NaCl kernel / service run-time system call ABI. stat/fstat. 9 | */ 10 | 11 | #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_STAT_H_ 12 | #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_INCLUDE_SYS_STAT_H_ 13 | 14 | #ifdef __native_client__ 15 | #include 16 | #else 17 | #include "native_client/src/trusted/service_runtime/include/machine/_types.h" 18 | #endif 19 | #include "native_client/src/trusted/service_runtime/include/bits/stat.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* 26 | * Linux uses preprocessor to define st_atime to 27 | * st_atim.tv_sec etc to widen the ABI to use a struct timespec rather 28 | * than just have a time_t access/modification/inode-change times. 29 | * this is unfortunate, since that symbol cannot be used as a struct 30 | * member elsewhere (!). 31 | * 32 | * just like with type name conflicts, we avoid it by using nacl_abi_ 33 | * as a prefix for struct members too. sigh. 34 | */ 35 | 36 | struct nacl_abi_stat { /* must be renamed when ABI is exported */ 37 | nacl_abi_dev_t nacl_abi_st_dev; /* not implemented */ 38 | nacl_abi_ino_t nacl_abi_st_ino; /* not implemented */ 39 | nacl_abi_mode_t nacl_abi_st_mode; /* partially implemented. */ 40 | nacl_abi_nlink_t nacl_abi_st_nlink; /* link count */ 41 | nacl_abi_uid_t nacl_abi_st_uid; /* not implemented */ 42 | nacl_abi_gid_t nacl_abi_st_gid; /* not implemented */ 43 | nacl_abi_dev_t nacl_abi_st_rdev; /* not implemented */ 44 | nacl_abi_off_t nacl_abi_st_size; /* object size */ 45 | nacl_abi_blksize_t nacl_abi_st_blksize; /* not implemented */ 46 | nacl_abi_blkcnt_t nacl_abi_st_blocks; /* not implemented */ 47 | nacl_abi_time_t nacl_abi_st_atime; /* access time */ 48 | int64_t nacl_abi_st_atimensec; /* possibly just pad */ 49 | nacl_abi_time_t nacl_abi_st_mtime; /* modification time */ 50 | int64_t nacl_abi_st_mtimensec; /* possibly just pad */ 51 | nacl_abi_time_t nacl_abi_st_ctime; /* inode change time */ 52 | int64_t nacl_abi_st_ctimensec; /* possibly just pad */ 53 | }; 54 | 55 | #ifdef __native_client__ 56 | extern int stat(char const *path, struct nacl_abi_stat *stbuf); 57 | extern int fstat(int d, struct nacl_abi_stat *stbuf); 58 | extern int lstat(const char *path, struct nacl_abi_stat *stbuf); 59 | extern int mkdir(const char *path, nacl_abi_mode_t mode); 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | --------------------------------------------------------------------------------