├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ └── feature_request.md └── workflows │ └── main.yml ├── .gitignore ├── .gitmodules ├── BUILD.md ├── CMakeLists.txt ├── CMakePresets.json ├── LICENSE ├── README.md ├── bootstrap.ps1 ├── bootstrap.sh ├── build-linux.sh ├── cmake ├── AddResources.cmake ├── CheckDependency.cmake ├── FindSpeex.cmake ├── FindSpeexDSP.cmake ├── GitUtils.cmake ├── ResourceCompiler.cmake └── triplets │ ├── arm64-osx.cmake │ ├── x64-mingw-static.cmake │ ├── x64-osx.cmake │ └── x86-mingw-static.cmake ├── dist ├── gen-release.sh ├── linux │ ├── io.github.ezQuake.128.png │ ├── io.github.ezQuake.48.png │ ├── io.github.ezQuake.64.png │ ├── io.github.ezQuake.appdata.xml │ └── io.github.ezQuake.desktop ├── macOS │ ├── MacOSXBundleInfo.plist.in │ ├── ezquake.entitlements.plist │ └── ezquake.icns └── windows │ ├── ezQuake.rc.in │ └── ezquake.ico ├── help_cmdline_params.json ├── help_commands.json ├── help_macros.json ├── help_variables.json ├── misc ├── appimage │ ├── appimage-manual_creation.sh │ └── ezquake.appdata.xml.template ├── cfg │ ├── cams.cfg │ ├── cams.tcl │ ├── eq260.cfg │ ├── ezhud.cfg │ ├── gfx_gl_eyecandy.cfg │ ├── gfx_gl_faithful.cfg │ ├── gfx_gl_fast.cfg │ ├── gfx_gl_higheyecandy.cfg │ ├── gfx_sw_default.cfg │ ├── gfx_sw_fast.cfg │ ├── how_to_use_these_files.txt │ ├── hud_aas.cfg │ ├── hud_berzerk.cfg │ ├── hud_corner.cfg │ ├── hud_dobbz.cfg │ ├── hud_empezar.cfg │ ├── hud_murdoc.cfg │ ├── hud_senft.cfg │ ├── hud_vleesh.cfg │ ├── movement.cfg │ ├── mvdhud_1on1.cfg │ ├── mvdhud_2on2.cfg │ ├── mvdhud_3on3.cfg │ ├── mvdhud_4on4.cfg │ ├── mvdhud_base.cfg │ ├── mvdhud_base_2.cfg │ ├── mvdhud_base_3.cfg │ ├── mvdhud_base_4.cfg │ ├── mvdhud_base_del.cfg │ ├── mvdhud_base_other.cfg │ ├── mvdhud_custom.cfg │ ├── pingdump.cfg │ ├── teamplay.cfg │ └── teamtime.cfg ├── fragfile │ └── fragfile.dat ├── pak.lst └── sb │ ├── au-sv.txt │ ├── cache │ └── empty │ ├── check_sources.sh │ ├── ctf.txt │ ├── eu-4on4.txt │ ├── eu-sv.txt │ ├── global.txt │ ├── na-sv.txt │ ├── qizmo.txt │ ├── sa-sv.txt │ ├── sources.txt │ ├── tf.txt │ └── update_sources.bat ├── src ├── Ctrl.c ├── Ctrl.h ├── Ctrl_EditBox.c ├── Ctrl_EditBox.h ├── Ctrl_PageViewer.c ├── Ctrl_PageViewer.h ├── Ctrl_ScrollBar.c ├── Ctrl_Tab.c ├── Ctrl_Tab.h ├── EX_FileList.c ├── EX_FileList.h ├── EX_browser.c ├── EX_browser.h ├── EX_browser_net.c ├── EX_browser_pathfind.c ├── EX_browser_ping.c ├── EX_browser_qtvlist.c ├── EX_browser_sources.c ├── EX_qtvlist.c ├── EX_qtvlist.h ├── anorm_dots.h ├── anorms.h ├── bspfile.h ├── cd_linux.c ├── cd_null.c ├── cd_win.c ├── cdaudio.h ├── central.c ├── central.h ├── cl_cam.c ├── cl_cmd.c ├── cl_demo.c ├── cl_ents.c ├── cl_input.c ├── cl_main.c ├── cl_multiview.c ├── cl_nqdemo.c ├── cl_parse.c ├── cl_pred.c ├── cl_screen.c ├── cl_screenshot.c ├── cl_skygroups.c ├── cl_slist.c ├── cl_slist.h ├── cl_tent.c ├── cl_view.c ├── cl_view.h ├── client.h ├── cmd.c ├── cmd.h ├── cmdline_params.h ├── cmdline_params_ids.h ├── cmodel.c ├── cmodel.h ├── collision.c ├── com_msg.c ├── common.c ├── common.h ├── common_draw.c ├── common_draw.h ├── config_manager.c ├── config_manager.h ├── console.c ├── console.h ├── crc.c ├── crc.h ├── cvar.c ├── cvar.h ├── cvar_groups.h ├── demo_controls.c ├── demo_controls.h ├── document_rendering.c ├── document_rendering.h ├── draw.h ├── ez_button.c ├── ez_button.h ├── ez_controls.c ├── ez_controls.h ├── ez_label.c ├── ez_label.h ├── ez_listview.c ├── ez_listview.h ├── ez_listviewitem.c ├── ez_listviewitem.h ├── ez_scrollbar.c ├── ez_scrollbar.h ├── ez_scrollpane.c ├── ez_scrollpane.h ├── ez_slider.c ├── ez_slider.h ├── ez_window.c ├── ez_window.h ├── ezquake-icon.c ├── fchecks.c ├── fchecks.h ├── fmod.c ├── fmod.h ├── fonts.c ├── fonts.h ├── fragstats.c ├── fs.c ├── fs.h ├── g_public.h ├── gl_aliasmodel.c ├── gl_aliasmodel_md3.c ├── gl_buffers.c ├── gl_debug.c ├── gl_drawcall_wrappers.c ├── gl_framebuffer.c ├── gl_framebuffer.h ├── gl_local.h ├── gl_misc.c ├── gl_model.h ├── gl_program.c ├── gl_sdl.c ├── gl_sprite3d.c ├── gl_sprite3d.h ├── gl_state.c ├── gl_texture.c ├── gl_texture.h ├── gl_texture_functions.c ├── gl_texture_internal.h ├── glc_aliasmodel.c ├── glc_aliasmodel_mesh.c ├── glc_bloom.c ├── glc_brushmodel.c ├── glc_draw.c ├── glc_framebuffer.c ├── glc_lightmaps.c ├── glc_local.h ├── glc_main.c ├── glc_matrix.c ├── glc_matrix.h ├── glc_md3.c ├── glc_misc.c ├── glc_particles.c ├── glc_performance.c ├── glc_sdl.c ├── glc_sky.c ├── glc_sprite3d.c ├── glc_state.c ├── glc_state.h ├── glc_surf.c ├── glc_turb_surface.c ├── glc_vao.c ├── glc_vao.h ├── glc_warp.c ├── glm_aliasmodel.c ├── glm_brushmodel.c ├── glm_brushmodel.h ├── glm_draw.c ├── glm_draw.h ├── glm_framebuffer.c ├── glm_lightmaps.c ├── glm_local.h ├── glm_main.c ├── glm_md3.c ├── glm_misc.c ├── glm_particles.c ├── glm_particles.h ├── glm_performance.c ├── glm_rmain.c ├── glm_rsurf.c ├── glm_sdl.c ├── glm_sprite.c ├── glm_sprite3d.c ├── glm_state.c ├── glm_texture_arrays.c ├── glm_texture_arrays.h ├── glm_vao.c ├── glm_vao.h ├── glsl │ ├── common.glsl │ ├── constants.glsl │ ├── draw_aliasmodel.fragment.glsl │ ├── draw_aliasmodel.vertex.glsl │ ├── draw_sprites.fragment.glsl │ ├── draw_sprites.vertex.glsl │ ├── draw_world.fragment.glsl │ ├── draw_world.vertex.glsl │ ├── fx_world_geometry.fragment.glsl │ ├── fx_world_geometry.vertex.glsl │ ├── glc │ │ ├── glc_aliasmodel_shadow.fragment.glsl │ │ ├── glc_aliasmodel_shadow.vertex.glsl │ │ ├── glc_aliasmodel_shell.fragment.glsl │ │ ├── glc_aliasmodel_shell.vertex.glsl │ │ ├── glc_aliasmodel_std.fragment.glsl │ │ ├── glc_aliasmodel_std.vertex.glsl │ │ ├── glc_caustics.fragment.glsl │ │ ├── glc_caustics.vertex.glsl │ │ ├── glc_draw_sprites.fragment.glsl │ │ ├── glc_draw_sprites.vertex.glsl │ │ ├── glc_hud_images.fragment.glsl │ │ ├── glc_hud_images.vertex.glsl │ │ ├── glc_post_process_screen.fragment.glsl │ │ ├── glc_post_process_screen.vertex.glsl │ │ ├── glc_sky.fragment.glsl │ │ ├── glc_sky.vertex.glsl │ │ ├── glc_turbsurface.fragment.glsl │ │ ├── glc_turbsurface.vertex.glsl │ │ ├── glc_world_drawflat.fragment.glsl │ │ ├── glc_world_drawflat.vertex.glsl │ │ ├── glc_world_secondpass.fragment.glsl │ │ ├── glc_world_secondpass.vertex.glsl │ │ ├── glc_world_textured.fragment.glsl │ │ └── glc_world_textured.vertex.glsl │ ├── hud_draw_circle.fragment.glsl │ ├── hud_draw_circle.vertex.glsl │ ├── hud_draw_image.fragment.glsl │ ├── hud_draw_image.geometry.glsl │ ├── hud_draw_image.vertex.glsl │ ├── hud_draw_line.fragment.glsl │ ├── hud_draw_line.vertex.glsl │ ├── hud_draw_polygon.fragment.glsl │ ├── hud_draw_polygon.vertex.glsl │ ├── lighting.compute.glsl │ ├── post_process_screen.fragment.glsl │ ├── post_process_screen.vertex.glsl │ ├── shared │ │ └── fxaa.h.glsl │ ├── simple.fragment.glsl │ ├── simple.vertex.glsl │ ├── simple3d.fragment.glsl │ └── simple3d.vertex.glsl ├── hash.c ├── hash.h ├── help.c ├── help.h ├── help_files.c ├── host.c ├── hud.c ├── hud.h ├── hud_262.c ├── hud_ammo.c ├── hud_armor.c ├── hud_autoid.c ├── hud_centerprint.c ├── hud_clock.c ├── hud_common.c ├── hud_common.h ├── hud_editor.c ├── hud_editor.h ├── hud_face.c ├── hud_frags.c ├── hud_gamesummary.c ├── hud_groups.c ├── hud_guns.c ├── hud_health.c ├── hud_items.c ├── hud_net.c ├── hud_performance.c ├── hud_qtv.c ├── hud_radar.c ├── hud_scores.c ├── hud_speed.c ├── hud_teaminfo.c ├── hud_tracking.c ├── hud_weapon_stats.c ├── ignore.c ├── ignore.h ├── image.c ├── image.h ├── in_osx.h ├── in_osx.m ├── in_sdl2.c ├── input.h ├── irc.c ├── irc.h ├── irc_filter.c ├── irc_filter.h ├── keys.c ├── keys.h ├── linux_signals.c ├── localtime.h ├── localtime_posix.c ├── localtime_win.c ├── logging.c ├── logging.h ├── macro_definitions.h ├── macro_ids.h ├── match_tools.c ├── match_tools_challenge.c ├── mathlib.c ├── mathlib.h ├── md4.c ├── menu.c ├── menu.h ├── menu_demo.c ├── menu_demo.h ├── menu_ingame.c ├── menu_ingame.h ├── menu_multiplayer.c ├── menu_multiplayer.h ├── menu_options.c ├── menu_options.h ├── menu_proxy.c ├── menu_proxy.h ├── modelgen.h ├── movie.c ├── movie.h ├── movie_avi.c ├── movie_avi.h ├── mvd_autotrack.c ├── mvd_utils.c ├── mvd_utils.h ├── mvd_utils_common.h ├── mvd_xmlstats.c ├── net.c ├── net.h ├── net_chan.c ├── parser.c ├── parser.h ├── particles_classic.h ├── pmove.c ├── pmove.h ├── pmovetst.c ├── pr2.h ├── pr2_cmds.c ├── pr2_edict.c ├── pr2_exec.c ├── pr_cmds.c ├── pr_comp.h ├── pr_edict.c ├── pr_exec.c ├── progdefs.h ├── progs.h ├── q_platform.h ├── q_shared.c ├── q_shared.h ├── qmb_particles.h ├── qsound.h ├── qtv.c ├── qtv.h ├── quakedef.h ├── qwsvdef.h ├── r_aliasmodel.c ├── r_aliasmodel.h ├── r_aliasmodel_md3.c ├── r_aliasmodel_md3.h ├── r_aliasmodel_mesh.c ├── r_aliasmodel_skins.c ├── r_atlas.c ├── r_bloom.c ├── r_brushmodel.c ├── r_brushmodel.h ├── r_brushmodel_bspx.c ├── r_brushmodel_load.c ├── r_brushmodel_sky.c ├── r_brushmodel_sky.h ├── r_brushmodel_surfaces.c ├── r_brushmodel_textures.c ├── r_brushmodel_warpsurfaces.c ├── r_brushmodel_warpsurfaces_sin.h ├── r_buffers.c ├── r_buffers.h ├── r_chaticons.c ├── r_chaticons.h ├── r_draw.c ├── r_draw.h ├── r_draw_charset.c ├── r_draw_circle.c ├── r_draw_image.c ├── r_draw_line.c ├── r_draw_polygon.c ├── r_framestats.h ├── r_hud.c ├── r_lighting.h ├── r_lightmaps.c ├── r_lightmaps.h ├── r_lightmaps_internal.h ├── r_local.h ├── r_main.c ├── r_matrix.c ├── r_matrix.h ├── r_misc.c ├── r_misc.cpp ├── r_model.c ├── r_netgraph.c ├── r_palette.c ├── r_part.c ├── r_part_trails.c ├── r_particles_qmb.c ├── r_particles_qmb.h ├── r_particles_qmb_spawn.c ├── r_particles_qmb_trails.c ├── r_performance.c ├── r_performance.h ├── r_program.h ├── r_refrag.c ├── r_renderer.h ├── r_renderer_structure.h ├── r_rlight.c ├── r_rmain.c ├── r_rmisc.c ├── r_shared.h ├── r_sprite3d.c ├── r_sprite3d.h ├── r_sprite3d_internal.h ├── r_sprites.c ├── r_state.h ├── r_states.c ├── r_texture.c ├── r_texture.h ├── r_texture_cvars.c ├── r_texture_internal.h ├── r_texture_load.c ├── r_texture_util.c ├── r_trace.h ├── r_vao.h ├── render.h ├── resource.h ├── rulesets.c ├── rulesets.h ├── sbar.c ├── sbar.h ├── screen.h ├── server.h ├── settings.h ├── settings_page.c ├── settings_page.h ├── sha1.c ├── sha1.h ├── sha3.c ├── sha3.h ├── skin.c ├── snd_main.c ├── snd_mem.c ├── snd_mix.c ├── snd_voip.c ├── spritegn.h ├── stats_grid.c ├── stats_grid.h ├── sv_ccmds.c ├── sv_demo.c ├── sv_demo_misc.c ├── sv_demo_qtv.c ├── sv_ents.c ├── sv_init.c ├── sv_log.h ├── sv_login.c ├── sv_main.c ├── sv_master.c ├── sv_mod_frags.c ├── sv_mod_frags.h ├── sv_move.c ├── sv_nchan.c ├── sv_null.c ├── sv_phys.c ├── sv_save.c ├── sv_send.c ├── sv_sys_unix.c ├── sv_sys_win.c ├── sv_user.c ├── sv_world.c ├── sv_world.h ├── sys.h ├── sys_osx.m ├── sys_posix.c ├── sys_sdl2.c ├── sys_win.c ├── teamplay.c ├── teamplay.h ├── teamplay_locfiles.c ├── textencoding.c ├── textencoding.h ├── tp_msgs.c ├── tp_msgs.h ├── tp_triggers.c ├── tp_triggers.h ├── tr_types.h ├── utils.c ├── utils.h ├── version.c ├── version.h ├── vfs.h ├── vfs_doomwad.c ├── vfs_gzip.c ├── vfs_mmap.c ├── vfs_os.c ├── vfs_pak.c ├── vfs_tar.c ├── vfs_tar.h ├── vfs_tcp.c ├── vfs_zip.c ├── vid.h ├── vid_common_gl.c ├── vid_sdl2.c ├── vid_vsync.c ├── vk_blending.c ├── vk_buffers.c ├── vk_debug.c ├── vk_draw.c ├── vk_graphics_pipeline.c ├── vk_instance.c ├── vk_lightmaps.c ├── vk_local.h ├── vk_main.c ├── vk_md3.c ├── vk_misc.c ├── vk_physical_devices.c ├── vk_renderpass.c ├── vk_sdl.c ├── vk_swapchain.c ├── vk_vao.c ├── vk_vao.h ├── vk_window_surface.c ├── vm.c ├── vm.h ├── vm_interpreted.c ├── vm_local.h ├── vm_x86.c ├── vx_camera.c ├── vx_camera.h ├── vx_coronas.c ├── vx_stuff.c ├── vx_stuff.h ├── vx_tracker.c ├── vx_tracker.h ├── vx_vertexlights.c ├── vx_vertexlights.h ├── wad.c ├── wad.h ├── winquake.rc ├── xsd.c ├── xsd.h ├── xsd_document.c ├── xsd_document.h ├── zone.c └── zone.h └── vcpkg.json /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: 'BUG: ' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Please search for existing issues and check for potential duplicates before filing yours. 11 | 12 | **ezQuake version:** 13 | (Specify the Git commit hash if using a non-stable build - this is available through the `/version` command) 14 | 15 | **OS/device including version:** 16 | Specify GPU model, drivers, and the renderer (classic or modern) if graphics-related. 17 | 18 | **Describe the bug** 19 | A clear and concise description of what the bug is. 20 | 21 | **To Reproduce** 22 | Steps to reproduce the behavior: 23 | 1. Go to '...' 24 | 2. Click on '....' 25 | 3. Scroll down to '....' 26 | 4. See error 27 | 28 | **Expected behavior** 29 | A clear and concise description of what you expected to happen. 30 | 31 | **Screenshots** 32 | If applicable, add screenshots to help explain your problem. 33 | Also please attach your config (.cfg) file 34 | 35 | **Additional context** 36 | Add any other context about the problem here. 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: 'REQ: ' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Please ensure that your request is predominantly client-based, and not better suited to being logged with the server or mod aspects of QuakeWorld (e.g. mvdsv or ktx) 11 | 12 | **Is your feature request related to a problem? Please describe.** 13 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 14 | 15 | **Describe the solution you'd like** 16 | A clear and concise description of what you want to happen. 17 | 18 | **Describe alternatives you've considered** 19 | A clear and concise description of any alternative solutions or features you've considered. 20 | 21 | **Additional context** 22 | Add any other context or screenshots about the feature request here. 23 | 24 | **Impact on server or mods** 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ezquake 2 | ezquake.exe 3 | ezquake-*.exe 4 | ezquake-*-* 5 | ezQuake.aps 6 | *.vcxproj*.user 7 | *.vcxproj*.cache 8 | SysPrintf.log 9 | .ezquake/ 10 | .vs 11 | /.vscode 12 | *.json.c 13 | *.glsl.c 14 | vcpkg_installed/ 15 | src/.msversion.h 16 | /build*/ 17 | 18 | !.gitignore 19 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/qwprot"] 2 | path = src/qwprot 3 | url = https://github.com/QW-Group/qwprot.git 4 | branch = master 5 | [submodule "vcpkg"] 6 | path = vcpkg 7 | url = https://github.com/Microsoft/vcpkg 8 | -------------------------------------------------------------------------------- /bootstrap.ps1: -------------------------------------------------------------------------------- 1 | function Show-MessageBox { 2 | param ([string]$message) 3 | Add-Type -AssemblyName PresentationFramework 4 | [System.Windows.MessageBox]::Show($message, "Bootstrap Error", 'OK', 'Warning') 5 | } 6 | 7 | if (-not (Get-Command git -ErrorAction SilentlyContinue)) { 8 | Show-MessageBox "Git is needed to checkout vcpkg, but it's not installed or not available in PATH." 9 | exit 1 10 | } 11 | 12 | git submodule update --init --recursive 13 | 14 | if (-not (Test-Path "vcpkg/.git")) { 15 | if (-not (Test-Path "version.json")) { 16 | Show-MessageBox "Unable to checkout correct version of vcpkg without 'version.json'." 17 | exit 1 18 | } 19 | 20 | try { 21 | $versionData = Get-Content -Raw -Path "version.json" | ConvertFrom-Json 22 | } catch { 23 | Show-MessageBox "version.json is not valid JSON." 24 | exit 1 25 | } 26 | 27 | $vcpkgVersion = $versionData.vcpkg 28 | 29 | if (Test-Path "vcpkg") { 30 | Remove-Item -Recurse -Force "vcpkg" 31 | } 32 | 33 | git clone --branch $vcpkgVersion --depth 1 https://github.com/microsoft/vcpkg.git "vcpkg" 34 | $cloneExitCode = $LASTEXITCODE 35 | 36 | if ($cloneExitCode -ne 0) { 37 | Show-MessageBox "Checkout of vcpkg failed." 38 | exit 1 39 | } 40 | } 41 | 42 | & "vcpkg/bootstrap-vcpkg.bat" -disableMetrics -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | show_error() { 4 | printf "\e[31mError\e[0m: $1\n" 5 | exit 1 6 | } 7 | 8 | required_commands="cmake ninja git automake autoconf pkg-config curl zip unzip tar" 9 | 10 | missing_deps="" 11 | for cmd in $required_commands; do 12 | if ! command -v "$cmd" >/dev/null 2>&1; then 13 | missing_deps="$missing_deps $cmd" 14 | fi 15 | done 16 | 17 | # naming differs on macOS/Linux 18 | if ! command -v "libtoolize" >/dev/null 2>&1 && ! command -v "glibtoolize" >/dev/null 2>&1; then 19 | missing_deps="$missing_deps libtool"; 20 | fi 21 | 22 | if [ -n "$missing_deps" ]; then 23 | show_error "Install packages that provide support for:$missing_deps" 24 | fi 25 | 26 | if [ -e ".git" ]; then 27 | echo "Updating submodules..." 28 | git submodule update --init --recursive 29 | fi 30 | 31 | if [ ! -e "vcpkg/.git" ]; then 32 | if [ ! -f "version.json" ]; then 33 | show_error "Unable to checkout vcpkg without 'version.json'." 34 | fi 35 | 36 | vcpkg_version=$(sed -n 's/.*"vcpkg": *"\(.*\)".*/\1/p' version.json) 37 | if [ -z "$vcpkg_version" ]; then 38 | show_error "Could not extract vcpkg version from version.json." 39 | fi 40 | 41 | if [ -d "vcpkg" ]; then 42 | rm -rf "vcpkg" 43 | fi 44 | 45 | git clone --branch "$vcpkg_version" --depth 1 https://github.com/microsoft/vcpkg.git "vcpkg" 46 | if [ $? -ne 0 ]; then 47 | show_error "Checkout of vcpkg failed." 48 | fi 49 | fi 50 | 51 | vcpkg/bootstrap-vcpkg.sh -disableMetrics 52 | if [ $? -ne 0 ]; then 53 | show_error "vcpkg bootstrap failed." 54 | fi 55 | -------------------------------------------------------------------------------- /cmake/CheckDependency.cmake: -------------------------------------------------------------------------------- 1 | # Check if a dependency exists and declare a target named Dep::$name. 2 | # If USE_SYSTEM_LIBS variable is set, find dependency via pkg-config. 3 | 4 | if (USE_SYSTEM_LIBS) 5 | find_package(PkgConfig REQUIRED) 6 | endif() 7 | 8 | macro(check_dependency target_var pkg_config_name vcpkg_name vcpkg_target_name) 9 | cmake_parse_arguments(_ARG "REQUIRED;CONFIG" "" "" ${ARGN}) 10 | set(_REQUIRED "") 11 | if (_ARG_REQUIRED) 12 | set(_REQUIRED "REQUIRED") 13 | endif() 14 | set(_CONFIG "") 15 | if (_ARG_CONFIG) 16 | set(_CONFIG "CONFIG") 17 | endif() 18 | string(TOUPPER ${target_var} _TARGET_VAR_UPPER) 19 | set(HAVE_${_TARGET_VAR_UPPER} FALSE) 20 | if (USE_SYSTEM_LIBS) 21 | pkg_check_modules(${target_var} ${_REQUIRED} IMPORTED_TARGET ${pkg_config_name}) 22 | if (${target_var}_FOUND) 23 | add_library(Dep::${target_var} ALIAS PkgConfig::${target_var}) 24 | set(HAVE_${_TARGET_VAR_UPPER} TRUE) 25 | endif() 26 | else() 27 | find_package(${vcpkg_name} ${_CONFIG} ${_REQUIRED}) 28 | add_library(Dep::${target_var} ALIAS ${vcpkg_target_name}) 29 | set(HAVE_${_TARGET_VAR_UPPER} TRUE) 30 | endif() 31 | endmacro() 32 | -------------------------------------------------------------------------------- /cmake/FindSpeex.cmake: -------------------------------------------------------------------------------- 1 | # Can be removed once vcpkg speexdsp package has gained a proper cmake-wrapper. 2 | set(_VCPKG_ARCH_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}") 3 | find_path(SPEEX_INCLUDE_DIR NAMES speex/speex.h PATHS "${_VCPKG_ARCH_DIR}/include" NO_DEFAULT_PATH REQUIRED) 4 | find_library(SPEEX_LIB_RELEASE NAMES speex PATHS "${_VCPKG_ARCH_DIR}/lib" NO_DEFAULT_PATH) 5 | find_library(SPEEX_LIB_DEBUG NAMES speex PATHS "${_VCPKG_ARCH_DIR}/debug/lib" NO_DEFAULT_PATH) 6 | if(NOT SPEEX_LIB_RELEASE AND NOT SPEEX_LIB_DEBUG) 7 | message(FATAL_ERROR "Speex library not found") 8 | endif() 9 | add_library(SPEEX::SPEEX STATIC IMPORTED) 10 | set_target_properties(SPEEX::SPEEX PROPERTIES 11 | IMPORTED_CONFIGURATIONS "Debug;Release" 12 | IMPORTED_LOCATION_RELEASE "${SPEEX_LIB_RELEASE}" 13 | IMPORTED_LOCATION_DEBUG "${SPEEX_LIB_DEBUG}" 14 | INTERFACE_INCLUDE_DIRECTORIES "${SPEEX_INCLUDE_DIR}" 15 | ) -------------------------------------------------------------------------------- /cmake/FindSpeexDSP.cmake: -------------------------------------------------------------------------------- 1 | # Can be removed once vcpkg speexdsp package has gained a proper cmake-wrapper. 2 | set(_VCPKG_ARCH_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}") 3 | find_path(SPEEXDSP_INCLUDE_DIR NAMES speex/speexdsp_types.h PATHS "${_VCPKG_ARCH_DIR}/include" NO_DEFAULT_PATH REQUIRED) 4 | find_library(SPEEXDSP_LIB_RELEASE NAMES speexdsp PATHS "${_VCPKG_ARCH_DIR}/lib" NO_DEFAULT_PATH) 5 | find_library(SPEEXDSP_LIB_DEBUG NAMES speexdsp PATHS "${_VCPKG_ARCH_DIR}/debug/lib" NO_DEFAULT_PATH) 6 | if(NOT SPEEXDSP_LIB_RELEASE AND NOT SPEEXDSP_LIB_DEBUG) 7 | message(FATAL_ERROR "SpeexDSP library not found") 8 | endif() 9 | add_library(SPEEX::SPEEXDSP STATIC IMPORTED) 10 | set_target_properties(SPEEX::SPEEXDSP PROPERTIES 11 | IMPORTED_CONFIGURATIONS "Debug;Release" 12 | IMPORTED_LOCATION_RELEASE "${SPEEXDSP_LIB_RELEASE}" 13 | IMPORTED_LOCATION_DEBUG "${SPEEXDSP_LIB_DEBUG}" 14 | INTERFACE_INCLUDE_DIRECTORIES "${SPEEXDSP_INCLUDE_DIR}" 15 | ) -------------------------------------------------------------------------------- /cmake/ResourceCompiler.cmake: -------------------------------------------------------------------------------- 1 | # Generate C code with some content encoded as an array of unsigned char. 2 | # See AddResources.cmake for more information. 3 | 4 | set(input_file "${CMAKE_ARGV3}") 5 | set(output_file "${CMAKE_ARGV4}") 6 | 7 | get_filename_component(base_name "${input_file}" NAME) 8 | string(REGEX REPLACE "[.]" "_" variable_name "${base_name}") 9 | 10 | file(READ "${input_file}" content HEX) 11 | 12 | string(LENGTH "${content}" content_length) 13 | math(EXPR data_length "${content_length} / 2") 14 | 15 | string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," data "${content}") 16 | 17 | string(APPEND data "0x00,") 18 | 19 | file(WRITE "${output_file}" "const unsigned char ${variable_name}[] = {\n${data}\n};\nconst unsigned int ${variable_name}_len = ${data_length};\n") 20 | -------------------------------------------------------------------------------- /cmake/triplets/arm64-osx.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE arm64) 2 | set(VCPKG_CRT_LINKAGE dynamic) 3 | set(VCPKG_LIBRARY_LINKAGE static) 4 | 5 | set(VCPKG_CMAKE_SYSTEM_NAME Darwin) 6 | set(VCPKG_OSX_ARCHITECTURES arm64) 7 | set(VCPKG_OSX_DEPLOYMENT_TARGET "11.0") -------------------------------------------------------------------------------- /cmake/triplets/x64-mingw-static.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE x64) 2 | set(VCPKG_CRT_LINKAGE dynamic) 3 | set(VCPKG_LIBRARY_LINKAGE static) 4 | set(VCPKG_ENV_PASSTHROUGH PATH) 5 | 6 | set(VCPKG_CMAKE_SYSTEM_NAME MinGW) 7 | 8 | set(VCPKG_C_FLAGS "-march=nehalem ") 9 | set(VCPKG_CXX_FLAGS "-march=nehalem ") -------------------------------------------------------------------------------- /cmake/triplets/x64-osx.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE x64) 2 | set(VCPKG_CRT_LINKAGE dynamic) 3 | set(VCPKG_LIBRARY_LINKAGE static) 4 | 5 | set(VCPKG_CMAKE_SYSTEM_NAME Darwin) 6 | set(VCPKG_OSX_ARCHITECTURES x86_64) 7 | set(VCPKG_OSX_DEPLOYMENT_TARGET "11.0") -------------------------------------------------------------------------------- /cmake/triplets/x86-mingw-static.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE x86) 2 | set(VCPKG_CRT_LINKAGE dynamic) 3 | set(VCPKG_LIBRARY_LINKAGE static) 4 | set(VCPKG_ENV_PASSTHROUGH PATH) 5 | 6 | set(VCPKG_CMAKE_SYSTEM_NAME MinGW) 7 | 8 | set(VCPKG_C_FLAGS "-msse2 ") 9 | set(VCPKG_CXX_FLAGS "-msse2 ") -------------------------------------------------------------------------------- /dist/linux/io.github.ezQuake.128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/dist/linux/io.github.ezQuake.128.png -------------------------------------------------------------------------------- /dist/linux/io.github.ezQuake.48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/dist/linux/io.github.ezQuake.48.png -------------------------------------------------------------------------------- /dist/linux/io.github.ezQuake.64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/dist/linux/io.github.ezQuake.64.png -------------------------------------------------------------------------------- /dist/linux/io.github.ezQuake.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Comment=A modern QuakeWorld client focused on competitive online play 3 | Categories=Game;Shooter; 4 | Exec=ezquake.sh 5 | Icon=io.github.ezQuake 6 | Name=ezQuake 7 | StartupNotify=true 8 | PrefersNonDefaultGPU=true 9 | Terminal=false 10 | Type=Application 11 | Keywords=quake;first;person;shooter;multiplayer; 12 | -------------------------------------------------------------------------------- /dist/macOS/MacOSXBundleInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIconFile 6 | ezquake.icns 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | mvd 13 | qwd 14 | dem 15 | 16 | CFBundleTypeIconFile 17 | ezquake.icns 18 | CFBundleTypeName 19 | Quake demo 20 | CFBundleTypeRole 21 | Viewer 22 | 23 | 24 | CFBundleURLTypes 25 | 26 | 27 | CFBundleURLName 28 | QW 29 | CFBundleURLSchemes 30 | 31 | qw 32 | 33 | 34 | 35 | NSHighResolutionCapable 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /dist/macOS/ezquake.entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.device.audio-input 8 | 9 | com.apple.security.network.client 10 | 11 | com.apple.security.network.server 12 | 13 | com.apple.security.files.user-selected.read-write 14 | 15 | com.apple.security.files.bookmarks.app-scope 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /dist/macOS/ezquake.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/dist/macOS/ezquake.icns -------------------------------------------------------------------------------- /dist/windows/ezQuake.rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | IDI_ICON1 ICON "@EZQUAKE_RESOURCE_ICON@" 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEVERSION @EZQUAKE_RESOURCE_VERSION@ 7 | BEGIN 8 | BLOCK "StringFileInfo" 9 | BEGIN 10 | BLOCK "040904b0" 11 | BEGIN 12 | VALUE "FileDescription", "@EZQUAKE_RESOURCE_DESCRIPTION@\0" 13 | VALUE "ProductName", "@EZQUAKE_RESOURCE_NAME@\0" 14 | VALUE "ProductVersion", "@EZQUAKE_RESOURCE_COMMIT@\0" 15 | VALUE "LegalCopyright", "@EZQUAKE_RESOURCE_AUTHOR@\0" 16 | END 17 | END 18 | BLOCK "VarFileInfo" 19 | BEGIN 20 | VALUE "Translation", 0x409, 1200 21 | END 22 | END -------------------------------------------------------------------------------- /dist/windows/ezquake.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/dist/windows/ezquake.ico -------------------------------------------------------------------------------- /misc/cfg/eq260.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/misc/cfg/eq260.cfg -------------------------------------------------------------------------------- /misc/cfg/how_to_use_these_files.txt: -------------------------------------------------------------------------------- 1 | Configuration files (configs) stored in this folder contain variety 2 | of scripts and settings of features. 3 | 4 | You can execute these configs by typing e.g. "/exec cfg/movement.cfg" 5 | into the console. 6 | 7 | Configuration file movement.cfg contains some basic movement and weapons 8 | keyboard binds, basic commands like ready/break and player tracking on numpad, 9 | very basic screen setup and Qizmo proxy navigation keyboard binds. 10 | Configuration files teamplay.cfg and eq260.cfg contain keyboard binds for 11 | teamplay communication messages. 12 | 13 | Configs with the name starting with 'hud_*' are Head Up Display configuration 14 | files. Some of them require specific 'conwidth' and 'conheight' settings (see 15 | ezStart utility). 16 | 17 | 18 | Advanced 19 | --- 20 | Configuration file teamtime.cfg contains script that helps you time items 21 | through teamplay messages with your teammates. 22 | 23 | Configs with the name starting with 'gfx_*' are used by the game engine when 24 | you choose different values for "Graphics settings" option in the Options menu. 25 | Usually you don't care much what is in those files and you don't need to 26 | customize them but you might wish to change something in them so the menu option 27 | suits your needs. 28 | -------------------------------------------------------------------------------- /misc/cfg/hud_aas.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/misc/cfg/hud_aas.cfg -------------------------------------------------------------------------------- /misc/cfg/hud_murdoc.cfg: -------------------------------------------------------------------------------- 1 | echo Murdoc's Head Up Display Configuration File 2 | echo made for conwidth 512 conheigh 412 3 | 4 | scr_newhud 1 5 | cvar_reset_re hud_. 6 | 7 | hud_ammo1_pos_x "270" 8 | hud_ammo1_pos_y "395" 9 | hud_ammo1_scale "0.5" 10 | hud_ammo1_show "1" 11 | hud_ammo2_pos_x "330" 12 | hud_ammo2_pos_y "395" 13 | hud_ammo2_scale "0.5" 14 | hud_ammo2_show "1" 15 | hud_ammo3_pos_x "390" 16 | hud_ammo3_pos_y "395" 17 | hud_ammo3_scale "0.5" 18 | hud_ammo3_show "1" 19 | hud_ammo4_pos_x "450" 20 | hud_ammo4_pos_y "395" 21 | hud_ammo4_scale "0.5" 22 | hud_ammo4_show "1" 23 | hud_ammo_pos_x "430" 24 | hud_ammo_pos_y "385" 25 | hud_armor_pos_x "40" 26 | hud_armor_pos_y "385" 27 | hud_armor_show "1" 28 | hud_face_pos_x "130" 29 | hud_face_pos_y "386" 30 | hud_face_show "1" 31 | hud_fps_pos_x "-24" 32 | hud_fps_pos_y "-42" 33 | hud_fps_show "1" 34 | hud_fps_title "0" 35 | hud_gun2_pos_x "279" 36 | hud_gun2_pos_y "-40" 37 | hud_gun2_show "1" 38 | hud_gun3_pos_x "-25" 39 | hud_gun3_pos_y "20" 40 | hud_gun3_show "1" 41 | hud_gun4_pos_x "35" 42 | hud_gun4_pos_y "-20" 43 | hud_gun4_show "1" 44 | hud_gun5_pos_x "-24" 45 | hud_gun5_pos_y "20" 46 | hud_gun5_show "1" 47 | hud_gun6_pos_x "36" 48 | hud_gun6_pos_y "-20" 49 | hud_gun6_show "1" 50 | hud_gun7_pos_x "-24" 51 | hud_gun7_pos_y "20" 52 | hud_gun7_show "1" 53 | hud_gun8_pos_x "35" 54 | hud_gun8_show "1" 55 | hud_health_pos_x "160" 56 | hud_health_pos_y "385" 57 | hud_health_show "1" 58 | hud_iarmor_pos_x "10" 59 | hud_iarmor_pos_y "387" 60 | hud_iarmor_show "1" 61 | 62 | hud_recalculate 63 | -------------------------------------------------------------------------------- /misc/cfg/mvdhud_1on1.cfg: -------------------------------------------------------------------------------- 1 | // backup keyboard bindings 2 | set_bind_str mvdhuddel del 3 | 4 | echo "press $[Delete$] to remove 1on1 hud" 5 | 6 | bind del "bind del $mvdhuddel; mvd_autohud 0; echo hud removed - use mvd_autohud 1 to turn it back" 7 | 8 | cl_multiview 2 9 | cl_mvinset 1 10 | scr_autoid 1 11 | cl_mvinsethud 1 12 | 13 | hide group1 14 | -------------------------------------------------------------------------------- /misc/cfg/mvdhud_2on2.cfg: -------------------------------------------------------------------------------- 1 | exec cfg/mvdhud_base_del.cfg 2 | 3 | cl_multiview 4 4 | 5 | // Default radar group 6 | set radar_group 2 7 | 8 | exec cfg/mvdhud_base.cfg 9 | exec cfg/mvdhud_base_4.cfg 10 | exec cfg/mvdhud_base_other.cfg 11 | 12 | frags cols 2 13 | 14 | // 15 | // ######################################## BINDS ########################################## 16 | // 17 | 18 | bind enter move_radar -------------------------------------------------------------------------------- /misc/cfg/mvdhud_3on3.cfg: -------------------------------------------------------------------------------- 1 | exec cfg/mvdhud_base_del.cfg 2 | 3 | cl_multiview 3 4 | 5 | // Default radar group 6 | set radar_group 3 7 | 8 | exec cfg/mvdhud_base.cfg 9 | exec cfg/mvdhud_base_3.cfg 10 | exec cfg/mvdhud_base_other.cfg 11 | 12 | frags cols 3 13 | 14 | // 15 | // ######################################## BINDS ########################################## 16 | // 17 | 18 | bind enter move_radar -------------------------------------------------------------------------------- /misc/cfg/mvdhud_4on4.cfg: -------------------------------------------------------------------------------- 1 | exec cfg/mvdhud_base_del.cfg 2 | 3 | cl_multiview 4 4 | 5 | // Default radar group is #2 (top right corner) 6 | set radar_group 2 7 | 8 | exec cfg/mvdhud_base.cfg 9 | exec cfg/mvdhud_base_4.cfg 10 | exec cfg/mvdhud_base_other.cfg 11 | 12 | frags cols 4 13 | 14 | // 15 | // ######################################## BINDS ########################################## 16 | // 17 | 18 | bind enter move_radar -------------------------------------------------------------------------------- /misc/cfg/mvdhud_base.cfg: -------------------------------------------------------------------------------- 1 | // 2 | // ######################################## BASIC ALIASES ######################################### 3 | // 4 | 5 | if $cl_multiview > 0 set max_group 5 else set_calc max_group $cl_multiview + 1 6 | 7 | // Let the player move the radar around in the views. 8 | alias next_radar_group "if $radar_group == $max_group set radar_group 1 else set_calc radar_group $radar_group + 1" 9 | alias move_radar "group$radar_group frame 0;next_radar_group;place radar group$radar_group" 10 | 11 | // Remove the frame of the group the radar is in when going into free fly mode. 12 | alias f_freeflyspectate "group$radar_group frame 0" 13 | alias f_trackspectate "if $cl_multiview > 0 group$radar_group frame 1 else group$radar_group frame 0" 14 | 15 | // 16 | // ######################################## BASIC CONFIG ########################################## 17 | // 18 | 19 | // Track the first team to start with 20 | trackteam 1 21 | 22 | // Display the mini-huds gathered in the center of the screen. 23 | cl_mvdisplayhud 4 24 | cl_mvhudpos gather 25 | cl_mvhudvertical 1 26 | 27 | // Someone might be using scr_newhud > 1 so don't screw with their settings 28 | if $scr_newhud == 0 scr_newhud 1 29 | 30 | // Allow elements to be offscreen (only in GL). 31 | hud_offscreen 0 32 | 33 | // Make sure we're not in planmode. 34 | hud_planmode 0 35 | 36 | // Show RL's/armor/health name. 37 | scr_autoid 4 38 | 39 | // Get rid of all hud elements. 40 | hide all 41 | -------------------------------------------------------------------------------- /misc/cfg/mvdhud_base_2.cfg: -------------------------------------------------------------------------------- 1 | // 2 | // ########################################### VIEW GROUPS ######################################## 3 | // 4 | cl_multiview 2 5 | 6 | // Calculate the size of a view. 7 | set_calc halfconh $conheight / 2 8 | 9 | // 10 | // One HUD group for each view. 11 | // 12 | 13 | // Top 14 | show group1 15 | place group1 screen 16 | align group1 left top 17 | move group1 0 0 18 | group1 name "Top" 19 | group1 width $conwidth 20 | group1 height $halfconh 21 | group1 frame 0 22 | group1 frame_color black 23 | 24 | // Bottom 25 | show group2 26 | place group2 screen 27 | align group2 left bottom 28 | move group2 0 0 29 | group2 name "Bottom" 30 | group2 width $conwidth 31 | group2 height $halfconh 32 | group2 frame 0 33 | group2 frame_color black 34 | 35 | hide group3 36 | hide group4 37 | hide group5 -------------------------------------------------------------------------------- /misc/cfg/mvdhud_base_3.cfg: -------------------------------------------------------------------------------- 1 | // 2 | // ########################################### VIEW GROUPS ######################################## 3 | // 4 | cl_multiview 3 5 | 6 | // Calculate the size of a view. 7 | set_calc halfconw $conwidth / 2 8 | set_calc halfconh $conheight / 2 9 | 10 | // 11 | // One HUD group for each view. 12 | // 13 | 14 | // Top 15 | show group1 16 | place group1 screen 17 | align group1 left top 18 | move group1 0 0 19 | group1 name "Top" 20 | group1 width $conwidth 21 | group1 height $halfconh 22 | group1 frame 0 23 | group1 frame_color black 24 | 25 | // Bottom left 26 | show group2 27 | place group2 screen 28 | align group2 left bottom 29 | move group2 0 0 30 | group2 name "Bottom left" 31 | group2 width $halfconw 32 | group2 height $halfconh 33 | group2 frame 0 34 | group2 frame_color black 35 | 36 | // Bottom right 37 | show group3 38 | place group3 screen 39 | align group3 right bottom 40 | move group3 0 0 41 | group3 name "Bottom right" 42 | group3 width $halfconw 43 | group3 height $halfconh 44 | group3 frame 0 45 | group3 frame_color black 46 | 47 | hide group4 48 | hide group5 -------------------------------------------------------------------------------- /misc/cfg/mvdhud_base_4.cfg: -------------------------------------------------------------------------------- 1 | // 2 | // ########################################### VIEW GROUPS ######################################## 3 | // 4 | //cl_multiview 4 5 | 6 | // Calculate the size of a view. 7 | set_calc halfconw $conwidth / 2 8 | set_calc halfconh $conheight / 2 9 | 10 | // 11 | // One HUD group for each view. 12 | // 13 | 14 | // Top left 15 | show group1 16 | place group1 screen 17 | align group1 left top 18 | move group1 0 0 19 | group1 name "Top left" 20 | group1 width $halfconw 21 | group1 height $halfconh 22 | group1 frame 0 23 | 24 | // Top right - Radar group 25 | show group2 26 | place group2 screen 27 | align group2 right top 28 | move group2 0 0 29 | group2 name "Top right radar" 30 | group2 width $halfconw 31 | group2 height $halfconh 32 | group2 frame 0 33 | group2 frame_color black 34 | 35 | // Bottom left 36 | show group3 37 | place group3 screen 38 | align group3 left bottom 39 | move group3 0 0 40 | group3 name "Bottom left" 41 | group3 width $halfconw 42 | group3 height $halfconh 43 | group3 frame 0 44 | group3 frame_color black 45 | 46 | // Bottom right 47 | show group4 48 | place group4 screen 49 | align group4 right bottom 50 | move group4 0 0 51 | group4 name "Bottom right" 52 | group4 width $halfconw 53 | group4 height $halfconh 54 | group4 frame 0 55 | group4 frame_color black 56 | 57 | hide group5 -------------------------------------------------------------------------------- /misc/cfg/mvdhud_base_del.cfg: -------------------------------------------------------------------------------- 1 | // backup keyboard bindings 2 | set_bind_str mvdhuddel del 3 | 4 | echo "press $[Delete$] to remove auto mvdhud" 5 | 6 | bind del "bind del $mvdhuddel; mvd_autohud 0; echo hud removed - use mvd_autohud 1 or 2 to turn it back on" -------------------------------------------------------------------------------- /misc/cfg/mvdhud_base_other.cfg: -------------------------------------------------------------------------------- 1 | // 2 | // ########################################### OTHER HUD ELEMENTS ######################################## 3 | // 4 | 5 | // 6 | // Radar 7 | // 8 | set_calc radarw $halfconw - 15 9 | set_calc radarh $halfconh - 15 10 | 11 | show radar 12 | place radar group2 13 | align radar center center 14 | move radar 0 0 15 | radar frame 0 16 | radar width $radarw 17 | radar height $radarh 18 | radar opacity 0.5 19 | radar itemfilter "quad pent armor ring backpack" 20 | radar autosize 0 21 | radar show_height 1 22 | radar show_powerups 1 23 | radar show_stats 1 24 | radar weaponfilter "rl lg gl" 25 | 26 | // 27 | // Frags 28 | // 29 | show frags 30 | place frags screen 31 | align frags center bottom 32 | move frags 0 -8 33 | frags frame 0.02 34 | frags frame_color white 35 | frags rows 8 36 | frags cols $cl_multiview 37 | frags vertical 0 38 | frags extra_spec_info 1 39 | frags teamsort 1 40 | frags cell_width 16 41 | frags cell_height 8 42 | frags padtext 1 43 | frags shownames 1 44 | frags showteams 0 45 | frags space_x 1 46 | frags space_y 1 47 | frags teamsort 1 48 | 49 | // 50 | // Teamfrags 51 | // 52 | show teamfrags 53 | place teamfrags screen 54 | align teamfrags center bottom 55 | move teamfrags 0 -35 56 | teamfrags frame 0.02 57 | teamfrags frame_color white 58 | teamfrags rows 2 59 | teamfrags cols 1 60 | teamfrags fliptext 1 61 | teamfrags cell_width 32 62 | teamfrags cell_height 8 63 | teamfrags padtext 1 64 | teamfrags shownames 1 65 | teamfrags extra_spec_info 1 66 | teamfrags vertical 0 67 | 68 | // 69 | // Team hold bar 70 | // 71 | show teamholdbar 72 | place teamholdbar screen 73 | align teamholdbar left bottom 74 | move teamholdbar 0 0 75 | teamholdbar width $conwidth 76 | teamholdbar height 8 77 | teamholdbar frame 0 78 | teamholdbar vertical 0 79 | teamholdbar vertical_text 0 80 | teamholdbar show_text 1 81 | 82 | // 83 | // Team hold info 84 | // 85 | show teamholdinfo 86 | place teamholdinfo group4 87 | align teamholdinfo right top 88 | move teamholdinfo 0 0 89 | teamholdinfo itemfilter "quad rl ra ya pent" 90 | teamholdinfo height 48 91 | teamholdinfo width 100 92 | teamholdinfo style 0 93 | teamholdinfo opacity 0.8 94 | -------------------------------------------------------------------------------- /misc/cfg/mvdhud_custom.cfg: -------------------------------------------------------------------------------- 1 | exec cfg/mvdhud_base_del.cfg 2 | exec cfg/mvdhud_4on4.cfg 3 | 4 | // 5 | // ######################################## ALIASES ############################################## 6 | // 7 | 8 | alias clear_groups "group1 frame 0;group2 frame 0;group3 frame 0;group4 frame 0" 9 | alias mv_1 "cl_multiview 0;exec cfg/mvdhud_base_4.cfg;clear_groups" 10 | alias mv_2 "cl_multiview 2;exec cfg/mvdhud_base_2.cfg;clear_groups" 11 | alias mv_3 "cl_multiview 3;exec cfg/mvdhud_base_3.cfg;clear_groups" 12 | alias mv_4 "cl_multiview 4;exec cfg/mvdhud_base_4.cfg;clear_groups" 13 | clear_groups 14 | // 15 | // ######################################## BINDS ########################################## 16 | // 17 | 18 | bind enter move_radar 19 | bind 1 mv_1 20 | bind 2 mv_2 21 | bind 3 mv_3 22 | bind 4 mv_4 -------------------------------------------------------------------------------- /misc/cfg/pingdump.cfg: -------------------------------------------------------------------------------- 1 | echo "ping dump script by JohnNy_cz" 2 | 3 | alias f_sbrefreshdone "log pingdump;sb_pingsdump;log stop;echo ping dumping to $log_dir/pingdump.log done" 4 | alias f_sbupdatesourcesdone "sb_sourceunmarkall; sb_sourcemark quakeservers.net;sb_refresh" 5 | cvar_reset_re sb_ping.* 6 | 7 | echo "Refreshing servers list, this may take up to 30 seconds..." 8 | 9 | sb_sourceadd quakeservers.net master.quakeservers.net master 10 | sb_sourcesupdate 11 | -------------------------------------------------------------------------------- /misc/fragfile/fragfile.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/misc/fragfile/fragfile.dat -------------------------------------------------------------------------------- /misc/pak.lst: -------------------------------------------------------------------------------- 1 | base.pk3 2 | help.pk3 3 | hud.pk3 4 | progs.pk3 5 | locs.pk3 6 | levelshots.pk3 7 | -------------------------------------------------------------------------------- /misc/sb/au-sv.txt: -------------------------------------------------------------------------------- 1 | 159.196.248.221:27600 2 | 103.195.53.179:28501 3 | 103.195.53.179:28502 4 | 103.195.53.179:28503 5 | 103.25.59.27:28000 6 | 103.25.59.27:28501 7 | 103.25.59.27:28502 8 | 103.25.59.27:28504 9 | 182.239.198.9:27500 10 | 103.25.59.27:30000 11 | 103.25.59.27:27501 12 | 103.25.59.27:27504 13 | 103.25.59.27:27505 14 | 103.25.59.27:27503 15 | 103.25.59.27:27502 16 | 103.151.65.19:27500 17 | 103.151.65.19:30000 18 | 16.50.174.37:27510 19 | 3.25.174.195:27501 20 | 3.25.174.195:27500 21 | 3.25.174.195:27502 22 | 3.25.174.195:30000 23 | 3.25.174.195:27510 24 | 3.25.174.195:27503 25 | 159.196.248.221:27601 26 | 210.54.39.19:28501 27 | 115.188.3.198:27500 28 | 103.151.65.11:28000 29 | 103.151.65.11:30000 30 | 103.151.65.11:28501 31 | 103.151.65.11:28502 32 | 163.47.21.45:28000 33 | 103.151.65.11:28503 34 | 103.151.65.11:28504 35 | 103.195.53.179:28000 36 | 223.165.64.141:27500 37 | 172.105.184.44:27501 38 | 203.29.243.177:28000 39 | 203.29.243.177:30000 40 | 203.29.243.177:28501 41 | 124.189.251.43:27666 42 | 124.189.251.43:28001 43 | 124.189.251.43:28002 44 | 124.189.251.43:28003 45 | 124.189.251.43:28000 46 | 124.189.251.43:30000 47 | 163.47.21.45:30000 48 | 103.25.59.27:28503 49 | -------------------------------------------------------------------------------- /misc/sb/cache/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/misc/sb/cache/empty -------------------------------------------------------------------------------- /misc/sb/check_sources.sh: -------------------------------------------------------------------------------- 1 | for source in *.txt; do 2 | cat $source | grep -v -E -e "^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]{5}$" 3 | done 4 | 5 | -------------------------------------------------------------------------------- /misc/sb/ctf.txt: -------------------------------------------------------------------------------- 1 | 72.83.103.37:28505 2 | 54.94.165.196:30000 3 | 159.196.248.221:27601 4 | 98.144.80.46:27500 5 | 149.28.240.2:28507 6 | 45.76.23.209:28507 7 | 159.203.25.195:28507 8 | -------------------------------------------------------------------------------- /misc/sb/qizmo.txt: -------------------------------------------------------------------------------- 1 | 95.216.202.86:27666 2 | 124.189.251.43:27666 3 | -------------------------------------------------------------------------------- /misc/sb/sa-sv.txt: -------------------------------------------------------------------------------- 1 | 177.71.158.196:27500 2 | 177.71.158.196:27502 3 | 144.22.145.206:27504 4 | 144.22.145.206:27506 5 | 144.22.145.206:27502 6 | 144.22.145.206:27508 7 | 144.22.145.206:30000 8 | 144.22.145.206:27510 9 | 54.232.250.209:28000 10 | 54.232.250.209:30000 11 | 54.232.250.209:28501 12 | 54.232.250.209:28502 13 | 54.232.250.209:28503 14 | 54.232.250.209:28504 15 | 129.148.54.225:26000 16 | 129.148.54.225:27500 17 | 18.228.39.185:27501 18 | 18.228.39.185:27502 19 | 18.228.39.185:30000 20 | 18.228.39.185:27510 21 | 18.228.39.185:27503 22 | 54.94.165.196:28501 23 | 54.94.165.196:28502 24 | 54.94.165.196:30000 25 | 54.94.165.196:27700 26 | 54.94.165.196:27500 27 | 54.94.165.196:27600 28 | 191.223.251.197:27500 29 | 164.152.62.160:28000 30 | 164.152.62.160:30000 31 | 18.228.199.156:28500 32 | 18.228.199.156:28501 33 | 18.228.199.156:28502 34 | 18.228.199.156:28503 35 | 18.228.199.156:28504 36 | 170.239.85.110:28000 37 | 170.239.85.110:30000 38 | 170.239.85.110:28501 39 | 170.239.85.110:28502 40 | 170.239.85.110:28503 41 | 170.239.85.110:28504 42 | 170.239.85.110:28505 43 | 164.152.62.160:28501 44 | 164.152.62.160:28502 45 | 164.152.62.160:28503 46 | 164.152.62.160:28504 47 | 177.76.50.14:27501 48 | 177.76.50.14:27502 49 | 177.76.50.14:27503 50 | 177.76.50.14:27504 51 | 177.76.50.14:28000 52 | 177.76.50.14:27506 53 | 177.76.50.14:27505 54 | 144.22.145.206:27500 55 | -------------------------------------------------------------------------------- /misc/sb/sources.txt: -------------------------------------------------------------------------------- 1 | url "QuakeServers URL" http://www.quakeservers.net/lists/servers/global.txt 2 | master "QuakeServers.net" master.quakeservers.net:27000 3 | master "Asgaard" qwmaster.fodquake.net:27000 4 | file "Global" global.txt 5 | master "Poland" 217.153.59.106:27000 6 | file "European Servers" eu-sv.txt 7 | file "Europe 4on4" eu-4on4.txt 8 | file "Australian Servers" au-sv.txt 9 | file "Capture The Flag" ctf.txt 10 | file "North America Servers" na-sv.txt 11 | file "South America Servers" sa-sv.txt 12 | file "Team Fortress" tf.txt 13 | file "World Qizmos" qizmo.txt 14 | -------------------------------------------------------------------------------- /misc/sb/tf.txt: -------------------------------------------------------------------------------- 1 | 177.71.158.196:27500 2 | 177.71.158.196:27502 3 | 144.22.145.206:27504 4 | 144.22.145.206:27506 5 | 144.22.145.206:27502 6 | 144.22.145.206:27508 7 | 144.22.145.206:27510 8 | 71.69.230.224:27500 9 | 23.227.170.222:26666 10 | 193.227.134.114:27500 11 | 193.227.134.114:27501 12 | 193.227.134.114:27502 13 | 193.227.134.114:27503 14 | 103.25.59.27:27501 15 | 103.25.59.27:27504 16 | 103.25.59.27:27505 17 | 103.25.59.27:27503 18 | 103.25.59.27:27502 19 | 54.177.92.188:27501 20 | 54.177.92.188:27510 21 | 54.177.92.188:27503 22 | 103.151.65.19:27500 23 | 34.244.130.97:27510 24 | 13.40.65.97:27510 25 | 16.50.174.37:27510 26 | 144.202.33.70:27510 27 | 3.108.227.32:27501 28 | 3.108.227.32:27500 29 | 3.108.227.32:27502 30 | 3.108.227.32:27510 31 | 3.108.227.32:27503 32 | 18.228.39.185:27501 33 | 18.228.39.185:27502 34 | 18.228.39.185:27510 35 | 18.228.39.185:27503 36 | 16.170.162.186:27501 37 | 16.170.162.186:27500 38 | 16.170.162.186:27502 39 | 16.170.162.186:27510 40 | 16.170.162.186:27503 41 | 3.25.174.195:27501 42 | 3.25.174.195:27500 43 | 3.25.174.195:27502 44 | 3.25.174.195:27510 45 | 3.25.174.195:27503 46 | 18.208.156.115:27501 47 | 18.208.156.115:27502 48 | 18.208.156.115:27510 49 | 18.208.156.115:27503 50 | 95.216.202.86:28504 51 | 95.216.202.86:28503 52 | 35.185.44.174:27502 53 | 23.227.170.216:27502 54 | 23.227.170.216:27500 55 | 23.227.170.216:27501 56 | 23.227.170.216:27507 57 | 23.227.170.216:27505 58 | 23.227.170.216:27506 59 | 144.22.145.206:27500 60 | 188.40.103.81:27600 61 | 35.185.44.174:27500 62 | -------------------------------------------------------------------------------- /misc/sb/update_sources.bat: -------------------------------------------------------------------------------- 1 | wget -m -nd --no-if-modified-since https://www.quakeservers.net/lists/australia/au-sv.txt 2 | wget -m -nd --no-if-modified-since https://www.quakeservers.net/lists/ctf/ctf.txt 3 | wget -m -nd --no-if-modified-since https://www.quakeservers.net/lists/europe/eu-sv.txt 4 | wget -m -nd --no-if-modified-since https://www.quakeservers.net/lists/servers/global.txt 5 | wget -m -nd --no-if-modified-since https://www.quakeservers.net/lists/north_america/na-sv.txt 6 | wget -m -nd --no-if-modified-since https://www.quakeservers.net/lists/qizmo/qizmo.txt 7 | wget -m -nd --no-if-modified-since https://www.quakeservers.net/lists/south_america/sa-sv.txt 8 | wget -m -nd --no-if-modified-since https://www.quakeservers.net/lists/tf/tf.txt 9 | wget -m -nd --no-if-modified-since https://www.quakeservers.net/lists/4on4_eu/eu-4on4.txt 10 | -------------------------------------------------------------------------------- /src/Ctrl_EditBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 azazello and ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | /* 19 | * EditBox functions 20 | * 21 | * $Id: Ctrl_EditBox.h,v 1.4 2006-05-13 07:31:57 disconn3ct Exp $ 22 | */ 23 | 24 | #ifndef __CTRL_EDITBOX_H__ 25 | #define __CTRL_EDITBOX_H__ 26 | 27 | #define MAX_EDITTEXT 255 28 | 29 | typedef struct CEditBox_s 30 | { 31 | char text[MAX_EDITTEXT+1]; 32 | unsigned int width; 33 | unsigned int max; 34 | unsigned int pos; 35 | unsigned int disp; 36 | } CEditBox; 37 | 38 | void CEditBox_Init(CEditBox *e, int width, int max); 39 | void CEditBox_Draw(CEditBox *e, int x, int y, qbool active); 40 | void CEditBox_Key(CEditBox *e, int key, wchar unichar); 41 | 42 | #endif // __CTRL_EDITBOX_H__ 43 | -------------------------------------------------------------------------------- /src/EX_qtvlist.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 dimman 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the included (GNU.txt) GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include 22 | 23 | struct str_buf { 24 | size_t len; /* len not size, basically strlen(str) so 1 byte less than actual size */ 25 | char *str; /* NULL terminated */ 26 | }; 27 | 28 | void qtvlist_init(void); 29 | void qtvlist_deinit(void); 30 | void qtvlist_joinfromqtv_cmd(void); 31 | 32 | -------------------------------------------------------------------------------- /src/cd_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | #include "quakedef.h" 19 | 20 | void CDAudio_Play(byte track, qbool looping) 21 | { 22 | } 23 | 24 | void CDAudio_Stop(void) 25 | { 26 | } 27 | 28 | void CDAudio_Pause(void) 29 | { 30 | } 31 | 32 | void CDAudio_Resume(void) 33 | { 34 | } 35 | 36 | void CD_f (void) { 37 | } 38 | 39 | void CDAudio_Update(void) 40 | { 41 | } 42 | 43 | int CDAudio_Init(void) 44 | { 45 | return 0; 46 | } 47 | 48 | void CDAudio_Shutdown(void) 49 | { 50 | } -------------------------------------------------------------------------------- /src/cdaudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | int CDAudio_Init(void); 22 | void CDAudio_Play(byte track, qbool looping); 23 | void CDAudio_Stop(void); 24 | void CDAudio_Pause(void); 25 | void CDAudio_Resume(void); 26 | void CDAudio_Shutdown(void); 27 | void CDAudio_Update(void); 28 | -------------------------------------------------------------------------------- /src/central.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef CENTRAL_H 3 | #define CENTRAL_H 4 | 5 | #include "server.h" 6 | 7 | void Central_Init(void); 8 | void Central_Shutdown(void); 9 | void Central_ProcessResponses(void); 10 | // void Central_SubmitGame(const char* path); 11 | 12 | // Creates a challenge/response on the web server after user claims to be 'username' 13 | void Central_GenerateChallenge(client_t* client, const char* username, qbool during_login); 14 | 15 | // Checks with the server if a client's response to a challenge is correct 16 | void Central_VerifyChallengeResponse(client_t* client, const char* challenge, const char* response); 17 | 18 | #ifndef SERVER_ONLY 19 | // 20 | void Central_FindChallengeResponse(const char* token, const char* challengeText); 21 | #endif 22 | 23 | #endif // !CENTRAL_H 24 | -------------------------------------------------------------------------------- /src/cl_slist.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1999,2000 contributors of the QuakeForge project 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #define MAX_SERVER_LIST 512 22 | 23 | typedef struct { 24 | char *server; 25 | char *description; 26 | } server_entry_t; 27 | 28 | extern server_entry_t slist[MAX_SERVER_LIST]; 29 | 30 | void SList_Init(void); 31 | void SList_Shutdown(void); 32 | void SList_Set(int i,char *addr,char *desc); 33 | void SList_Reset_NoFree(int i); 34 | void SList_Reset(int i); 35 | void SList_Switch(int a,int b); 36 | int SList_Length(void); 37 | void SList_Load(void); 38 | void SList_Save(FILE *f); 39 | -------------------------------------------------------------------------------- /src/cl_view.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | extern float v_blend[4]; 22 | void V_AddLightBlend (float r, float g, float b, float a2, qbool suppress_polyblend); 23 | 24 | extern cvar_t v_gamma; 25 | extern cvar_t v_contrast; 26 | 27 | void V_Init (void); 28 | void V_UpdatePalette (void); 29 | void V_ParseDamage (void); 30 | void V_SetContentsColor (int contents); 31 | void V_CalcBlend (void); 32 | 33 | float V_CalcRoll (vec3_t angles, vec3_t velocity); 34 | 35 | void V_StartPitchDrift (void); 36 | void V_StopPitchDrift (void); 37 | 38 | void V_TF_ClearGrenadeEffects (void); // BorisU 39 | -------------------------------------------------------------------------------- /src/cmdline_params.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_CMDLINE_PARAMS_H 3 | #define EZQUAKE_CMDLINE_PARAMS_H 4 | 5 | #define CMDLINE_DEF(x, str) cmdline_param_ ## x 6 | 7 | typedef enum { 8 | #include "cmdline_params_ids.h" 9 | num_cmdline_params 10 | } cmdline_param_id; 11 | 12 | #undef CMDLINE_DEF 13 | 14 | #endif // EZQUAKE_CMDLINE_PARAMS_H 15 | 16 | -------------------------------------------------------------------------------- /src/collision.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | #include "quakedef.h" 19 | #include "pmove.h" 20 | 21 | float CL_TraceLine (vec3_t start, vec3_t end, vec3_t impact, vec3_t normal) 22 | { 23 | trace_t trace = PM_TraceLine (start, end); /* PM_TraceLine hits bmodels and players */ 24 | VectorCopy (trace.endpos, impact); 25 | if (normal) 26 | VectorCopy (trace.plane.normal, normal); 27 | 28 | return 0.0; 29 | } 30 | -------------------------------------------------------------------------------- /src/config_manager.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2001-2002 A Nourai 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the included (GNU.txt) GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef _CONFIG_MANAGER_H_ 22 | 23 | #define _CONFIG_MANAGER_H_ 24 | 25 | void ConfigManager_Init (void); 26 | void Config_QuitSave(void); 27 | void ResetBinds(void); 28 | void Cfg_ExecuteDefaultConfig(void); 29 | void Cfg_GetConfigPath(char* path, size_t max_length, const char* name); 30 | 31 | extern cvar_t cfg_save_unchanged, cfg_legacy_exec; 32 | 33 | #define MAIN_CONFIG_FILENAME "config.cfg" 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/crc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | /* crc.h */ 21 | 22 | #ifndef __CRC_H__ 23 | #define __CRC_H__ 24 | 25 | void CRC_Init(unsigned short *crcvalue); 26 | void CRC_ProcessByte(unsigned short *crcvalue, byte data); 27 | unsigned short CRC_Value(unsigned short crcvalue); 28 | unsigned short CRC_Block (byte *start, unsigned int count); 29 | void CRC_AddBlock (unsigned short *crcvalue, byte *start, int count); 30 | 31 | #endif /* !__CRC_H__ */ 32 | -------------------------------------------------------------------------------- /src/demo_controls.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Copyright (C) 2007 ezQuake team 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | 20 | $Id: demo_controls.c,v 1.78 2007/10/27 14:51:15 cokeman1982 Exp $ 21 | */ 22 | 23 | void DemoControls_Draw(void); 24 | qbool DemoControls_MouseEvent(mouse_state_t *ms); 25 | qbool DemoControls_KeyEvent(int key, int unichar, qbool down); 26 | void DemoControls_f(void); 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/document_rendering.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 azazello and ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | #ifndef __DOCUMENT_RENDERING_H__ 19 | #define __DOCUMENT_RENDERING_H__ 20 | 21 | 22 | typedef struct document_rendered_link_s 23 | { 24 | int start; 25 | int end; 26 | document_tag_a_t *tag; 27 | 28 | struct document_rendered_link_s *next; 29 | } 30 | document_rendered_link_t; 31 | 32 | typedef struct document_rendered_section_s 33 | { 34 | int start; 35 | document_tag_section_t *tag; 36 | 37 | struct document_rendered_section_s *children; 38 | struct document_rendered_section_s *next; 39 | } 40 | document_rendered_section_t; 41 | 42 | 43 | typedef struct document_renered_s 44 | { 45 | // head 46 | char *title; 47 | int title_lines; 48 | 49 | // body 50 | char *text; 51 | int text_lines; 52 | 53 | // metadata 54 | document_rendered_link_t *links; 55 | document_rendered_section_t *sections; 56 | } 57 | document_rendered_t; 58 | 59 | // renders document into memory buffer, 60 | int XSD_RenderDocument(document_rendered_t *r, xml_document_t *doc, int width); 61 | 62 | // free rendered document 63 | void XSD_RenderClear(document_rendered_t *); 64 | 65 | 66 | 67 | 68 | #endif // __DOCUMENT_RENDERING_H__ 69 | -------------------------------------------------------------------------------- /src/fchecks.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-2002 A Nourai 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the included (GNU.txt) GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | $Id: fchecks.h,v 1.4 2007-09-14 13:29:28 disconn3ct Exp $ 20 | */ 21 | 22 | #ifndef __FCHECKS_H__ 23 | #define __FCHECKS_H__ 24 | 25 | void FChecks_Init (void); 26 | void FChecks_CheckRequest (const char *); 27 | 28 | #endif /* !__FCHECKS_H__ */ 29 | -------------------------------------------------------------------------------- /src/fmod.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-2002 A Nourai 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the included (GNU.txt) GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | $Id: fmod.h,v 1.3 2007-09-14 13:29:28 disconn3ct Exp $ 20 | */ 21 | 22 | #ifndef __FMOD_H__ 23 | #define __FMOD_H__ 24 | 25 | void FMod_Init (void); 26 | void FMod_CheckModel (const char *name, const void *buf, const size_t len); 27 | char *FMod_Response_Text(void); 28 | void FMod_Response (void); 29 | 30 | #endif /* !__FMOD_H__ */ 31 | -------------------------------------------------------------------------------- /src/fonts.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_FONTS_HEADER 3 | #define EZQUAKE_FONTS_HEADER 4 | 5 | #ifdef EZ_FREETYPE_SUPPORT 6 | void FontInitialise(void); 7 | int FontFixedWidth(int max_length, float scale, qbool digits_only, qbool proportional); 8 | #else 9 | #define FontFixedWidth(max_length, scale, digits_only, proportional) (max_length * 8.0f * scale) 10 | #endif 11 | 12 | qbool FontAlterCharCoordsWide(float* x, float* y, wchar ch, qbool bigchar, float scale, qbool proportional); 13 | float FontCharacterWidthWide(wchar ch, float scale, qbool proportional); 14 | float FontCharacterWidth(char ch, float scale, qbool proportional); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/gl_aliasmodel.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | // Alias model rendering (common to OpenGL) 21 | 22 | #include "quakedef.h" 23 | #include "gl_model.h" 24 | #include "r_local.h" 25 | #include "r_aliasmodel.h" 26 | 27 | -------------------------------------------------------------------------------- /src/gl_sprite3d.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | // 3D sprites 21 | #include "quakedef.h" 22 | #include "gl_model.h" 23 | #include "gl_local.h" 24 | #include "gl_sprite3d.h" 25 | #include "r_sprite3d_internal.h" 26 | #include "tr_types.h" 27 | 28 | GLenum glPrimitiveTypes[r_primitive_count] = { 29 | GL_TRIANGLE_STRIP, 30 | GL_TRIANGLE_FAN, 31 | GL_TRIANGLES 32 | }; 33 | 34 | void GL_DrawSequentialBatchImpl(gl_sprite3d_batch_t* batch, int first_batch, int last_batch, int index_offset, GLuint maximum_batch_size) 35 | { 36 | int vertOffset = batch->glFirstVertices[first_batch]; 37 | int numVertices = batch->numVertices[first_batch]; 38 | int batch_count = last_batch - first_batch; 39 | void* indexes = (void*)(index_offset * sizeof(GLuint)); 40 | int terminators = GL_Supported(R_SUPPORT_PRIMITIVERESTART) ? 1 : (numVertices % 2 == 0 ? 2 : 3); 41 | 42 | // Ugh! 43 | if (!GL_Supported(R_SUPPORT_PRIMITIVERESTART) && batch->primitive_id == r_primitive_triangle_fan) { 44 | maximum_batch_size = 1; 45 | } 46 | 47 | while (batch_count > maximum_batch_size) { 48 | GL_DrawElementsBaseVertex(glPrimitiveTypes[batch->primitive_id], maximum_batch_size * numVertices + (maximum_batch_size - 1) * terminators, GL_UNSIGNED_INT, indexes, vertOffset); 49 | batch_count -= maximum_batch_size; 50 | vertOffset += maximum_batch_size * numVertices; 51 | } 52 | if (batch_count) { 53 | GL_DrawElementsBaseVertex(glPrimitiveTypes[batch->primitive_id], batch_count * numVertices + (batch_count - 1) * terminators, GL_UNSIGNED_INT, indexes, vertOffset); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/gl_sprite3d.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_GL_SPRITE3D_HEADER 3 | #define EZQUAKE_GL_SPRITE3D_HEADER 4 | 5 | #include "r_sprite3d.h" 6 | #include "r_sprite3d_internal.h" 7 | 8 | // GL only 9 | extern GLenum glPrimitiveTypes[r_primitive_count]; 10 | 11 | void GL_DrawSequentialBatchImpl(gl_sprite3d_batch_t* batch, int first_batch, int last_batch, int index_offset, GLuint maximum_batch_size); 12 | 13 | extern int indexes_start_quads; 14 | extern int indexes_start_flashblend; 15 | extern int indexes_start_sparks; 16 | 17 | #endif // #ifndef EZQUAKE_GL_SPRITE3D_HEADER 18 | -------------------------------------------------------------------------------- /src/gl_texture.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-2002 A Nourai 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the included (GNU.txt) GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_GL_TEXTURE_H 21 | #define EZQUAKE_GL_TEXTURE_H 22 | 23 | #include "r_texture.h" 24 | #include "r_texture_internal.h" 25 | 26 | // External API 27 | qbool GL_EnsureTextureUnitBound(int unit, texture_ref texture); 28 | void GL_TextureMipmapGenerate(texture_ref texture); 29 | void GL_TextureAnistropyChanged(texture_ref texture); 30 | void GL_TextureGet(texture_ref tex, int buffer_size, byte* buffer, int bpp); 31 | void GL_TextureWrapModeClamp(texture_ref tex); 32 | void GL_UploadTexture(texture_ref texture, int mode, int width, int height, byte* newdata); 33 | void GL_ReplaceSubImageRGBA(texture_ref ref, int offsetx, int offsety, int width, int height, byte* buffer); 34 | 35 | // Internal 36 | qbool GLM_TextureAllocateArrayStorage(gltexture_t* slot); 37 | void GL_AllocateStorage(gltexture_t* texture); 38 | void GL_AllocateTextureNames(gltexture_t* glt); 39 | 40 | // Samplers 41 | void GL_SamplerSetNearest(unsigned int texture_unit_number); 42 | void GL_SamplerSetLinear(unsigned int texture_unit_number); 43 | void GL_SamplerClear(unsigned int texture_unit_number); 44 | void GL_DeleteSamplers(void); 45 | 46 | #endif // EZQUAKE_GL_TEXTURE_H 47 | -------------------------------------------------------------------------------- /src/glc_local.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_GLC_LOCAL_HEADER 3 | #define EZQUAKE_GLC_LOCAL_HEADER 4 | 5 | void GLC_FreeAliasPoseBuffer(void); 6 | void GLC_Shutdown(r_shutdown_mode_t mode); 7 | 8 | void GLC_PreRenderView(void); 9 | void GLC_SetupGL(void); 10 | void GLC_StateBeginAliasOutlineFrame(qbool weaponmodel); 11 | void GLC_StateBeginBrightenScreen(void); 12 | void GLC_StateBeginFastSky(qbool world); 13 | void GLC_StateBeginSkyZBufferPass(void); 14 | void GLC_StateBeginSingleTextureSkyDome(void); 15 | void GLC_StateBeginSingleTextureSkyDomeCloudPass(void); 16 | void GLC_StateBeginMultiTextureSkyDome(qbool use_program); 17 | void GLC_StateBeginMultiTextureSkyChain(void); 18 | void GLC_StateBeginSingleTextureSkyPass(void); 19 | void GLC_StateBeginSingleTextureCloudPass(void); 20 | void GLC_StateBeginRenderFullbrights(void); 21 | void GLC_StateBeginRenderLumas(void); 22 | void GLC_StateBeginEmitDetailPolys(void); 23 | void GLC_StateBeginDrawMapOutline(void); 24 | void GLC_StateBeginDrawAliasFrame(texture_ref texture, texture_ref fb_texture, qbool mtex, qbool alpha_blend, struct custom_model_color_s* custom_model, qbool weapon_model); 25 | void GLC_StateBeginDrawAliasFrameProgram(texture_ref texture, texture_ref fb_texture, int render_effects, struct custom_model_color_s* custom_model, float ent_alpha, qbool additive_pass); 26 | void GLC_StateBeginDrawAliasZPass(qbool weapon_model); 27 | void GLC_StateBeginAliasModelShadow(void); 28 | void GLC_StateBeginFastTurbPoly(byte color[4]); 29 | void GLC_StateBeginBlendLightmaps(qbool use_buffers); 30 | void GLC_StateBeginCausticsPolys(void); 31 | void GLC_StateBeginUnderwaterAliasModelCaustics(texture_ref base_texture, texture_ref caustics_texture); 32 | void GLC_StateEndUnderwaterAliasModelCaustics(void); 33 | void GLC_StateBeginBloomDraw(texture_ref texture); 34 | void GLC_StateBeginImageDraw(qbool is_text); 35 | void GLC_StateBeginImageDrawNonGLSL(qbool is_text); 36 | void GLC_StateBeginDrawAlphaPieSliceRGB(float thickness); 37 | 38 | void GLC_Begin(GLenum primitive); 39 | void GLC_End(void); 40 | void GLC_Vertex2f(GLfloat x, GLfloat y); 41 | void GLC_Vertex2fv(const GLfloat* v); 42 | void GLC_Vertex3f(GLfloat x, GLfloat y, GLfloat z); 43 | void GLC_Vertex3fv(const GLfloat* v); 44 | 45 | unsigned int GLC_DrawIndexedPoly(glpoly_t* p, unsigned int* modelIndexes, unsigned int modelIndexMaximum, unsigned int index_count); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/glc_matrix.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_GLC_MATRIX_HEADER 21 | #define EZQUAKE_GLC_MATRIX_HEADER 22 | 23 | #include "r_matrix.h" 24 | 25 | void GLC_IdentityModelview(void); 26 | void GLC_RotateModelview(float angle, float x, float y, float z); 27 | void GLC_TranslateModelview(float x, float y, float z); 28 | void GLC_PopModelviewMatrix(const float* matrix); 29 | void GLC_LoadModelviewMatrix(void); 30 | 31 | void GLC_IdentityProjectionView(void); 32 | void GLC_OrthographicProjection(float left, float right, float top, float bottom, float zNear, float zFar); 33 | 34 | void GLC_PopProjectionMatrix(const float* matrix); 35 | void GLC_ScaleModelview(float xScale, float yScale, float zScale); 36 | void GLC_Frustum(double left, double right, double bottom, double top, double zNear, double zFar); 37 | void GLC_PauseMatrixUpdate(void); 38 | void GLC_ResumeMatrixUpdate(void); 39 | void GLC_BeginCausticsTextureMatrix(void); 40 | void GLC_EndCausticsTextureMatrix(void); 41 | 42 | void GLC_PauseMatrixUpdate(void); 43 | void GLC_ResumeMatrixUpdate(void); 44 | 45 | #endif // EZQUAKE_GLC_MATRIX_HEADER 46 | -------------------------------------------------------------------------------- /src/glc_particles.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifdef RENDERER_OPTION_CLASSIC_OPENGL 21 | 22 | #include "quakedef.h" 23 | #include "gl_model.h" 24 | #include "gl_local.h" 25 | #include "gl_sprite3d.h" 26 | #include "glm_particles.h" 27 | #include "particles_classic.h" 28 | 29 | void GLC_DrawClassicParticles(int particles_to_draw) 30 | { 31 | extern texture_ref particletexture; 32 | r_sprite3d_vert_t* vert; 33 | 34 | R_Sprite3DInitialiseBatch(SPRITE3D_PARTICLES_CLASSIC, r_state_particles_classic, particletexture, particletexture_array_index, r_primitive_triangles); 35 | vert = R_Sprite3DAddEntry(SPRITE3D_PARTICLES_CLASSIC, 3 * particles_to_draw); 36 | if (vert) { 37 | extern r_sprite3d_vert_t glvertices[ABSOLUTE_MAX_PARTICLES * 3]; 38 | 39 | memcpy(vert, glvertices, particles_to_draw * 3 * sizeof(glvertices[0])); 40 | } 41 | } 42 | 43 | #endif // #ifdef RENDERER_OPTION_CLASSIC_OPENGL 44 | -------------------------------------------------------------------------------- /src/glc_performance.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | $Id: gl_rmisc.c,v 1.27 2007-09-17 19:37:55 qqshka Exp $ 20 | */ 21 | // gl_rmisc.c 22 | 23 | #ifdef RENDERER_OPTION_CLASSIC_OPENGL 24 | 25 | #include "quakedef.h" 26 | #include "gl_model.h" 27 | #include "gl_local.h" 28 | #include "tr_types.h" 29 | #include "r_renderer.h" 30 | 31 | void GLC_TimeRefresh(void) 32 | { 33 | int i; 34 | float start, stop, time; 35 | 36 | if (!GL_FramebufferEnabled2D()) { 37 | #ifndef __APPLE__ 38 | if (glConfig.hardwareType != GLHW_INTEL) { 39 | // Causes the console to flicker on Intel cards. 40 | GL_BuiltinProcedure(glDrawBuffer, "mode=GL_FRONT", GL_FRONT) 41 | } 42 | #endif 43 | } 44 | 45 | renderer.EnsureFinished(); 46 | 47 | start = Sys_DoubleTime(); 48 | for (i = 0; i < 128; i++) { 49 | r_refdef.viewangles[1] = i * (360.0 / 128.0); 50 | R_SetupFrame(); 51 | R_RenderView(); 52 | } 53 | 54 | renderer.EnsureFinished(); 55 | stop = Sys_DoubleTime(); 56 | time = stop - start; 57 | Com_Printf("%f seconds (%f fps)\n", time, 128 / time); 58 | 59 | if (!GL_FramebufferEnabled2D()) { 60 | #ifndef __APPLE__ 61 | if (glConfig.hardwareType != GLHW_INTEL) { 62 | GL_BuiltinProcedure(glDrawBuffer, "mode=GL_BACK", GL_BACK) 63 | } 64 | #endif 65 | } 66 | 67 | R_EndRendering(); 68 | } 69 | 70 | #endif // #ifdef RENDERER_OPTION_CLASSIC_OPENGL 71 | -------------------------------------------------------------------------------- /src/glc_sdl.c: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 1999-2005 Id Software, Inc. 4 | 5 | This file is part of Quake III Arena source code. 6 | 7 | Quake III Arena 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 | Quake III Arena 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 Foobar; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | 22 | */ 23 | 24 | #ifdef RENDERER_OPTION_CLASSIC_OPENGL 25 | 26 | #include 27 | #include "quakedef.h" 28 | #include "gl_local.h" 29 | 30 | static opengl_version_t versions[] = { 31 | { 4, 3, false, false }, 32 | { 3, 2, false, false }, 33 | { 0, 0, false, true }, 34 | { 4, 3, true, false }, 35 | { 3, 2, true, false }, 36 | { 0, 0, false, true }, 37 | }; 38 | 39 | SDL_GLContext GLC_SDL_CreateContext(SDL_Window* window) 40 | { 41 | return GL_SDL_CreateBestContext(window, versions, sizeof(versions) / sizeof(versions[0])); 42 | } 43 | 44 | #endif // #ifdef RENDERER_OPTION_CLASSIC_OPENGL 45 | -------------------------------------------------------------------------------- /src/glc_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_GLC_STATE_HEADER 21 | #define EZQUAKE_GLC_STATE_HEADER 22 | 23 | #include "r_state.h" 24 | 25 | #ifdef RENDERER_OPTION_CLASSIC_OPENGL 26 | void R_GLC_TextureUnitSet(rendering_state_t* state, int index, qbool enabled, r_texunit_mode_t mode); 27 | void GLC_InitialiseSkyStates(void); 28 | void GLC_CustomAlphaTesting(qbool enabled); 29 | void R_GLC_ConfigureAlphaTesting(rendering_state_t* state, qbool enabled, r_alphatest_func_t func, float value); 30 | #define R_GLC_EnableAlphaTesting(state) { state->alphaTesting.enabled = true; } 31 | #define R_GLC_DisableAlphaTesting(state) { state->alphaTesting.enabled = false; } 32 | 33 | void R_GLC_DisableColorPointer(void); 34 | void R_GLC_DisableTexturePointer(int unit); 35 | #else 36 | #define R_GLC_TextureUnitSet(...) 37 | #define R_GLC_ConfigureAlphaTesting(...) 38 | #define GLC_CustomAlphaTesting(...) 39 | #define R_GLC_EnableAlphaTesting(...) 40 | #define R_GLC_DisableAlphaTesting(...) 41 | #endif // RENDERER_OPTION_CLASSIC_OPENGL 42 | 43 | #endif // EZQUAKE_GLC_STATE_HEADER 44 | -------------------------------------------------------------------------------- /src/glm_brushmodel.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_GLM_BRUSHMODEL_HEADER 3 | #define EZQUAKE_GLM_BRUSHMODEL_HEADER 4 | 5 | #include "r_brushmodel.h" 6 | 7 | // Our limit, user's limit will be dictated by graphics card (glConfig.texture_units set during startup) 8 | #define MAXIMUM_MATERIAL_SAMPLERS 32 9 | 10 | // Cross-material textures which might be used up before we start binding materials 11 | // May well be lower in practise, depending on configuration options enabled 12 | // Currently lightmaps + detail + caustics + (2*skydome|1*skybox) = 5 13 | #define MAX_STANDARD_TEXTURES 5 14 | 15 | void GLM_CreateBrushModelVAO(void); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/glm_draw.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_GLM_DRAW_HEADER 3 | #define EZQUAKE_GLM_DRAW_HEADER 4 | 5 | #define MAX_LINES_PER_FRAME 128 6 | 7 | typedef struct glm_line_point_s { 8 | vec3_t position; 9 | byte color[4]; 10 | } glm_line_point_t; 11 | 12 | typedef struct glm_line_framedata_s { 13 | float line_thickness[MAX_LINES_PER_FRAME]; 14 | int imageIndex[MAX_LINES_PER_FRAME]; 15 | int lineCount; 16 | } glm_line_framedata_t; 17 | 18 | #define CIRCLE_LINE_COUNT 40 19 | #define FLOATS_PER_CIRCLE ((3 + 2 * CIRCLE_LINE_COUNT) * 2) 20 | #define CIRCLES_PER_FRAME 256 21 | 22 | typedef struct glm_circle_framedata_s { 23 | float drawCirclePointData[FLOATS_PER_CIRCLE * CIRCLES_PER_FRAME]; 24 | float drawCircleColors[CIRCLES_PER_FRAME][4]; 25 | qbool drawCircleFill[CIRCLES_PER_FRAME]; 26 | int drawCirclePoints[CIRCLES_PER_FRAME]; 27 | float drawCircleThickness[CIRCLES_PER_FRAME]; 28 | 29 | int circleCount; 30 | } glm_circle_framedata_t; 31 | 32 | #define MAX_POLYGONS_PER_FRAME 8 33 | 34 | typedef struct glm_polygon_framedata_s { 35 | int polygonVerts[MAX_POLYGONS_PER_FRAME]; 36 | int polygonImageIndexes[MAX_POLYGONS_PER_FRAME]; 37 | int polygonCount; 38 | } glm_polygon_framedata_t; 39 | 40 | #define MAX_MULTI_IMAGE_BATCH 4096 41 | typedef enum { 42 | imagetype_image, 43 | imagetype_circle, 44 | imagetype_polygon, 45 | imagetype_line, 46 | 47 | imagetype_count 48 | } r_image_type_t; 49 | 50 | typedef struct glm_image_s { 51 | float pos[2]; 52 | float tex[4]; 53 | unsigned char colour[4]; 54 | int flags; 55 | } glm_image_t; 56 | 57 | typedef struct glm_image_framedata_s { 58 | glm_image_t images[MAX_MULTI_IMAGE_BATCH * 4]; 59 | 60 | int imageCount; 61 | } glm_image_framedata_t; 62 | 63 | extern glm_circle_framedata_t circleData; 64 | extern glm_image_framedata_t imageData; 65 | extern glm_polygon_framedata_t polygonData; 66 | extern glm_line_framedata_t lineData; 67 | 68 | qbool R_LogCustomImageType(r_image_type_t type, int index); 69 | qbool R_LogCustomImageTypeWithTexture(r_image_type_t type, int index, texture_ref texture); 70 | void R_HudUndoLastElement(void); 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /src/glm_particles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_GLM_PARTICLES_HEADER 21 | #define EZQUAKE_GLM_PARTICLES_HEADER 22 | 23 | #include "glm_texture_arrays.h" 24 | #include "r_texture.h" 25 | 26 | extern texture_ref particletexture_array; 27 | extern int particletexture_array_index; 28 | 29 | void GLM_LoadParticleTextures(void); 30 | void Part_ImportTexturesForArrayReferences(texture_flag_t* texture_flags); 31 | void Part_FlagTexturesForArray(texture_flag_t* texture_flags); 32 | 33 | #endif // EZQUAKE_GLM_PARTICLES_HEADER 34 | -------------------------------------------------------------------------------- /src/glm_performance.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | $Id: gl_rmisc.c,v 1.27 2007-09-17 19:37:55 qqshka Exp $ 20 | */ 21 | // gl_rmisc.c 22 | 23 | #ifdef RENDERER_OPTION_MODERN_OPENGL 24 | 25 | #include "quakedef.h" 26 | #include "gl_model.h" 27 | #include "gl_local.h" 28 | #include "tr_types.h" 29 | #include "r_renderer.h" 30 | 31 | void GLM_TimeRefresh(void) 32 | { 33 | int i; 34 | float start, stop, time; 35 | 36 | if (!GL_FramebufferEnabled2D()) { 37 | #ifndef __APPLE__ 38 | if (glConfig.hardwareType != GLHW_INTEL) { 39 | // Causes the console to flicker on Intel cards. 40 | glDrawBuffer(GL_FRONT); 41 | } 42 | #endif 43 | } 44 | 45 | renderer.EnsureFinished(); 46 | 47 | start = Sys_DoubleTime(); 48 | for (i = 0; i < 128; i++) { 49 | r_refdef.viewangles[1] = i * (360.0 / 128.0); 50 | R_SetupFrame(); 51 | R_RenderView(); 52 | } 53 | 54 | renderer.EnsureFinished(); 55 | stop = Sys_DoubleTime(); 56 | time = stop - start; 57 | Com_Printf("%f seconds (%f fps)\n", time, 128 / time); 58 | 59 | if (!GL_FramebufferEnabled2D()) { 60 | #ifndef __APPLE__ 61 | if (glConfig.hardwareType != GLHW_INTEL) { 62 | glDrawBuffer(GL_BACK); 63 | } 64 | #endif 65 | } 66 | 67 | R_EndRendering(); 68 | } 69 | 70 | #endif // #ifdef RENDERER_OPTION_MODERN_OPENGL 71 | -------------------------------------------------------------------------------- /src/glm_sdl.c: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 1999-2005 Id Software, Inc. 4 | 5 | This file is part of Quake III Arena source code. 6 | 7 | Quake III Arena 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 | Quake III Arena 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 Foobar; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | 22 | */ 23 | 24 | #ifdef RENDERER_OPTION_MODERN_OPENGL 25 | 26 | #include 27 | #include "quakedef.h" 28 | #include "gl_local.h" 29 | 30 | static opengl_version_t versions[] = { 31 | { 4, 6, false }, 32 | { 4, 5, false }, 33 | { 4, 4, false }, 34 | { 4, 3, false }, 35 | { 4, 6, true }, 36 | { 4, 5, true }, 37 | { 4, 4, true }, 38 | { 4, 3, true }, 39 | }; 40 | 41 | SDL_GLContext GLM_SDL_CreateContext(SDL_Window* window) 42 | { 43 | return GL_SDL_CreateBestContext(window, versions, sizeof(versions) / sizeof(versions[0])); 44 | } 45 | 46 | #endif // #ifdef RENDERER_OPTION_MODERN_OPENGL 47 | -------------------------------------------------------------------------------- /src/glm_state.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "quakedef.h" 22 | #include "r_local.h" 23 | #include "r_trace.h" 24 | #include "r_state.h" 25 | 26 | void GLM_BeginDrawWorld(qbool alpha_surfaces, qbool polygon_offset) 27 | { 28 | if (alpha_surfaces && polygon_offset) { 29 | R_ApplyRenderingState(r_state_alpha_surfaces_offset_glm); 30 | } 31 | else if (alpha_surfaces) { 32 | R_ApplyRenderingState(r_state_alpha_surfaces_glm); 33 | } 34 | else if (polygon_offset) { 35 | R_ApplyRenderingState(r_state_opaque_surfaces_offset_glm); 36 | } 37 | else { 38 | R_ApplyRenderingState(r_state_opaque_surfaces_glm); 39 | } 40 | } 41 | 42 | void GLM_StateBeginDraw3DSprites(void) 43 | { 44 | } 45 | 46 | void GLM_StateBeginPolyBlend(void) 47 | { 48 | R_ApplyRenderingState(r_state_poly_blend); 49 | } 50 | 51 | void GLM_StateBeginImageDraw(void) 52 | { 53 | R_ApplyRenderingState(r_state_hud_images_glm); 54 | } 55 | 56 | void GLM_StateBeginAliasOutlineBatch(void) 57 | { 58 | R_ApplyRenderingState(r_state_aliasmodel_outline); 59 | } 60 | 61 | void GLM_StateBeginAliasModelBatch(qbool translucent, qbool additive) 62 | { 63 | if (additive) { 64 | R_ApplyRenderingState(r_state_aliasmodel_additive_batch); 65 | } 66 | else if (translucent) { 67 | R_ApplyRenderingState(r_state_aliasmodel_translucent_batch); 68 | } 69 | else { 70 | R_ApplyRenderingState(r_state_aliasmodel_opaque_batch); 71 | } 72 | } 73 | 74 | void GLM_StateBeginAliasModelZPassBatch(void) 75 | { 76 | R_ApplyRenderingState(r_state_aliasmodel_translucent_batch_zpass); 77 | } 78 | -------------------------------------------------------------------------------- /src/glm_texture_arrays.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef GLM_TEXTURE_ARRAYS_HEADER 3 | #define GLM_TEXTURE_ARRAYS_HEADER 4 | 5 | typedef enum { 6 | TEXTURETYPES_ALIASMODEL, 7 | TEXTURETYPES_BRUSHMODEL, 8 | TEXTURETYPES_WORLDMODEL, 9 | TEXTURETYPES_SPRITES, 10 | 11 | TEXTURETYPES_COUNT 12 | } texture_type; 13 | 14 | typedef struct texture_array_ref_s { 15 | texture_ref ref; 16 | int index; 17 | float scale_s; 18 | float scale_t; 19 | } texture_array_ref_t; 20 | 21 | typedef struct texture_flag_s { 22 | texture_ref ref; 23 | int subsequent; 24 | int flags; 25 | 26 | texture_array_ref_t array_ref[TEXTURETYPES_COUNT]; 27 | } texture_flag_t; 28 | 29 | void QMB_FlagTexturesForArray(texture_flag_t* texture_flags); 30 | void QMB_ImportTextureArrayReferences(texture_flag_t* texture_flags); 31 | 32 | void VX_FlagTexturesForArray(texture_flag_t* texture_flags); 33 | void VX_ImportTextureArrayReferences(texture_flag_t* texture_flags); 34 | 35 | void Part_FlagTexturesForArray(texture_flag_t* texture_flags); 36 | void Part_ImportTexturesForArrayReferences(texture_flag_t* texture_flags); 37 | 38 | void R_ImportChatIconTextureArrayReferences(texture_flag_t* texture_flags); 39 | void R_FlagChatIconTexturesForArray(texture_flag_t* texture_flags); 40 | 41 | #endif // #ifndef GLM_TEXTURE_ARRAYS_HEADER 42 | -------------------------------------------------------------------------------- /src/glm_vao.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_GLM_VAO_HEADER 21 | #define EZQUAKE_GLM_VAO_HEADER 22 | 23 | #include "gl_local.h" 24 | #include "r_vao.h" 25 | 26 | void GLM_BindVertexArray(r_vao_id vao); 27 | void GLM_GenVertexArray(r_vao_id vao, const char* name); 28 | void GLM_SetVertexArrayElementBuffer(r_vao_id vao, r_buffer_id ibo); 29 | void GLM_DeleteVAOs(void); 30 | 31 | qbool GLM_InitialiseVAOHandling(void); 32 | qbool GLM_VertexArrayCreated(r_vao_id vao); 33 | 34 | void GLM_ConfigureVertexAttribPointer(r_vao_id vao, r_buffer_id vbo, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer, int divisor); 35 | void GLM_ConfigureVertexAttribIPointer(r_vao_id vao, r_buffer_id vbo, GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer, int divisor); 36 | 37 | void GLM_BindVertexArrayElementBuffer(r_vao_id, r_buffer_id ref); 38 | 39 | #endif // EZQUAKE_GLM_VAO_HEADER 40 | -------------------------------------------------------------------------------- /src/glsl/draw_sprites.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | #ezquake-definitions 4 | 5 | layout(binding=0) uniform sampler2DArray materialTex; 6 | uniform bool alpha_test; 7 | 8 | in vec3 TextureCoord; 9 | in vec4 fsColor; 10 | 11 | out vec4 frag_color; 12 | 13 | void main() 14 | { 15 | frag_color = texture(materialTex, TextureCoord); 16 | 17 | frag_color *= fsColor; 18 | 19 | if (alpha_test && frag_color.a < 0.3) { 20 | discard; 21 | } 22 | 23 | #ifdef DRAW_FOG 24 | frag_color = applyFogBlend(frag_color, gl_FragCoord.z / gl_FragCoord.w); 25 | #endif 26 | } 27 | -------------------------------------------------------------------------------- /src/glsl/draw_sprites.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | #ezquake-definitions 4 | 5 | layout(location=0) in vec3 position; 6 | layout(location=1) in vec3 texCoord; 7 | layout(location=2) in vec4 colour; 8 | 9 | out vec3 TextureCoord; 10 | out vec4 fsColor; 11 | 12 | void main() 13 | { 14 | gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1); 15 | TextureCoord = texCoord; 16 | fsColor = colour; 17 | } 18 | -------------------------------------------------------------------------------- /src/glsl/fx_world_geometry.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | #ezquake-definitions 4 | 5 | layout(binding = 0) uniform sampler2D normal_texture; 6 | 7 | uniform vec3 outline_color; 8 | uniform float outline_scale; 9 | uniform float outline_depth_threshold; 10 | uniform float outline_normal_threshold; 11 | 12 | in vec2 TextureCoord; 13 | out vec4 frag_colour; 14 | 15 | bool vec_nequ(vec3 a, vec3 b) { 16 | return dot(a, b) < outline_normal_threshold; 17 | } 18 | 19 | void main() 20 | { 21 | ivec2 coords = ivec2(TextureCoord.x * r_width, TextureCoord.y * r_height); 22 | vec4 center = texelFetch(normal_texture, coords, 0); 23 | vec4 left = texelFetch(normal_texture, coords - ivec2(1, 0), 0); 24 | vec4 right = texelFetch(normal_texture, coords + ivec2(1, 0), 0); 25 | vec4 up = texelFetch(normal_texture, coords - ivec2(0, 1), 0); 26 | vec4 down = texelFetch(normal_texture, coords + ivec2(0, 1), 0); 27 | 28 | bool ignore = center.a == left.a && center.a == right.a && center.a == up.a && center.a == down.a; 29 | if(ignore) { 30 | frag_colour = vec4(0); 31 | return; 32 | } 33 | 34 | if(center.a == 0) { 35 | frag_colour = vec4(0); 36 | return; 37 | } 38 | 39 | if ((left.a != 0 && vec_nequ(center.rgb, left.rgb )) || 40 | (right.a != 0 && vec_nequ(center.rgb, right.rgb)) || 41 | (up.a != 0 && vec_nequ(center.rgb, up.rgb )) || 42 | (down.a != 0 && vec_nequ(center.rgb, down.rgb )) 43 | ) { 44 | frag_colour.rgb = outline_color; 45 | frag_colour.a = 1; 46 | return; 47 | } 48 | 49 | bool z_diff = r_zFar * abs((right.a - center.a) - (center.a - left.a)) > outline_depth_threshold; 50 | bool z_diff2 = r_zFar * abs((down.a - center.a) - (center.a - up.a)) > outline_depth_threshold; 51 | 52 | if (center.a != 0 && ( 53 | (left.a != 0 && right.a != 0 && z_diff) || 54 | (down.a != 0 && up.a != 0 && z_diff2) 55 | )) { 56 | frag_colour = vec4(outline_color, 1.0f); 57 | return; 58 | } 59 | frag_colour = vec4(0.0f); 60 | } 61 | -------------------------------------------------------------------------------- /src/glsl/fx_world_geometry.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout(location = 0) in vec2 inPosition; 4 | layout(location = 1) in vec2 inTextureCoord; 5 | 6 | out vec2 TextureCoord; 7 | 8 | void main() 9 | { 10 | gl_Position = vec4(inPosition, 0, 1); 11 | TextureCoord = inTextureCoord; 12 | } 13 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_aliasmodel_shadow.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | void main() 6 | { 7 | gl_FragColor = vec4(0, 0, 0, 0.5); 8 | 9 | #ifdef DRAW_FOG 10 | gl_FragColor = applyFog(gl_FragColor, gl_FragCoord.z / gl_FragCoord.w); 11 | #endif 12 | } 13 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_aliasmodel_shadow.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | attribute float flags; 6 | 7 | uniform float lerpFraction; 8 | uniform vec2 shadevector; 9 | uniform float lheight; 10 | 11 | void main() 12 | { 13 | float lerpFrac = lerpFraction; 14 | 15 | #ifdef EZQ_ALIASMODEL_MUZZLEHACK 16 | // #define AM_VERTEX_NOLERP 1 - no bittest in glsl 1.2 17 | lerpFrac = sign(lerpFrac) * max(lerpFrac, mod(flags, 2)); 18 | #endif 19 | 20 | vec4 pos = gl_Vertex + lerpFrac * vec4(gl_MultiTexCoord1.xyz, 0); 21 | 22 | pos.x -= shadevector[0] * (pos[2] + lheight); 23 | pos.y -= shadevector[1] * (pos[2] + lheight); 24 | pos.z = (1 - lheight); 25 | 26 | gl_Position = gl_ModelViewProjectionMatrix * pos; 27 | } 28 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_aliasmodel_shell.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | uniform sampler2D texSampler; 6 | uniform vec4 fsBaseColor1; 7 | uniform vec4 fsBaseColor2; 8 | 9 | varying vec2 fsTextureCoord; 10 | varying vec2 fsAltTextureCoord; 11 | 12 | void main() 13 | { 14 | vec4 tex = texture2D(texSampler, fsTextureCoord); 15 | vec4 alt = texture2D(texSampler, fsAltTextureCoord); 16 | 17 | gl_FragColor = tex * fsBaseColor1 + alt * fsBaseColor2; 18 | 19 | #ifdef DRAW_FOG 20 | gl_FragColor = applyFog(gl_FragColor, gl_FragCoord.z / gl_FragCoord.w); 21 | #endif 22 | } 23 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_aliasmodel_shell.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | attribute float flags; 6 | 7 | varying vec2 fsTextureCoord; 8 | varying vec2 fsAltTextureCoord; 9 | uniform float lerpFraction; // 0 to 1 10 | uniform vec4 scroll; 11 | 12 | void main() 13 | { 14 | float lerpFrac = lerpFraction; 15 | 16 | #ifdef EZQ_ALIASMODEL_MUZZLEHACK 17 | // #define AM_VERTEX_NOLERP 1 - no bittest in glsl 1.2 18 | lerpFrac = sign(lerpFrac) * max(lerpFrac, mod(flags, 2)); 19 | #endif 20 | 21 | gl_Position = gl_ModelViewProjectionMatrix * ((gl_Vertex + lerpFrac * vec4(gl_MultiTexCoord1.xyz, 0)) + vec4(gl_Normal * 0.5, 0)); 22 | fsTextureCoord = vec2(gl_MultiTexCoord0.s * 2 + scroll.x, gl_MultiTexCoord0.t * 2 + scroll.y); 23 | fsAltTextureCoord = vec2(gl_MultiTexCoord0.s * 2 + scroll.z, gl_MultiTexCoord0.t * 2 + scroll.a); 24 | } 25 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_aliasmodel_std.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | #ifdef TEXTURING_ENABLED 6 | uniform sampler2D texSampler; 7 | uniform float fsMinLumaMix; 8 | #endif 9 | 10 | #ifdef DRAW_CAUSTIC_TEXTURES 11 | uniform sampler2D causticsSampler; 12 | uniform float time; 13 | uniform float fsCausticEffects; 14 | #endif 15 | 16 | #if defined(TEXTURING_ENABLED) || defined(DRAW_CAUSTIC_TEXTURES) 17 | varying vec2 fsTextureCoord; 18 | #endif 19 | 20 | #ifdef EZQ_ALIASMODEL_FLATSHADING 21 | varying flat vec4 fsBaseColor; 22 | #else 23 | varying vec4 fsBaseColor; 24 | #endif 25 | 26 | void main() 27 | { 28 | #ifdef BACKFACE_PASS 29 | gl_FragColor = fsBaseColor; 30 | #else 31 | #ifdef TEXTURING_ENABLED 32 | vec4 tex = texture2D(texSampler, fsTextureCoord); 33 | vec3 texMix = mix(tex.rgb, tex.rgb * fsBaseColor.rgb, max(fsMinLumaMix, tex.a)); 34 | 35 | gl_FragColor = vec4(texMix, fsBaseColor.a); 36 | #else 37 | gl_FragColor = fsBaseColor; 38 | #endif 39 | 40 | #ifdef DRAW_CAUSTIC_TEXTURES 41 | vec4 causticCoord = vec4( 42 | // Using multipler of 3 here - not in other caustics logic but range 43 | // isn't enough otherwise, effect too subtle 44 | (fsTextureCoord.s + sin(0.465 * (time + fsTextureCoord.t))) * 3 * -0.1234375, 45 | (fsTextureCoord.t + sin(0.465 * (time + fsTextureCoord.s))) * 3 * -0.1234375, 46 | 0, 47 | 1 48 | ); 49 | vec4 caustic = texture2D(causticsSampler, (gl_TextureMatrix[1] * causticCoord).st); 50 | 51 | // FIXME: Do proper GL_DECAL etc 52 | gl_FragColor = vec4(caustic.rgb * gl_FragColor.rgb * 1.8, gl_FragColor.a); 53 | #endif 54 | #endif // BACKFACE_PASS 55 | 56 | #ifdef DRAW_FOG 57 | gl_FragColor = applyFog(gl_FragColor, gl_FragCoord.z / gl_FragCoord.w); 58 | #endif 59 | } 60 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_aliasmodel_std.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | attribute float flags; 6 | 7 | #ifdef BACKFACE_PASS 8 | 9 | // for outline 10 | uniform float outlineScale; 11 | 12 | #else 13 | 14 | #if defined(TEXTURING_ENABLED) || defined(DRAW_CAUSTIC_TEXTURES) 15 | varying vec2 fsTextureCoord; 16 | #endif 17 | 18 | #ifndef FULLBRIGHT_MODELS 19 | uniform vec3 angleVector; // normalized 20 | uniform float shadelight; // divided by 256 in C 21 | uniform float ambientlight; // divided by 256 in C 22 | #endif 23 | 24 | #endif // BACKFACE_PASS (outlining) 25 | 26 | uniform float lerpFraction; // 0 to 1 27 | #ifdef EZQ_ALIASMODEL_FLATSHADING 28 | varying flat vec4 fsBaseColor; 29 | #else 30 | varying vec4 fsBaseColor; 31 | #endif 32 | 33 | 34 | #define AM_VERTEX_NOLERP 1 35 | 36 | void main() 37 | { 38 | float lerpFrac = lerpFraction; 39 | #ifdef EZQ_ALIASMODEL_MUZZLEHACK 40 | lerpFrac = sign(lerpFrac) * max(lerpFrac, mod(flags, 2)); 41 | #endif 42 | 43 | #ifdef BACKFACE_PASS 44 | gl_Position = gl_ModelViewProjectionMatrix * (gl_Vertex + lerpFrac * vec4(gl_MultiTexCoord1.xyz, 0) + vec4(outlineScale * gl_Normal, 0)); 45 | // gl_Position += gl_ModelViewProjectionMatrix * 46 | fsBaseColor = gl_Color; 47 | #else 48 | gl_Position = gl_ModelViewProjectionMatrix * (gl_Vertex + lerpFrac * vec4(gl_MultiTexCoord1.xyz, 0)); 49 | #if defined(TEXTURING_ENABLED) || defined(DRAW_CAUSTIC_TEXTURES) 50 | fsTextureCoord = gl_MultiTexCoord0.st; 51 | #endif // TEXTURING 52 | 53 | #ifdef FULLBRIGHT_MODELS 54 | fsBaseColor = gl_Color; 55 | #else 56 | // Lighting: this is rough approximation 57 | // Credit to mh @ http://forums.insideqc.com/viewtopic.php?f=3&t=2983 58 | float l = (1 - step(1000, shadelight)) * min((dot(gl_Normal, angleVector) + 1) * shadelight + ambientlight, 1); 59 | 60 | fsBaseColor = vec4(gl_Color.rgb * l, gl_Color.a); 61 | #endif // FULLBRIGHT_MODELS 62 | #endif // BACKFACE_PASS 63 | } 64 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_caustics.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | uniform sampler2D texSampler; 6 | uniform float time; 7 | 8 | varying vec2 TextureCoord; 9 | 10 | void main() 11 | { 12 | vec2 tex; 13 | 14 | tex.s = (TextureCoord.s + 8 * sin((TextureCoord.t + time) * 0.465)) * 0.0234375; 15 | tex.t = (TextureCoord.t + 8 * sin((TextureCoord.s + time) * 0.465)) * 0.0234375; 16 | 17 | gl_FragColor = texture2D(texSampler, tex); 18 | } 19 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_caustics.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | varying vec2 TextureCoord; 6 | 7 | void main() 8 | { 9 | gl_Position = ftransform(); 10 | TextureCoord = gl_MultiTexCoord0.st; 11 | } 12 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_draw_sprites.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | uniform sampler2D materialSampler; 6 | uniform float alphaThreshold; 7 | 8 | varying vec2 TextureCoord; 9 | varying vec4 fsColor; 10 | 11 | void main() 12 | { 13 | gl_FragColor = texture2D(materialSampler, TextureCoord) * fsColor; 14 | 15 | #ifdef DRAW_FOG 16 | gl_FragColor = applyFogBlend(gl_FragColor, gl_FragCoord.z / gl_FragCoord.w); 17 | #endif 18 | } 19 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_draw_sprites.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | varying vec2 TextureCoord; 6 | varying vec4 fsColor; 7 | 8 | void main() 9 | { 10 | gl_Position = ftransform(); 11 | TextureCoord = gl_MultiTexCoord0.st; 12 | fsColor = gl_Color; 13 | } 14 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_hud_images.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | uniform sampler2D primarySampler; 6 | #ifdef MIXED_SAMPLING 7 | uniform sampler2D secondarySampler; 8 | #endif 9 | 10 | varying vec4 TextureCoord; 11 | varying vec4 fsColor; 12 | 13 | void main() 14 | { 15 | gl_FragColor = texture2D(primarySampler, TextureCoord.st); 16 | 17 | #ifdef MIXED_SAMPLING 18 | gl_FragColor *= TextureCoord.a; 19 | gl_FragColor += texture2D(secondarySampler, TextureCoord.st) * (1 - TextureCoord.a); 20 | #endif 21 | 22 | #ifdef PREMULT_ALPHA_HACK 23 | // Some people prefer the smoothing effect from ezQuake < 3.5, 24 | // caused by the alpha being blended incorrectly & effectively applied twice 25 | gl_FragColor.r *= gl_FragColor.a; 26 | gl_FragColor.g *= gl_FragColor.a; 27 | gl_FragColor.b *= gl_FragColor.a; 28 | #endif 29 | 30 | gl_FragColor *= fsColor; 31 | } 32 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_hud_images.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | varying vec4 TextureCoord; 6 | varying vec4 fsColor; 7 | 8 | void main() 9 | { 10 | gl_Position = ftransform(); 11 | TextureCoord = gl_MultiTexCoord0; 12 | fsColor = gl_Color; 13 | } 14 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_post_process_screen.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | varying vec2 TextureCoord; 4 | 5 | void main() 6 | { 7 | gl_Position = gl_Vertex; 8 | TextureCoord = gl_MultiTexCoord0.xy; 9 | } 10 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_sky.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | #ifdef DRAW_SKYBOX 6 | uniform samplerCube skyTex; 7 | #ifdef DRAW_SKYWIND 8 | uniform vec4 skyWind; 9 | #endif 10 | #else 11 | uniform sampler2D skyDomeTex; 12 | uniform sampler2D skyDomeCloudTex; 13 | #endif 14 | 15 | #ifdef DRAW_FOG 16 | uniform float skyFogMix; 17 | #endif 18 | 19 | uniform float skySpeedscale; 20 | uniform float skySpeedscale2; 21 | 22 | varying vec3 Direction; 23 | 24 | void main() 25 | { 26 | #if defined(DRAW_SKYBOX) 27 | gl_FragColor = textureCube(skyTex, Direction); 28 | #if defined(DRAW_SKYWIND) 29 | float t1 = skyWind.w; 30 | float t2 = fract(t1) - 0.5; 31 | float blend = abs(t1 * 2.0); 32 | vec3 dir = normalize(Direction); 33 | vec4 layer1 = textureCube(skyTex, dir + t1 * skyWind.xyz); 34 | vec4 layer2 = textureCube(skyTex, dir + t2 * skyWind.xyz); 35 | layer1.a *= 1.0 - blend; 36 | layer2.a *= blend; 37 | layer1.rgb *= layer1.a; 38 | layer2.rgb *= layer2.a; 39 | vec4 combined = layer1 + layer2; 40 | gl_FragColor = vec4(gl_FragColor.rgb * (1.0 - combined.a) + combined.rgb, 1); 41 | #endif 42 | #else 43 | const float len = 3.09375; 44 | // Flatten it out 45 | vec3 dir = normalize(vec3(Direction.x, Direction.y, 3 * Direction.z)); 46 | 47 | vec4 skyColor = texture2D(skyDomeTex, vec2(skySpeedscale + dir.x * len, skySpeedscale + dir.y * len)); 48 | vec4 cloudColor = texture2D(skyDomeCloudTex, vec2(skySpeedscale2 + dir.x * len, skySpeedscale2 + dir.y * len)); 49 | 50 | gl_FragColor = mix(skyColor, cloudColor, cloudColor.a); 51 | #endif 52 | 53 | #ifdef DRAW_FOG 54 | gl_FragColor = vec4(mix(gl_FragColor.rgb, fogColor, skyFogMix), gl_FragColor.a); 55 | #endif 56 | } 57 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_sky.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | uniform vec3 cameraPosition; 6 | 7 | varying vec3 Direction; 8 | 9 | void main() 10 | { 11 | gl_Position = ftransform(); 12 | Direction = (gl_Vertex.xyz - cameraPosition); 13 | #if defined(DRAW_SKYBOX) 14 | Direction = vec3(-Direction.y, Direction.z, Direction.x); 15 | #endif 16 | } 17 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_turbsurface.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | #ifdef FLAT_COLOR 6 | uniform vec4 color; 7 | #else 8 | uniform sampler2D texSampler; 9 | varying vec2 TextureCoord; 10 | uniform float alpha; 11 | uniform float time; 12 | #endif 13 | 14 | void main() 15 | { 16 | #ifdef FLAT_COLOR 17 | gl_FragColor = color; 18 | #else 19 | vec2 tex; 20 | 21 | tex.s = TextureCoord.s + (sin((TextureCoord.t + time) * 1.5) * 0.125); 22 | tex.t = TextureCoord.t + (sin((TextureCoord.s + time) * 1.5) * 0.125); 23 | 24 | gl_FragColor = texture2D(texSampler, tex); 25 | gl_FragColor *= alpha; 26 | #endif 27 | 28 | #ifdef DRAW_FOG 29 | gl_FragColor = applyFog(gl_FragColor, gl_FragCoord.z / gl_FragCoord.w); 30 | #endif 31 | } 32 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_turbsurface.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | #ifndef FLAT_COLOR 6 | varying vec2 TextureCoord; 7 | #endif 8 | 9 | void main() 10 | { 11 | gl_Position = ftransform(); 12 | #ifndef FLAT_COLOR 13 | TextureCoord = gl_MultiTexCoord0.st; 14 | #endif 15 | } 16 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_world_drawflat.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | #ifdef EZ_USE_TEXTURE_ARRAYS 6 | #extension GL_EXT_texture_array : enable 7 | uniform sampler2DArray texSampler; 8 | centroid varying vec3 TextureCoord; 9 | #else 10 | uniform sampler2D texSampler; 11 | centroid varying vec2 TextureCoord; 12 | #endif 13 | 14 | varying float lightmapScale; 15 | varying float fogScale; 16 | 17 | varying vec4 color; 18 | 19 | void main() 20 | { 21 | // lightmap 22 | #ifdef EZ_USE_TEXTURE_ARRAYS 23 | vec4 lightmap = vec4(1, 1, 1, 1 + lightmapScale) - lightmapScale * texture2DArray(texSampler, TextureCoord); 24 | #else 25 | vec4 lightmap = vec4(1, 1, 1, 1 + lightmapScale) - lightmapScale * texture2D(texSampler, TextureCoord); 26 | #endif 27 | 28 | gl_FragColor = color * lightmap; 29 | 30 | #ifdef DRAW_FOG 31 | gl_FragColor = applyFog(gl_FragColor, fogScale * gl_FragCoord.z / gl_FragCoord.w); 32 | #endif 33 | } 34 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_world_drawflat.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | attribute float style; 6 | varying vec4 color; 7 | #ifdef EZ_USE_TEXTURE_ARRAYS 8 | centroid varying vec3 TextureCoord; 9 | #else 10 | centroid varying vec2 TextureCoord; 11 | #endif 12 | varying float lightmapScale; 13 | varying float fogScale; 14 | 15 | uniform vec4 wallcolor; 16 | uniform vec4 floorcolor; 17 | uniform vec4 skycolor; 18 | uniform vec4 watercolor; 19 | uniform vec4 slimecolor; 20 | uniform vec4 lavacolor; 21 | uniform vec4 telecolor; 22 | 23 | void main() 24 | { 25 | gl_Position = ftransform(); 26 | #ifdef EZ_USE_TEXTURE_ARRAYS 27 | TextureCoord = gl_MultiTexCoord0.xyz; 28 | #else 29 | TextureCoord = gl_MultiTexCoord0.st; 30 | #endif 31 | 32 | lightmapScale = step(64, mod(style, 256)); 33 | 34 | color = vec4(0, 0, 0, 1); 35 | color += mod(style, 2) * skycolor; 36 | color += mod(floor(style / 2), 2) * watercolor; 37 | color += mod(floor(style / 4), 2) * slimecolor; 38 | color += mod(floor(style / 8), 2) * lavacolor; 39 | color += mod(floor(style / 16), 2) * telecolor; 40 | color += mod(floor(style / 32), 2) * skycolor; 41 | color += mod(floor(style / 64), 2) * floorcolor; 42 | color += mod(floor(style / 128), 2) * wallcolor; 43 | color.a = 1; 44 | 45 | // don't apply z-fog to the sky 46 | fogScale = 1 - mod(style, 2); 47 | } 48 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_world_secondpass.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | uniform sampler2D texSampler; 6 | varying vec2 TextureCoord; 7 | 8 | void main() 9 | { 10 | gl_FragColor = texture2D(texSampler, TextureCoord); 11 | } 12 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_world_secondpass.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | varying vec2 TextureCoord; 6 | 7 | void main() 8 | { 9 | gl_Position = ftransform(); 10 | TextureCoord = gl_MultiTexCoord0.st; 11 | } 12 | -------------------------------------------------------------------------------- /src/glsl/glc/glc_world_textured.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | #ezquake-definitions 4 | 5 | varying vec2 TextureCoord; 6 | attribute float style; 7 | 8 | #ifdef DRAW_LIGHTMAPS 9 | #ifdef EZ_USE_TEXTURE_ARRAYS 10 | centroid varying vec3 LightmapCoord; 11 | #else 12 | centroid varying vec2 LightmapCoord; 13 | #endif 14 | #endif 15 | #ifdef DRAW_EXTRA_TEXTURES 16 | uniform float lumaMultiplier; 17 | uniform float fbMultiplier; 18 | varying float lumaScale; 19 | varying float fbScale; 20 | #endif 21 | #ifdef DRAW_DETAIL 22 | attribute vec2 detailCoordInput; 23 | varying vec2 DetailCoord; 24 | #endif 25 | #ifdef DRAW_CAUSTICS 26 | attribute vec2 causticsCoord; 27 | varying float causticsScale; 28 | #endif 29 | 30 | // 0 for textureless, 1 for normal 31 | uniform float texture_multiplier; 32 | 33 | varying float mix_floor; 34 | varying float mix_wall; 35 | 36 | void main() 37 | { 38 | gl_Position = ftransform(); 39 | #ifdef DRAW_ALPHATEST_ENABLED 40 | TextureCoord = gl_MultiTexCoord0.st; 41 | #else 42 | TextureCoord = gl_MultiTexCoord0.st * texture_multiplier; 43 | #endif 44 | 45 | #ifdef DRAW_LIGHTMAPS 46 | #ifdef EZ_USE_TEXTURE_ARRAYS 47 | LightmapCoord = gl_MultiTexCoord1.xyz; 48 | #else 49 | LightmapCoord = gl_MultiTexCoord1.st; 50 | #endif 51 | #endif 52 | 53 | #ifdef DRAW_EXTRA_TEXTURES 54 | lumaScale = lumaMultiplier * mod(floor(style / 256), 2); 55 | fbScale = fbMultiplier * mod(floor(style / 1024), 2); 56 | #endif 57 | #ifdef DRAW_CAUSTICS 58 | causticsScale = mod(floor(style / 512), 2); 59 | #endif 60 | #ifdef DRAW_DETAIL 61 | DetailCoord = detailCoordInput; 62 | #endif 63 | 64 | mix_floor = mod(floor(style / 64), 2); 65 | mix_wall = mod(floor(style / 128), 2); 66 | } 67 | -------------------------------------------------------------------------------- /src/glsl/hud_draw_circle.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | uniform vec4 color; 4 | 5 | out vec4 frag_colour; 6 | 7 | void main(void) 8 | { 9 | frag_colour = color; 10 | } 11 | -------------------------------------------------------------------------------- /src/glsl/hud_draw_circle.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout(location = 0) in vec2 position; 4 | 5 | uniform mat4 matrix; 6 | 7 | void main(void) 8 | { 9 | gl_Position = matrix * vec4(position, 0, 1); 10 | } 11 | -------------------------------------------------------------------------------- /src/glsl/hud_draw_image.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | #ezquake-definitions 4 | 5 | #ifdef MIXED_SAMPLING 6 | layout(binding=0) uniform sampler2D tex[2]; 7 | #else 8 | layout(binding=0) uniform sampler2D tex; 9 | #endif 10 | 11 | in vec2 TextureCoord; 12 | in vec4 Colour; 13 | in float AlphaTest; 14 | #ifdef MIXED_SAMPLING 15 | flat in int IsNearest; 16 | #endif 17 | 18 | out vec4 frag_colour; 19 | 20 | void main() 21 | { 22 | vec4 texColor; 23 | 24 | #ifdef MIXED_SAMPLING 25 | texColor = texture(tex[IsNearest], TextureCoord); 26 | #else 27 | texColor = texture(tex, TextureCoord); 28 | #endif 29 | 30 | if (AlphaTest != 0 && texColor.a < 0.666) { 31 | discard; 32 | } 33 | 34 | #ifdef PREMULT_ALPHA_HACK 35 | // Some people prefer the smoothing effect from ezQuake < 3.5, 36 | // caused by the alpha being blended incorrectly & effectively applied twice 37 | texColor.r *= texColor.a; 38 | texColor.g *= texColor.a; 39 | texColor.b *= texColor.a; 40 | #endif 41 | 42 | frag_colour = texColor * Colour; 43 | } 44 | -------------------------------------------------------------------------------- /src/glsl/hud_draw_image.geometry.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | // Converts a single point to a quad with correct texture co-ords for character 4 | 5 | layout(points) in; 6 | layout(triangle_strip, max_vertices = 4) out; 7 | 8 | in vec4 gPositionTL[1]; 9 | in vec4 gPositionBR[1]; 10 | in vec2 gTexCoordTL[1]; 11 | in vec2 gTexCoordBR[1]; 12 | in vec4 gColour[1]; 13 | in float gAlphaTest[1]; 14 | 15 | out vec2 TextureCoord; 16 | out vec4 Colour; 17 | out float AlphaTest; 18 | 19 | void main() 20 | { 21 | Colour = gColour[0]; 22 | AlphaTest = gAlphaTest[0]; 23 | 24 | gl_Position = gPositionTL[0]; 25 | TextureCoord = gTexCoordTL[0]; 26 | EmitVertex(); 27 | 28 | gl_Position = vec4(gPositionTL[0].x, gPositionBR[0].y, 0, 1); 29 | TextureCoord = vec2(gTexCoordTL[0].s, gTexCoordBR[0].t); 30 | EmitVertex(); 31 | 32 | gl_Position = vec4(gPositionBR[0].x, gPositionTL[0].y, 0, 1); 33 | TextureCoord = vec2(gTexCoordBR[0].s, gTexCoordTL[0].t); 34 | EmitVertex(); 35 | 36 | gl_Position = gPositionBR[0]; 37 | TextureCoord = gTexCoordBR[0]; 38 | EmitVertex(); 39 | 40 | EndPrimitive(); 41 | } 42 | -------------------------------------------------------------------------------- /src/glsl/hud_draw_image.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | #ezquake-definitions 4 | 5 | layout(location = 0) in vec2 inPosition; 6 | layout(location = 1) in vec2 inTexCoord; 7 | layout(location = 2) in vec4 inColour; 8 | layout(location = 3) in int inFlags; 9 | 10 | out vec2 TextureCoord; 11 | out vec4 Colour; 12 | out float AlphaTest; 13 | #ifdef MIXED_SAMPLING 14 | flat out int IsNearest; 15 | #endif 16 | 17 | void main() 18 | { 19 | gl_Position = vec4(inPosition, 0, 1); 20 | TextureCoord = inTexCoord; 21 | Colour = inColour; 22 | #ifdef MIXED_SAMPLING 23 | IsNearest = (inFlags & IMAGEPROG_FLAGS_NEAREST) != 0 ? 1 : 0; 24 | #endif 25 | AlphaTest = (inFlags & IMAGEPROG_FLAGS_TEXT) * r_alphatestfont + (inFlags & IMAGEPROG_FLAGS_ALPHATEST); 26 | } 27 | -------------------------------------------------------------------------------- /src/glsl/hud_draw_line.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | in vec4 inColor; 4 | out vec4 color; 5 | 6 | void main(void) 7 | { 8 | color = inColor; 9 | } 10 | -------------------------------------------------------------------------------- /src/glsl/hud_draw_line.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout(location=0) in vec3 position; 4 | layout(location=1) in vec4 color; 5 | 6 | out vec4 inColor; 7 | 8 | void main(void) 9 | { 10 | gl_Position = vec4(position, 1); 11 | inColor = color; 12 | } 13 | -------------------------------------------------------------------------------- /src/glsl/hud_draw_polygon.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | uniform vec4 color; 4 | 5 | out vec4 frag_colour; 6 | 7 | void main(void) 8 | { 9 | frag_colour = color; 10 | } 11 | -------------------------------------------------------------------------------- /src/glsl/hud_draw_polygon.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout(location = 0) in vec3 position; 4 | 5 | void main(void) 6 | { 7 | gl_Position = vec4(position, 1); 8 | } 9 | -------------------------------------------------------------------------------- /src/glsl/post_process_screen.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout(location = 0) in vec2 inPosition; 4 | layout(location = 1) in vec2 inTextureCoord; 5 | 6 | out vec2 TextureCoord; 7 | 8 | void main() 9 | { 10 | gl_Position = vec4(inPosition, 0, 1); 11 | TextureCoord = inTextureCoord; 12 | } 13 | -------------------------------------------------------------------------------- /src/glsl/simple.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | uniform vec4 color; 4 | out vec4 frag_color; 5 | 6 | void main(void) 7 | { 8 | frag_color = color; 9 | } 10 | -------------------------------------------------------------------------------- /src/glsl/simple.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | layout(location = 0) in vec2 position; 4 | 5 | void main(void) 6 | { 7 | gl_Position = vec4(position, 0, 1); 8 | } 9 | -------------------------------------------------------------------------------- /src/glsl/simple3d.fragment.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | uniform vec4 color; 4 | out vec4 frag_color; 5 | 6 | void main(void) 7 | { 8 | frag_color = color; 9 | 10 | #ifdef DRAW_FOG 11 | frag_color = applyFog(frag_color, gl_FragCoord.z / gl_FragCoord.w); 12 | #endif 13 | } 14 | -------------------------------------------------------------------------------- /src/glsl/simple3d.vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 430 2 | 3 | #ezquake-definitions 4 | 5 | layout(location = 0) in vec3 position; 6 | layout(location = 6) in int _instanceId; 7 | 8 | layout(std140, binding = EZQ_GL_BINDINGPOINT_BRUSHMODEL_DRAWDATA) buffer WorldCvars { 9 | WorldDrawInfo drawInfo[]; 10 | }; 11 | 12 | void main(void) 13 | { 14 | gl_Position = projectionMatrix * drawInfo[_instanceId].mvMatrix * vec4(position, 1.0); 15 | } 16 | -------------------------------------------------------------------------------- /src/hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | //============================= 19 | //David's hash tables 20 | //string based. 21 | 22 | #ifndef __HASH_H__ 23 | #define __HASH_H__ 24 | 25 | #define STRCMP(s1,s2) (((*s1)!=(*s2)) || strcmp(s1+1,s2+1)) //saves about 2-6 out of 120 - expansion of idea from fastqcc 26 | typedef struct bucket_s { 27 | void *data; 28 | char *keystring; 29 | struct bucket_s *next; 30 | int flags; 31 | } bucket_t; 32 | 33 | #define HASH_BUCKET_KEYSTRING_OWNED 1 34 | 35 | typedef struct hashtable_s { 36 | int numbuckets; 37 | bucket_t **bucket; 38 | } hashtable_t; 39 | 40 | hashtable_t *Hash_InitTable(int numbucks); 41 | void Hash_ShutdownTable(hashtable_t* table); 42 | 43 | int Hash_Key(char *name, int modulus); 44 | void *Hash_Get(hashtable_t *table, char *name); 45 | void *Hash_GetInsensitive(hashtable_t *table, const char *name); 46 | void *Hash_GetKey(hashtable_t *table, char *key); 47 | void *Hash_GetNext(hashtable_t *table, char *name, void *old); 48 | void *Hash_GetNextInsensitive(hashtable_t *table, char *name, void *old); 49 | void *Hash_Add(hashtable_t *table, char *name, void *data); 50 | void *Hash_AddInsensitive(hashtable_t *table, char *name, void *data); 51 | void Hash_Remove(hashtable_t *table, char *name); 52 | void Hash_RemoveData(hashtable_t *table, char *name, void *data); 53 | void Hash_RemoveKey(hashtable_t *table, char *key); 54 | void *Hash_AddKey(hashtable_t *table, char *key, void *data, bucket_t *buck); 55 | void Hash_Flush(hashtable_t *table); 56 | 57 | #if 0 58 | /* Print some stats on the bucket distrubution */ 59 | void Hash_BucketStats(hashtable_t *table); 60 | #endif 61 | 62 | #endif // __HASH_H__ 63 | -------------------------------------------------------------------------------- /src/help.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or 3 | modify it under the terms of the GNU General Public License 4 | as published by the Free Software Foundation; either version 2 5 | of the License, or (at your option) any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | 11 | See the GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | $Id: help.h,v 1.6 2007-09-30 22:59:23 disconn3ct Exp $ 18 | */ 19 | 20 | #ifndef __HELP_H__ 21 | #define __HELP_H__ 22 | 23 | // variable description 24 | void Help_VarDescription (const char *varname, char* buf, size_t bufsize); 25 | 26 | // initialize help system 27 | void Help_Init (void); 28 | void Help_Shutdown (void); 29 | 30 | // help menu 31 | void Menu_Help_Init (void); 32 | void Menu_Help_Draw (int x, int y, int w, int h); 33 | void Menu_Help_Key (int key, wchar unichar); 34 | qbool Menu_Help_Mouse_Event (const mouse_state_t *ms); 35 | 36 | void Menu_Help_Shutdown(void); 37 | void Menu_Demo_Shutdown(void); 38 | void Menu_Options_Shutdown(void); 39 | void Menu_Ingame_Shutdown(void); 40 | void Menu_MultiPlayer_Shutdown(void); 41 | 42 | #endif // __HELP_H__ 43 | -------------------------------------------------------------------------------- /src/hud_editor.h: -------------------------------------------------------------------------------- 1 | /* 2 | HUD Editor module 3 | 4 | Copyright (C) 2007 Cokeman 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; either version 2 9 | of the License, or (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | 15 | See the GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | */ 20 | 21 | #ifndef __HUD_EDITOR_H__ 22 | #define __HUD_EDITOR_H__ 23 | 24 | // hud editor drawing function 25 | void HUD_Editor_Draw(void); 26 | 27 | // hud editor initialization 28 | void HUD_Editor_Init(void); 29 | 30 | // Mouse processing. 31 | qbool HUD_Editor_MouseEvent (mouse_state_t *ms); 32 | 33 | // Key press processing function. 34 | void HUD_Editor_Key(int key, int unichar, qbool down); 35 | 36 | // 37 | // Should this HUD element be fully drawn or not when in align mode 38 | // when using the HUD editor. 39 | // 40 | qbool HUD_Editor_ConfirmDraw(hud_t *hud); 41 | 42 | typedef enum 43 | { 44 | hud_editmode_off, 45 | hud_editmode_align, 46 | hud_editmode_place, 47 | hud_editmode_move_resize, 48 | hud_editmode_resize, 49 | hud_editmode_move_lockedaxis, 50 | hud_editmode_hudmenu, 51 | hud_editmode_menu, 52 | hud_editmode_hoverlist, 53 | hud_editmode_normal 54 | } hud_editor_mode_t; 55 | 56 | extern hud_editor_mode_t hud_editor_mode; 57 | extern hud_t *selected_hud; 58 | 59 | #endif // __HUD_EDITOR_H__ 60 | -------------------------------------------------------------------------------- /src/ignore.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2001-2002 A Nourai 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the included (GNU.txt) GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef __IGNORE_H_ 22 | 23 | #define __IGNORE_H_ 24 | 25 | 26 | #define NO_IGNORE_NO_ADD 0 27 | #define NO_IGNORE_ADD 1 28 | #define IGNORE_NO_ADD 2 29 | 30 | void Ignore_Init(void); 31 | qbool Ignore_Message(char *s, int flags, int offset); 32 | char Ignore_Check_Flood(char *s, int flags, int offset); 33 | void Ignore_Flood_Add(char *s); 34 | void Ignore_ResetFloodList(void); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/in_osx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Florian Zwoch 3 | Copyright (C) 2011 Mark Olsen 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | int OSX_Mouse_Init(void); 22 | void OSX_Mouse_Shutdown(void); 23 | void OSX_Mouse_GetMouseMovement(int *mouse_x, int *mouse_y); 24 | -------------------------------------------------------------------------------- /src/irc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Internet Relay Chat Support 3 | 4 | Copyright (C) 2009 johnnycz 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; either version 2 9 | of the License, or (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | 15 | See the GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | */ 20 | 21 | #ifdef WITH_IRC 22 | /// initializes the IRC module, creates libircclient session 23 | void IRC_Init(void); 24 | 25 | /// process new data waiting on the socket 26 | void IRC_Update(void); 27 | 28 | /// return the name of the active (currently selected) channel from the channel list 29 | char* IRC_GetCurrentChan(void); 30 | 31 | /// select following channel from the channels list as the current channel 32 | void IRC_NextChan(void); 33 | 34 | /// select previous channel from the channels list as the current channel 35 | void IRC_PrevChan(void); 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /src/irc_filter.c: -------------------------------------------------------------------------------- 1 | /* 2 | Internet Relay Chat filtering methods 3 | 4 | Copyright (C) 2011 Andrew 'dies-el' Donaldson 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; either version 2 9 | of the License, or (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | 15 | See the GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | */ 20 | 21 | #ifdef WITH_IRC 22 | 23 | #include "quakedef.h" 24 | 25 | cvar_t irc_filter_join_part_messages = {"irc_filter_join_part_messages", "0"}; 26 | cvar_t irc_filter_quit_messages = {"irc_filter_quit_messages", "0"}; 27 | cvar_t irc_filter_private_messages = {"irc_filter_private_messages", "0"}; 28 | cvar_t irc_filter_notice_messages = {"irc_filter_notice_messages", "0"}; 29 | 30 | void IRC_filter_register_cvars() { 31 | Cvar_Register(&irc_filter_join_part_messages); 32 | Cvar_Register(&irc_filter_quit_messages); 33 | Cvar_Register(&irc_filter_private_messages); 34 | Cvar_Register(&irc_filter_notice_messages); 35 | } 36 | 37 | // These methods are deliberately a lot broader than the cvars above. 38 | 39 | int IRC_filter_show_chanop_messages() { 40 | return (irc_filter_join_part_messages.integer == 0); 41 | } 42 | 43 | int IRC_filter_show_connection_messages() { 44 | return (irc_filter_quit_messages.integer == 0); 45 | } 46 | 47 | int IRC_filter_show_private_messages() { 48 | return (irc_filter_private_messages.integer == 0); 49 | } 50 | 51 | int IRC_filter_show_notice_messages() { 52 | return (irc_filter_notice_messages.integer == 0); 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/irc_filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Internet Relay Chat filtering methods 3 | 4 | Copyright (C) 2011 Andrew 'dies-el' Donaldson 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; either version 2 9 | of the License, or (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | 15 | See the GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | */ 20 | 21 | #ifdef WITH_IRC 22 | 23 | // Registers the cvars that these filters rely on. 24 | void IRC_filter_register_cvars(void); 25 | 26 | // Returns true if chanop messages (join/parts/etc) are to be shown 27 | int IRC_filter_show_chanop_messages(void); 28 | 29 | // Returns true if connection messages (quits) are to be shown 30 | int IRC_filter_show_connection_messages(void); 31 | 32 | // Returns true if private messages are to be shown 33 | int IRC_filter_show_private_messages(void); 34 | 35 | // Returns true if notices are to be shown 36 | int IRC_filter_show_notice_messages(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/linux_signals.c: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 1999-2005 Id Software, Inc. 4 | 5 | This file is part of Quake III Arena source code. 6 | 7 | Quake III Arena 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 | Quake III Arena 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 Foobar; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | 22 | $Id: linux_signals.c,v 1.4 2007-06-15 12:26:07 johnnycz Exp $ 23 | 24 | */ 25 | #include 26 | 27 | #include "quakedef.h" 28 | #include "input.h" 29 | 30 | static qbool signalcaught = false; 31 | 32 | static void signal_handler(int sig) // bk010104 - replace this... (NOTE TTimo huh?) 33 | { 34 | if (signalcaught) 35 | { 36 | printf("DOUBLE SIGNAL FAULT: Received signal %d, exiting...\n", sig); 37 | Sys_Quit(); 38 | exit(0); 39 | } 40 | 41 | signalcaught = true; 42 | printf("Received signal %d, exiting...\n", sig); 43 | 44 | // 45 | // client related things 46 | // 47 | VID_Shutdown(false); // bk010104 - shouldn't this be CL_Shutdown 48 | 49 | Sys_Quit(); 50 | exit(0); 51 | } 52 | 53 | void InitSig(void) 54 | { 55 | signal(SIGHUP, signal_handler); 56 | signal(SIGINT, signal_handler); // btw, q3 do not have this signal handling 57 | signal(SIGQUIT, signal_handler); 58 | signal(SIGILL, signal_handler); 59 | signal(SIGTRAP, signal_handler); 60 | signal(SIGIOT, signal_handler); 61 | signal(SIGBUS, signal_handler); 62 | signal(SIGFPE, signal_handler); 63 | signal(SIGSEGV, signal_handler); 64 | signal(SIGTERM, signal_handler); 65 | } 66 | -------------------------------------------------------------------------------- /src/localtime.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef __LOCALTIME_H__ 20 | #define __LOCALTIME_H__ 21 | 22 | #ifdef _WIN32 23 | 24 | #include // FIXME: we should include it only at winquake.h 25 | #include 26 | 27 | #else 28 | 29 | #include 30 | 31 | typedef struct SYSTEMTIME_s 32 | { 33 | int wYear; 34 | int wMonth; 35 | int wDay; 36 | int wDayOfWeek; 37 | int wHour; 38 | int wMinute; 39 | int wSecond; 40 | int wMilliseconds; 41 | } SYSTEMTIME; 42 | 43 | void GetLocalTime(SYSTEMTIME *); 44 | 45 | #endif 46 | 47 | 48 | int GetFileLocalTime(char *, SYSTEMTIME *); 49 | void UnixtimeToWintime(SYSTEMTIME *, struct tm *); 50 | int SYSTEMTIMEcmp(const SYSTEMTIME *, const SYSTEMTIME *); 51 | 52 | #endif // __LOCALTIME_H__ 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/localtime_win.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include 20 | #include "localtime.h" 21 | 22 | // localtime built-in 23 | // void GetLocalTime(SYSTEMTIME *wintime); 24 | 25 | 26 | // local file time 27 | int GetFileLocalTime(char *path, SYSTEMTIME *wintime) 28 | { 29 | // update time 30 | HANDLE hFile; 31 | // OFSTRUCT of; 32 | FILETIME ft1, ft2; 33 | 34 | hFile = CreateFile(path, 0, FILE_SHARE_READ, 35 | NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 36 | if (hFile == (HANDLE)ERROR_INVALID_HANDLE) 37 | return 0; 38 | 39 | GetFileTime(hFile, NULL, NULL, &ft1); 40 | FileTimeToLocalFileTime(&ft1, &ft2); 41 | FileTimeToSystemTime(&ft2, wintime); 42 | CloseHandle(hFile); 43 | return 1; 44 | } 45 | 46 | int intcmp(int i1, int i2) 47 | { 48 | if (i1 > i2) 49 | return 1; 50 | if (i1 < i2) 51 | return -1; 52 | return 0; 53 | } 54 | 55 | int SYSTEMTIMEcmp(const SYSTEMTIME *t1, const SYSTEMTIME *t2) 56 | { 57 | return intcmp( t1->wSecond, t2->wSecond ) * 2 58 | + intcmp( t1->wMinute, t2->wMinute ) * 4 59 | + intcmp( t1->wHour, t2->wHour ) * 8 60 | + intcmp( t1->wDay, t2->wDay ) * 16 61 | + intcmp( t1->wMonth, t2->wMonth ) * 32 62 | + intcmp( t1->wYear, t2->wYear ) * 64; 63 | } 64 | -------------------------------------------------------------------------------- /src/logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2001-2002 A Nourai 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the included (GNU.txt) GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef __LOGGING_H_ 22 | 23 | #define __LOGGING_H_ 24 | 25 | qbool Log_IsLogging(void); 26 | void Log_Init(void); 27 | void Log_Shutdown(void); 28 | void Log_Write(char *s); 29 | 30 | void Log_AutoLogging_StopMatch(void); 31 | void Log_AutoLogging_CancelMatch(void); 32 | void Log_AutoLogging_StartMatch(char *logname); 33 | qbool Log_AutoLogging_Status(void); 34 | void Log_AutoLogging_SaveMatch(qbool allow_upload); 35 | qbool Log_TempLogUploadPending(void); 36 | qbool MT_Challenge_Log_IsUploadAllowed(void); 37 | void Log_AutoLogging_Upload(const char *filename); 38 | qbool MT_ChallengeSpecified(void); 39 | 40 | #define TEMP_LOG_NAME "_!_temp_!_.log" 41 | 42 | extern cvar_t log_readable; 43 | extern cvar_t log_dir; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/macro_definitions.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_MACRO_DEFINITIONS_H 3 | #define EZQUAKE_MACRO_DEFINITIONS_H 4 | 5 | #define MACRO_DEF(x) macro_ ## x 6 | 7 | typedef enum { 8 | #include "macro_ids.h" 9 | num_macros 10 | } macro_id; 11 | 12 | #undef MACRO_DEF 13 | 14 | #endif // EZQUAKE_MACRO_DEFINITIONS_H 15 | -------------------------------------------------------------------------------- /src/macro_ids.h: -------------------------------------------------------------------------------- 1 | 2 | MACRO_DEF(health), 3 | MACRO_DEF(armortype), 4 | MACRO_DEF(armor), 5 | MACRO_DEF(colored_armor), 6 | MACRO_DEF(colored_powerups), 7 | MACRO_DEF(colored_short_powerups), 8 | MACRO_DEF(tp_powerups), 9 | MACRO_DEF(shells), 10 | MACRO_DEF(nails), 11 | MACRO_DEF(rockets), 12 | MACRO_DEF(cells), 13 | MACRO_DEF(weapons), 14 | MACRO_DEF(ammo), 15 | MACRO_DEF(bestweapon), 16 | MACRO_DEF(bestammo), 17 | MACRO_DEF(powerups), 18 | MACRO_DEF(location), 19 | MACRO_DEF(deathloc), 20 | MACRO_DEF(tookatloc), 21 | MACRO_DEF(tookloc), 22 | MACRO_DEF(took), 23 | MACRO_DEF(pointatloc), 24 | MACRO_DEF(pointloc), 25 | MACRO_DEF(point), 26 | MACRO_DEF(need), 27 | MACRO_DEF(droploc), 28 | MACRO_DEF(droptime), 29 | MACRO_DEF(ledpoint), 30 | MACRO_DEF(ledstatus), 31 | MACRO_DEF(lastloc), 32 | MACRO_DEF(lastpowerup), 33 | MACRO_DEF(cam_pos_x), 34 | MACRO_DEF(cam_pos_y), 35 | MACRO_DEF(cam_pos_z), 36 | MACRO_DEF(cam_pos), 37 | MACRO_DEF(cam_angles_pitch), 38 | MACRO_DEF(cam_angles_yaw), 39 | MACRO_DEF(cam_angles_roll), 40 | MACRO_DEF(cam_angles), 41 | MACRO_DEF(demoname), 42 | MACRO_DEF(demolength), 43 | MACRO_DEF(connectiontype), 44 | MACRO_DEF(demoplayback), 45 | MACRO_DEF(demotime), 46 | MACRO_DEF(rand), 47 | MACRO_DEF(matchstatus), 48 | MACRO_DEF(serverip), 49 | MACRO_DEF(conwidth), 50 | MACRO_DEF(conheight), 51 | MACRO_DEF(matchname), 52 | MACRO_DEF(matchtype), 53 | MACRO_DEF(mp3info), 54 | MACRO_DEF(mp3_volume), 55 | MACRO_DEF(lastip), 56 | MACRO_DEF(qt), 57 | MACRO_DEF(latency), 58 | MACRO_DEF(ping), 59 | MACRO_DEF(time), 60 | MACRO_DEF(timestamp), 61 | MACRO_DEF(date), 62 | MACRO_DEF(dateiso), 63 | MACRO_DEF(weaponnum), 64 | MACRO_DEF(weapon), 65 | MACRO_DEF(tf_skin), 66 | MACRO_DEF(gamedir), 67 | MACRO_DEF(triggermatch), 68 | MACRO_DEF(team1), 69 | MACRO_DEF(team2), 70 | 71 | // leave trailing , 72 | -------------------------------------------------------------------------------- /src/menu_demo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | /* 19 | Demo Menu module 20 | $Id: menu_demo.h,v 1.8 2007-03-19 13:23:20 johnnycz Exp $ 21 | */ 22 | 23 | #include "keys.h" 24 | 25 | // 26 | // initializes the "Demo" menu on client startup 27 | void Menu_Demo_Init(void); 28 | 29 | // process key press that belongs to demo menu 30 | void Menu_Demo_Key(int key, wchar unichar); 31 | 32 | // process request to draw the demo menu 33 | void Menu_Demo_Draw (void); 34 | 35 | // process mouse move event 36 | qbool Menu_Demo_Mouse_Event(const mouse_state_t *); 37 | 38 | // sets new starting dir 39 | void Menu_Demo_NewHome(const char *); 40 | // 41 | 42 | 43 | // 44 | void CL_Demo_Playlist_f(void); 45 | void CL_Demo_NextInPlaylist(void); 46 | void CL_Demo_Disconnected(void); 47 | // 48 | -------------------------------------------------------------------------------- /src/menu_ingame.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | /** 19 | 20 | In-game menu 21 | 22 | made by johnnycz, June 2007 23 | last edit: 24 | $Id: menu_ingame.h,v 1.2 2007-07-15 09:50:44 disconn3ct Exp $ 25 | 26 | */ 27 | 28 | #ifndef __MENU_INGAME_H__ 29 | #define __MENU_INGAME_H__ 30 | 31 | extern void M_Ingame_Draw(void); 32 | extern void M_Democtrl_Draw(void); 33 | 34 | extern void M_Ingame_Key(int); 35 | extern void M_Democtrl_Key(int); 36 | 37 | extern qbool Menu_Ingame_Mouse_Event(const mouse_state_t *ms); 38 | extern qbool Menu_Democtrl_Mouse_Event(const mouse_state_t *ms); 39 | 40 | extern void Menu_Ingame_Init(void); 41 | 42 | #endif // __MENU_INGAME_H__ 43 | -------------------------------------------------------------------------------- /src/menu_multiplayer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | // initialize the multiplayer menu 20 | void Menu_MultiPlayer_Init(void); 21 | 22 | void Menu_MultiPlayer_Draw (void); 23 | 24 | void Menu_MultiPlayer_Key(int key, wchar unichar); 25 | 26 | qbool Menu_MultiPlayer_Mouse_Event(const mouse_state_t *ms); 27 | 28 | void Menu_MultiPlayer_SwitchToServersTab(void); 29 | 30 | typedef enum 31 | { 32 | SBPG_SERVERS, // Servers page 33 | SBPG_SOURCES, // Sources page 34 | SBPG_PLAYERS, // Players page 35 | SBPG_OPTIONS, // Options page 36 | SBPG_CREATEGAME // Host Game page 37 | } sb_tab_t; 38 | extern CTab_t sb_tab; 39 | 40 | -------------------------------------------------------------------------------- /src/menu_options.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | /* 19 | Options Menu module 20 | $Id: menu_options.h,v 1.4 2007-03-19 13:23:20 johnnycz Exp $ 21 | */ 22 | 23 | // 24 | // initializes the "Demo" menu on client startup 25 | void Menu_Options_Init(void); 26 | 27 | // process key press that belongs to demo menu 28 | void Menu_Options_Key(int key, wchar unichar); 29 | 30 | // process request to draw the demo menu 31 | void Menu_Options_Draw (void); 32 | 33 | qbool Menu_Options_IsBindingKey (void); 34 | 35 | // process mouse move 36 | qbool Menu_Options_Mouse_Event(const mouse_state_t *); 37 | // 38 | -------------------------------------------------------------------------------- /src/menu_proxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | Proxy Menu module 3 | 4 | Copyright (C) 2011 johnnycz 5 | 6 | This program is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU General Public License 8 | as published by the Free Software Foundation; either version 2 9 | of the License, or (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | 15 | See the GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | */ 20 | 21 | // catches key presses sent to proxy 22 | void Menu_Proxy_Key(int key); 23 | 24 | // main proxy menu drawing function 25 | void Menu_Proxy_Draw(void); 26 | 27 | // send signal to the proxy to toggle the menu 28 | void Menu_Proxy_Toggle(void); 29 | -------------------------------------------------------------------------------- /src/movie.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2001-2002 A Nourai 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the included (GNU.txt) GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef __MOVIE_H_ 22 | 23 | #define __MOVIE_H_ 24 | 25 | void Movie_Init(void); 26 | void Movie_StartFrame(void); 27 | void Movie_FinishFrame(void); 28 | qbool Movie_IsCapturing(void); 29 | qbool Movie_IsCapturingAVI(void); 30 | void Movie_Stop(qbool restarting); 31 | double Movie_Frametime(void); 32 | double Movie_InputFrametime(void); 33 | qbool Movie_TransferSound(void* data, int snd_linear_count); 34 | void Movie_MixFrameSound(void (*mixFunction)(void)); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/movie_avi.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2002 Quake done Quick 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __MOVIE_AVI_H_ 22 | 23 | #define __MOVIE_AVI_H_ 24 | 25 | void Capture_InitAVI (void); 26 | void Capture_InitACM (void); 27 | qbool Capture_Open (char *filename); 28 | void Capture_WriteVideo (byte *pixel_buffer, int size); 29 | void Capture_WriteAudio (int samples, byte *sample_buffer); 30 | void Capture_Close (void); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/particles_classic.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PARTICLES_CLASSIC_HEADER 3 | #define PARTICLES_CLASSIC_HEADER 4 | 5 | typedef enum { 6 | pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2, pt_rail 7 | } ptype_t; 8 | 9 | typedef struct qparticle_s { 10 | vec3_t org; 11 | float color; 12 | vec3_t vel; 13 | float ramp; 14 | float die; 15 | ptype_t type; 16 | //struct particle_s *next; 17 | } qparticle_t; 18 | 19 | //#define DEFAULT_NUM_PARTICLES 2048 20 | #define ABSOLUTE_MIN_PARTICLES 512 21 | #define ABSOLUTE_MAX_PARTICLES 8192 22 | 23 | #endif // PARTICLES_CLASSIC_HEADER 24 | -------------------------------------------------------------------------------- /src/pr2_edict.c: -------------------------------------------------------------------------------- 1 | /* 2 | * QW262 3 | * Copyright (C) 2004 [sd] angel 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | * 19 | * 20 | * 21 | */ 22 | 23 | #ifndef CLIENTONLY 24 | #ifdef USE_PR2 25 | 26 | #include "qwsvdef.h" 27 | 28 | field_t *fields; 29 | 30 | eval_t *PR2_GetEdictFieldValue(edict_t *ed, char *field) 31 | { 32 | char *s; 33 | field_t *f; 34 | 35 | if (!sv_vm) 36 | return PR1_GetEdictFieldValue(ed, field); 37 | 38 | for (f = fields; (s = PR2_GetString(f->name)) && *s; f++) 39 | if (!strcasecmp(PR2_GetString(f->name), field)) 40 | return (eval_t *)((char *)ed->v + f->ofs); 41 | 42 | return NULL; 43 | } 44 | 45 | int ED2_FindFieldOffset (char *field) 46 | { 47 | char *s; 48 | field_t *f; 49 | 50 | if (!sv_vm) 51 | return ED1_FindFieldOffset(field); 52 | 53 | for (f = fields; (s = PR2_GetString(f->name)) && *s; f++) 54 | if (!strcasecmp(PR2_GetString(f->name), field)) 55 | return f->ofs; 56 | 57 | return 0; 58 | } 59 | 60 | /* 61 | ============= 62 | ED2_PrintEdict_f 63 | 64 | For debugging, prints a single edicy 65 | ============= 66 | */ 67 | void ED2_PrintEdict_f (void) 68 | { 69 | extern void ED_PrintEdict_f (void); 70 | 71 | if(!sv_vm) 72 | ED_PrintEdict_f(); 73 | } 74 | 75 | /* 76 | ============= 77 | ED2_PrintEdicts 78 | 79 | For debugging, prints all the entities in the current server 80 | ============= 81 | */ 82 | void ED2_PrintEdicts (void) 83 | { 84 | extern void ED_PrintEdicts (void); 85 | 86 | if(!sv_vm) 87 | ED_PrintEdicts(); 88 | } 89 | 90 | #endif /* USE_PR2 */ 91 | 92 | #endif // !CLIENTONLY 93 | -------------------------------------------------------------------------------- /src/qwsvdef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // qwsvdef.h -- primary header for server 21 | 22 | 23 | //define PARANOID // speed sapping error checking 24 | 25 | #include 26 | #include "common.h" 27 | #include "fs.h" 28 | #include "gl_model.h" 29 | #include "server.h" 30 | 31 | #include "net.h" 32 | #include "crc.h" 33 | #include "sha1.h" 34 | #include "sha3.h" 35 | #include "pmove.h" 36 | #include "version.h" 37 | #include "sv_log.h" 38 | #include "sv_world.h" 39 | #include "vfs.h" 40 | -------------------------------------------------------------------------------- /src/r_bloom.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1997-2001 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "quakedef.h" 22 | #include "r_local.h" 23 | 24 | void GLC_BloomBlend(void); 25 | void GLC_InitBloomTextures(void); 26 | 27 | void R_BloomBlend(void) 28 | { 29 | #ifdef RENDERER_OPTION_CLASSIC_OPENGL 30 | if (R_UseImmediateOpenGL()) { 31 | GLC_BloomBlend(); 32 | } 33 | #endif 34 | } 35 | 36 | void R_InitBloomTextures(void) 37 | { 38 | #ifdef RENDERER_OPTION_CLASSIC_OPENGL 39 | if (R_UseImmediateOpenGL()) { 40 | GLC_InitBloomTextures(); 41 | } 42 | #endif 43 | } 44 | -------------------------------------------------------------------------------- /src/r_brushmodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef R_BRUSHMODEL_HEADER 21 | #define R_BRUSHMODEL_HEADER 22 | 23 | #include "r_buffers.h" 24 | #include "r_framestats.h" 25 | 26 | qbool R_PointIsUnderwater(vec3_t point); 27 | 28 | void GLC_StateBeginWaterSurfaces(void); 29 | void GLC_StateBeginAlphaChain(void); 30 | void GLC_StateBeginAlphaChainSurface(msurface_t* s); 31 | 32 | // gl_rsurf.c 33 | void GLC_EmitDetailPolys_GLSL(void); 34 | void GLC_EmitDetailPolys(qbool use_vbo); 35 | void R_BrushModelDrawEntity(entity_t *e); 36 | void R_DrawWorld(void); 37 | void GLC_DrawAlphaChain(msurface_t* alphachain, frameStatsPolyType polyType); 38 | 39 | // gl_warp.c 40 | void R_TurbSurfacesSubdivide(msurface_t *fa); 41 | void R_SkySurfacesBuildPolys(msurface_t *fa); 42 | void R_InitSky(texture_t *mt); // called at level load 43 | void R_DrawSky(void); 44 | qbool R_DrawWorldOutlines(void); 45 | 46 | // internal 47 | #define CHAIN_SURF_B2F(surf, chain) \ 48 | { \ 49 | (surf)->texturechain = (chain); \ 50 | (chain) = (surf); \ 51 | } 52 | void chain_surfaces_simple(msurface_t** chain_head, msurface_t* surf); 53 | void chain_surfaces_simple_drawflat(msurface_t** chain_head, msurface_t* surf); 54 | void chain_surfaces_by_lightmap(msurface_t** chain_head, msurface_t* surf); 55 | extern unsigned int* modelIndexes; 56 | extern unsigned int modelIndexMaximum; 57 | void R_BrushModelCreateVBO(void); 58 | 59 | #define BRUSHMODEL_MAX_SURFACE_EXTENTS +999999999 60 | #define BRUSHMODEL_MIN_SURFACE_EXTENTS -999999999 61 | 62 | #endif // R_BRUSHMODEL_HEADER 63 | -------------------------------------------------------------------------------- /src/r_brushmodel_bspx.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | //============================================================ 21 | // BSPX loading 22 | 23 | // This code has been moved to cmodel.c, as there are physics lumps (rampjump) 24 | // as well as rendering-only (colored lighting) 25 | // Move code to do with rendering lumps here? 26 | -------------------------------------------------------------------------------- /src/r_brushmodel_sky.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_R_BRUSHMODEL_SKY_HEADER 3 | #define EZQUAKE_R_BRUSHMODEL_SKY_HEADER 4 | 5 | void GLC_SkyDrawChainedSurfaces(void); 6 | 7 | extern msurface_t *skychain; 8 | extern msurface_t **skychain_tail; 9 | extern texture_ref solidskytexture, alphaskytexture; 10 | extern cvar_t r_skyname; 11 | 12 | #define MAX_SKYBOXTEXTURES 6 13 | extern texture_ref skyboxtextures[MAX_SKYBOXTEXTURES]; 14 | 15 | void R_ClearSkyTextures(void); 16 | void R_SkyRegisterCvars(void); 17 | extern qbool r_skyboxloaded; 18 | 19 | qbool Skywind_Active(void); 20 | qbool Skywind_GetDirectionAndPhase(float wind_dir[3], float *wind_phase); 21 | 22 | #endif // EZQUAKE_R_BRUSHMODEL_SKY_HEADER 23 | -------------------------------------------------------------------------------- /src/r_buffers.c: -------------------------------------------------------------------------------- 1 | 2 | #include "quakedef.h" 3 | #include "r_local.h" 4 | #include "r_buffers.h" 5 | 6 | api_buffers_t buffers; 7 | 8 | void R_CreateInstanceVBO(void) 9 | { 10 | unsigned int values[MAX_STANDARD_ENTITIES]; 11 | int i; 12 | 13 | for (i = 0; i < MAX_STANDARD_ENTITIES; ++i) { 14 | values[i] = i; 15 | } 16 | 17 | buffers.Create(r_buffer_instance_number, buffertype_vertex, "instance#", sizeof(values), values, bufferusage_reuse_many_frames); 18 | } 19 | -------------------------------------------------------------------------------- /src/r_chaticons.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-2003 Id Software, Inc., A Nourai 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef EZQUAKE_R_CHATICONS_HEADER 22 | #define EZQUAKE_R_CHATICONS_HEADER 23 | 24 | void R_InitChatIcons(void); 25 | void R_SetupChatIcons(void); 26 | void R_DrawChatIcons(void); 27 | 28 | #endif // EZQUAKE_R_CHATICONS_HEADER 29 | -------------------------------------------------------------------------------- /src/r_draw.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_R_DRAW_HEADER 3 | #define EZQUAKE_R_DRAW_HEADER 4 | 5 | void R_Draw_SAlphaSubPic2(float x, float y, mpic_t *pic, int src_width, int src_height, float newsl, float newtl, float newsh, float newth, float scale_x, float scale_y, float alpha); 6 | void R_Draw_AlphaPieSliceRGB(float x, float y, float radius, float startangle, float endangle, float thickness, qbool fill, color_t color); 7 | void R_Draw_LineRGB(float thickness, byte* color, float x_start, float y_start, float x_end, float y_end); 8 | void R_DrawImage(float x, float y, float width, float height, float tex_s, float tex_t, float tex_width, float tex_height, byte* color, qbool alpha_test, texture_ref texnum, qbool isText, qbool isCrosshair); 9 | void R_DrawAlphaRectangleRGB(int x, int y, int w, int h, float thickness, qbool fill, byte* bytecolor); 10 | void R_Draw_FadeScreen(float alpha); 11 | float R_Draw_CharacterBase(float x, float y, wchar num, float scale, qbool apply_overall_alpha, qbool bigchar, qbool gl_statechange, qbool proportional); 12 | void R_Draw_ResetCharGLState(void); 13 | void R_Draw_SetColor(byte* rgba); 14 | void R_Draw_StringBase_StartString(float x, float y, float scale); 15 | void R_Cache2DMatrix(void); 16 | void R_UndoLastCharacter(void); 17 | void R_Draw_Polygon(float x, float y, vec3_t *vertices, int num_vertices, color_t color); 18 | 19 | #endif // EZQUAKE_R_DRAW_HEADER 20 | -------------------------------------------------------------------------------- /src/r_draw_polygon.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2017-2018 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "quakedef.h" 21 | #include "common_draw.h" 22 | #include "glm_draw.h" 23 | #include "glm_vao.h" 24 | #include "r_state.h" 25 | #include "r_matrix.h" 26 | #include "r_buffers.h" 27 | 28 | glm_polygon_framedata_t polygonData; 29 | 30 | void R_Draw_Polygon(float x, float y, vec3_t *vertices, int num_vertices, color_t color) 31 | { 32 | int i; 33 | texture_ref texture; 34 | float texCoords[2]; 35 | 36 | if (polygonData.polygonCount >= MAX_POLYGONS_PER_FRAME) { 37 | return; 38 | } 39 | if (num_vertices <= 2 || num_vertices >= 4 * (MAX_MULTI_IMAGE_BATCH - imageData.imageCount)) { 40 | return; 41 | } 42 | 43 | Atlas_SolidTextureCoordinates(&texture, &texCoords[0], &texCoords[1]); 44 | 45 | if (!R_LogCustomImageTypeWithTexture(imagetype_polygon, polygonData.polygonCount, texture)) { 46 | return; 47 | } 48 | 49 | polygonData.polygonVerts[polygonData.polygonCount] = num_vertices; 50 | polygonData.polygonImageIndexes[polygonData.polygonCount] = imageData.imageCount * 4; 51 | 52 | for (i = 0; i < num_vertices; ++i) { 53 | extern float cachedMatrix[16]; 54 | float v1[4] = { vertices[i][0], vertices[i][1], vertices[i][2], 1 }; 55 | glm_image_t* img = &imageData.images[imageData.imageCount * 4 + i]; 56 | 57 | R_MultiplyVector(cachedMatrix, v1, v1); 58 | 59 | COLOR_TO_RGBA_PREMULT(color, img->colour); 60 | img->tex[0] = texCoords[0]; 61 | img->tex[1] = texCoords[1]; 62 | img->pos[0] = v1[0]; 63 | img->pos[1] = v1[1]; 64 | } 65 | imageData.imageCount += (num_vertices + 3) / 4; 66 | ++polygonData.polygonCount; 67 | } 68 | -------------------------------------------------------------------------------- /src/r_framestats.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_R_FRAMESTATS_HEADER 3 | #define EZQUAKE_R_FRAMESTATS_HEADER 4 | 5 | typedef enum { 6 | polyTypeWorldModel, 7 | polyTypeAliasModel, 8 | polyTypeBrushModel, 9 | 10 | polyTypeMaximum 11 | } frameStatsPolyType; 12 | 13 | typedef struct r_frame_stats_classic_s { 14 | int polycount[polyTypeMaximum]; 15 | } r_frame_stats_classic_t; 16 | 17 | typedef struct r_frame_stats_modern_s { 18 | int world_batches; 19 | int buffer_uploads; 20 | int multidraw_calls; 21 | } r_frame_stats_modern_t; 22 | 23 | typedef struct r_frame_stats_s { 24 | r_frame_stats_classic_t classic; 25 | r_frame_stats_modern_t modern; 26 | 27 | qbool hotloop; 28 | int hotloop_mallocs; 29 | int mallocs; 30 | int hotloop_stringops; 31 | int stringops; 32 | 33 | int texture_binds; 34 | unsigned int lightmap_min_changed; 35 | unsigned int lightmap_max_changed; 36 | int lightmap_updates; 37 | int draw_calls; 38 | int subdraw_calls; 39 | int particle_count; 40 | 41 | double start_time; 42 | double end_time; 43 | } r_frame_stats_t; 44 | 45 | extern r_frame_stats_t frameStats, prevFrameStats; 46 | extern cvar_t r_speeds; 47 | 48 | #endif // EZQUAKE_R_FRAMESTATS_HEADER 49 | -------------------------------------------------------------------------------- /src/r_lighting.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_R_LIGHTING_HEADER 21 | #define EZQUAKE_R_LIGHTING_HEADER 22 | 23 | extern cvar_t gl_lightmode; 24 | extern cvar_t gl_modulate; 25 | extern int lightmode; // set to gl_lightmode on mapchange 26 | 27 | extern cvar_t gl_flashblend; 28 | extern cvar_t gl_rl_globe; 29 | 30 | // gl_rlight.c 31 | void R_MarkLights(dlight_t *light, int bit, mnode_t *node); 32 | void R_AnimateLight(void); 33 | void R_RenderDlights(void); 34 | void R_LightEntity(entity_t* ent); 35 | 36 | extern unsigned int d_lightstylevalue[256]; // 8.8 fraction of base light value 37 | static const float rgb9e5tab[32] = { 38 | //multipliers for the 9-bit mantissa, according to the biased mantissa 39 | //aka: pow(2, biasedexponent - bias-bits) where bias is 15 and bits is 9 40 | 1.0/(1<<24), 1.0/(1<<23), 1.0/(1<<22), 1.0/(1<<21), 1.0/(1<<20), 1.0/(1<<19), 1.0/(1<<18), 1.0/(1<<17), 41 | 1.0/(1<<16), 1.0/(1<<15), 1.0/(1<<14), 1.0/(1<<13), 1.0/(1<<12), 1.0/(1<<11), 1.0/(1<<10), 1.0/(1<<9), 42 | 1.0/(1<<8), 1.0/(1<<7), 1.0/(1<<6), 1.0/(1<<5), 1.0/(1<<4), 1.0/(1<<3), 1.0/(1<<2), 1.0/(1<<1), 43 | 1.0, 1.0*(1<<1), 1.0*(1<<2), 1.0*(1<<3), 1.0*(1<<4), 1.0*(1<<5), 1.0*(1<<6), 1.0*(1<<7), 44 | }; 45 | 46 | extern cvar_t r_dynamic; 47 | #define R_NoLighting() (r_dynamic.integer == 0) 48 | #define R_HardwareLighting() (r_dynamic.integer == 2 && R_UseModernOpenGL()) 49 | #define R_SoftwareLighting() (r_dynamic.integer && !R_HardwareLighting()) 50 | 51 | #endif // EZQUAKE_R_LOCAL_HEADER 52 | -------------------------------------------------------------------------------- /src/r_lightmaps.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_R_LIGHTMAPS_HEADER 21 | #define EZQUAKE_R_LIGHTMAPS_HEADER 22 | 23 | void R_BuildLightmaps(void); 24 | qbool R_FullBrightAllowed(void); 25 | void R_CheckReloadLightmaps(void); 26 | void R_RenderAllDynamicLightmaps(struct model_s* model); 27 | void R_LightmapFrameInit(void); 28 | void R_ForceReloadLightMaps(void); 29 | unsigned int R_LightmapCount(void); 30 | struct msurface_s* R_DrawflatLightmapChain(int i); 31 | void R_ClearDrawflatLightmapChain(int i); 32 | void R_AddDrawflatChainSurface(struct msurface_s* surf, qbool floor); 33 | 34 | #endif // EZQUAKE_R_LIGHTMAPS_HEADER 35 | -------------------------------------------------------------------------------- /src/r_lightmaps_internal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_R_LIGHTMAPS_INTERNAL_HEADER 3 | #define EZQUAKE_R_LIGHTMAPS_INTERNAL_HEADER 4 | 5 | // Lightmap size 6 | #define LIGHTMAP_WIDTH 128 7 | #define LIGHTMAP_HEIGHT 128 8 | 9 | #define MAX_LIGHTMAP_SIZE (64 * 64) 10 | #define LIGHTMAP_ARRAY_GROWTH 4 11 | 12 | typedef struct glRect_s { 13 | unsigned int l, t, w, h; 14 | } glRect_t; 15 | 16 | typedef struct lightmap_data_s { 17 | byte rawdata[4 * LIGHTMAP_WIDTH * LIGHTMAP_HEIGHT]; 18 | int computeData[4 * LIGHTMAP_WIDTH * LIGHTMAP_HEIGHT]; 19 | unsigned int sourcedata[4 * LIGHTMAP_WIDTH * LIGHTMAP_HEIGHT]; 20 | int allocated[LIGHTMAP_WIDTH]; 21 | 22 | texture_ref gl_texref; 23 | glpoly_t* poly_chain; 24 | msurface_t* drawflat_chain; 25 | msurface_t** drawflat_chain_tail; 26 | glRect_t change_area; 27 | qbool modified; 28 | } lightmap_data_t; 29 | 30 | extern lightmap_data_t* lightmaps; 31 | extern unsigned int lightmap_array_size; 32 | 33 | void GLM_LightmapFrameInit(void); 34 | void GLM_RenderDynamicLightmaps(msurface_t* surface, qbool world); 35 | void GLM_ComputeLightmaps(void); 36 | 37 | #endif // EZQUAKE_R_LIGHTMAPS_INTERNAL_HEADER 38 | -------------------------------------------------------------------------------- /src/r_misc.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | $Id: r_part.c,v 1.19 2007-10-29 00:13:26 d3urk Exp $ 20 | 21 | */ 22 | 23 | #include "quakedef.h" 24 | #include "r_local.h" 25 | -------------------------------------------------------------------------------- /src/r_misc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QW-Group/ezquake-source/f217e0eae95e42f467fedfca75221b2921a8001d/src/r_misc.cpp -------------------------------------------------------------------------------- /src/r_performance.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_R_PERFORMANCE_HEADER 3 | #define EZQUAKE_R_PERFORMANCE_HEADER 4 | 5 | void R_PerformanceBeginFrame(void); 6 | void R_PerformanceEndFrame(void); 7 | 8 | void GLC_TimeRefresh(void); 9 | void GLM_TimeRefresh(void); 10 | 11 | #endif // #ifndef EZQUAKE_R_PERFORMANCE_HEADER -------------------------------------------------------------------------------- /src/r_renderer.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_R_RENDERER_HEADER 3 | #define EZQUAKE_R_RENDERER_HEADER 4 | 5 | #include "gl_model.h" 6 | #include "r_state.h" 7 | #include "r_vao.h" 8 | #include "gl_framebuffer.h" 9 | 10 | typedef enum { 11 | r_cubemap_right, 12 | r_cubemap_back, 13 | r_cubemap_left, 14 | r_cubemap_front, 15 | r_cubemap_up, 16 | r_cubemap_down, 17 | 18 | r_cubemap_direction_count 19 | } r_cubemap_direction_id; 20 | 21 | #ifdef RENDERER_METHOD 22 | #undef RENDERER_METHOD 23 | #endif 24 | 25 | #define RENDERER_METHOD(returntype, name, ...) returntype (*name)(__VA_ARGS__); 26 | 27 | typedef struct renderer_api_s { 28 | #include "r_renderer_structure.h" 29 | 30 | qbool vaos_supported; 31 | } renderer_api_t; 32 | 33 | extern renderer_api_t renderer; 34 | 35 | #undef RENDERER_METHOD 36 | 37 | #endif // EZQUAKE_R_RENDERER_HEADER 38 | -------------------------------------------------------------------------------- /src/r_sprite3d_internal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_GL_SPRITE3D_INTERNAL 3 | #define EZQUAKE_GL_SPRITE3D_INTERNAL 4 | 5 | // Internal only 6 | #define MAX_3DSPRITES_PER_BATCH 16384 // Batches limited to this so they can't break other functionality 7 | #define INDEXES_MAX_QUADS 512 8 | #define INDEXES_MAX_FLASHBLEND 8 9 | #define INDEXES_MAX_SPARKS 16 10 | 11 | typedef struct gl_sprite3d_batch_s { 12 | r_state_id rendering_state; 13 | r_primitive_id primitive_id; 14 | texture_ref texture; 15 | int texture_index; 16 | qbool allSameNumber; 17 | 18 | int firstVertices[MAX_3DSPRITES_PER_BATCH]; 19 | int glFirstVertices[MAX_3DSPRITES_PER_BATCH]; 20 | int numVertices[MAX_3DSPRITES_PER_BATCH]; 21 | texture_ref textures[MAX_3DSPRITES_PER_BATCH]; 22 | int textureIndexes[MAX_3DSPRITES_PER_BATCH]; 23 | 24 | const char* name; 25 | sprite3d_batch_id id; 26 | unsigned int count; 27 | } gl_sprite3d_batch_t; 28 | 29 | typedef enum { 30 | sprite_vertpool_game_entities, 31 | sprite_vertpool_game_annotations, 32 | sprite_vertpool_simple_particles, 33 | sprite_vertpool_qmb_particles_normal, 34 | sprite_vertpool_qmb_particles_environment, 35 | 36 | sprite_vertpool_count 37 | } sprite_vertpool_id; 38 | 39 | // FIXME: Bit ugly with these externs here 40 | #define MAX_VERTS_PER_BATCH (MAX_3DSPRITES_PER_BATCH * 4) 41 | #define MAX_VERTS_PER_SCENE (MAX_VERTS_PER_BATCH * sprite_vertpool_count) 42 | 43 | extern r_sprite3d_vert_t verts[MAX_VERTS_PER_SCENE]; 44 | extern gl_sprite3d_batch_t batches[MAX_SPRITE3D_BATCHES]; 45 | 46 | extern unsigned int batchCount; 47 | extern unsigned int vertexCount; 48 | #endif 49 | -------------------------------------------------------------------------------- /src/r_texture_internal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EZQUAKE_R_TEXTURE_INTERNAL_HEADER 3 | #define EZQUAKE_R_TEXTURE_INTERNAL_HEADER 4 | 5 | #include "r_texture.h" 6 | 7 | typedef struct gltexture_s { 8 | // Internal handle 9 | unsigned int texnum; 10 | 11 | // 12 | r_texture_type_id type; 13 | char identifier[MAX_QPATH]; 14 | char* pathname; 15 | int image_width, image_height; 16 | int texture_width, texture_height; 17 | int texmode; 18 | unsigned crc; 19 | int bpp; 20 | int miplevels; 21 | 22 | // Arrays 23 | qbool is_array; 24 | int depth; 25 | 26 | texture_ref reference; 27 | int next_free; 28 | 29 | qbool mipmaps_generated; 30 | qbool storage_allocated; 31 | 32 | texture_minification_id minification_filter; 33 | texture_magnification_id magnification_filter; 34 | } gltexture_t; 35 | 36 | extern gltexture_t gltextures[MAX_GLTEXTURES]; 37 | 38 | void R_TextureSetDimensions(texture_ref ref, int width, int height); 39 | gltexture_t* R_TextureAllocateSlot(r_texture_type_id type, const char* identifier, int width, int height, int depth, int bpp, int mode, unsigned short crc, qbool* new_texture); 40 | 41 | void R_TextureUtil_ScaleDimensions(int width, int height, int *scaled_width, int *scaled_height, int mode); 42 | void R_TextureUtil_Brighten32(byte *data, int size); 43 | void R_TextureUtil_ImageDimensionsToTexture(int imageWidth, int imageHeight, int* textureWidth, int* textureHeight, int mode); 44 | 45 | void R_TextureUtil_SetFiltering(texture_ref texture); 46 | 47 | gltexture_t* R_NextTextureSlot(r_texture_type_id target); 48 | gltexture_t* R_FindTexture(const char *identifier); 49 | 50 | void R_TextureRegisterCvars(void); 51 | void R_TextureModeChanged(texture_ref tex, qbool mipmap, qbool viewmodel); 52 | void R_TextureModeForEach(void(*func)(texture_ref tex, qbool mipmap, qbool viewmodel)); 53 | 54 | #endif // EZQUAKE_R_TEXTURE_HEADER 55 | -------------------------------------------------------------------------------- /src/r_texture_util.c: -------------------------------------------------------------------------------- 1 | 2 | #include "quakedef.h" 3 | #include "r_texture.h" 4 | #include "r_texture_internal.h" 5 | #include "tr_types.h" 6 | 7 | void R_TextureUtil_ScaleDimensions(int width, int height, int *scaled_width, int *scaled_height, int mode) 8 | { 9 | int maxsize, picmip; 10 | qbool scale = (mode & TEX_MIPMAP) && !(mode & TEX_NOSCALE); 11 | extern cvar_t gl_picmip; 12 | 13 | R_TextureSizeRoundUp(width, height, scaled_width, scaled_height); 14 | 15 | if (scale) { 16 | picmip = (int)bound(0, gl_picmip.value, 16); 17 | *scaled_width >>= picmip; 18 | *scaled_height >>= picmip; 19 | } 20 | 21 | maxsize = scale ? gl_max_size.value : glConfig.gl_max_size_default; 22 | 23 | *scaled_width = bound(1, *scaled_width, maxsize); 24 | *scaled_height = bound(1, *scaled_height, maxsize); 25 | } 26 | 27 | void R_TextureUtil_Brighten32(byte *data, int size) 28 | { 29 | byte *p; 30 | int i; 31 | 32 | p = data; 33 | for (i = 0; i < size / 4; i++) { 34 | p[0] = min(p[0] * 2.0 / 1.5, 255); 35 | p[1] = min(p[1] * 2.0 / 1.5, 255); 36 | p[2] = min(p[2] * 2.0 / 1.5, 255); 37 | p += 4; 38 | } 39 | } 40 | 41 | void R_TextureUtil_ImageDimensionsToTexture(int imageWidth_, int imageHeight_, int* textureWidth, int* textureHeight, int mode) 42 | { 43 | int imageWidth, imageHeight; 44 | int scaledWidth, scaledHeight; 45 | 46 | R_TextureSizeRoundUp(imageWidth_, imageHeight_, &imageWidth, &imageHeight); 47 | R_TextureUtil_ScaleDimensions(imageWidth, imageHeight, &scaledWidth, &scaledHeight, mode); 48 | while (imageWidth > scaledWidth || imageHeight > scaledHeight) { 49 | imageWidth = max(1, imageWidth / 2); 50 | imageHeight = max(1, imageHeight / 2); 51 | } 52 | *textureWidth = imageWidth; 53 | *textureHeight = imageHeight; 54 | } 55 | 56 | void R_TextureUtil_SetFiltering(texture_ref texture) 57 | { 58 | int mode = gltextures[texture.index].texmode; 59 | 60 | R_TextureModeChanged(texture, mode & TEX_MIPMAP, mode & TEX_VIEWMODEL); 61 | R_TextureAnisotropyChanged(texture, mode & TEX_MIPMAP, mode & TEX_VIEWMODEL); 62 | } 63 | -------------------------------------------------------------------------------- /src/r_trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_R_TRACE_HEADER 21 | #define EZQUAKE_R_TRACE_HEADER 22 | 23 | #ifdef WITH_RENDERING_TRACE 24 | #define R_TraceEnterFunctionRegion R_TraceEnterRegion(__FUNCTION__, true) 25 | #define R_TraceLeaveFunctionRegion R_TraceLeaveRegion(true) 26 | #define R_TraceEnterNamedRegion(x) R_TraceEnterRegion(x, false) 27 | #define R_TraceLeaveNamedRegion() R_TraceLeaveRegion(false) 28 | void R_TraceEnterRegion(const char* regionName, qbool trace_only); 29 | void R_TraceLeaveRegion(qbool trace_only); 30 | void R_TracePrintState(FILE* output, int indent); 31 | void R_TraceDebugState(void); 32 | void R_TraceResetRegion(qbool start); 33 | void R_TraceLogAPICallDirect(const char* message, ...); 34 | #define R_TraceLogAPICall(...) { R_TraceLogAPICallDirect(__VA_ARGS__); } 35 | void R_TraceAPI(const char* formatString, ...); 36 | qbool R_TraceLoggingEnabled(void); 37 | void R_TraceTextureLabelGet(unsigned int name, int bufSize, int* length, char* label); 38 | #else 39 | #define R_TraceEnterFunctionRegion 40 | #define R_TraceLeaveFunctionRegion 41 | #define R_TraceEnterNamedRegion(x) 42 | #define R_TraceLeaveNamedRegion() 43 | #define R_TraceEnterRegion(...) 44 | #define R_TraceLeaveRegion(...) 45 | #define R_TracePrintState(...) 46 | #define R_TraceDebugState() 47 | #define R_TraceResetRegion(x) 48 | #define R_TraceLogAPICallDirect(x, ...) 49 | #define R_TraceLogAPICall(...) 50 | #define R_TraceAPI(formatString, ...) 51 | #define R_TraceLoggingEnabled() (false) 52 | #define R_TraceTextureLabelSet(...) 53 | #define R_TraceTextureLabelGet(...) 54 | #endif 55 | 56 | #endif // EZQUAKE_R_TRACE_HEADER 57 | -------------------------------------------------------------------------------- /src/r_vao.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_R_VAO_HEADER 21 | #define EZQUAKE_R_VAO_HEADER 22 | 23 | #include "r_buffers.h" 24 | 25 | typedef enum { 26 | vao_none, 27 | vao_aliasmodel, 28 | vao_brushmodel, 29 | vao_3dsprites, 30 | vao_hud_circles, 31 | vao_hud_images, 32 | vao_hud_lines, 33 | vao_hud_polygons, 34 | vao_postprocess, 35 | 36 | // non-shader (classic OpenGL) only 37 | vao_aliasmodel_powerupshell, 38 | vao_brushmodel_details, 39 | vao_brushmodel_lightmap_pass, 40 | vao_brushmodel_lm_unit1, 41 | vao_brushmodel_simpletex, 42 | vao_hud_images_non_glsl, 43 | 44 | vao_count 45 | } r_vao_id; 46 | 47 | void R_GenVertexArray(r_vao_id vao); 48 | void R_BindVertexArray(r_vao_id vao); 49 | qbool R_VertexArrayCreated(r_vao_id vao); 50 | void R_InitialiseVAOState(void); 51 | qbool R_VAOBound(void); 52 | void R_BindVertexArrayElementBuffer(r_buffer_id ref); 53 | 54 | typedef struct r_vaos_api_s { 55 | void(*Bind)(r_vao_id vao); 56 | } r_vaos_api_t; 57 | 58 | #endif // EZQUAKE_R_VAO_HEADER 59 | -------------------------------------------------------------------------------- /src/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by ezQuake.rc 4 | // 5 | #define IDI_ICON1 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /src/sbar.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // the status bar is only redrawn if something has changed, but if anything 22 | // does, the entire thing will be redrawn for the next vid.numpages frames. 23 | 24 | #ifndef EZQUAKE_SBAR_HEADER 25 | #define EZQUAKE_SBAR_HEADER 26 | 27 | #define SBAR_HEIGHT 24 28 | 29 | extern int sb_lines; // scan lines to draw 30 | 31 | void Sbar_Init (void); 32 | 33 | void Sbar_Changed (void); 34 | // call whenever any of the client stats represented on the sbar changes 35 | 36 | void Sbar_Draw (void); 37 | // called every frame by screen 38 | 39 | void Sbar_IntermissionOverlay (void); 40 | // called each frame after the level has been completed 41 | 42 | void Sbar_FinaleOverlay (void); 43 | 44 | int Sbar_TopColor(player_info_t *player); 45 | int Sbar_BottomColor(player_info_t *player); 46 | 47 | void Sbar_DrawNum (int x, int y, int num, int digits, int color); 48 | 49 | // covert quake pallete color number to rgb color 50 | int Sbar_ColorForMap (int m); 51 | 52 | #define STAT_MINUS 10 // num frame for '-' stats digit 53 | 54 | void Sbar_DrawPic(int x, int y, mpic_t *pic); 55 | void Sbar_DrawString(int x, int y, char *str); 56 | qbool Sbar_IsStandardBar(void); 57 | 58 | void Sbar_DrawTrackingString(void); 59 | void Sbar_DrawSpectatorMessage(void); 60 | 61 | #endif // #ifdef EZQUAKE_SBAR_HEADER 62 | -------------------------------------------------------------------------------- /src/settings_page.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 johnnycz 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | /** Guide to create settings page: 19 | 1) make new variables: 20 | a) 'settings_page' variable 21 | b) array of 'setting' elements, use macros from settings.h to do this 22 | 2) in some Init function call Settings_Page_Init(a, b); - a and b are variables from steps a and b 23 | 3) place calls to _Draw and _Key functions to appropriate places 24 | */ 25 | 26 | #ifndef __SETTINGS_PAGE_H__ 27 | #define __SETTINGS_PAGE_H__ 28 | 29 | #include "keys.h" 30 | 31 | #define Settings_Page_Init(set_page, settings) Settings_Init(&set_page, settings, (int)(sizeof(settings) / sizeof(setting)), #set_page) 32 | #define Settings_Page_SetMinit(set_page) { set_page.mini = true; } 33 | 34 | // initializes the page structure 35 | void Settings_Init(settings_page *page, setting *settings, int size, const char* name); 36 | 37 | void Settings_Shutdown(settings_page *page); 38 | 39 | // initilalize settings pages structures 40 | void Settings_MainInit(void); 41 | void Settings_MainShutdown(void); 42 | 43 | // draw request handler 44 | void Settings_Draw(int x, int y, int w, int h, settings_page* page); 45 | 46 | // optonal call at the moment of first display 47 | void Settings_OnShow(settings_page *tab); 48 | 49 | // key press handler 50 | qbool Settings_Key(settings_page* page, int key, wchar unichar); 51 | 52 | // mouse move handler 53 | qbool Settings_Mouse_Event(settings_page * page, const mouse_state_t *ms); 54 | 55 | #endif // __SETTINGS_PAGE_H__ 56 | -------------------------------------------------------------------------------- /src/sha1.h: -------------------------------------------------------------------------------- 1 | /* 2 | SHA-1 in C 3 | By Steve Reid 4 | 100% Public Domain 5 | 6 | Test Vectors (from FIPS PUB 180-1) 7 | "abc" 8 | A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D 9 | "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" 10 | 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 11 | A million repetitions of "a" 12 | 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F 13 | 14 | $Id: sha1.h,v 1.9 2007-08-08 00:53:29 disconn3ct Exp $ 15 | */ 16 | 17 | #define SHA1HANDSOFF /* Copies data before messing with it. */ 18 | #ifndef _SHA1 19 | #define _SHA1 20 | typedef struct { 21 | unsigned int state[5]; 22 | size_t count[2]; 23 | unsigned char buffer[64]; 24 | } SHA1_CTX; 25 | 26 | #define DIGEST_SIZE 20 27 | void SHA1Transform(unsigned int state[5], unsigned char buffer[64]); 28 | void SHA1Init(SHA1_CTX* context); 29 | void SHA1Update(SHA1_CTX* context, unsigned char* data, size_t len); 30 | void SHA1Final(unsigned char digest[DIGEST_SIZE], SHA1_CTX* context); 31 | 32 | #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) 33 | 34 | /* blk0() and blk() perform the initial expand. */ 35 | /* I got the idea of expanding during the round function from SSLeay */ 36 | /* 37 | #ifdef __BIG_ENDIAN 38 | #define blk0(i) block->l[i] 39 | #else 40 | #define blk0(i) (block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) | \ 41 | (rol(block->l[i], 8) & 0x00FF00FF)) 42 | #endif 43 | */ 44 | 45 | #define blk0(i) (block->l[i] = BigLong(block->l[i])) 46 | 47 | #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ 48 | ^block->l[(i+2)&15]^block->l[i&15],1)) 49 | 50 | /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ 51 | #define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); 52 | #define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); 53 | #define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); 54 | #define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); 55 | #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); 56 | 57 | //VVD: SHA1 crypt 58 | char *SHA1(char *string); 59 | void SHA1_Init(void); 60 | void SHA1_Update(unsigned char* data); 61 | char *SHA1_Final(void); 62 | char *bin2hex(unsigned char *d); 63 | #endif //_SHA1 64 | -------------------------------------------------------------------------------- /src/sv_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004 VVD (vvd0@sorceforge.net). 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __LOG_H__ 22 | #define __LOG_H__ 23 | 24 | enum { MIN_LOG = 0, CONSOLE_LOG = 0, ERROR_LOG, RCON_LOG, 25 | TELNET_LOG, FRAG_LOG, PLAYER_LOG, MOD_FRAG_LOG, MAX_LOG}; 26 | 27 | typedef struct log_s { 28 | FILE *sv_logfile; 29 | char *command; 30 | char *file_name; 31 | char *message_off; 32 | char *message_on; 33 | xcommand_t function; 34 | int log_level; 35 | } log_t; 36 | 37 | extern log_t logs[MAX_LOG]; 38 | extern cvar_t frag_log_type; 39 | extern cvar_t telnet_log_level; 40 | 41 | //bliP: logging 42 | void SV_Logfile (int sv_log, qbool newlog); 43 | void SV_LogPlayer(client_t *cl, char *msg, int level); 44 | //<- 45 | void SV_Write_Log(int sv_log, int level, char *msg); 46 | 47 | #endif /* !__LOG_H__ */ 48 | -------------------------------------------------------------------------------- /src/sv_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // sv_null.c -- this file can stub out the entire server system 21 | // for pure net-only clients 22 | 23 | void SV_Init (void) 24 | { 25 | } 26 | void SV_Shutdown (char *finalmsg) 27 | { 28 | } 29 | void SV_Frame (double time) 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /src/textencoding.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011-2015 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | wchar *decode_string (const char *s); 20 | char *encode_say (wchar *in); 21 | 22 | wchar TextEncodingDecodeUTF8(char* str, int* index); 23 | 24 | // Make sure the renderer can display all Unicode chars in the string, 25 | // otherwise try to replace them with Latin equivalents 26 | wchar *maybe_transliterate (wchar *src); 27 | -------------------------------------------------------------------------------- /src/tp_msgs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 johnnycz 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | /** 19 | \file 20 | 21 | \brief 22 | Inbuilt teamplay messages module 23 | 24 | \author johnnycz 25 | \author Up2nOgOoD[ROCK] 26 | **/ 27 | 28 | #ifndef __TP_MSGS_H__ 29 | #define __TP_MSGS_H__ 30 | 31 | extern void TP_Msg_Lost_f (void); 32 | extern void TP_Msg_Report_f (void); 33 | extern void TP_Msg_Coming_f (void); 34 | extern void TP_Msg_EnemyPowerup_f (void); 35 | extern void TP_Msg_Safe_f (void); 36 | extern void TP_Msg_KillMe_f (void); 37 | extern void TP_Msg_Help_f (void); 38 | extern void TP_Msg_GetQuad_f (void); 39 | extern void TP_Msg_GetPent_f (void); 40 | extern void TP_Msg_QuadDead_f (void); 41 | extern void TP_Msg_Took_f (void); 42 | extern void TP_Msg_Point_f (void); 43 | extern void TP_Msg_Need_f (void); 44 | extern void TP_Msg_YesOk_f (void); 45 | extern void TP_Msg_NoCancel_f (void); 46 | extern void TP_Msg_YouTake_f (void); 47 | extern void TP_Msg_ItemSoon_f (void); 48 | extern void TP_Msg_Waiting_f (void); 49 | extern void TP_Msg_Slipped_f (void); 50 | extern void TP_Msg_Replace_f (void); 51 | extern void TP_Msg_Trick_f (void); 52 | //TF messages 53 | extern void TP_Msg_TFConced_f (void); 54 | 55 | extern const char* TP_MSG_Colored_Armor(void); 56 | extern const char * TP_MSG_Colored_Powerup(void); 57 | extern const char * TP_MSG_Colored_Short_Powerups(void); 58 | 59 | #endif // __TP_MSGS_H__ 60 | -------------------------------------------------------------------------------- /src/tp_triggers.h: -------------------------------------------------------------------------------- 1 | /* 2 | This program is free software; you can redistribute it and/or 3 | modify it under the terms of the GNU General Public License 4 | as published by the Free Software Foundation; either version 2 5 | of the License, or (at your option) any later version. 6 | 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | 11 | See the GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | $Id: tp_triggers.h,v 1.2 2007-05-13 13:41:44 johnnycz Exp $ 18 | */ 19 | 20 | #define RE_PRINT_LOW 1 21 | #define RE_PRINT_NEDIUM 2 22 | #define RE_PRINT_HIGH 4 23 | #define RE_PRINT_CHAT 8 24 | #define RE_PRINT_CENTER 16 25 | #define RE_PRINT_ECHO 32 26 | #define RE_PRINT_INTERNAL 64 27 | #define RE_PRINT_ALL 31 // all of the above except internal 28 | #define RE_FINAL 256 // do not look for other triggers if matching is succesful 29 | #define RE_REMOVESTR 512 // do not display string if matching is uccesful 30 | #define RE_NOLOG 1024 // do not log string if matching is succesful 31 | #define RE_ENABLED 2048 // trigger is enabled 32 | #define RE_NOACTION 4096 // do not call alias 33 | 34 | typedef struct pcre_trigger_s { 35 | char *name; 36 | char *regexpstr; 37 | struct pcre_trigger_s* next; 38 | pcre2_code* regexp; 39 | unsigned flags; 40 | float min_interval; 41 | double lasttime; 42 | int counter; 43 | } pcre_trigger_t; 44 | 45 | typedef void internal_trigger_func (const char *s); 46 | 47 | typedef struct pcre_internal_trigger_s { 48 | struct pcre_internal_trigger_s *next; 49 | pcre2_code *regexp; 50 | internal_trigger_func *func; 51 | unsigned flags; 52 | } pcre_internal_trigger_t; 53 | 54 | // re-triggers 55 | qbool CL_SearchForReTriggers (const char *s, unsigned trigger_type); 56 | // if true, string should not be displayed 57 | pcre_trigger_t *CL_FindReTrigger (char *name); 58 | void CL_RE_Trigger_ResetLasttime (void); 59 | 60 | // message triggers 61 | void TP_SearchForMsgTriggers (const char *s, int level); 62 | -------------------------------------------------------------------------------- /src/vk_draw.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | // vk_draw.c 21 | 22 | #ifdef RENDERER_OPTION_VULKAN 23 | 24 | #include "quakedef.h" 25 | 26 | void VK_HudDrawComplete(void) 27 | { 28 | 29 | } 30 | 31 | void VK_HudPrepareCircles(void) 32 | { 33 | } 34 | 35 | void VK_HudDrawCircles(texture_ref tex, int start, int end) 36 | { 37 | } 38 | 39 | void VK_HudPrepareImages(void) 40 | { 41 | } 42 | 43 | void VK_HudDrawImages(texture_ref tex, int start, int end) 44 | { 45 | } 46 | 47 | void VK_HudPreparePolygons(void) 48 | { 49 | } 50 | 51 | void VK_HudDrawPolygons(texture_ref tex, int start, int end) 52 | { 53 | } 54 | 55 | void VK_HudPrepareLines(void) 56 | { 57 | } 58 | 59 | void VK_HudDrawLines(texture_ref ref, int start, int end) 60 | { 61 | } 62 | 63 | void VK_DrawImage(float x, float y, float width, float height, float tex_s, float tex_t, float tex_width, float tex_height, byte* color, int flags) 64 | { 65 | } 66 | 67 | void VK_DrawRectangle(float x, float y, float width, float height, byte* color) 68 | { 69 | } 70 | 71 | void VK_AdjustImages(int first, int last, float x_offset) 72 | { 73 | } 74 | 75 | #endif // #ifdef RENDERER_OPTION_VULKAN 76 | -------------------------------------------------------------------------------- /src/vk_graphics_pipeline.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | // vk_vao.c 21 | // - Vulkan graphics pipeline functions 22 | 23 | #ifdef RENDERER_OPTION_VULKAN 24 | 25 | #include 26 | #include "quakedef.h" 27 | 28 | void VK_CreateGraphicsPipelines(void) 29 | { 30 | VkPipelineVertexInputStateCreateInfo vertexInputInfo = {}; 31 | vertexInputInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; 32 | vertexInputInfo.vertexBindingDescriptionCount = 0; 33 | vertexInputInfo.pVertexBindingDescriptions = nullptr; // Optional 34 | vertexInputInfo.vertexAttributeDescriptionCount = 0; 35 | vertexInputInfo.pVertexAttributeDescriptions = nullptr; // Optional 36 | 37 | VkPipelineInputAssemblyStateCreateInfo inputAssembly = {}; 38 | inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; 39 | inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; 40 | inputAssembly.primitiveRestartEnable = VK_FALSE; 41 | } 42 | 43 | #endif // RENDERER_OPTION_VULKAN 44 | -------------------------------------------------------------------------------- /src/vk_lightmaps.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifdef RENDERER_OPTION_VULKAN 22 | 23 | void VK_CreateLightmapTextures(void) 24 | { 25 | } 26 | 27 | void VK_UploadLightmap(int textureUnit, int lightmapnum) 28 | { 29 | 30 | } 31 | 32 | void VK_BuildLightmap(int lightmapnum) 33 | { 34 | } 35 | 36 | #endif // #ifdef RENDERER_OPTION_VULKAN 37 | -------------------------------------------------------------------------------- /src/vk_md3.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Copyright (C) 2018 ezQuake team 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifdef RENDERER_OPTION_VULKAN 22 | 23 | #include "quakedef.h" 24 | 25 | void VK_DrawAlias3Model(entity_t* ent, qbool outline, qbool additive_pass) 26 | { 27 | } 28 | 29 | #endif // #ifdef RENDERER_OPTION_VULKAN 30 | -------------------------------------------------------------------------------- /src/vk_misc.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | Copyright (C) 2018 ezQuake team 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifdef RENDERER_OPTION_VULKAN 22 | 23 | #include "quakedef.h" 24 | 25 | void VK_PrintGfxInfo(void) 26 | { 27 | } 28 | 29 | #endif // #ifdef RENDERER_OPTION_VULKAN 30 | -------------------------------------------------------------------------------- /src/vk_sdl.c: -------------------------------------------------------------------------------- 1 | /* 2 | =========================================================================== 3 | Copyright (C) 1999-2005 Id Software, Inc. 4 | 5 | This file is part of Quake III Arena source code. 6 | 7 | Quake III Arena 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 | Quake III Arena 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 Foobar; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | 22 | */ 23 | 24 | #ifdef RENDERER_OPTION_VULKAN 25 | 26 | #include 27 | #include "quakedef.h" 28 | 29 | void VK_SDL_SetupAttributes(void) 30 | { 31 | // Do nothing at the moment... 32 | } 33 | 34 | #endif // #ifdef RENDERER_OPTION_VULKAN 35 | -------------------------------------------------------------------------------- /src/vk_vao.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef EZQUAKE_VK_VAO_HEADER 21 | #define EZQUAKE_VK_VAO_HEADER 22 | 23 | #include "r_vao.h" 24 | 25 | void VK_DeleteVAOs(void); 26 | void VK_GenVertexArray(r_vao_id vao, const char* name); 27 | qbool VK_VertexArrayCreated(r_vao_id vao); 28 | void VK_BindVertexArray(r_vao_id vao); 29 | qbool VK_InitialiseVAOHandling(void); 30 | 31 | #endif // EZQUAKE_VK_VAO_HEADER 32 | 33 | -------------------------------------------------------------------------------- /src/vk_window_surface.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 ezQuake team 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | // vk_window_surface.c 21 | // - Window surfaces 22 | 23 | #ifdef RENDERER_OPTION_VULKAN 24 | 25 | #include 26 | #include "quakedef.h" 27 | 28 | #include 29 | #include 30 | 31 | #include "vk_local.h" 32 | 33 | qbool VK_CreateWindowSurface(SDL_Window* window, VkInstance instance, VkSurfaceKHR* surface) 34 | { 35 | surface = VK_NULL_HANDLE; 36 | 37 | if (SDL_Vulkan_CreateSurface(window, instance, surface) != SDL_TRUE) { 38 | return false; 39 | } 40 | 41 | return true; 42 | } 43 | 44 | void VK_DestroyWindowSurface(VkInstance instance, VkSurfaceKHR surface) 45 | { 46 | if (surface != VK_NULL_HANDLE) { 47 | vkDestroySurfaceKHR(instance, surface, NULL); 48 | surface = VK_NULL_HANDLE; 49 | } 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/vm.h: -------------------------------------------------------------------------------- 1 | #ifndef VM_H 2 | #define VM_H 3 | 4 | /* 5 | ============================================================== 6 | 7 | VIRTUAL MACHINE 8 | 9 | ============================================================== 10 | */ 11 | 12 | #ifdef _WIN32 13 | #define QDECL __cdecl 14 | #else 15 | #define QDECL 16 | #endif 17 | 18 | typedef struct vm_s vm_t; 19 | 20 | typedef enum { 21 | VMI_NONE, 22 | VMI_NATIVE, 23 | VMI_BYTECODE, 24 | VMI_COMPILED 25 | } vmInterpret_t; 26 | 27 | 28 | typedef enum { 29 | VM_BAD = -1, 30 | VM_GAME = 0, 31 | VM_COUNT 32 | } vmIndex_t; 33 | 34 | extern vm_t *currentVM; 35 | typedef intptr_t (*syscall_t)( intptr_t *parms ); 36 | typedef intptr_t (QDECL *dllSyscall_t)( intptr_t callNum, ... ); 37 | typedef void (QDECL *dllEntry_t)( dllSyscall_t syscallptr ); 38 | 39 | 40 | void VM_Init( void ); 41 | vm_t *VM_Create( vmIndex_t index, const char* name, syscall_t systemCalls, /*dllSyscall_t dllSyscalls,*/ vmInterpret_t interpret ); 42 | 43 | extern vm_t *currentVM; 44 | 45 | // module should be bare: "cgame", not "cgame.dll" or "vm/cgame.qvm" 46 | 47 | void VM_Free( vm_t *vm ); 48 | void VM_Clear(void); 49 | void VM_Forced_Unload_Start(void); 50 | void VM_Forced_Unload_Done(void); 51 | vm_t *VM_Restart( vm_t *vm ); 52 | 53 | intptr_t QDECL VM_Call( vm_t *vm, int nargs, int callNum, ... ); 54 | 55 | void VM_Debug( int level ); 56 | void VM_CheckBounds( const vm_t *vm, unsigned int address, unsigned int length ); 57 | void VM_CheckBounds2( const vm_t *vm, unsigned int addr1, unsigned int addr2, unsigned int length ); 58 | 59 | #if 1 60 | #define VM_CHECKBOUNDS VM_CheckBounds 61 | #define VM_CHECKBOUNDS2 VM_CheckBounds2 62 | #else // for performance evaluation purposes 63 | #define VM_CHECKBOUNDS(vm,a,b) 64 | #define VM_CHECKBOUNDS2(vm,a,b,c) 65 | #endif 66 | 67 | void *VM_ArgPtr( intptr_t intValue ); 68 | void *VM_ExplicitArgPtr( vm_t *vm, intptr_t intValue ); 69 | intptr_t VM_Ptr2VM( void* ptr ) ; 70 | intptr_t VM_ExplicitPtr2VM( vm_t *vm, void* ptr ); 71 | 72 | typedef union floatint_u 73 | { 74 | int i; 75 | unsigned int u; 76 | float f; 77 | byte b[4]; 78 | } 79 | floatint_t; 80 | 81 | #define VMA(x) VM_ArgPtr(args[x]) 82 | static inline float _vmf(intptr_t x) 83 | { 84 | floatint_t v; 85 | v.i = (int)x; 86 | return v.f; 87 | } 88 | #define VMF(x) _vmf(args[x]) 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /src/vx_camera.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 VultureIIC 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | //vx_camera.h for QWAMF 20 | //VultureIIC 21 | 22 | void Start_DeathCam(void); 23 | void Update_DeathCam(void); 24 | void End_DeathCam(void); 25 | extern cvar_t r_deathcam; 26 | extern cvar_t chase_back; 27 | extern cvar_t chase_up; 28 | extern cvar_t chase_active; 29 | extern cvar_t r_externcam; 30 | extern qbool chasecam_allowed; 31 | 32 | extern int externcam; 33 | extern vec3_t death_org; 34 | 35 | 36 | //Screen shaking 37 | extern vec3_t shakemag[1]; 38 | extern cvar_t r_screenshaking; 39 | 40 | void ApplyRadialForce(vec3_t org, float power); 41 | void Update_ScreenShake (void); 42 | void Reset_ScreenShake (void); 43 | void Init_ScreenShake (void); 44 | -------------------------------------------------------------------------------- /src/vx_tracker.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 VultureIIC 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef __VX_TRACKER_H__ 20 | #define __VX_TRACKER_H__ 21 | 22 | extern cvar_t amf_tracker_messages; 23 | extern cvar_t amf_tracker_time; 24 | extern cvar_t amf_tracker_align_right; 25 | extern cvar_t amf_tracker_scale; 26 | 27 | void VX_TrackerDeath(int player, int weapon, int count); 28 | void VX_TrackerSuicide(int player, int weapon, int count); 29 | void VX_TrackerFragXvsY(int player, int killer, int weapon, int player_wcount, int killer_wcount); 30 | void VX_TrackerOddFrag(int player, int weapon, int wcount); 31 | 32 | void VX_TrackerTK_XvsY(int player, int killer, int weapon, int p_count, int p_icount, int k_count, int k_icount); 33 | void VX_TrackerOddTeamkill(int player, int weapon, int count); 34 | void VX_TrackerOddTeamkilled(int player, int weapon); 35 | 36 | void VX_TrackerFlagTouch(int count); 37 | void VX_TrackerFlagDrop(int count); 38 | void VX_TrackerFlagCapture(int count); 39 | 40 | char* GetWeaponName(int num); 41 | char* GetColoredWeaponName(int num, const byte *color); 42 | const char* GetWeaponImageName(int num); 43 | const char* GetWeaponTextName(int num); 44 | void VX_TrackerThink(void); 45 | void VX_TrackerInit(void); 46 | void VX_TrackerClear(void); 47 | void VX_TrackerStreak(int player, int count); 48 | void VX_TrackerStreakEnd(int player, int killer, int count); 49 | void VX_TrackerStreakEndOddTeamkilled(int player, int count); 50 | 51 | // This needs improved... 52 | void VX_TrackerPickupText(const char* line); 53 | 54 | #define MAX_WEAPON_CLASSES 64 55 | #define MAX_FRAG_DEFINITIONS 512 56 | #define MAX_FRAGMSG_LENGTH 256 57 | #define MAX_TRACKER_IMAGES 128 58 | 59 | #endif // __VX_TRACKER_H__ 60 | -------------------------------------------------------------------------------- /src/vx_vertexlights.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 VultureIIC 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | float VLight_LerpLight(int index1, int index2, float ilerp, float apitch, float ayaw); 20 | float VLight_LerpLightByAngles(float pitchofs1, float yawofs1, float pitchofs2, float yawofs2, float ilerp, float apitch, float ayaw); 21 | 22 | void Init_VLights(void); 23 | -------------------------------------------------------------------------------- /src/wad.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // wad.h 21 | 22 | #ifndef _WAD_H 23 | #define _WAD_H 24 | 25 | //#include "bspfile.h" 26 | 27 | //=============== 28 | // TYPES 29 | //=============== 30 | 31 | #define CMP_NONE 0 32 | #define CMP_LZSS 1 33 | 34 | #define TYP_NONE 0 35 | #define TYP_LABEL 1 36 | 37 | #define TYP_LUMPY 64 // 64 + grab command number 38 | #define TYP_PALETTE 64 39 | #define TYP_QTEX 65 40 | #define TYP_QPIC 66 41 | #define TYP_SOUND 67 42 | #define TYP_MIPTEX 68 43 | 44 | typedef struct { 45 | int width, height; 46 | byte data[4]; // variably sized 47 | } qpic_t; 48 | 49 | void W_LoadWadFile(const char *filename); 50 | void* W_GetLumpName(const char *name); 51 | void W_FreeWadFile(void); 52 | 53 | void SwapPic(qpic_t *pic); 54 | 55 | void WAD3_LoadWadFile(const char *filename); 56 | byte* WAD3_LoadTexture(texture_t *tx); 57 | 58 | #endif // _WAD_H 59 | -------------------------------------------------------------------------------- /src/winquake.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | 1 VERSIONINFO 5 | { 6 | BLOCK "StringFileInfo" 7 | { 8 | BLOCK "040904B0" 9 | { 10 | VALUE "ProductName", "ezQuake" 11 | VALUE "ProductVersion", VERSION_NUMBER " Build " VERSION 12 | VALUE "FileDescription", "ezQuake v" VERSION_NUMBER " - QuakeWorld(r) Today" 13 | VALUE "FileVersion", VERSION_NUMBER 14 | VALUE "CompanyName", "The ezQuake Developers" 15 | VALUE "OriginalFileName", "ezquake.exe" 16 | VALUE "InternalName", "ezquake" 17 | } 18 | } 19 | 20 | BLOCK "VarFileInfo" 21 | { 22 | VALUE "Translation", 0x0409, 0x04B0 23 | } 24 | } 25 | 26 | 1 ICON "ezquake.ico" 27 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "ezquake.exe.manifest" 28 | -------------------------------------------------------------------------------- /vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", 3 | "name": "ezquake", 4 | "version": "1.0.0", 5 | "dependencies": [ 6 | { "name": "pkgconf", "default-features": false, "platform": "osx", "host": true }, 7 | { "name": "zlib", "default-features": false }, 8 | { "name": "pcre2", "default-features": false }, 9 | { "name": "minizip", "default-features": false }, 10 | { "name": "expat", "default-features": false }, 11 | { "name": "jansson", "default-features": false }, 12 | { "name": "curl", "default-features": false, "features": ["schannel"], "platform": "windows" }, 13 | { "name": "curl", "default-features": false, "features": ["mbedtls"], "platform": "linux, osx" }, 14 | { "name": "libpng", "default-features": false }, 15 | { "name": "libjpeg-turbo", "default-features": false }, 16 | { "name": "freetype", "default-features": false, "features": ["zlib"] }, 17 | { "name": "speex", "default-features": false }, 18 | { "name": "speexdsp", "default-features": false }, 19 | { "name": "libsndfile", "default-features": false, "features": ["external-libs"] }, 20 | { "name": "alsa", "default-features": false, "platform": "linux" }, 21 | { "name": "sdl2", "default-features": false, "platform": "windows, osx" }, 22 | { "name": "sdl2", "default-features": false, "features": ["wayland", "x11", "alsa"], "platform": "linux" } 23 | ] 24 | } 25 | --------------------------------------------------------------------------------