├── .github └── workflows │ └── build.yml ├── .gitignore ├── BUILD.md ├── COPYING.txt ├── LICENSE ├── Makefile ├── README.md ├── code ├── asm │ ├── common_x64.asm │ ├── qasm.h │ ├── snd_mix_mmx.s │ ├── snd_mix_sse.s │ ├── snd_mix_x64.asm │ └── snd_mix_x86_64.s ├── botlib │ ├── aasfile.h │ ├── be_aas.h │ ├── be_aas_bsp.h │ ├── be_aas_bspq3.c │ ├── be_aas_cluster.c │ ├── be_aas_cluster.h │ ├── be_aas_debug.c │ ├── be_aas_debug.h │ ├── be_aas_def.h │ ├── be_aas_entity.c │ ├── be_aas_entity.h │ ├── be_aas_file.c │ ├── be_aas_file.h │ ├── be_aas_funcs.h │ ├── be_aas_main.c │ ├── be_aas_main.h │ ├── be_aas_move.c │ ├── be_aas_move.h │ ├── be_aas_optimize.c │ ├── be_aas_optimize.h │ ├── be_aas_reach.c │ ├── be_aas_reach.h │ ├── be_aas_route.c │ ├── be_aas_route.h │ ├── be_aas_routealt.c │ ├── be_aas_routealt.h │ ├── be_aas_sample.c │ ├── be_aas_sample.h │ ├── be_ai_char.c │ ├── be_ai_char.h │ ├── be_ai_chat.c │ ├── be_ai_chat.h │ ├── be_ai_goal.c │ ├── be_ai_goal.h │ ├── be_ai_move.c │ ├── be_ai_move.h │ ├── be_ai_weap.c │ ├── be_ai_weap.h │ ├── be_ai_weight.c │ ├── be_ai_weight.h │ ├── be_ea.c │ ├── be_ea.h │ ├── be_interface.c │ ├── be_interface.h │ ├── botlib.h │ ├── l_crc.c │ ├── l_crc.h │ ├── l_libvar.c │ ├── l_libvar.h │ ├── l_log.c │ ├── l_log.h │ ├── l_memory.c │ ├── l_memory.h │ ├── l_precomp.c │ ├── l_precomp.h │ ├── l_script.c │ ├── l_script.h │ ├── l_struct.c │ ├── l_struct.h │ └── l_utils.h ├── cgame │ └── cg_public.h ├── client │ ├── cl_avi.c │ ├── cl_cgame.c │ ├── cl_cin.c │ ├── cl_console.c │ ├── cl_input.c │ ├── cl_jpeg.c │ ├── cl_keys.c │ ├── cl_main.c │ ├── cl_net_chan.c │ ├── cl_parse.c │ ├── cl_scrn.c │ ├── cl_ui.c │ ├── client.h │ ├── keycodes.h │ ├── keys.h │ ├── snd_adpcm.c │ ├── snd_codec.c │ ├── snd_codec.h │ ├── snd_codec_mp3.c │ ├── snd_codec_ogg.c │ ├── snd_codec_wav.c │ ├── snd_dma.c │ ├── snd_local.h │ ├── snd_main.c │ ├── snd_mem.c │ ├── snd_mix.c │ ├── snd_public.h │ └── snd_wavelet.c ├── game │ ├── bg_public.h │ └── g_public.h ├── libjpeg │ ├── README │ ├── jaricom.c │ ├── jcapimin.c │ ├── jcapistd.c │ ├── jcarith.c │ ├── jccoefct.c │ ├── jccolor.c │ ├── jcdctmgr.c │ ├── jchuff.c │ ├── jcinit.c │ ├── jcmainct.c │ ├── jcmarker.c │ ├── jcmaster.c │ ├── jcomapi.c │ ├── jconfig.h │ ├── jcparam.c │ ├── jcprepct.c │ ├── jcsample.c │ ├── jctrans.c │ ├── jdapimin.c │ ├── jdapistd.c │ ├── jdarith.c │ ├── jdatadst.c │ ├── jdatasrc.c │ ├── jdcoefct.c │ ├── jdcolor.c │ ├── jdct.h │ ├── jddctmgr.c │ ├── jdhuff.c │ ├── jdinput.c │ ├── jdmainct.c │ ├── jdmarker.c │ ├── jdmaster.c │ ├── jdmerge.c │ ├── jdpostct.c │ ├── jdsample.c │ ├── jdtrans.c │ ├── jerror.c │ ├── jerror.h │ ├── jfdctflt.c │ ├── jfdctfst.c │ ├── jfdctint.c │ ├── jidctflt.c │ ├── jidctfst.c │ ├── jidctint.c │ ├── jinclude.h │ ├── jmemmgr.c │ ├── jmemnobs.c │ ├── jmemsys.h │ ├── jmorecfg.h │ ├── jpegint.h │ ├── jpeglib.h │ ├── jquant1.c │ ├── jquant2.c │ ├── jutils.c │ ├── jversion.h │ └── libjpeg-changes.diff ├── libmad │ ├── COPYRIGHT │ ├── CREDITS │ ├── D.dat │ ├── bit.c │ ├── bit.h │ ├── config.h │ ├── decoder.c │ ├── decoder.h │ ├── fixed.c │ ├── fixed.h │ ├── frame.c │ ├── frame.h │ ├── global.h │ ├── huffman.c │ ├── huffman.h │ ├── imdct_l_arm.S │ ├── imdct_s.dat │ ├── include │ │ └── mad.h │ ├── layer12.c │ ├── layer12.h │ ├── layer3.c │ ├── layer3.h │ ├── qc_table.dat │ ├── rq_table.dat │ ├── sf_table.dat │ ├── stream.c │ ├── stream.h │ ├── synth.c │ ├── synth.h │ ├── timer.c │ ├── timer.h │ ├── version.c │ └── version.h ├── libogg │ ├── COPYING │ ├── include │ │ └── ogg │ │ │ ├── config_types.h │ │ │ ├── ogg.h │ │ │ └── os_types.h │ └── src │ │ ├── bitwise.c │ │ ├── crctable.h │ │ └── framing.c ├── libsdl │ ├── include │ │ └── SDL2 │ │ │ ├── SDL.h │ │ │ ├── SDL_assert.h │ │ │ ├── SDL_atomic.h │ │ │ ├── SDL_audio.h │ │ │ ├── SDL_bits.h │ │ │ ├── SDL_blendmode.h │ │ │ ├── SDL_clipboard.h │ │ │ ├── SDL_config.h │ │ │ ├── SDL_cpuinfo.h │ │ │ ├── SDL_egl.h │ │ │ ├── SDL_endian.h │ │ │ ├── SDL_error.h │ │ │ ├── SDL_events.h │ │ │ ├── SDL_filesystem.h │ │ │ ├── SDL_gamecontroller.h │ │ │ ├── SDL_gesture.h │ │ │ ├── SDL_haptic.h │ │ │ ├── SDL_hints.h │ │ │ ├── SDL_joystick.h │ │ │ ├── SDL_keyboard.h │ │ │ ├── SDL_keycode.h │ │ │ ├── SDL_loadso.h │ │ │ ├── SDL_log.h │ │ │ ├── SDL_main.h │ │ │ ├── SDL_messagebox.h │ │ │ ├── SDL_mouse.h │ │ │ ├── SDL_mutex.h │ │ │ ├── SDL_name.h │ │ │ ├── SDL_opengl.h │ │ │ ├── SDL_opengl_glext.h │ │ │ ├── SDL_opengles.h │ │ │ ├── SDL_opengles2.h │ │ │ ├── SDL_opengles2_gl2.h │ │ │ ├── SDL_opengles2_gl2ext.h │ │ │ ├── SDL_opengles2_gl2platform.h │ │ │ ├── SDL_opengles2_khrplatform.h │ │ │ ├── SDL_pixels.h │ │ │ ├── SDL_platform.h │ │ │ ├── SDL_power.h │ │ │ ├── SDL_quit.h │ │ │ ├── SDL_rect.h │ │ │ ├── SDL_render.h │ │ │ ├── SDL_revision.h │ │ │ ├── SDL_rwops.h │ │ │ ├── SDL_scancode.h │ │ │ ├── SDL_sensor.h │ │ │ ├── SDL_shape.h │ │ │ ├── SDL_stdinc.h │ │ │ ├── SDL_surface.h │ │ │ ├── SDL_system.h │ │ │ ├── SDL_syswm.h │ │ │ ├── SDL_test.h │ │ │ ├── SDL_test_assert.h │ │ │ ├── SDL_test_common.h │ │ │ ├── SDL_test_compare.h │ │ │ ├── SDL_test_crc32.h │ │ │ ├── SDL_test_font.h │ │ │ ├── SDL_test_fuzzer.h │ │ │ ├── SDL_test_harness.h │ │ │ ├── SDL_test_images.h │ │ │ ├── SDL_test_log.h │ │ │ ├── SDL_test_md5.h │ │ │ ├── SDL_test_memory.h │ │ │ ├── SDL_test_random.h │ │ │ ├── SDL_thread.h │ │ │ ├── SDL_timer.h │ │ │ ├── SDL_touch.h │ │ │ ├── SDL_types.h │ │ │ ├── SDL_version.h │ │ │ ├── SDL_video.h │ │ │ ├── SDL_vulkan.h │ │ │ ├── begin_code.h │ │ │ └── close_code.h │ ├── macosx │ │ ├── libSDL2-2.0.0.dylib │ │ └── libSDL2main.a │ └── windows │ │ └── mingw │ │ ├── lib32 │ │ ├── SDL2.dll │ │ ├── libSDL2.dll.a │ │ └── libSDL2.la │ │ └── lib64 │ │ ├── SDL264.dll │ │ ├── libSDL264.dll.a │ │ └── libSDL264.la ├── libvorbis │ ├── COPYING │ ├── include │ │ └── vorbis │ │ │ ├── codec.h │ │ │ ├── vorbisenc.h │ │ │ └── vorbisfile.h │ └── lib │ │ ├── analysis.c │ │ ├── backends.h │ │ ├── bitrate.c │ │ ├── bitrate.h │ │ ├── block.c │ │ ├── books │ │ ├── coupled │ │ │ ├── res_books_51.h │ │ │ └── res_books_stereo.h │ │ ├── floor │ │ │ └── floor_books.h │ │ └── uncoupled │ │ │ └── res_books_uncoupled.h │ │ ├── codebook.c │ │ ├── codebook.h │ │ ├── codec_internal.h │ │ ├── envelope.c │ │ ├── envelope.h │ │ ├── floor0.c │ │ ├── floor1.c │ │ ├── highlevel.h │ │ ├── info.c │ │ ├── lookup.c │ │ ├── lookup.h │ │ ├── lookup_data.h │ │ ├── lpc.c │ │ ├── lpc.h │ │ ├── lsp.c │ │ ├── lsp.h │ │ ├── mapping0.c │ │ ├── masking.h │ │ ├── mdct.c │ │ ├── mdct.h │ │ ├── misc.h │ │ ├── modes │ │ ├── floor_all.h │ │ ├── psych_11.h │ │ ├── psych_16.h │ │ ├── psych_44.h │ │ ├── psych_8.h │ │ ├── residue_16.h │ │ ├── residue_44.h │ │ ├── residue_44p51.h │ │ ├── residue_44u.h │ │ ├── residue_8.h │ │ ├── setup_11.h │ │ ├── setup_16.h │ │ ├── setup_22.h │ │ ├── setup_32.h │ │ ├── setup_44.h │ │ ├── setup_44p51.h │ │ ├── setup_44u.h │ │ ├── setup_8.h │ │ └── setup_X.h │ │ ├── os.h │ │ ├── psy.c │ │ ├── psy.h │ │ ├── registry.c │ │ ├── registry.h │ │ ├── res0.c │ │ ├── scales.h │ │ ├── sharedbook.c │ │ ├── smallft.c │ │ ├── smallft.h │ │ ├── synthesis.c │ │ ├── vorbisfile.c │ │ ├── window.c │ │ └── window.h ├── qcommon │ ├── cm_load.c │ ├── cm_local.h │ ├── cm_patch.c │ ├── cm_patch.h │ ├── cm_polylib.c │ ├── cm_polylib.h │ ├── cm_public.h │ ├── cm_test.c │ ├── cm_trace.c │ ├── cmd.c │ ├── common.c │ ├── cvar.c │ ├── files.c │ ├── history.c │ ├── huffman.c │ ├── huffman_static.c │ ├── json.h │ ├── keys.c │ ├── md4.c │ ├── md5.c │ ├── msg.c │ ├── net_chan.c │ ├── net_ip.c │ ├── puff.c │ ├── puff.h │ ├── q_math.c │ ├── q_platform.h │ ├── q_shared.c │ ├── q_shared.h │ ├── qcommon.h │ ├── qfiles.h │ ├── surfaceflags.h │ ├── unzip.c │ ├── unzip.h │ ├── vm.c │ ├── vm_aarch64.c │ ├── vm_armv7l.c │ ├── vm_interpreted.c │ ├── vm_local.h │ └── vm_x86.c ├── renderer │ ├── qgl.h │ ├── tr_arb.c │ ├── tr_backend.c │ ├── tr_bsp.c │ ├── tr_cmds.c │ ├── tr_common.h │ ├── tr_curve.c │ ├── tr_image.c │ ├── tr_init.c │ ├── tr_light.c │ ├── tr_local.h │ ├── tr_main.c │ ├── tr_marks.c │ ├── tr_mesh.c │ ├── tr_model.c │ ├── tr_scene.c │ ├── tr_shade.c │ ├── tr_shade_calc.c │ ├── tr_shader.c │ ├── tr_sky.c │ ├── tr_surface.c │ ├── tr_vbo.c │ └── tr_world.c ├── renderercommon │ ├── tr_image_bmp.c │ ├── tr_image_jpg.c │ ├── tr_image_pcx.c │ ├── tr_image_png.c │ ├── tr_image_tga.c │ ├── tr_noise.c │ ├── tr_public.h │ ├── tr_types.h │ └── vulkan │ │ ├── vk_platform.h │ │ ├── vulkan.h │ │ ├── vulkan_core.h │ │ ├── vulkan_win32.h │ │ ├── vulkan_xlib.h │ │ └── vulkan_xlib_xrandr.h ├── renderervk.zip ├── sdl │ ├── sdl_gamma.c │ ├── sdl_glimp.c │ ├── sdl_glw.h │ ├── sdl_icon.h │ ├── sdl_input.c │ └── sdl_snd.c ├── server │ ├── server.h │ ├── sv_bot.c │ ├── sv_ccmds.c │ ├── sv_client.c │ ├── sv_filter.c │ ├── sv_game.c │ ├── sv_init.c │ ├── sv_main.c │ ├── sv_net_chan.c │ ├── sv_snapshot.c │ └── sv_world.c ├── ui │ └── ui_public.h ├── unix │ ├── linux_local.h │ ├── linux_signals.c │ ├── quake3.png │ ├── quake3_flat.icns │ ├── unix_main.c │ └── unix_shared.c └── win32 │ ├── background.bmp │ ├── clear.bmp │ ├── glw_win.h │ ├── q3.manifest │ ├── qe3.ico │ ├── resource.h │ ├── win_local.h │ ├── win_main.c │ ├── win_resource.rc │ ├── win_shared.c │ └── win_syscon.c ├── docs ├── LinuxSupport │ ├── CHANGES-1.32.txt │ ├── INSTALL │ ├── index.html │ ├── udp_wide_README.txt │ └── udp_wide_broadcast.patch ├── README.Linux ├── README.Q3Test ├── filter.txt ├── firewall │ ├── fw-openwrt.txt │ └── fw-q3host.sh ├── q3url_add.cmd ├── q3url_rem.cmd ├── quake3e-FAQ.txt ├── quake3e-changes.txt ├── quake3e.htm └── quake3e.md ├── id-readme.txt ├── make-macosx-app.sh └── make-macosx-ub2.sh /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | output/ 3 | .vs/ 4 | .vscode/ 5 | *.user 6 | cmake-* 7 | .idea 8 | -------------------------------------------------------------------------------- /code/asm/common_x64.asm: -------------------------------------------------------------------------------- 1 | ; common x86_64 assembler code form MSVC 2 | 3 | .code 4 | 5 | ; params : RCX - void *jmp_buf[10], RSP[0] = callee addr, RSP[8] - callee stack pointer 6 | Q_setjmp_c PROC 7 | ; store RIP in jmp_buf[0] 8 | mov rax, [rsp+0] 9 | mov [rcx+ 0], rax 10 | ; store RSP in jmp_buf[1] 11 | lea rax, [rsp+8] 12 | mov [rcx+ 8], rax 13 | ; store all remaining regs 14 | mov [rcx+16], rbp 15 | mov [rcx+24], rbx 16 | mov [rcx+32], rsi 17 | mov [rcx+40], rdi 18 | mov [rcx+48], r12 19 | mov [rcx+56], r13 20 | mov [rcx+64], r14 21 | mov [rcx+72], r15 22 | ; set normal return code (0) 23 | xor eax, eax 24 | ret 25 | Q_setjmp_c ENDP 26 | 27 | 28 | ; params : RCX - void *jmp_buf[10], RDX - return code 29 | Q_longjmp_c PROC 30 | ; restore registers 31 | mov r15, [rcx+72] 32 | mov r14, [rcx+64] 33 | mov r13, [rcx+56] 34 | mov r12, [rcx+48] 35 | mov rdi, [rcx+40] 36 | mov rsi, [rcx+32] 37 | mov rbx, [rcx+24] 38 | mov rbp, [rcx+16] 39 | mov rsp, [rcx+ 8] 40 | ; set return code in EAX 41 | mov eax, edx 42 | ; jump to RIP 43 | jmp qword ptr [rcx+ 0] 44 | Q_longjmp_c ENDP 45 | 46 | 47 | ; input: RCX=eax, RDX=ecx, R8=out, R9=unused/scratch 48 | CPUID_EX PROC 49 | mov r9, rbx ; push rbx 50 | mov eax, ecx 51 | mov ecx, edx 52 | cpuid 53 | mov dword ptr [r8+0], eax 54 | mov dword ptr [r8+4], ebx 55 | mov dword ptr [r8+8], ecx 56 | mov dword ptr [r8+12], edx 57 | mov rbx, r9 ; pop rbx 58 | ret 59 | CPUID_EX ENDP 60 | 61 | END 62 | -------------------------------------------------------------------------------- /code/asm/qasm.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | #ifndef __ASM_I386__ 23 | #define __ASM_I386__ 24 | 25 | #include "../qcommon/q_platform.h" 26 | 27 | #if defined(__MINGW32__) || defined(MACOS_X) 28 | #undef ELF 29 | #endif 30 | 31 | #ifdef __ELF__ 32 | .section .note.GNU-stack,"",@progbits 33 | #endif 34 | 35 | #ifdef ELF 36 | #define C(label) label 37 | #else 38 | #define C(label) _##label 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /code/asm/snd_mix_mmx.s: -------------------------------------------------------------------------------- 1 | #include "qasm.h" 2 | 3 | #if id386 4 | 5 | #ifndef __clang__ 6 | .arch athlon 7 | #endif 8 | 9 | .intel_syntax noprefix 10 | 11 | .text 12 | 13 | .globl C(S_WriteLinearBlastStereo16_MMX) 14 | C(S_WriteLinearBlastStereo16_MMX): 15 | 16 | push ebx 17 | push esi 18 | push edi 19 | mov esi,snd_p 20 | mov edi,snd_out 21 | mov ebx,snd_linear_count 22 | test ebx,ebx 23 | jz LExit 24 | mov ecx,esi 25 | and ecx,63 26 | jz LMain 27 | and ecx,3 28 | jnz LTail 29 | shr ecx,2 30 | not ecx 31 | add ecx,17 32 | LClamp1: 33 | mov eax,[esi] 34 | sar eax,8 35 | cmp eax,32767 36 | jg LClampHigh1 37 | cmp eax,-32768 38 | jnl LClampDone1 39 | mov eax,-32768 40 | jmp LClampDone1 41 | LClampHigh1: 42 | mov eax,32767 43 | LClampDone1: 44 | mov [edi],ax 45 | add esi,4 46 | add edi,2 47 | dec ebx 48 | jz LExit 49 | dec ecx 50 | jnz LClamp1 51 | LMain: 52 | mov ecx,ebx 53 | shr ecx,4 54 | jz LTail 55 | and ebx,15 56 | LAgain: 57 | movq mm0, qword ptr [esi+ 0] 58 | movq mm1, qword ptr [esi+ 8] 59 | movq mm2, qword ptr [esi+16] 60 | movq mm3, qword ptr [esi+24] 61 | movq mm4, qword ptr [esi+32] 62 | movq mm5, qword ptr [esi+40] 63 | movq mm6, qword ptr [esi+48] 64 | movq mm7, qword ptr [esi+56] 65 | psrad mm0,8 66 | psrad mm1,8 67 | psrad mm2,8 68 | psrad mm3,8 69 | psrad mm4,8 70 | psrad mm5,8 71 | psrad mm6,8 72 | psrad mm7,8 73 | packssdw mm0, mm1 74 | packssdw mm2, mm3 75 | packssdw mm4, mm5 76 | packssdw mm6, mm7 77 | movq qword ptr [edi+ 0], mm0 78 | movq qword ptr [edi+ 8], mm2 79 | movq qword ptr [edi+16], mm4 80 | movq qword ptr [edi+24], mm6 81 | add esi, 64 82 | add edi, 32 83 | dec ecx 84 | jnz LAgain 85 | LTail: 86 | test ebx, ebx 87 | jz LEnd 88 | LClamp2: 89 | mov eax,[esi] 90 | sar eax,8 91 | cmp eax,32767 92 | jg LClampHigh2 93 | cmp eax,-32768 94 | jnl LClampDone2 95 | mov eax,-32768 96 | jmp LClampDone2 97 | LClampHigh2: 98 | mov eax,32767 99 | LClampDone2: 100 | mov [edi],ax 101 | add esi,4 102 | add edi,2 103 | dec ebx 104 | jnz LClamp2 105 | LEnd: 106 | emms 107 | LExit: 108 | pop edi 109 | pop esi 110 | pop ebx 111 | ret 112 | 113 | #endif -------------------------------------------------------------------------------- /code/asm/snd_mix_sse.s: -------------------------------------------------------------------------------- 1 | #include "qasm.h" 2 | 3 | #if id386 4 | 5 | #ifndef __clang__ 6 | .arch athlon 7 | #endif 8 | 9 | .intel_syntax noprefix 10 | 11 | .text 12 | 13 | .globl C(S_WriteLinearBlastStereo16_SSE) 14 | C(S_WriteLinearBlastStereo16_SSE): 15 | 16 | push ebx 17 | push esi 18 | push edi 19 | mov esi,snd_p 20 | mov edi,snd_out 21 | mov ebx,snd_linear_count 22 | test ebx,ebx 23 | jz LExit 24 | mov ecx,esi 25 | and ecx,63 26 | jz LMain 27 | and ecx,3 28 | jnz LTail 29 | shr ecx,2 30 | not ecx 31 | add ecx,17 32 | LClamp1: 33 | mov eax,[esi] 34 | sar eax,8 35 | cmp eax,32767 36 | jg LClampHigh1 37 | cmp eax,-32768 38 | jnl LClampDone1 39 | mov eax,-32768 40 | jmp LClampDone1 41 | LClampHigh1: 42 | mov eax,32767 43 | LClampDone1: 44 | mov [edi],ax 45 | add esi,4 46 | add edi,2 47 | dec ebx 48 | jz LExit 49 | dec ecx 50 | jnz LClamp1 51 | LMain: 52 | mov ecx,ebx 53 | shr ecx,4 54 | jz LTail 55 | and ebx,15 56 | LAgain: 57 | movq mm0, qword ptr [esi+ 0] 58 | movq mm1, qword ptr [esi+ 8] 59 | movq mm2, qword ptr [esi+16] 60 | movq mm3, qword ptr [esi+24] 61 | movq mm4, qword ptr [esi+32] 62 | movq mm5, qword ptr [esi+40] 63 | movq mm6, qword ptr [esi+48] 64 | movq mm7, qword ptr [esi+56] 65 | psrad mm0,8 66 | psrad mm1,8 67 | psrad mm2,8 68 | psrad mm3,8 69 | psrad mm4,8 70 | psrad mm5,8 71 | psrad mm6,8 72 | psrad mm7,8 73 | packssdw mm0, mm1 74 | packssdw mm2, mm3 75 | packssdw mm4, mm5 76 | packssdw mm6, mm7 77 | movntq qword ptr [edi+ 0], mm0 78 | movntq qword ptr [edi+ 8], mm2 79 | movntq qword ptr [edi+16], mm4 80 | movntq qword ptr [edi+24], mm6 81 | add esi, 64 82 | add edi, 32 83 | dec ecx 84 | jnz LAgain 85 | LTail: 86 | test ebx, ebx 87 | jz LEnd 88 | LClamp2: 89 | mov eax,[esi] 90 | sar eax,8 91 | cmp eax,32767 92 | jg LClampHigh2 93 | cmp eax,-32768 94 | jnl LClampDone2 95 | mov eax,-32768 96 | jmp LClampDone2 97 | LClampHigh2: 98 | mov eax,32767 99 | LClampDone2: 100 | mov [edi],ax 101 | add esi,4 102 | add edi,2 103 | dec ebx 104 | jnz LClamp2 105 | LEnd: 106 | sfence 107 | emms 108 | LExit: 109 | pop edi 110 | pop esi 111 | pop ebx 112 | ret 113 | 114 | #endif -------------------------------------------------------------------------------- /code/asm/snd_mix_x64.asm: -------------------------------------------------------------------------------- 1 | 2 | ; this is mostly copy-pasted x86-version with x86_64-related fixes and comments 3 | ; runs about 4x times faster than C version 4 | ; saves about 3M ticks each second 5 | 6 | .code 7 | 8 | S_WriteLinearBlastStereo16_SSE_x64 PROC 9 | 10 | push rsi 11 | push rdi 12 | push rbx 13 | 14 | mov rsi, rcx ; snd_p 15 | mov rdi, rdx ; snd_out 16 | mov rbx, r8 ; snd_linear_count 17 | 18 | test ebx,ebx 19 | jz LExit 20 | mov ecx,esi ; try to align source memory to 64 bytes boundary 21 | and ecx,63 22 | jz LMain ; if already aligned - goto main loop 23 | and ecx,3 24 | jnz LTail ; if not dword-aligned - tail work & exit, should never happen though 25 | shr ecx,2 ; get dword count to align source data 26 | not ecx 27 | add ecx,17 28 | 29 | LClamp1: 30 | mov eax,[rsi] 31 | sar eax,8 32 | cmp eax,32767 33 | jg LClampHigh1 34 | cmp eax,-32768 35 | jnl LClampDone1 36 | mov eax,-32768 37 | jmp LClampDone1 38 | LClampHigh1: 39 | mov eax,32767 40 | LClampDone1: 41 | mov [rdi],ax 42 | add rsi,4 43 | add rdi,2 44 | dec ebx 45 | jz LExit ; check if nothing left during alignment 46 | dec ecx 47 | jnz LClamp1 48 | 49 | LMain: 50 | mov ecx,ebx 51 | shr ecx,4 52 | jz LTail ; not enough 64-byte blocks 53 | and ebx, 15 ; remainder for tail job 54 | 55 | LAgain: 56 | movq mm0, qword ptr [rsi+ 0] 57 | movq mm1, qword ptr [rsi+ 8] 58 | movq mm2, qword ptr [rsi+16] 59 | movq mm3, qword ptr [rsi+24] 60 | movq mm4, qword ptr [rsi+32] 61 | movq mm5, qword ptr [rsi+40] 62 | movq mm6, qword ptr [rsi+48] 63 | movq mm7, qword ptr [rsi+56] 64 | psrad mm0,8 65 | psrad mm1,8 66 | psrad mm2,8 67 | psrad mm3,8 68 | psrad mm4,8 69 | psrad mm5,8 70 | psrad mm6,8 71 | psrad mm7,8 72 | packssdw mm0, mm1 73 | packssdw mm2, mm3 74 | packssdw mm4, mm5 75 | packssdw mm6, mm7 76 | movntq qword ptr [rdi+ 0], mm0 77 | movntq qword ptr [rdi+ 8], mm2 78 | movntq qword ptr [rdi+16], mm4 79 | movntq qword ptr [rdi+24], mm6 80 | add rsi, 64 81 | add rdi, 32 82 | dec ecx 83 | jnz LAgain 84 | 85 | LTail: 86 | test ebx, ebx 87 | jz LEnd 88 | 89 | LClamp2: 90 | mov eax,[rsi] 91 | sar eax,8 92 | cmp eax,32767 93 | jg LClampHigh2 94 | cmp eax,-32768 95 | jnl LClampDone2 96 | mov eax,-32768 97 | jmp LClampDone2 98 | LClampHigh2: 99 | mov eax,32767 100 | LClampDone2: 101 | mov [rdi],ax 102 | add rsi,4 103 | add rdi,2 104 | dec ebx 105 | jnz LClamp2 106 | 107 | LEnd: 108 | sfence 109 | emms 110 | 111 | LExit: 112 | pop rbx 113 | pop rdi 114 | pop rsi 115 | ret 116 | 117 | S_WriteLinearBlastStereo16_SSE_x64 ENDP 118 | 119 | END -------------------------------------------------------------------------------- /code/asm/snd_mix_x86_64.s: -------------------------------------------------------------------------------- 1 | #if defined(__APPLE__) 2 | #undef ELF 3 | #endif 4 | 5 | #ifdef __ELF__ 6 | .section .note.GNU-stack,"",@progbits 7 | #endif 8 | 9 | #ifdef ELF 10 | #define C(label) label 11 | #else 12 | #define C(label) _##label 13 | #endif 14 | 15 | .intel_syntax noprefix 16 | 17 | .text 18 | 19 | .globl C(S_WriteLinearBlastStereo16_SSE_x64) 20 | C(S_WriteLinearBlastStereo16_SSE_x64): 21 | push rbx 22 | #ifdef _WIN32 23 | // RCX RDX R8 R9 24 | push rsi 25 | push rdi 26 | mov rsi, rcx 27 | mov rdi, rdx 28 | mov ebx, r8d 29 | #else 30 | // RDI RSI RDX RCX R8 R9 31 | xchg rsi, rdi 32 | mov ebx, edx 33 | #endif 34 | test ebx,ebx 35 | jz LExit 36 | mov ecx,esi 37 | and ecx,63 38 | jz LMain 39 | and ecx,3 40 | jnz LTail 41 | shr ecx,2 42 | not ecx 43 | add ecx,17 44 | LClamp1: 45 | mov eax,[rsi] 46 | sar eax,8 47 | cmp eax,32767 48 | jg LClampHigh1 49 | cmp eax,-32768 50 | jnl LClampDone1 51 | mov eax,-32768 52 | jmp LClampDone1 53 | LClampHigh1: 54 | mov eax,32767 55 | LClampDone1: 56 | mov [rdi],ax 57 | add rsi,4 58 | add rdi,2 59 | dec ebx 60 | jz LExit 61 | dec ecx 62 | jnz LClamp1 63 | LMain: 64 | mov ecx,ebx 65 | shr ecx,4 66 | jz LTail 67 | and ebx,15 68 | LAgain: 69 | movq mm0, qword ptr [rsi+ 0] 70 | movq mm1, qword ptr [rsi+ 8] 71 | movq mm2, qword ptr [rsi+16] 72 | movq mm3, qword ptr [rsi+24] 73 | movq mm4, qword ptr [rsi+32] 74 | movq mm5, qword ptr [rsi+40] 75 | movq mm6, qword ptr [rsi+48] 76 | movq mm7, qword ptr [rsi+56] 77 | psrad mm0,8 78 | psrad mm1,8 79 | psrad mm2,8 80 | psrad mm3,8 81 | psrad mm4,8 82 | psrad mm5,8 83 | psrad mm6,8 84 | psrad mm7,8 85 | packssdw mm0, mm1 86 | packssdw mm2, mm3 87 | packssdw mm4, mm5 88 | packssdw mm6, mm7 89 | movntq qword ptr [rdi+ 0], mm0 90 | movntq qword ptr [rdi+ 8], mm2 91 | movntq qword ptr [rdi+16], mm4 92 | movntq qword ptr [rdi+24], mm6 93 | add rsi, 64 94 | add rdi, 32 95 | dec ecx 96 | jnz LAgain 97 | LTail: 98 | test ebx, ebx 99 | jz LEnd 100 | LClamp2: 101 | mov eax,[rsi] 102 | sar eax,8 103 | cmp eax,32767 104 | jg LClampHigh2 105 | cmp eax,-32768 106 | jnl LClampDone2 107 | mov eax,-32768 108 | jmp LClampDone2 109 | LClampHigh2: 110 | mov eax,32767 111 | LClampDone2: 112 | mov [rdi],ax 113 | add rsi,4 114 | add rdi,2 115 | dec ebx 116 | jnz LClamp2 117 | LEnd: 118 | sfence 119 | emms 120 | LExit: 121 | #ifdef _WIN32 122 | pop rdi 123 | pop rsi 124 | #endif 125 | pop rbx 126 | ret 127 | -------------------------------------------------------------------------------- /code/botlib/be_aas_bsp.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_bsp.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_bsp.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifdef AASINTERN 33 | //loads the given BSP file 34 | int AAS_LoadBSPFile(void); 35 | //dump the loaded BSP data 36 | void AAS_DumpBSPData(void); 37 | //unlink the given entity from the bsp tree leaves 38 | void AAS_UnlinkFromBSPLeaves(bsp_link_t *leaves); 39 | //link the given entity to the bsp tree leaves of the given model 40 | bsp_link_t *AAS_BSPLinkEntity(vec3_t absmins, 41 | vec3_t absmaxs, 42 | int entnum, 43 | int modelnum); 44 | 45 | //calculates collision with given entity 46 | qboolean AAS_EntityCollision(int entnum, 47 | vec3_t start, 48 | vec3_t boxmins, 49 | vec3_t boxmaxs, 50 | vec3_t end, 51 | int contentmask, 52 | bsp_trace_t *trace); 53 | //for debugging 54 | void AAS_PrintFreeBSPLinks(char *str); 55 | // 56 | #endif //AASINTERN 57 | 58 | #define MAX_EPAIRKEY 128 59 | 60 | //trace through the world 61 | bsp_trace_t AAS_Trace( vec3_t start, 62 | vec3_t mins, 63 | vec3_t maxs, 64 | vec3_t end, 65 | int passent, 66 | int contentmask); 67 | //returns the contents at the given point 68 | int AAS_PointContents(vec3_t point); 69 | //gets the mins, maxs and origin of a BSP model 70 | void AAS_BSPModelMinsMaxsOrigin(int modelnum, vec3_t angles, vec3_t mins, vec3_t maxs, vec3_t origin); 71 | //handle to the next bsp entity 72 | int AAS_NextBSPEntity(int ent); 73 | //return the value of the BSP epair key 74 | int AAS_ValueForBSPEpairKey(int ent, const char *key, char *value, int size); 75 | //get a vector for the BSP epair key 76 | int AAS_VectorForBSPEpairKey(int ent, const char *key, vec3_t v); 77 | //get a float for the BSP epair key 78 | int AAS_FloatForBSPEpairKey(int ent, const char *key, float *value); 79 | //get an integer for the BSP epair key 80 | int AAS_IntForBSPEpairKey(int ent, const char *key, int *value); 81 | 82 | -------------------------------------------------------------------------------- /code/botlib/be_aas_cluster.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_cluster.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_cluster.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifdef AASINTERN 33 | //initialize the AAS clustering 34 | void AAS_InitClustering(void); 35 | // 36 | void AAS_SetViewPortalsAsClusterPortals(void); 37 | #endif //AASINTERN 38 | 39 | -------------------------------------------------------------------------------- /code/botlib/be_aas_debug.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_debug.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_debug.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | //clear the shown debug lines 33 | void AAS_ClearShownDebugLines(void); 34 | // 35 | void AAS_ClearShownPolygons(void); 36 | //show a debug line 37 | void AAS_DebugLine(vec3_t start, vec3_t end, int color); 38 | //show a permenent line 39 | void AAS_PermanentLine(vec3_t start, vec3_t end, int color); 40 | //show a permanent cross 41 | void AAS_DrawPermanentCross(vec3_t origin, float size, int color); 42 | //draw a cross in the plane 43 | void AAS_DrawPlaneCross(vec3_t point, vec3_t normal, float dist, int type, int color); 44 | //show a bounding box 45 | void AAS_ShowBoundingBox(vec3_t origin, vec3_t mins, vec3_t maxs); 46 | //show a face 47 | void AAS_ShowFace(int facenum); 48 | //show an area 49 | void AAS_ShowArea(int areanum, int groundfacesonly); 50 | // 51 | void AAS_ShowAreaPolygons(int areanum, int color, int groundfacesonly); 52 | //draw a cross 53 | void AAS_DrawCross(vec3_t origin, float size, int color); 54 | //print the travel type 55 | void AAS_PrintTravelType(int traveltype); 56 | //draw an arrow 57 | void AAS_DrawArrow(vec3_t start, vec3_t end, int linecolor, int arrowcolor); 58 | //visualize the given reachability 59 | void AAS_ShowReachability(struct aas_reachability_s *reach); 60 | //show the reachable areas from the given area 61 | void AAS_ShowReachableAreas(int areanum); 62 | 63 | -------------------------------------------------------------------------------- /code/botlib/be_aas_entity.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_entity.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_entity.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifdef AASINTERN 33 | //invalidates all entity infos 34 | void AAS_InvalidateEntities(void); 35 | //unlink not updated entities 36 | void AAS_UnlinkInvalidEntities(void); 37 | //resets the entity AAS and BSP links (sets areas and leaves pointers to NULL) 38 | void AAS_ResetEntityLinks(void); 39 | //updates an entity 40 | int AAS_UpdateEntity(int ent, bot_entitystate_t *state); 41 | //gives the entity data used for collision detection 42 | #endif //AASINTERN 43 | //returns the BSP model number of the entity 44 | int AAS_EntityModelNum(int entnum); 45 | //returns the origin of an entity with the given model number 46 | int AAS_OriginOfMoverWithModelNum(int modelnum, vec3_t origin); 47 | //returns the info of the given entity 48 | void AAS_EntityInfo(int entnum, aas_entityinfo_t *info); 49 | //returns the next entity 50 | int AAS_NextEntity(int entnum); 51 | //returns the entity type 52 | int AAS_EntityType(int entnum); 53 | //returns the model index of the entity 54 | int AAS_EntityModelindex(int entnum); 55 | 56 | -------------------------------------------------------------------------------- /code/botlib/be_aas_file.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_file.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_file.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifdef AASINTERN 33 | //loads the AAS file with the given name 34 | int AAS_LoadAASFile(char *filename); 35 | //writes an AAS file with the given name 36 | qboolean AAS_WriteAASFile(char *filename); 37 | //dumps the loaded AAS data 38 | void AAS_DumpAASData(void); 39 | //print AAS file information 40 | void AAS_FileInfo(void); 41 | #endif //AASINTERN 42 | 43 | -------------------------------------------------------------------------------- /code/botlib/be_aas_funcs.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_funcs.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_funcs.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifndef BSPCINCLUDE 33 | 34 | #include "be_aas_main.h" 35 | #include "be_aas_entity.h" 36 | #include "be_aas_sample.h" 37 | #include "be_aas_cluster.h" 38 | #include "be_aas_reach.h" 39 | #include "be_aas_route.h" 40 | #include "be_aas_routealt.h" 41 | #include "be_aas_debug.h" 42 | #include "be_aas_file.h" 43 | #include "be_aas_optimize.h" 44 | #include "be_aas_bsp.h" 45 | #include "be_aas_move.h" 46 | 47 | #endif //BSPCINCLUDE 48 | -------------------------------------------------------------------------------- /code/botlib/be_aas_main.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_main.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_main.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifdef AASINTERN 33 | 34 | extern aas_t aasworld; 35 | 36 | //AAS error message 37 | void QDECL AAS_Error(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 38 | //setup AAS with the given number of entities and clients 39 | int AAS_Setup(void); 40 | //shutdown AAS 41 | void AAS_Shutdown(void); 42 | //start a new map 43 | int AAS_LoadMap(const char *mapname); 44 | //start a new time frame 45 | int AAS_StartFrame(float time); 46 | #endif //AASINTERN 47 | 48 | //returns true if AAS is initialized 49 | int AAS_Initialized(void); 50 | //returns true if the AAS file is loaded 51 | int AAS_Loaded(void); 52 | //returns the current time 53 | float AAS_Time(void); 54 | // 55 | void AAS_ProjectPointOntoVector( vec3_t point, vec3_t vStart, vec3_t vEnd, vec3_t vProj ); 56 | -------------------------------------------------------------------------------- /code/botlib/be_aas_optimize.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_optimize.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_optimize.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | void AAS_Optimize(void); 33 | 34 | -------------------------------------------------------------------------------- /code/botlib/be_aas_reach.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_reach.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_reach.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifdef AASINTERN 33 | //initialize calculating the reachabilities 34 | void AAS_InitReachability(void); 35 | //continue calculating the reachabilities 36 | int AAS_ContinueInitReachability(float time); 37 | #endif //AASINTERN 38 | 39 | //returns true if the are has reachabilities to other areas 40 | int AAS_AreaReachability(int areanum); 41 | //returns the best reachable area and goal origin for a bounding box at the given origin 42 | int AAS_BestReachableArea(vec3_t origin, vec3_t mins, vec3_t maxs, vec3_t goalorigin); 43 | //returns the best jumppad area from which the bbox at origin is reachable 44 | int AAS_BestReachableFromJumpPadArea(vec3_t origin, vec3_t mins, vec3_t maxs); 45 | //returns the next reachability using the given model 46 | int AAS_NextModelReachability(int num, int modelnum); 47 | //returns the total area of the ground faces of the given area 48 | float AAS_AreaGroundFaceArea(int areanum); 49 | //returns true if the area is crouch only 50 | int AAS_AreaCrouch(int areanum); 51 | //returns true if a player can swim in this area 52 | int AAS_AreaSwim(int areanum); 53 | //returns true if the area is filled with a liquid 54 | int AAS_AreaLiquid(int areanum); 55 | //returns true if the area contains lava 56 | int AAS_AreaLava(int areanum); 57 | //returns true if the area contains slime 58 | int AAS_AreaSlime(int areanum); 59 | //returns true if the area has one or more ground faces 60 | int AAS_AreaGrounded(int areanum); 61 | //returns true if the area is a jump pad 62 | int AAS_AreaJumpPad(int areanum); 63 | //returns true if the area is donotenter 64 | int AAS_AreaDoNotEnter(int areanum); 65 | -------------------------------------------------------------------------------- /code/botlib/be_aas_route.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_route.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_route.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifdef AASINTERN 33 | //initialize the AAS routing 34 | void AAS_InitRouting(void); 35 | //free the AAS routing caches 36 | void AAS_FreeRoutingCaches(void); 37 | //returns the travel time from start to end in the given area 38 | unsigned short int AAS_AreaTravelTime(int areanum, vec3_t start, vec3_t end); 39 | // 40 | void AAS_CreateAllRoutingCache(void); 41 | void AAS_WriteRouteCache(void); 42 | // 43 | void AAS_RoutingInfo(void); 44 | #endif //AASINTERN 45 | 46 | //returns the travel flag for the given travel type 47 | int AAS_TravelFlagForType(int traveltype); 48 | //return the travel flag(s) for traveling through this area 49 | int AAS_AreaContentsTravelFlags(int areanum); 50 | //returns the index of the next reachability for the given area 51 | int AAS_NextAreaReachability(int areanum, int reachnum); 52 | //returns the reachability with the given index 53 | void AAS_ReachabilityFromNum(int num, struct aas_reachability_s *reach); 54 | //returns a random goal area and goal origin 55 | int AAS_RandomGoalArea(int areanum, int travelflags, int *goalareanum, vec3_t goalorigin); 56 | //enable or disable an area for routing 57 | int AAS_EnableRoutingArea(int areanum, int enable); 58 | //returns the travel time within the given area from start to end 59 | unsigned short int AAS_AreaTravelTime(int areanum, vec3_t start, vec3_t end); 60 | //returns the travel time from the area to the goal area using the given travel flags 61 | int AAS_AreaTravelTimeToGoalArea(int areanum, vec3_t origin, int goalareanum, int travelflags); 62 | //predict a route up to a stop event 63 | int AAS_PredictRoute(struct aas_predictroute_s *route, int areanum, vec3_t origin, 64 | int goalareanum, int travelflags, int maxareas, int maxtime, 65 | int stopevent, int stopcontents, int stoptfl, int stopareanum); 66 | 67 | 68 | -------------------------------------------------------------------------------- /code/botlib/be_aas_routealt.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_routealt.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_routealt.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifdef AASINTERN 33 | void AAS_InitAlternativeRouting(void); 34 | void AAS_ShutdownAlternativeRouting(void); 35 | #endif //AASINTERN 36 | 37 | 38 | int AAS_AlternativeRouteGoals(vec3_t start, int startareanum, vec3_t goal, int goalareanum, int travelflags, 39 | aas_altroutegoal_t *altroutegoals, int maxaltroutegoals, 40 | int type); 41 | -------------------------------------------------------------------------------- /code/botlib/be_aas_sample.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_aas_sample.h 25 | * 26 | * desc: AAS 27 | * 28 | * $Archive: /source/code/botlib/be_aas_sample.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #ifdef AASINTERN 33 | void AAS_InitAASLinkHeap(void); 34 | void AAS_InitAASLinkedEntities(void); 35 | void AAS_FreeAASLinkHeap(void); 36 | void AAS_FreeAASLinkedEntities(void); 37 | aas_face_t *AAS_TraceEndFace(aas_trace_t *trace); 38 | aas_plane_t *AAS_PlaneFromNum(int planenum); 39 | aas_link_t *AAS_AASLinkEntity(vec3_t absmins, vec3_t absmaxs, int entnum); 40 | aas_link_t *AAS_LinkEntityClientBBox(vec3_t absmins, vec3_t absmaxs, int entnum, int presencetype); 41 | qboolean AAS_PointInsideFace(int facenum, vec3_t point, float epsilon); 42 | void AAS_UnlinkFromAreas(aas_link_t *areas); 43 | #endif //AASINTERN 44 | 45 | //returns the mins and maxs of the bounding box for the given presence type 46 | void AAS_PresenceTypeBoundingBox(int presencetype, vec3_t mins, vec3_t maxs); 47 | //returns the cluster the area is in (negative portal number if the area is a portal) 48 | int AAS_AreaCluster(int areanum); 49 | //returns the presence type(s) of the area 50 | int AAS_AreaPresenceType(int areanum); 51 | //returns the presence type(s) at the given point 52 | int AAS_PointPresenceType(vec3_t point); 53 | //returns the result of the trace of a client bbox 54 | aas_trace_t AAS_TraceClientBBox(vec3_t start, vec3_t end, int presencetype, int passent); 55 | //stores the areas the trace went through and returns the number of passed areas 56 | int AAS_TraceAreas(vec3_t start, vec3_t end, int *areas, vec3_t *points, int maxareas); 57 | //returns the areas the bounding box is in 58 | int AAS_BBoxAreas(vec3_t absmins, vec3_t absmaxs, int *areas, int maxareas); 59 | //return area information 60 | int AAS_AreaInfo( int areanum, aas_areainfo_t *info ); 61 | //returns the area the point is in 62 | int AAS_PointAreaNum(vec3_t point); 63 | // 64 | int AAS_PointReachabilityAreaIndex( vec3_t point ); 65 | -------------------------------------------------------------------------------- /code/botlib/be_ai_char.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | // 23 | 24 | /***************************************************************************** 25 | * name: be_ai_char.h 26 | * 27 | * desc: bot characters 28 | * 29 | * $Archive: /source/code/botlib/be_ai_char.h $ 30 | * 31 | *****************************************************************************/ 32 | 33 | //loads a bot character from a file 34 | int BotLoadCharacter(const char *charfile, float skill); 35 | //frees a bot character 36 | void BotFreeCharacter(int character); 37 | //returns a float characteristic 38 | float Characteristic_Float(int character, int index); 39 | //returns a bounded float characteristic 40 | float Characteristic_BFloat(int character, int index, float min, float max); 41 | //returns an integer characteristic 42 | int Characteristic_Integer(int character, int index); 43 | //returns a bounded integer characteristic 44 | int Characteristic_BInteger(int character, int index, int min, int max); 45 | //returns a string characteristic 46 | void Characteristic_String(int character, int index, char *buf, int size); 47 | //free cached bot characters 48 | void BotShutdownCharacters(void); 49 | -------------------------------------------------------------------------------- /code/botlib/be_ai_weight.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_ai_weight.h 25 | * 26 | * desc: fuzzy weights 27 | * 28 | * $Archive: /source/code/botlib/be_ai_weight.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #define WT_BALANCE 1 33 | #define MAX_WEIGHTS 128 34 | 35 | //fuzzy separator 36 | typedef struct fuzzyseperator_s 37 | { 38 | int index; 39 | int value; 40 | int type; 41 | float weight; 42 | float minweight; 43 | float maxweight; 44 | struct fuzzyseperator_s *child; 45 | struct fuzzyseperator_s *next; 46 | } fuzzyseperator_t; 47 | 48 | //fuzzy weight 49 | typedef struct weight_s 50 | { 51 | char *name; 52 | struct fuzzyseperator_s *firstseperator; 53 | } weight_t; 54 | 55 | //weight configuration 56 | typedef struct weightconfig_s 57 | { 58 | int numweights; 59 | weight_t weights[MAX_WEIGHTS]; 60 | char filename[MAX_QPATH]; 61 | } weightconfig_t; 62 | 63 | //reads a weight configuration 64 | weightconfig_t *ReadWeightConfig(const char *filename); 65 | //free a weight configuration 66 | void FreeWeightConfig(weightconfig_t *config); 67 | //writes a weight configuration, returns true if successful 68 | qboolean WriteWeightConfig(char *filename, weightconfig_t *config); 69 | //find the fuzzy weight with the given name 70 | int FindFuzzyWeight(const weightconfig_t *wc, const char *name); 71 | //returns the fuzzy weight for the given inventory and weight 72 | float FuzzyWeight(int *inventory, weightconfig_t *wc, int weightnum); 73 | float FuzzyWeightUndecided(int *inventory, weightconfig_t *wc, int weightnum); 74 | //scales the weight with the given name 75 | void ScaleWeight(weightconfig_t *config, char *name, float scale); 76 | //scale the balance range 77 | void ScaleBalanceRange(weightconfig_t *config, float scale); 78 | //frees cached weight configurations 79 | void BotShutdownWeights(void); 80 | -------------------------------------------------------------------------------- /code/botlib/be_ea.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | // 23 | 24 | /***************************************************************************** 25 | * name: be_ea.h 26 | * 27 | * desc: elementary actions 28 | * 29 | * $Archive: /source/code/botlib/be_ea.h $ 30 | * 31 | *****************************************************************************/ 32 | 33 | //ClientCommand elementary actions 34 | void EA_Say(int client, const char *str); 35 | void EA_SayTeam(int client, const char *str); 36 | void EA_Command(int client, const char *command ); 37 | 38 | void EA_Action(int client, int action); 39 | void EA_Crouch(int client); 40 | void EA_Walk(int client); 41 | void EA_MoveUp(int client); 42 | void EA_MoveDown(int client); 43 | void EA_MoveForward(int client); 44 | void EA_MoveBack(int client); 45 | void EA_MoveLeft(int client); 46 | void EA_MoveRight(int client); 47 | void EA_Attack(int client); 48 | void EA_Respawn(int client); 49 | void EA_Talk(int client); 50 | void EA_Gesture(int client); 51 | void EA_Use(int client); 52 | 53 | //regular elementary actions 54 | void EA_SelectWeapon(int client, int weapon); 55 | void EA_Jump(int client); 56 | void EA_DelayedJump(int client); 57 | void EA_Move(int client, vec3_t dir, float speed); 58 | void EA_View(int client, vec3_t viewangles); 59 | 60 | //send regular input to the server 61 | void EA_GetInput(int client, float thinktime, bot_input_t *input); 62 | void EA_ResetInput(int client); 63 | //setup and shutdown routines 64 | int EA_Setup(void); 65 | void EA_Shutdown(void); 66 | -------------------------------------------------------------------------------- /code/botlib/be_interface.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: be_interface.h 25 | * 26 | * desc: botlib interface 27 | * 28 | * $Archive: /source/code/botlib/be_interface.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | //#define DEBUG //debug code 33 | #define RANDOMIZE //randomize bot behaviour 34 | 35 | //FIXME: get rid of this global structure 36 | typedef struct botlib_globals_s 37 | { 38 | int botlibsetup; //true when the bot library has been setup 39 | int maxentities; //maximum number of entities 40 | int maxclients; //maximum number of clients 41 | float time; //the global time 42 | #ifdef DEBUG 43 | qboolean debug; //true if debug is on 44 | int goalareanum; 45 | vec3_t goalorigin; 46 | int runai; 47 | #endif 48 | } botlib_globals_t; 49 | 50 | 51 | extern botlib_globals_t botlibglobals; 52 | extern botlib_import_t botimport; 53 | extern int botDeveloper; //true if developer is on 54 | 55 | // 56 | int Sys_MilliSeconds(void); 57 | 58 | -------------------------------------------------------------------------------- /code/botlib/l_crc.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | typedef unsigned short crc_t; 24 | unsigned short CRC_ProcessString(unsigned char *data, int length); 25 | -------------------------------------------------------------------------------- /code/botlib/l_libvar.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: l_libvar.h 25 | * 26 | * desc: botlib vars 27 | * 28 | * $Archive: /source/code/botlib/l_libvar.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | //library variable 33 | typedef struct libvar_s 34 | { 35 | char *name; 36 | char *string; 37 | int flags; 38 | qboolean modified; // set each time the cvar is changed 39 | float value; 40 | struct libvar_s *next; 41 | } libvar_t; 42 | 43 | //removes all library variables 44 | void LibVarDeAllocAll(void); 45 | //gets the library variable with the given name 46 | libvar_t *LibVarGet( const char *var_name ); 47 | //gets the string of the library variable with the given name 48 | const char *LibVarGetString( const char *var_name ); 49 | //gets the value of the library variable with the given name 50 | float LibVarGetValue( const char *var_name ); 51 | //creates the library variable if not existing already and returns it 52 | libvar_t *LibVar( const char *var_name, const char *value ); 53 | //creates the library variable if not existing already and returns the value 54 | float LibVarValue( const char *var_name, const char *value ); 55 | //creates the library variable if not existing already and returns the value string 56 | const char *LibVarString( const char *var_name, const char *value ); 57 | //sets the library variable 58 | void LibVarSet( const char *var_name, const char *value ); 59 | -------------------------------------------------------------------------------- /code/botlib/l_log.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: l_log.h 25 | * 26 | * desc: log file 27 | * 28 | * $Archive: /source/code/botlib/l_log.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | //open a log file 33 | void Log_Open( const char *filename ); 34 | //close log file if present 35 | void Log_Shutdown(void); 36 | //write to the current opened log file 37 | void QDECL Log_Write(char *fmt, ...) __attribute__ ((format (printf, 1, 2))); 38 | //returns a pointer to the log file 39 | FILE *Log_FilePointer(void); 40 | //flush log file 41 | void Log_Flush(void); 42 | 43 | -------------------------------------------------------------------------------- /code/botlib/l_struct.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: l_struct.h 25 | * 26 | * desc: structure reading/writing 27 | * 28 | * $Archive: /source/code/botlib/l_struct.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | 33 | #define MAX_STRINGFIELD 80 34 | //field types 35 | #define FT_CHAR 1 // char 36 | #define FT_INT 2 // int 37 | #define FT_FLOAT 3 // float 38 | #define FT_STRING 4 // char [MAX_STRINGFIELD] 39 | #define FT_STRUCT 6 // struct (sub structure) 40 | //type only mask 41 | #define FT_TYPE 0x00FF // only type, clear subtype 42 | //sub types 43 | #define FT_ARRAY 0x0100 // array of type 44 | #define FT_BOUNDED 0x0200 // bounded value 45 | #define FT_UNSIGNED 0x0400 46 | 47 | //structure field definition 48 | typedef struct fielddef_s 49 | { 50 | const char *name; //name of the field 51 | int offset; //offset in the structure 52 | int type; //type of the field 53 | //type specific fields 54 | int maxarray; //maximum array size 55 | float floatmin, floatmax; //float min and max 56 | struct structdef_s *substruct; //sub structure 57 | } fielddef_t; 58 | 59 | //structure definition 60 | typedef struct structdef_s 61 | { 62 | int size; 63 | const fielddef_t *fields; 64 | } structdef_t; 65 | 66 | //read a structure from a script 67 | int ReadStructure(source_t *source, const structdef_t *def, char *structure); 68 | //write a structure to a file 69 | int WriteStructure(FILE *fp, const structdef_t *def, const char *structure); 70 | //writes indents 71 | int WriteIndent(FILE *fp, int indent); 72 | //writes a float without trailing zeros 73 | int WriteFloat(FILE *fp, float value); 74 | 75 | 76 | -------------------------------------------------------------------------------- /code/botlib/l_utils.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | /***************************************************************************** 24 | * name: l_util.h 25 | * 26 | * desc: utils 27 | * 28 | * $Archive: /source/code/botlib/l_util.h $ 29 | * 30 | *****************************************************************************/ 31 | 32 | #define Vector2Angles(v,a) vectoangles(v,a) 33 | #ifndef MAX_PATH 34 | #define MAX_PATH MAX_QEXTENDEDPATH 35 | #endif 36 | #define Maximum(x,y) (x > y ? x : y) 37 | #define Minimum(x,y) (x < y ? x : y) 38 | -------------------------------------------------------------------------------- /code/client/cl_net_chan.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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | #include "../qcommon/q_shared.h" 24 | #include "../qcommon/qcommon.h" 25 | #include "client.h" 26 | 27 | /* 28 | ================= 29 | CL_Netchan_TransmitNextFragment 30 | ================= 31 | */ 32 | static qboolean CL_Netchan_TransmitNextFragment( netchan_t *chan ) 33 | { 34 | if ( chan->unsentFragments ) 35 | { 36 | Netchan_TransmitNextFragment( chan ); 37 | return qtrue; 38 | } 39 | 40 | return qfalse; 41 | } 42 | 43 | /* 44 | =============== 45 | CL_Netchan_Transmit 46 | ================ 47 | */ 48 | void CL_Netchan_Transmit( netchan_t *chan, msg_t* msg ) { 49 | 50 | Netchan_Transmit( chan, msg->cursize, msg->data ); 51 | 52 | // Transmit all fragments without delay 53 | while ( CL_Netchan_TransmitNextFragment( chan ) ) { 54 | // might happen if server die silently but client continue adding/sending commands 55 | Com_DPrintf( S_COLOR_YELLOW "%s: unsent fragments\n", __func__ ); 56 | } 57 | } 58 | 59 | /* 60 | =============== 61 | CL_Netchan_Enqueue 62 | ================ 63 | */ 64 | void CL_Netchan_Enqueue( netchan_t *chan, msg_t* msg, int times ) { 65 | int i; 66 | 67 | // make sure we send all pending fragments to get correct chan->outgoingSequence 68 | while ( CL_Netchan_TransmitNextFragment( chan ) ) { 69 | ; 70 | } 71 | 72 | for ( i = 0; i < times; i++ ) { 73 | Netchan_Enqueue( chan, msg->cursize, msg->data ); 74 | } 75 | 76 | chan->outgoingSequence++; 77 | } 78 | 79 | /* 80 | ================= 81 | CL_Netchan_Process 82 | ================= 83 | */ 84 | qboolean CL_Netchan_Process( netchan_t *chan, msg_t *msg ) { 85 | qboolean ret; 86 | 87 | ret = Netchan_Process( chan, msg ); 88 | if ( !ret ) 89 | return qfalse; 90 | 91 | return qtrue; 92 | } 93 | -------------------------------------------------------------------------------- /code/client/keys.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | #include "keycodes.h" 23 | 24 | typedef struct { 25 | qboolean down; 26 | qboolean bound; 27 | int repeats; // if > 1, it is autorepeating 28 | char *binding; 29 | } qkey_t; 30 | 31 | extern qboolean key_overstrikeMode; 32 | extern qkey_t keys[MAX_KEYS]; 33 | 34 | extern int anykeydown; 35 | 36 | // NOTE TTimo the declaration of field_t and Field_Clear is now in qcommon/qcommon.h 37 | 38 | void Key_WriteBindings( fileHandle_t f ); 39 | void Key_SetBinding( int keynum, const char *binding ); 40 | const char *Key_GetBinding( int keynum ); 41 | void Key_ParseBinding( int key, qboolean down, unsigned time ); 42 | 43 | int Key_GetKey( const char *binding ); 44 | const char *Key_KeynumToString( int keynum ); 45 | int Key_StringToKeynum( const char *str ); 46 | 47 | qboolean Key_IsDown( int keynum ); 48 | void Key_ClearStates( void ); 49 | 50 | qboolean Key_GetOverstrikeMode( void ); 51 | void Key_SetOverstrikeMode( qboolean state ); 52 | 53 | void Com_InitKeyCommands( void ); 54 | -------------------------------------------------------------------------------- /code/client/snd_public.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | 24 | void S_Init( void ); 25 | void S_Shutdown( void ); 26 | 27 | // if origin is NULL, the sound will be dynamically sourced from the entity 28 | void S_StartSound( vec3_t origin, int entnum, int entchannel, sfxHandle_t sfx ); 29 | void S_StartLocalSound( sfxHandle_t sfx, int channelNum ); 30 | 31 | void S_StartBackgroundTrack( const char *intro, const char *loop ); 32 | 33 | // cinematics and voice-over-network will send raw samples 34 | // 1.0 volume will be direct output of source samples 35 | void S_RawSamples (int samples, int rate, int width, int channels, 36 | const byte *data, float volume); 37 | 38 | // stop all sounds and the background track 39 | void S_StopAllSounds( void ); 40 | 41 | // all continuous looping sounds must be added before calling S_Update 42 | void S_ClearLoopingSounds( qboolean killall ); 43 | void S_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx ); 44 | void S_AddRealLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx ); 45 | void S_StopLoopingSound(int entityNum ); 46 | 47 | // recompute the relative volumes for all running sounds 48 | // relative to the given entityNum / orientation 49 | void S_Respatialize( int entityNum, const vec3_t origin, vec3_t axis[3] ); 50 | 51 | // let the sound system know where an entity currently is 52 | void S_UpdateEntityPosition( int entityNum, const vec3_t origin ); 53 | 54 | void S_Update( int msec ); 55 | 56 | void S_DisableSounds( void ); 57 | 58 | void S_BeginRegistration( void ); 59 | 60 | // RegisterSound will always return a valid sample, even if it 61 | // has to create a placeholder. This prevents continuous filesystem 62 | // checks for missing files 63 | sfxHandle_t S_RegisterSound( const char *sample, qboolean compressed ); 64 | 65 | void S_DisplayFreeMemory(void); 66 | 67 | void S_ClearSoundBuffer( void ); 68 | 69 | void SNDDMA_Activate( void ); 70 | -------------------------------------------------------------------------------- /code/game/bg_public.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | #ifndef _BG_PUBLIC_H 24 | #define _BG_PUBLIC_H 25 | 26 | // CS_SERVERINFO and CS_SYSTEMINFO are defined in q_shared.h 27 | #define CS_MODELS MAX_CUSTOMSTRINGS 28 | #define CS_SOUNDS (CS_MODELS+MAX_MODELS) 29 | #define CS_PLAYERS (CS_SOUNDS+MAX_SOUNDS) 30 | #define CS_LOCATIONS (CS_PLAYERS+MAX_CLIENTS) 31 | #define CS_MAX (CS_LOCATIONS+MAX_LOCATIONS) 32 | 33 | #if (CS_MAX) > MAX_CONFIGSTRINGS 34 | #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS 35 | #endif 36 | 37 | typedef enum { 38 | //FFA GAMEMODES 39 | GT_SANDBOX, 40 | GT_MAPEDITOR, 41 | GT_FFA, 42 | //TEAM GAMEMODES 43 | GT_TEAM, 44 | GT_CTF, 45 | GT_1FCTF, 46 | GT_OBELISK, 47 | GT_HARVESTER, 48 | 49 | GT_MAX_GAME_TYPE 50 | } gametype_t; 51 | 52 | // content masks 53 | #define MASK_ALL (-1) 54 | #define MASK_SOLID (CONTENTS_SOLID) 55 | #define MASK_PLAYERSOLID (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_BODY) 56 | #define MASK_DEADSOLID (CONTENTS_SOLID|CONTENTS_PLAYERCLIP) 57 | #define MASK_WATER (CONTENTS_WATER|CONTENTS_LAVA|CONTENTS_SLIME) 58 | #define MASK_OPAQUE (CONTENTS_SOLID|CONTENTS_SLIME|CONTENTS_LAVA) 59 | #define MASK_SHOT (CONTENTS_SOLID|CONTENTS_BODY|CONTENTS_CORPSE) 60 | 61 | // 62 | // entityState_t->eType 63 | // 64 | typedef enum { 65 | ET_GENERAL, 66 | ET_PLAYER, 67 | ET_ITEM, 68 | ET_MISSILE, 69 | ET_MOVER, 70 | ET_BEAM, 71 | ET_PORTAL, 72 | ET_SPEAKER, 73 | ET_PUSH_TRIGGER, 74 | ET_TELEPORT_TRIGGER, 75 | ET_INVISIBLE, 76 | ET_GRAPPLE, 77 | ET_TEAM, 78 | ET_EVENTS 79 | } entityType_t; 80 | 81 | #endif // _BG_PUBLIC_H 82 | -------------------------------------------------------------------------------- /code/libjpeg/jconfig.h: -------------------------------------------------------------------------------- 1 | /* jconfig.h. Generated from jconfig.cfg by configure. */ 2 | /* jconfig.cfg --- source file edited by configure script */ 3 | /* see jconfig.txt for explanations */ 4 | 5 | /* Define this if you get warnings about undefined structures. */ 6 | /* #undef INCOMPLETE_TYPES_BROKEN */ 7 | 8 | #define HAVE_PROTOTYPES 1 9 | #define HAVE_UNSIGNED_CHAR 1 10 | #define HAVE_UNSIGNED_SHORT 1 11 | /* #undef void */ 12 | /* #undef const */ 13 | /* #undef CHAR_IS_UNSIGNED */ 14 | 15 | #ifdef JPEG_INTERNALS 16 | 17 | #define HAVE_STDDEF_H 1 18 | #define HAVE_STDLIB_H 1 19 | #define HAVE_LOCALE_H 1 20 | /* #undef NEED_BSD_STRINGS */ 21 | /* #undef NEED_SYS_TYPES_H */ 22 | /* #undef NEED_FAR_POINTERS */ 23 | /* #undef NEED_SHORT_EXTERNAL_NAMES */ 24 | 25 | /* Define "boolean" as unsigned char, not int, on Windows systems. */ 26 | #ifdef _WIN32 27 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 28 | typedef unsigned char boolean; 29 | #endif 30 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 31 | #ifndef FALSE /* in case these macros already exist */ 32 | #define FALSE 0 /* values of boolean */ 33 | #endif 34 | #ifndef TRUE 35 | #define TRUE 1 36 | #endif 37 | #endif 38 | 39 | /* #undef RIGHT_SHIFT_IS_UNSIGNED */ 40 | #ifdef _MSC_VER 41 | #define INLINE __inline 42 | #else 43 | #define INLINE __inline__ 44 | #endif 45 | /* These are for configuring the JPEG memory manager. */ 46 | /* #undef DEFAULT_MAX_MEM */ 47 | /* #undef NO_MKTEMP */ 48 | 49 | #endif /* JPEG_INTERNALS */ 50 | 51 | #ifdef JPEG_CJPEG_DJPEG 52 | 53 | #define BMP_SUPPORTED /* BMP image file format */ 54 | #define GIF_SUPPORTED /* GIF image file format */ 55 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 56 | /* #undef RLE_SUPPORTED */ 57 | #define TARGA_SUPPORTED /* Targa image file format */ 58 | 59 | /* #undef TWO_FILE_COMMANDLINE */ 60 | /* #undef NEED_SIGNAL_CATCHER */ 61 | /* #undef DONT_USE_B_MODE */ 62 | 63 | /* Define this if you want percent-done progress reports from cjpeg/djpeg. */ 64 | /* #undef PROGRESS_REPORT */ 65 | 66 | #endif /* JPEG_CJPEG_DJPEG */ 67 | -------------------------------------------------------------------------------- /code/libjpeg/jversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jversion.h 3 | * 4 | * Copyright (C) 1991-2022, Thomas G. Lane, Guido Vollbeding. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file contains software version identification. 9 | */ 10 | 11 | 12 | #define JVERSION "9e 16-Jan-2022" 13 | 14 | #define JCOPYRIGHT "Copyright (C) 2022, Thomas G. Lane, Guido Vollbeding" 15 | -------------------------------------------------------------------------------- /code/libjpeg/libjpeg-changes.diff: -------------------------------------------------------------------------------- 1 | List of changes applied over original jpegsrc.v9d.tar.gz distribution files 2 | 3 | ------ 4 | 5 | --- code/libjpeg-orig/jdatasrc.c 6 | +++ code/libjpeg/jdatasrc.c 7 | @@ -12,14 +12,15 @@ 8 | * some will want to use a different source manager. 9 | * IMPORTANT: we assume that fread() will correctly transcribe an array of 10 | * JOCTETs from 8-bit-wide elements on external storage. If char is wider 11 | * than 8 bits on your machine, you may need to do some tweaking. 12 | */ 13 | 14 | /* this is not a core library module, so it doesn't define JPEG_INTERNALS */ 15 | +#define JPEG_INTERNALS 16 | #include "jinclude.h" 17 | #include "jpeglib.h" 18 | #include "jerror.h" 19 | 20 | 21 | /* Expanded data source object for stdio input */ 22 | 23 | --- code/libjpeg-orig/jerror.c 24 | +++ code/libjpeg/jerror.c 25 | @@ -25,14 +25,16 @@ 26 | 27 | /* this is not a core library module, so it doesn't define JPEG_INTERNALS */ 28 | #include "jinclude.h" 29 | #include "jpeglib.h" 30 | #include "jversion.h" 31 | #include "jerror.h" 32 | 33 | +#include 34 | + 35 | #ifndef EXIT_FAILURE /* define exit() codes if not provided */ 36 | #define EXIT_FAILURE 1 37 | #endif 38 | 39 | 40 | /* 41 | * Create the message string table. 42 | -------------------------------------------------------------------------------- /code/libmad/COPYRIGHT: -------------------------------------------------------------------------------- 1 | 2 | libmad - MPEG audio decoder library 3 | Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | If you would like to negotiate alternate licensing terms, you may do 20 | so by contacting: Underbit Technologies, Inc. 21 | 22 | -------------------------------------------------------------------------------- /code/libmad/bit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: bit.h,v 1.12 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_BIT_H 23 | # define LIBMAD_BIT_H 24 | 25 | struct mad_bitptr { 26 | unsigned char const *byte; 27 | unsigned short cache; 28 | unsigned short left; 29 | }; 30 | 31 | void mad_bit_init(struct mad_bitptr *, unsigned char const *); 32 | 33 | # define mad_bit_finish(bitptr) /* nothing */ 34 | 35 | unsigned int mad_bit_length(struct mad_bitptr const *, 36 | struct mad_bitptr const *); 37 | 38 | # define mad_bit_bitsleft(bitptr) ((bitptr)->left) 39 | unsigned char const *mad_bit_nextbyte(struct mad_bitptr const *); 40 | 41 | void mad_bit_skip(struct mad_bitptr *, unsigned int); 42 | unsigned long mad_bit_read(struct mad_bitptr *, unsigned int); 43 | void mad_bit_write(struct mad_bitptr *, unsigned int, unsigned long); 44 | 45 | unsigned short mad_bit_crc(struct mad_bitptr, unsigned int, unsigned short); 46 | 47 | # endif 48 | -------------------------------------------------------------------------------- /code/libmad/decoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: decoder.h,v 1.17 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_DECODER_H 23 | # define LIBMAD_DECODER_H 24 | 25 | # include "stream.h" 26 | # include "frame.h" 27 | # include "synth.h" 28 | 29 | enum mad_decoder_mode { 30 | MAD_DECODER_MODE_SYNC = 0, 31 | MAD_DECODER_MODE_ASYNC 32 | }; 33 | 34 | enum mad_flow { 35 | MAD_FLOW_CONTINUE = 0x0000, /* continue normally */ 36 | MAD_FLOW_STOP = 0x0010, /* stop decoding normally */ 37 | MAD_FLOW_BREAK = 0x0011, /* stop decoding and signal an error */ 38 | MAD_FLOW_IGNORE = 0x0020 /* ignore the current frame */ 39 | }; 40 | 41 | struct mad_decoder { 42 | enum mad_decoder_mode mode; 43 | 44 | int options; 45 | 46 | struct { 47 | long pid; 48 | int in; 49 | int out; 50 | } async; 51 | 52 | struct { 53 | struct mad_stream stream; 54 | struct mad_frame frame; 55 | struct mad_synth synth; 56 | } *sync; 57 | 58 | void *cb_data; 59 | 60 | enum mad_flow (*input_func)(void *, struct mad_stream *); 61 | enum mad_flow (*header_func)(void *, struct mad_header const *); 62 | enum mad_flow (*filter_func)(void *, 63 | struct mad_stream const *, struct mad_frame *); 64 | enum mad_flow (*output_func)(void *, 65 | struct mad_header const *, struct mad_pcm *); 66 | enum mad_flow (*error_func)(void *, struct mad_stream *, struct mad_frame *); 67 | enum mad_flow (*message_func)(void *, void *, unsigned int *); 68 | }; 69 | 70 | void mad_decoder_init(struct mad_decoder *, void *, 71 | enum mad_flow (*)(void *, struct mad_stream *), 72 | enum mad_flow (*)(void *, struct mad_header const *), 73 | enum mad_flow (*)(void *, 74 | struct mad_stream const *, 75 | struct mad_frame *), 76 | enum mad_flow (*)(void *, 77 | struct mad_header const *, 78 | struct mad_pcm *), 79 | enum mad_flow (*)(void *, 80 | struct mad_stream *, 81 | struct mad_frame *), 82 | enum mad_flow (*)(void *, void *, unsigned int *)); 83 | int mad_decoder_finish(struct mad_decoder *); 84 | 85 | # define mad_decoder_options(decoder, opts) \ 86 | ((void) ((decoder)->options = (opts))) 87 | 88 | int mad_decoder_run(struct mad_decoder *, enum mad_decoder_mode); 89 | int mad_decoder_message(struct mad_decoder *, void *, unsigned int *); 90 | 91 | # endif 92 | -------------------------------------------------------------------------------- /code/libmad/fixed.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: fixed.c,v 1.13 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # if 1 //ifdef HAVE_CONFIG_H 23 | # include "config.h" 24 | # endif 25 | 26 | # include "global.h" 27 | 28 | # include "fixed.h" 29 | 30 | /* 31 | * NAME: fixed->abs() 32 | * DESCRIPTION: return absolute value of a fixed-point number 33 | */ 34 | mad_fixed_t mad_f_abs(mad_fixed_t x) 35 | { 36 | return x < 0 ? -x : x; 37 | } 38 | 39 | /* 40 | * NAME: fixed->div() 41 | * DESCRIPTION: perform division using fixed-point math 42 | */ 43 | mad_fixed_t mad_f_div(mad_fixed_t x, mad_fixed_t y) 44 | { 45 | mad_fixed_t q, r; 46 | unsigned int bits; 47 | 48 | q = mad_f_abs(x / y); 49 | 50 | if (x < 0) { 51 | x = -x; 52 | y = -y; 53 | } 54 | 55 | r = x % y; 56 | 57 | if (y < 0) { 58 | x = -x; 59 | y = -y; 60 | } 61 | 62 | if (q > mad_f_intpart(MAD_F_MAX) && 63 | !(q == -mad_f_intpart(MAD_F_MIN) && r == 0 && (x < 0) != (y < 0))) 64 | return 0; 65 | 66 | for (bits = MAD_F_FRACBITS; bits && r; --bits) { 67 | q <<= 1, r <<= 1; 68 | if (r >= y) 69 | r -= y, ++q; 70 | } 71 | 72 | /* round */ 73 | if (2 * r >= y) 74 | ++q; 75 | 76 | /* fix sign */ 77 | if ((x < 0) != (y < 0)) 78 | q = -q; 79 | 80 | return q << bits; 81 | } 82 | -------------------------------------------------------------------------------- /code/libmad/global.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: global.h,v 1.11 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_GLOBAL_H 23 | # define LIBMAD_GLOBAL_H 24 | 25 | /* conditional debugging */ 26 | 27 | # if defined(DEBUG) && defined(NDEBUG) 28 | # error "cannot define both DEBUG and NDEBUG" 29 | # endif 30 | 31 | # if defined(DEBUG) 32 | # include 33 | # endif 34 | 35 | /* conditional features */ 36 | 37 | # if defined(OPT_SPEED) && defined(OPT_ACCURACY) 38 | # error "cannot optimize for both speed and accuracy" 39 | # endif 40 | 41 | # if defined(OPT_SPEED) && !defined(OPT_SSO) 42 | # define OPT_SSO 43 | # endif 44 | 45 | # if defined(HAVE_UNISTD_H) && defined(HAVE_WAITPID) && \ 46 | defined(HAVE_FCNTL) && defined(HAVE_PIPE) && defined(HAVE_FORK) 47 | # define USE_ASYNC 48 | # endif 49 | 50 | # if !defined(HAVE_ASSERT_H) 51 | # if defined(NDEBUG) 52 | # define assert(x) /* nothing */ 53 | # else 54 | # define assert(x) do { if (!(x)) abort(); } while (0) 55 | # endif 56 | # endif 57 | 58 | # endif 59 | -------------------------------------------------------------------------------- /code/libmad/huffman.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: huffman.h,v 1.11 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_HUFFMAN_H 23 | # define LIBMAD_HUFFMAN_H 24 | 25 | union huffquad { 26 | struct { 27 | unsigned short final : 1; 28 | unsigned short bits : 3; 29 | unsigned short offset : 12; 30 | } ptr; 31 | struct { 32 | unsigned short final : 1; 33 | unsigned short hlen : 3; 34 | unsigned short v : 1; 35 | unsigned short w : 1; 36 | unsigned short x : 1; 37 | unsigned short y : 1; 38 | } value; 39 | unsigned short final : 1; 40 | }; 41 | 42 | union huffpair { 43 | struct { 44 | unsigned short final : 1; 45 | unsigned short bits : 3; 46 | unsigned short offset : 12; 47 | } ptr; 48 | struct { 49 | unsigned short final : 1; 50 | unsigned short hlen : 3; 51 | unsigned short x : 4; 52 | unsigned short y : 4; 53 | } value; 54 | unsigned short final : 1; 55 | }; 56 | 57 | struct hufftable { 58 | union huffpair const *table; 59 | unsigned short linbits; 60 | unsigned short startbits; 61 | }; 62 | 63 | extern union huffquad const *const mad_huff_quad_table[2]; 64 | extern struct hufftable const mad_huff_pair_table[32]; 65 | 66 | # endif 67 | -------------------------------------------------------------------------------- /code/libmad/imdct_s.dat: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: imdct_s.dat,v 1.8 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | /* 0 */ { MAD_F(0x09bd7ca0) /* 0.608761429 */, 23 | -MAD_F(0x0ec835e8) /* -0.923879533 */, 24 | -MAD_F(0x0216a2a2) /* -0.130526192 */, 25 | MAD_F(0x0fdcf549) /* 0.991444861 */, 26 | -MAD_F(0x061f78aa) /* -0.382683432 */, 27 | -MAD_F(0x0cb19346) /* -0.793353340 */ }, 28 | 29 | /* 6 */ { -MAD_F(0x0cb19346) /* -0.793353340 */, 30 | MAD_F(0x061f78aa) /* 0.382683432 */, 31 | MAD_F(0x0fdcf549) /* 0.991444861 */, 32 | MAD_F(0x0216a2a2) /* 0.130526192 */, 33 | -MAD_F(0x0ec835e8) /* -0.923879533 */, 34 | -MAD_F(0x09bd7ca0) /* -0.608761429 */ }, 35 | 36 | /* 1 */ { MAD_F(0x061f78aa) /* 0.382683432 */, 37 | -MAD_F(0x0ec835e8) /* -0.923879533 */, 38 | MAD_F(0x0ec835e8) /* 0.923879533 */, 39 | -MAD_F(0x061f78aa) /* -0.382683432 */, 40 | -MAD_F(0x061f78aa) /* -0.382683432 */, 41 | MAD_F(0x0ec835e8) /* 0.923879533 */ }, 42 | 43 | /* 7 */ { -MAD_F(0x0ec835e8) /* -0.923879533 */, 44 | -MAD_F(0x061f78aa) /* -0.382683432 */, 45 | MAD_F(0x061f78aa) /* 0.382683432 */, 46 | MAD_F(0x0ec835e8) /* 0.923879533 */, 47 | MAD_F(0x0ec835e8) /* 0.923879533 */, 48 | MAD_F(0x061f78aa) /* 0.382683432 */ }, 49 | 50 | /* 2 */ { MAD_F(0x0216a2a2) /* 0.130526192 */, 51 | -MAD_F(0x061f78aa) /* -0.382683432 */, 52 | MAD_F(0x09bd7ca0) /* 0.608761429 */, 53 | -MAD_F(0x0cb19346) /* -0.793353340 */, 54 | MAD_F(0x0ec835e8) /* 0.923879533 */, 55 | -MAD_F(0x0fdcf549) /* -0.991444861 */ }, 56 | 57 | /* 8 */ { -MAD_F(0x0fdcf549) /* -0.991444861 */, 58 | -MAD_F(0x0ec835e8) /* -0.923879533 */, 59 | -MAD_F(0x0cb19346) /* -0.793353340 */, 60 | -MAD_F(0x09bd7ca0) /* -0.608761429 */, 61 | -MAD_F(0x061f78aa) /* -0.382683432 */, 62 | -MAD_F(0x0216a2a2) /* -0.130526192 */ } 63 | -------------------------------------------------------------------------------- /code/libmad/layer12.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: layer12.h,v 1.10 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_LAYER12_H 23 | # define LIBMAD_LAYER12_H 24 | 25 | # include "stream.h" 26 | # include "frame.h" 27 | 28 | int mad_layer_I(struct mad_stream *, struct mad_frame *); 29 | int mad_layer_II(struct mad_stream *, struct mad_frame *); 30 | 31 | # endif 32 | -------------------------------------------------------------------------------- /code/libmad/layer3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: layer3.h,v 1.10 2004/01/23 09:41:32 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_LAYER3_H 23 | # define LIBMAD_LAYER3_H 24 | 25 | # include "stream.h" 26 | # include "frame.h" 27 | 28 | int mad_layer_III(struct mad_stream *, struct mad_frame *); 29 | 30 | # endif 31 | -------------------------------------------------------------------------------- /code/libmad/synth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: synth.h,v 1.15 2004/01/23 09:41:33 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_SYNTH_H 23 | # define LIBMAD_SYNTH_H 24 | 25 | # include "fixed.h" 26 | # include "frame.h" 27 | 28 | struct mad_pcm { 29 | unsigned int samplerate; /* sampling frequency (Hz) */ 30 | unsigned short channels; /* number of channels */ 31 | unsigned short length; /* number of samples per channel */ 32 | mad_fixed_t samples[2][1152]; /* PCM output samples [ch][sample] */ 33 | }; 34 | 35 | struct mad_synth { 36 | mad_fixed_t filter[2][2][2][16][8]; /* polyphase filterbank outputs */ 37 | /* [ch][eo][peo][s][v] */ 38 | 39 | unsigned int phase; /* current processing phase */ 40 | 41 | struct mad_pcm pcm; /* PCM output */ 42 | }; 43 | 44 | /* single channel PCM selector */ 45 | enum { 46 | MAD_PCM_CHANNEL_SINGLE = 0 47 | }; 48 | 49 | /* dual channel PCM selector */ 50 | enum { 51 | MAD_PCM_CHANNEL_DUAL_1 = 0, 52 | MAD_PCM_CHANNEL_DUAL_2 = 1 53 | }; 54 | 55 | /* stereo PCM selector */ 56 | enum { 57 | MAD_PCM_CHANNEL_STEREO_LEFT = 0, 58 | MAD_PCM_CHANNEL_STEREO_RIGHT = 1 59 | }; 60 | 61 | void mad_synth_init(struct mad_synth *); 62 | 63 | # define mad_synth_finish(synth) /* nothing */ 64 | 65 | void mad_synth_mute(struct mad_synth *); 66 | 67 | void mad_synth_frame(struct mad_synth *, struct mad_frame const *); 68 | 69 | # endif 70 | -------------------------------------------------------------------------------- /code/libmad/version.c: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: version.c,v 1.15 2004/01/23 09:41:33 rob Exp $ 20 | */ 21 | 22 | # if 1 //ifdef HAVE_CONFIG_H 23 | # include "config.h" 24 | # endif 25 | 26 | # include "global.h" 27 | 28 | # include "version.h" 29 | 30 | char const mad_version[] = "MPEG Audio Decoder " MAD_VERSION; 31 | char const mad_copyright[] = "Copyright (C) " MAD_PUBLISHYEAR " " MAD_AUTHOR; 32 | char const mad_author[] = MAD_AUTHOR " <" MAD_EMAIL ">"; 33 | 34 | char const mad_build[] = "" 35 | # if defined(DEBUG) 36 | "DEBUG " 37 | # elif defined(NDEBUG) 38 | "NDEBUG " 39 | # endif 40 | 41 | # if defined(EXPERIMENTAL) 42 | "EXPERIMENTAL " 43 | # endif 44 | 45 | # if defined(FPM_64BIT) 46 | "FPM_64BIT " 47 | # elif defined(FPM_INTEL) 48 | "FPM_INTEL " 49 | # elif defined(FPM_ARM) 50 | "FPM_ARM " 51 | # elif defined(FPM_MIPS) 52 | "FPM_MIPS " 53 | # elif defined(FPM_SPARC) 54 | "FPM_SPARC " 55 | # elif defined(FPM_PPC) 56 | "FPM_PPC " 57 | # elif defined(FPM_DEFAULT) 58 | "FPM_DEFAULT " 59 | # endif 60 | 61 | # if defined(ASO_IMDCT) 62 | "ASO_IMDCT " 63 | # endif 64 | # if defined(ASO_INTERLEAVE1) 65 | "ASO_INTERLEAVE1 " 66 | # endif 67 | # if defined(ASO_INTERLEAVE2) 68 | "ASO_INTERLEAVE2 " 69 | # endif 70 | # if defined(ASO_ZEROCHECK) 71 | "ASO_ZEROCHECK " 72 | # endif 73 | 74 | # if defined(OPT_SPEED) 75 | "OPT_SPEED " 76 | # elif defined(OPT_ACCURACY) 77 | "OPT_ACCURACY " 78 | # endif 79 | 80 | # if defined(OPT_SSO) 81 | "OPT_SSO " 82 | # endif 83 | 84 | # if defined(OPT_DCTO) /* never defined here */ 85 | "OPT_DCTO " 86 | # endif 87 | 88 | # if defined(OPT_STRICT) 89 | "OPT_STRICT " 90 | # endif 91 | ; 92 | -------------------------------------------------------------------------------- /code/libmad/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libmad - MPEG audio decoder library 3 | * Copyright (C) 2000-2004 Underbit Technologies, Inc. 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 | * $Id: version.h,v 1.26 2004/01/23 09:41:33 rob Exp $ 20 | */ 21 | 22 | # ifndef LIBMAD_VERSION_H 23 | # define LIBMAD_VERSION_H 24 | 25 | # define MAD_VERSION_MAJOR 0 26 | # define MAD_VERSION_MINOR 15 27 | # define MAD_VERSION_PATCH 1 28 | # define MAD_VERSION_EXTRA " (beta)" 29 | 30 | # define MAD_VERSION_STRINGIZE(str) #str 31 | # define MAD_VERSION_STRING(num) MAD_VERSION_STRINGIZE(num) 32 | 33 | # define MAD_VERSION MAD_VERSION_STRING(MAD_VERSION_MAJOR) "." \ 34 | MAD_VERSION_STRING(MAD_VERSION_MINOR) "." \ 35 | MAD_VERSION_STRING(MAD_VERSION_PATCH) \ 36 | MAD_VERSION_EXTRA 37 | 38 | # define MAD_PUBLISHYEAR "2000-2004" 39 | # define MAD_AUTHOR "Underbit Technologies, Inc." 40 | # define MAD_EMAIL "info@underbit.com" 41 | 42 | extern char const mad_version[]; 43 | extern char const mad_copyright[]; 44 | extern char const mad_author[]; 45 | extern char const mad_build[]; 46 | 47 | # endif 48 | -------------------------------------------------------------------------------- /code/libogg/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002, Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /code/libogg/include/ogg/config_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_TYPES_H__ 2 | #define __CONFIG_TYPES_H__ 3 | 4 | /* these are filled in by configure */ 5 | /* #define INCLUDE_INTTYPES_H 1 */ 6 | #define INCLUDE_STDINT_H 1 7 | /* #define INCLUDE_SYS_TYPES_H 1 */ 8 | 9 | #if INCLUDE_INTTYPES_H 10 | # include 11 | #endif 12 | #if INCLUDE_STDINT_H 13 | # include 14 | #endif 15 | #if INCLUDE_SYS_TYPES_H 16 | # include 17 | #endif 18 | 19 | typedef int16_t ogg_int16_t; 20 | typedef uint16_t ogg_uint16_t; 21 | typedef int32_t ogg_int32_t; 22 | typedef uint32_t ogg_uint32_t; 23 | typedef int64_t ogg_int64_t; 24 | typedef uint64_t ogg_uint64_t; 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef SDL_clipboard_h_ 29 | #define SDL_clipboard_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * \brief Put UTF-8 text into the clipboard 43 | * 44 | * \sa SDL_GetClipboardText() 45 | */ 46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 47 | 48 | /** 49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() 50 | * 51 | * \sa SDL_SetClipboardText() 52 | */ 53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 54 | 55 | /** 56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty 57 | * 58 | * \sa SDL_GetClipboardText() 59 | */ 60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 61 | 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* SDL_clipboard_h_ */ 70 | 71 | /* vi: set ts=4 sw=4 expandtab: */ 72 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_error.h 24 | * 25 | * Simple error message routines for SDL. 26 | */ 27 | 28 | #ifndef SDL_error_h_ 29 | #define SDL_error_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Public functions */ 40 | /* SDL_SetError() unconditionally returns -1. */ 41 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 42 | extern DECLSPEC const char *SDLCALL SDL_GetError(void); 43 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 44 | 45 | /** 46 | * \name Internal error functions 47 | * 48 | * \internal 49 | * Private error reporting function - used internally. 50 | */ 51 | /* @{ */ 52 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 53 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 54 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) 55 | typedef enum 56 | { 57 | SDL_ENOMEM, 58 | SDL_EFREAD, 59 | SDL_EFWRITE, 60 | SDL_EFSEEK, 61 | SDL_UNSUPPORTED, 62 | SDL_LASTERROR 63 | } SDL_errorcode; 64 | /* SDL_Error() unconditionally returns -1. */ 65 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); 66 | /* @} *//* Internal error functions */ 67 | 68 | /* Ends C function definitions when using C++ */ 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | #include "close_code.h" 73 | 74 | #endif /* SDL_error_h_ */ 75 | 76 | /* vi: set ts=4 sw=4 expandtab: */ 77 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_gesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_gesture.h 24 | * 25 | * Include file for SDL gesture event handling. 26 | */ 27 | 28 | #ifndef SDL_gesture_h_ 29 | #define SDL_gesture_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "SDL_touch.h" 36 | 37 | 38 | #include "begin_code.h" 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef Sint64 SDL_GestureID; 45 | 46 | /* Function prototypes */ 47 | 48 | /** 49 | * \brief Begin Recording a gesture on the specified touch, or all touches (-1) 50 | * 51 | * 52 | */ 53 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); 54 | 55 | 56 | /** 57 | * \brief Save all currently loaded Dollar Gesture templates 58 | * 59 | * 60 | */ 61 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); 62 | 63 | /** 64 | * \brief Save a currently loaded Dollar Gesture template 65 | * 66 | * 67 | */ 68 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); 69 | 70 | 71 | /** 72 | * \brief Load Dollar Gesture templates from a file 73 | * 74 | * 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); 77 | 78 | 79 | /* Ends C function definitions when using C++ */ 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #include "close_code.h" 84 | 85 | #endif /* SDL_gesture_h_ */ 86 | 87 | /* vi: set ts=4 sw=4 expandtab: */ 88 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_loadso.h 24 | * 25 | * System dependent library loading routines 26 | * 27 | * Some things to keep in mind: 28 | * \li These functions only work on C function names. Other languages may 29 | * have name mangling and intrinsic language support that varies from 30 | * compiler to compiler. 31 | * \li Make sure you declare your function pointers with the same calling 32 | * convention as the actual library function. Your code will crash 33 | * mysteriously if you do not do this. 34 | * \li Avoid namespace collisions. If you load a symbol from the library, 35 | * it is not defined whether or not it goes into the global symbol 36 | * namespace for the application. If it does and it conflicts with 37 | * symbols in your code or other shared libraries, you will not get 38 | * the results you expect. :) 39 | */ 40 | 41 | #ifndef SDL_loadso_h_ 42 | #define SDL_loadso_h_ 43 | 44 | #include "SDL_stdinc.h" 45 | #include "SDL_error.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** 54 | * This function dynamically loads a shared object and returns a pointer 55 | * to the object handle (or NULL if there was an error). 56 | * The 'sofile' parameter is a system dependent name of the object file. 57 | */ 58 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); 59 | 60 | /** 61 | * Given an object handle, this function looks up the address of the 62 | * named function in the shared object and returns it. This address 63 | * is no longer valid after calling SDL_UnloadObject(). 64 | */ 65 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, 66 | const char *name); 67 | 68 | /** 69 | * Unload a shared object from memory. 70 | */ 71 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_loadso_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifndef _MSC_VER 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_power_h_ 23 | #define SDL_power_h_ 24 | 25 | /** 26 | * \file SDL_power.h 27 | * 28 | * Header for the SDL power management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief The basic state for the system's power supply. 41 | */ 42 | typedef enum 43 | { 44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ 45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ 46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ 47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ 48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ 49 | } SDL_PowerState; 50 | 51 | 52 | /** 53 | * \brief Get the current power supply details. 54 | * 55 | * \param secs Seconds of battery life left. You can pass a NULL here if 56 | * you don't care. Will return -1 if we can't determine a 57 | * value, or we're not running on a battery. 58 | * 59 | * \param pct Percentage of battery life left, between 0 and 100. You can 60 | * pass a NULL here if you don't care. Will return -1 if we 61 | * can't determine a value, or we're not running on a battery. 62 | * 63 | * \return The state of the battery (if any). 64 | */ 65 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); 66 | 67 | /* Ends C function definitions when using C++ */ 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #include "close_code.h" 72 | 73 | #endif /* SDL_power_h_ */ 74 | 75 | /* vi: set ts=4 sw=4 expandtab: */ 76 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef SDL_quit_h_ 29 | #define SDL_quit_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* SDL_quit_h_ */ 59 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-12952:bc90ce38f1e2" 2 | #define SDL_REVISION_NUMBER 12952 3 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_h_ 31 | #define SDL_test_h_ 32 | 33 | #include "SDL.h" 34 | #include "SDL_test_assert.h" 35 | #include "SDL_test_common.h" 36 | #include "SDL_test_compare.h" 37 | #include "SDL_test_crc32.h" 38 | #include "SDL_test_font.h" 39 | #include "SDL_test_fuzzer.h" 40 | #include "SDL_test_harness.h" 41 | #include "SDL_test_images.h" 42 | #include "SDL_test_log.h" 43 | #include "SDL_test_md5.h" 44 | #include "SDL_test_memory.h" 45 | #include "SDL_test_random.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /* Global definitions */ 54 | 55 | /* 56 | * Note: Maximum size of SDLTest log message is less than SDL's limit 57 | * to ensure we can fit additional information such as the timestamp. 58 | */ 59 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_test_compare.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_compare.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines comparison functions (i.e. for surfaces). 33 | 34 | */ 35 | 36 | #ifndef SDL_test_compare_h_ 37 | #define SDL_test_compare_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "SDL_test_images.h" 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Compares a surface and with reference image data for equality 51 | * 52 | * \param surface Surface used in comparison 53 | * \param referenceSurface Test Surface used in comparison 54 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. 55 | * 56 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. 57 | */ 58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); 59 | 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_compare_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_test_font.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_font.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_font_h_ 31 | #define SDL_test_font_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | #define FONT_CHARACTER_SIZE 8 42 | 43 | /** 44 | * \brief Draw a string in the currently set font. 45 | * 46 | * \param renderer The renderer to draw on. 47 | * \param x The X coordinate of the upper left corner of the character. 48 | * \param y The Y coordinate of the upper left corner of the character. 49 | * \param c The character to draw. 50 | * 51 | * \returns Returns 0 on success, -1 on failure. 52 | */ 53 | int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c); 54 | 55 | /** 56 | * \brief Draw a string in the currently set font. 57 | * 58 | * \param renderer The renderer to draw on. 59 | * \param x The X coordinate of the upper left corner of the string. 60 | * \param y The Y coordinate of the upper left corner of the string. 61 | * \param s The string to draw. 62 | * 63 | * \returns Returns 0 on success, -1 on failure. 64 | */ 65 | int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); 66 | 67 | 68 | /** 69 | * \brief Cleanup textures used by font drawing functions. 70 | */ 71 | void SDLTest_CleanupTextDrawing(void); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_test_font_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_test_images.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_images.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines some images for tests. 33 | 34 | */ 35 | 36 | #ifndef SDL_test_images_h_ 37 | #define SDL_test_images_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "begin_code.h" 42 | /* Set up for C function definitions, even when using C++ */ 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /** 48 | *Type for test images. 49 | */ 50 | typedef struct SDLTest_SurfaceImage_s { 51 | int width; 52 | int height; 53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ 54 | const char *pixel_data; 55 | } SDLTest_SurfaceImage_t; 56 | 57 | /* Test images */ 58 | SDL_Surface *SDLTest_ImageBlit(void); 59 | SDL_Surface *SDLTest_ImageBlitColor(void); 60 | SDL_Surface *SDLTest_ImageBlitAlpha(void); 61 | SDL_Surface *SDLTest_ImageBlitBlendAdd(void); 62 | SDL_Surface *SDLTest_ImageBlitBlend(void); 63 | SDL_Surface *SDLTest_ImageBlitBlendMod(void); 64 | SDL_Surface *SDLTest_ImageBlitBlendNone(void); 65 | SDL_Surface *SDLTest_ImageBlitBlendAll(void); 66 | SDL_Surface *SDLTest_ImageFace(void); 67 | SDL_Surface *SDLTest_ImagePrimitives(void); 68 | SDL_Surface *SDLTest_ImagePrimitivesBlend(void); 69 | 70 | /* Ends C function definitions when using C++ */ 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | #include "close_code.h" 75 | 76 | #endif /* SDL_test_images_h_ */ 77 | 78 | /* vi: set ts=4 sw=4 expandtab: */ 79 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_log_h_ 37 | #define SDL_test_log_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* SDL_test_log_h_ */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_memory.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_memory_h_ 31 | #define SDL_test_memory_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** 41 | * \brief Start tracking SDL memory allocations 42 | * 43 | * \note This should be called before any other SDL functions for complete tracking coverage 44 | */ 45 | int SDLTest_TrackAllocations(void); 46 | 47 | /** 48 | * \brief Print a log of any outstanding allocations 49 | * 50 | * \note This can be called after SDL_Quit() 51 | */ 52 | void SDLTest_LogAllocations(void); 53 | 54 | 55 | /* Ends C function definitions when using C++ */ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | #include "close_code.h" 60 | 61 | #endif /* SDL_test_memory_h_ */ 62 | 63 | /* vi: set ts=4 sw=4 expandtab: */ 64 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /code/libsdl/include/SDL2/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /code/libsdl/macosx/libSDL2-2.0.0.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/libsdl/macosx/libSDL2-2.0.0.dylib -------------------------------------------------------------------------------- /code/libsdl/macosx/libSDL2main.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/libsdl/macosx/libSDL2main.a -------------------------------------------------------------------------------- /code/libsdl/windows/mingw/lib32/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/libsdl/windows/mingw/lib32/SDL2.dll -------------------------------------------------------------------------------- /code/libsdl/windows/mingw/lib32/libSDL2.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/libsdl/windows/mingw/lib32/libSDL2.dll.a -------------------------------------------------------------------------------- /code/libsdl/windows/mingw/lib32/libSDL2.la: -------------------------------------------------------------------------------- 1 | # libSDL2.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='../bin/SDL2.dll' 9 | 10 | # Names of this library. 11 | library_names='libSDL2.dll.a' 12 | 13 | # The name of the static archive. 14 | old_library='' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libSDL2. 26 | current=10 27 | age=10 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/usr/local/lib' 42 | -------------------------------------------------------------------------------- /code/libsdl/windows/mingw/lib64/SDL264.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/libsdl/windows/mingw/lib64/SDL264.dll -------------------------------------------------------------------------------- /code/libsdl/windows/mingw/lib64/libSDL264.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/libsdl/windows/mingw/lib64/libSDL264.dll.a -------------------------------------------------------------------------------- /code/libsdl/windows/mingw/lib64/libSDL264.la: -------------------------------------------------------------------------------- 1 | # libSDL264.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.2 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='../bin/SDL264.dll' 9 | 10 | # Names of this library. 11 | library_names='libSDL264.dll.a' 12 | 13 | # The name of the static archive. 14 | old_library='' 15 | 16 | # Linker flags that can not go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libSDL264. 26 | current=10 27 | age=10 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/usr/local/cross-tools/x86_64-w64-mingw32/lib' 42 | -------------------------------------------------------------------------------- /code/libvorbis/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2020 Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /code/libvorbis/lib/bitrate.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: bitrate tracking and management 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_BITRATE_H_ 18 | #define _V_BITRATE_H_ 19 | 20 | #include "vorbis/codec.h" 21 | #include "codec_internal.h" 22 | #include "os.h" 23 | 24 | /* encode side bitrate tracking */ 25 | typedef struct bitrate_manager_state { 26 | int managed; 27 | 28 | long avg_reservoir; 29 | long minmax_reservoir; 30 | long avg_bitsper; 31 | long min_bitsper; 32 | long max_bitsper; 33 | 34 | long short_per_long; 35 | double avgfloat; 36 | 37 | vorbis_block *vb; 38 | int choice; 39 | } bitrate_manager_state; 40 | 41 | typedef struct bitrate_manager_info{ 42 | long avg_rate; 43 | long min_rate; 44 | long max_rate; 45 | long reservoir_bits; 46 | double reservoir_bias; 47 | 48 | double slew_damp; 49 | 50 | } bitrate_manager_info; 51 | 52 | extern void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bs); 53 | extern void vorbis_bitrate_clear(bitrate_manager_state *bs); 54 | extern int vorbis_bitrate_managed(vorbis_block *vb); 55 | extern int vorbis_bitrate_addblock(vorbis_block *vb); 56 | extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /code/libvorbis/lib/envelope.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: PCM data envelope analysis and manipulation 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_ENVELOPE_ 18 | #define _V_ENVELOPE_ 19 | 20 | #include "mdct.h" 21 | 22 | #define VE_PRE 16 23 | #define VE_WIN 4 24 | #define VE_POST 2 25 | #define VE_AMP (VE_PRE+VE_POST-1) 26 | 27 | #define VE_BANDS 7 28 | #define VE_NEARDC 15 29 | 30 | #define VE_MINSTRETCH 2 /* a bit less than short block */ 31 | #define VE_MAXSTRETCH 12 /* one-third full block */ 32 | 33 | typedef struct { 34 | float ampbuf[VE_AMP]; 35 | int ampptr; 36 | 37 | float nearDC[VE_NEARDC]; 38 | float nearDC_acc; 39 | float nearDC_partialacc; 40 | int nearptr; 41 | 42 | } envelope_filter_state; 43 | 44 | typedef struct { 45 | int begin; 46 | int end; 47 | float *window; 48 | float total; 49 | } envelope_band; 50 | 51 | typedef struct { 52 | int ch; 53 | int winlength; 54 | int searchstep; 55 | float minenergy; 56 | 57 | mdct_lookup mdct; 58 | float *mdct_win; 59 | 60 | envelope_band band[VE_BANDS]; 61 | envelope_filter_state *filter; 62 | int stretch; 63 | 64 | int *mark; 65 | 66 | long storage; 67 | long current; 68 | long curmark; 69 | long cursor; 70 | } envelope_lookup; 71 | 72 | extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi); 73 | extern void _ve_envelope_clear(envelope_lookup *e); 74 | extern long _ve_envelope_search(vorbis_dsp_state *v); 75 | extern void _ve_envelope_shift(envelope_lookup *e,long shift); 76 | extern int _ve_envelope_mark(vorbis_dsp_state *v); 77 | 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /code/libvorbis/lib/highlevel.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: highlevel encoder setup struct separated out for vorbisenc clarity 14 | 15 | ********************************************************************/ 16 | 17 | typedef struct highlevel_byblocktype { 18 | double tone_mask_setting; 19 | double tone_peaklimit_setting; 20 | double noise_bias_setting; 21 | double noise_compand_setting; 22 | } highlevel_byblocktype; 23 | 24 | typedef struct highlevel_encode_setup { 25 | int set_in_stone; 26 | const void *setup; 27 | double base_setting; 28 | 29 | double impulse_noisetune; 30 | 31 | /* bitrate management below all settable */ 32 | float req; 33 | int managed; 34 | long bitrate_min; 35 | long bitrate_av; 36 | double bitrate_av_damp; 37 | long bitrate_max; 38 | long bitrate_reservoir; 39 | double bitrate_reservoir_bias; 40 | 41 | int impulse_block_p; 42 | int noise_normalize_p; 43 | int coupling_p; 44 | 45 | double stereo_point_setting; 46 | double lowpass_kHz; 47 | int lowpass_altered; 48 | 49 | double ath_floating_dB; 50 | double ath_absolute_dB; 51 | 52 | double amplitude_track_dBpersec; 53 | double trigger_setting; 54 | 55 | highlevel_byblocktype block[4]; /* padding, impulse, transition, long */ 56 | 57 | } highlevel_encode_setup; 58 | -------------------------------------------------------------------------------- /code/libvorbis/lib/lookup.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: lookup based functions 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_LOOKUP_H_ 18 | 19 | #ifdef FLOAT_LOOKUP 20 | extern float vorbis_coslook(float a); 21 | extern float vorbis_invsqlook(float a); 22 | extern float vorbis_invsq2explook(int a); 23 | extern float vorbis_fromdBlook(float a); 24 | #endif 25 | #ifdef INT_LOOKUP 26 | extern long vorbis_invsqlook_i(long a,long e); 27 | extern long vorbis_coslook_i(long a); 28 | extern float vorbis_fromdBlook_i(long a); 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /code/libvorbis/lib/lpc.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: LPC low level routines 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_LPC_H_ 18 | #define _V_LPC_H_ 19 | 20 | #include "vorbis/codec.h" 21 | 22 | /* simple linear scale LPC code */ 23 | extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m); 24 | 25 | extern void vorbis_lpc_predict(float *coeff,float *prime,int m, 26 | float *data,long n); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /code/libvorbis/lib/lsp.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: LSP (also called LSF) conversion routines 14 | 15 | ********************************************************************/ 16 | 17 | 18 | #ifndef _V_LSP_H_ 19 | #define _V_LSP_H_ 20 | 21 | extern int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m); 22 | 23 | extern void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln, 24 | float *lsp,int m, 25 | float amp,float ampoffset); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /code/libvorbis/lib/mdct.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: modified discrete cosine transform prototypes 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _OGG_mdct_H_ 18 | #define _OGG_mdct_H_ 19 | 20 | #include "vorbis/codec.h" 21 | 22 | 23 | 24 | 25 | 26 | /*#define MDCT_INTEGERIZED <- be warned there could be some hurt left here*/ 27 | #ifdef MDCT_INTEGERIZED 28 | 29 | #define DATA_TYPE int 30 | #define REG_TYPE register int 31 | #define TRIGBITS 14 32 | #define cPI3_8 6270 33 | #define cPI2_8 11585 34 | #define cPI1_8 15137 35 | 36 | #define FLOAT_CONV(x) ((int)((x)*(1<>TRIGBITS) 38 | #define HALVE(x) ((x)>>1) 39 | 40 | #else 41 | 42 | #define DATA_TYPE float 43 | #define REG_TYPE float 44 | #define cPI3_8 .38268343236508977175F 45 | #define cPI2_8 .70710678118654752441F 46 | #define cPI1_8 .92387953251128675613F 47 | 48 | #define FLOAT_CONV(x) (x) 49 | #define MULT_NORM(x) (x) 50 | #define HALVE(x) ((x)*.5f) 51 | 52 | #endif 53 | 54 | 55 | typedef struct { 56 | int n; 57 | int log2n; 58 | 59 | DATA_TYPE *trig; 60 | int *bitrev; 61 | 62 | DATA_TYPE scale; 63 | } mdct_lookup; 64 | 65 | extern void mdct_init(mdct_lookup *lookup,int n); 66 | extern void mdct_clear(mdct_lookup *l); 67 | extern void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out); 68 | extern void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /code/libvorbis/lib/misc.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: miscellaneous prototypes 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_RANDOM_H_ 18 | #define _V_RANDOM_H_ 19 | #include "vorbis/codec.h" 20 | 21 | extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes); 22 | extern void _vorbis_block_ripcord(vorbis_block *vb); 23 | extern int ov_ilog(ogg_uint32_t v); 24 | 25 | #ifdef ANALYSIS 26 | extern int analysis_noisy; 27 | extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB, 28 | ogg_int64_t off); 29 | extern void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB, 30 | ogg_int64_t off); 31 | #endif 32 | 33 | #ifdef DEBUG_MALLOC 34 | 35 | #define _VDBG_GRAPHFILE "malloc.m" 36 | #undef _VDBG_GRAPHFILE 37 | extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line); 38 | extern void _VDBG_free(void *ptr,char *file,long line); 39 | 40 | #ifndef MISC_C 41 | #undef _ogg_malloc 42 | #undef _ogg_calloc 43 | #undef _ogg_realloc 44 | #undef _ogg_free 45 | 46 | #define _ogg_malloc(x) _VDBG_malloc(NULL,(x),__FILE__,__LINE__) 47 | #define _ogg_calloc(x,y) _VDBG_malloc(NULL,(x)*(y),__FILE__,__LINE__) 48 | #define _ogg_realloc(x,y) _VDBG_malloc((x),(y),__FILE__,__LINE__) 49 | #define _ogg_free(x) _VDBG_free((x),__FILE__,__LINE__) 50 | #endif 51 | #endif 52 | 53 | #endif 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /code/libvorbis/lib/modes/psych_11.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: 11kHz settings 14 | 15 | ********************************************************************/ 16 | 17 | static const double _psy_lowpass_11[3]={4.5,5.5,30.,}; 18 | 19 | static const att3 _psy_tone_masteratt_11[3]={ 20 | {{ 30, 25, 12}, 0, 0}, /* 0 */ 21 | {{ 30, 25, 12}, 0, 0}, /* 0 */ 22 | {{ 20, 0, -14}, 0, 0}, /* 0 */ 23 | }; 24 | 25 | static const vp_adjblock _vp_tonemask_adj_11[3]={ 26 | /* adjust for mode zero */ 27 | /* 63 125 250 500 1 2 4 8 16 */ 28 | {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* 0 */ 29 | {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 5, 0, 0,99,99,99}}, /* 1 */ 30 | {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 2 */ 31 | }; 32 | 33 | 34 | static const noise3 _psy_noisebias_11[3]={ 35 | /* 63 125 250 500 1k 2k 4k 8k 16k*/ 36 | {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99}, 37 | {-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 4, 5, 5, 10, 99, 99, 99}, 38 | {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, 39 | 40 | {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99}, 41 | {-15,-15,-15,-15,-10,-10, -5, -5, -5, 0, 0, 0, 0, 0, 99, 99, 99}, 42 | {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, 43 | 44 | {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 99, 99, 99}, 45 | {-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10, 99, 99, 99}, 46 | {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}}, 47 | }; 48 | 49 | static const double _noise_thresh_11[3]={ .3,.5,.5 }; 50 | 51 | -------------------------------------------------------------------------------- /code/libvorbis/lib/modes/setup_44p51.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: toplevel settings for 44.1/48kHz 5.1 surround modes 14 | 15 | ********************************************************************/ 16 | 17 | #include "modes/residue_44p51.h" 18 | 19 | static const double rate_mapping_44p51[12]={ 20 | 14000.,20000.,28000.,38000.,46000.,54000., 21 | 75000.,96000.,120000.,140000.,180000.,240001. 22 | }; 23 | 24 | static const ve_setup_data_template ve_setup_44_51={ 25 | 11, 26 | rate_mapping_44p51, 27 | quality_mapping_44, 28 | 6, 29 | 40000, 30 | 70000, 31 | 32 | blocksize_short_44, 33 | blocksize_long_44, 34 | 35 | _psy_tone_masteratt_44, 36 | _psy_tone_0dB, 37 | _psy_tone_suppress, 38 | 39 | _vp_tonemask_adj_otherblock, 40 | _vp_tonemask_adj_longblock, 41 | _vp_tonemask_adj_otherblock, 42 | 43 | _psy_noiseguards_44, 44 | _psy_noisebias_impulse, 45 | _psy_noisebias_padding, 46 | _psy_noisebias_trans, 47 | _psy_noisebias_long, 48 | _psy_noise_suppress, 49 | 50 | _psy_compand_44, 51 | _psy_compand_short_mapping, 52 | _psy_compand_long_mapping, 53 | 54 | {_noise_start_short_44,_noise_start_long_44}, 55 | {_noise_part_short_44,_noise_part_long_44}, 56 | _noise_thresh_44, 57 | 58 | _psy_ath_floater, 59 | _psy_ath_abs, 60 | 61 | _psy_lowpass_44, 62 | 63 | _psy_global_44, 64 | _global_mapping_44, 65 | _psy_stereo_modes_44, 66 | 67 | _floor_books, 68 | _floor, 69 | 3, 70 | _floor_mapping_44, 71 | 72 | _mapres_template_44_51 73 | }; 74 | -------------------------------------------------------------------------------- /code/libvorbis/lib/modes/setup_44u.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: toplevel settings for 44.1/48kHz uncoupled modes 14 | 15 | ********************************************************************/ 16 | 17 | #include "modes/residue_44u.h" 18 | 19 | static const double rate_mapping_44_un[12]={ 20 | 32000.,48000.,60000.,70000.,80000.,86000., 21 | 96000.,110000.,120000.,140000.,160000.,240001. 22 | }; 23 | 24 | static const ve_setup_data_template ve_setup_44_uncoupled={ 25 | 11, 26 | rate_mapping_44_un, 27 | quality_mapping_44, 28 | -1, 29 | 40000, 30 | 50000, 31 | 32 | blocksize_short_44, 33 | blocksize_long_44, 34 | 35 | _psy_tone_masteratt_44, 36 | _psy_tone_0dB, 37 | _psy_tone_suppress, 38 | 39 | _vp_tonemask_adj_otherblock, 40 | _vp_tonemask_adj_longblock, 41 | _vp_tonemask_adj_otherblock, 42 | 43 | _psy_noiseguards_44, 44 | _psy_noisebias_impulse, 45 | _psy_noisebias_padding, 46 | _psy_noisebias_trans, 47 | _psy_noisebias_long, 48 | _psy_noise_suppress, 49 | 50 | _psy_compand_44, 51 | _psy_compand_short_mapping, 52 | _psy_compand_long_mapping, 53 | 54 | {_noise_start_short_44,_noise_start_long_44}, 55 | {_noise_part_short_44,_noise_part_long_44}, 56 | _noise_thresh_44, 57 | 58 | _psy_ath_floater, 59 | _psy_ath_abs, 60 | 61 | _psy_lowpass_44, 62 | 63 | _psy_global_44, 64 | _global_mapping_44, 65 | _psy_stereo_modes_44, 66 | 67 | _floor_books, 68 | _floor, 69 | 2, 70 | _floor_mapping_44, 71 | 72 | _mapres_template_44_uncoupled 73 | }; 74 | -------------------------------------------------------------------------------- /code/libvorbis/lib/registry.c: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: registry for time, floor, res backends and channel mappings 14 | 15 | ********************************************************************/ 16 | 17 | #include "vorbis/codec.h" 18 | #include "codec_internal.h" 19 | #include "registry.h" 20 | #include "misc.h" 21 | /* seems like major overkill now; the backend numbers will grow into 22 | the infrastructure soon enough */ 23 | 24 | extern const vorbis_func_floor floor0_exportbundle; 25 | extern const vorbis_func_floor floor1_exportbundle; 26 | extern const vorbis_func_residue residue0_exportbundle; 27 | extern const vorbis_func_residue residue1_exportbundle; 28 | extern const vorbis_func_residue residue2_exportbundle; 29 | extern const vorbis_func_mapping mapping0_exportbundle; 30 | 31 | const vorbis_func_floor *const _floor_P[]={ 32 | &floor0_exportbundle, 33 | &floor1_exportbundle, 34 | }; 35 | 36 | const vorbis_func_residue *const _residue_P[]={ 37 | &residue0_exportbundle, 38 | &residue1_exportbundle, 39 | &residue2_exportbundle, 40 | }; 41 | 42 | const vorbis_func_mapping *const _mapping_P[]={ 43 | &mapping0_exportbundle, 44 | }; 45 | -------------------------------------------------------------------------------- /code/libvorbis/lib/registry.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: registry for time, floor, res backends and channel mappings 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_REG_H_ 18 | #define _V_REG_H_ 19 | 20 | #define VI_TRANSFORMB 1 21 | #define VI_WINDOWB 1 22 | #define VI_TIMEB 1 23 | #define VI_FLOORB 2 24 | #define VI_RESB 3 25 | #define VI_MAPB 1 26 | 27 | extern const vorbis_func_floor *const _floor_P[]; 28 | extern const vorbis_func_residue *const _residue_P[]; 29 | extern const vorbis_func_mapping *const _mapping_P[]; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /code/libvorbis/lib/scales.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: linear scale -> dB, Bark and Mel scales 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_SCALES_H_ 18 | #define _V_SCALES_H_ 19 | 20 | #include 21 | #include "os.h" 22 | 23 | #ifdef _MSC_VER 24 | /* MS Visual Studio doesn't have C99 inline keyword. */ 25 | #define inline __inline 26 | #endif 27 | 28 | /* 20log10(x) */ 29 | #define VORBIS_IEEE_FLOAT32 1 30 | #ifdef VORBIS_IEEE_FLOAT32 31 | 32 | static inline float unitnorm(float x){ 33 | union { 34 | ogg_uint32_t i; 35 | float f; 36 | } ix; 37 | ix.f = x; 38 | ix.i = (ix.i & 0x80000000U) | (0x3f800000U); 39 | return ix.f; 40 | } 41 | 42 | /* Segher was off (too high) by ~ .3 decibel. Center the conversion correctly. */ 43 | static inline float todB(const float *x){ 44 | union { 45 | ogg_uint32_t i; 46 | float f; 47 | } ix; 48 | ix.f = *x; 49 | ix.i = ix.i&0x7fffffff; 50 | return (float)(ix.i * 7.17711438e-7f -764.6161886f); 51 | } 52 | 53 | #define todB_nn(x) todB(x) 54 | 55 | #else 56 | 57 | static float unitnorm(float x){ 58 | if(x<0)return(-1.f); 59 | return(1.f); 60 | } 61 | 62 | #define todB(x) (*(x)==0?-400.f:log(*(x)**(x))*4.34294480f) 63 | #define todB_nn(x) (*(x)==0.f?-400.f:log(*(x))*8.6858896f) 64 | 65 | #endif 66 | 67 | #define fromdB(x) (exp((x)*.11512925f)) 68 | 69 | /* The bark scale equations are approximations, since the original 70 | table was somewhat hand rolled. The below are chosen to have the 71 | best possible fit to the rolled tables, thus their somewhat odd 72 | appearance (these are more accurate and over a longer range than 73 | the oft-quoted bark equations found in the texts I have). The 74 | approximations are valid from 0 - 30kHz (nyquist) or so. 75 | 76 | all f in Hz, z in Bark */ 77 | 78 | #define toBARK(n) (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n)) 79 | #define fromBARK(z) (102.f*(z)-2.f*pow(z,2.f)+.4f*pow(z,3.f)+pow(1.46f,z)-1.f) 80 | #define toMEL(n) (log(1.f+(n)*.001f)*1442.695f) 81 | #define fromMEL(m) (1000.f*exp((m)/1442.695f)-1000.f) 82 | 83 | /* Frequency to octave. We arbitrarily declare 63.5 Hz to be octave 84 | 0.0 */ 85 | 86 | #define toOC(n) (log(n)*1.442695f-5.965784f) 87 | #define fromOC(o) (exp(((o)+5.965784f)*.693147f)) 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /code/libvorbis/lib/smallft.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: fft transform 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_SMFT_H_ 18 | #define _V_SMFT_H_ 19 | 20 | #include "vorbis/codec.h" 21 | 22 | typedef struct { 23 | int n; 24 | float *trigcache; 25 | int *splitcache; 26 | } drft_lookup; 27 | 28 | extern void drft_forward(drft_lookup *l,float *data); 29 | extern void drft_backward(drft_lookup *l,float *data); 30 | extern void drft_init(drft_lookup *l,int n); 31 | extern void drft_clear(drft_lookup *l); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /code/libvorbis/lib/window.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation https://xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: window functions 14 | 15 | ********************************************************************/ 16 | 17 | #ifndef _V_WINDOW_ 18 | #define _V_WINDOW_ 19 | 20 | extern const float *_vorbis_window_get(int n); 21 | extern void _vorbis_apply_window(float *d,int *winno,long *blocksizes, 22 | int lW,int W,int nW); 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /code/qcommon/cm_patch.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | #define MAX_FACETS 1024 24 | #define MAX_PATCH_PLANES (2048+128) 25 | 26 | typedef struct { 27 | float plane[4]; 28 | int signbits; // signx + (signy<<1) + (signz<<2), used as lookup during collision 29 | } patchPlane_t; 30 | 31 | typedef struct { 32 | int surfacePlane; 33 | int numBorders; // 3 or four + 6 axial bevels + 4 or 3 * 4 edge bevels 34 | int borderPlanes[4+6+16]; 35 | int borderInward[4+6+16]; 36 | qboolean borderNoAdjust[4+6+16]; 37 | } facet_t; 38 | 39 | typedef struct patchCollide_s { 40 | vec3_t bounds[2]; 41 | int numPlanes; // surface planes plus edge planes 42 | patchPlane_t *planes; 43 | int numFacets; 44 | facet_t *facets; 45 | } patchCollide_t; 46 | 47 | 48 | #define MAX_GRID_SIZE 129 49 | 50 | typedef struct { 51 | int width; 52 | int height; 53 | qboolean wrapWidth; 54 | qboolean wrapHeight; 55 | vec3_t points[MAX_GRID_SIZE][MAX_GRID_SIZE]; // [width][height] 56 | } cGrid_t; 57 | 58 | #define SUBDIVIDE_DISTANCE 16 //4 // never more than this units away from curve 59 | #define PLANE_TRI_EPSILON 0.1 60 | #define WRAP_POINT_EPSILON 0.1 61 | 62 | 63 | struct patchCollide_s *CM_GeneratePatchCollide( int width, int height, vec3_t *points ); 64 | -------------------------------------------------------------------------------- /code/qcommon/cm_polylib.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | // this is only used for visualization tools in cm_ debug functions 24 | 25 | typedef struct 26 | { 27 | int numpoints; 28 | vec3_t p[4]; // variable sized 29 | } winding_t; 30 | 31 | #define MAX_POINTS_ON_WINDING 64 32 | 33 | #define SIDE_FRONT 0 34 | #define SIDE_BACK 1 35 | #define SIDE_ON 2 36 | #define SIDE_CROSS 3 37 | 38 | #define CLIP_EPSILON 0.1f 39 | 40 | #define MAX_MAP_BOUNDS 65535 41 | 42 | // you can define on_epsilon in the makefile as tighter 43 | #ifndef ON_EPSILON 44 | #define ON_EPSILON 0.1f 45 | #endif 46 | 47 | void WindingCenter (winding_t *w, vec3_t center); 48 | winding_t *ChopWinding (winding_t *in, vec3_t normal, vec_t dist); 49 | winding_t *CopyWinding (const winding_t *w); 50 | winding_t *ReverseWinding (winding_t *w); 51 | winding_t *BaseWindingForPlane (vec3_t normal, vec_t dist); 52 | void CheckWinding (winding_t *w); 53 | void WindingPlane (winding_t *w, vec3_t normal, vec_t *dist); 54 | void RemoveColinearPoints (winding_t *w); 55 | int WindingOnPlaneSide( const winding_t *w, vec3_t normal, vec_t dist ); 56 | void FreeWinding (winding_t *w); 57 | void WindingBounds( const winding_t *w, vec3_t mins, vec3_t maxs ); 58 | 59 | void AddWindingToConvexHull( winding_t *w, winding_t **hull, vec3_t normal ); 60 | 61 | void ChopWindingInPlace( winding_t **w, const vec3_t normal, vec_t dist, vec_t epsilon ); 62 | // frees the original if clipped 63 | -------------------------------------------------------------------------------- /code/qcommon/cm_public.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | #include "qfiles.h" 24 | 25 | 26 | #ifdef USE_BSP_COLMODELS 27 | int CM_LoadMap( const char *name, qboolean clientload, int *checksum); 28 | #else 29 | void CM_LoadMap( const char *name, qboolean clientload, int *checksum); 30 | #endif 31 | void CM_ClearMap( void ); 32 | clipHandle_t CM_InlineModel( int index ); // 0 = world, 1 + are bmodels 33 | clipHandle_t CM_TempBoxModel( const vec3_t mins, const vec3_t maxs ); 34 | 35 | void CM_ModelBounds( clipHandle_t model, vec3_t mins, vec3_t maxs ); 36 | 37 | int CM_NumClusters (void); 38 | int CM_NumInlineModels( void ); 39 | char *CM_EntityString (void); 40 | 41 | // returns an ORed contents mask 42 | int CM_PointContents( const vec3_t p, clipHandle_t model ); 43 | int CM_TransformedPointContents( const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles ); 44 | 45 | void CM_BoxTrace( trace_t *results, const vec3_t start, const vec3_t end, 46 | const vec3_t mins, const vec3_t maxs, 47 | clipHandle_t model, int brushmask ); 48 | void CM_TransformedBoxTrace( trace_t *results, const vec3_t start, const vec3_t end, 49 | const vec3_t mins, const vec3_t maxs, 50 | clipHandle_t model, int brushmask, 51 | const vec3_t origin, const vec3_t angles ); 52 | 53 | byte *CM_ClusterPVS (int cluster); 54 | 55 | int CM_PointLeafnum( const vec3_t p ); 56 | 57 | // only returns non-solid leafs 58 | // overflow if return listsize and if *lastLeaf != list[listsize-1] 59 | int CM_BoxLeafnums( const vec3_t mins, const vec3_t maxs, int *list, 60 | int listsize, int *lastLeaf ); 61 | 62 | int CM_LeafCluster (int leafnum); 63 | int CM_LeafArea (int leafnum); 64 | 65 | void CM_AdjustAreaPortalState( int area1, int area2, qboolean open ); 66 | qboolean CM_AreasConnected( int area1, int area2 ); 67 | 68 | int CM_WriteAreaBits( byte *buffer, int area ); 69 | -------------------------------------------------------------------------------- /code/qcommon/puff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a modified version of Mark Adlers work, 3 | * see below for the original copyright. 4 | * 2006 - Joerg Dietrich 5 | */ 6 | 7 | /* puff.h 8 | Copyright (C) 2002, 2003 Mark Adler, all rights reserved 9 | version 1.7, 3 Mar 2002 10 | 11 | This software is provided 'as-is', without any express or implied 12 | warranty. In no event will the author be held liable for any damages 13 | arising from the use of this software. 14 | 15 | Permission is granted to anyone to use this software for any purpose, 16 | including commercial applications, and to alter it and redistribute it 17 | freely, subject to the following restrictions: 18 | 19 | 1. The origin of this software must not be misrepresented; you must not 20 | claim that you wrote the original software. If you use this software 21 | in a product, an acknowledgment in the product documentation would be 22 | appreciated but is not required. 23 | 2. Altered source versions must be plainly marked as such, and must not be 24 | misrepresented as being the original software. 25 | 3. This notice may not be removed or altered from any source distribution. 26 | 27 | Mark Adler madler@alumni.caltech.edu 28 | */ 29 | 30 | #ifndef __PUFF_H 31 | #define __PUFF_H 32 | 33 | #include "q_shared.h" /* for definitions of the types */ 34 | 35 | /* 36 | * See puff.c for purpose and usage. 37 | */ 38 | int32_t puff(uint8_t *dest, /* pointer to destination pointer */ 39 | uint32_t *destlen, /* amount of output space */ 40 | uint8_t *source, /* pointer to source data pointer */ 41 | uint32_t *sourcelen); /* amount of input available */ 42 | 43 | #endif // __PUFF_H 44 | -------------------------------------------------------------------------------- /code/renderercommon/tr_image_jpg.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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | #include "../qcommon/q_shared.h" 24 | #include "../renderercommon/tr_public.h" 25 | 26 | void R_LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) 27 | { 28 | ri.CL_LoadJPG( filename, pic, width, height ); 29 | } 30 | -------------------------------------------------------------------------------- /code/renderercommon/tr_noise.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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | #include "../qcommon/q_shared.h" 24 | #include "../renderercommon/tr_public.h" 25 | 26 | #define NOISE_SIZE 256 27 | #define NOISE_MASK ( NOISE_SIZE - 1 ) 28 | 29 | #define VAL( a ) s_noise_perm[ ( a ) & ( NOISE_MASK )] 30 | #define INDEX( x, y, z, t ) VAL( x + VAL( y + VAL( z + VAL( t ) ) ) ) 31 | 32 | static float s_noise_table[NOISE_SIZE]; 33 | static int s_noise_perm[NOISE_SIZE]; 34 | 35 | static float GetNoiseValue( int x, int y, int z, int t ) 36 | { 37 | int index = INDEX( ( int ) x, ( int ) y, ( int ) z, ( int ) t ); 38 | 39 | return s_noise_table[index]; 40 | } 41 | 42 | void R_NoiseInit( void ) 43 | { 44 | int i; 45 | 46 | for ( i = 0; i < NOISE_SIZE; i++ ) 47 | { 48 | s_noise_table[i] = ( float ) ( ( ( rand() / ( float ) RAND_MAX ) * 2.0 - 1.0 ) ); 49 | s_noise_perm[i] = ( unsigned char ) ( rand() / ( float ) RAND_MAX * 255 ); 50 | } 51 | } 52 | 53 | float R_NoiseGet4f( float x, float y, float z, double t ) 54 | { 55 | int i; 56 | int ix, iy, iz, it; 57 | float fx, fy, fz, ft; 58 | float front[4]; 59 | float back[4]; 60 | float fvalue, bvalue, value[2], finalvalue; 61 | 62 | ix = ( int ) floor( x ); 63 | fx = x - ix; 64 | iy = ( int ) floor( y ); 65 | fy = y - iy; 66 | iz = ( int ) floor( z ); 67 | fz = z - iz; 68 | it = ( int ) floor( t ); 69 | ft = t - it; 70 | 71 | for ( i = 0; i < 2; i++ ) 72 | { 73 | front[0] = GetNoiseValue( ix, iy, iz, it + i ); 74 | front[1] = GetNoiseValue( ix+1, iy, iz, it + i ); 75 | front[2] = GetNoiseValue( ix, iy+1, iz, it + i ); 76 | front[3] = GetNoiseValue( ix+1, iy+1, iz, it + i ); 77 | 78 | back[0] = GetNoiseValue( ix, iy, iz + 1, it + i ); 79 | back[1] = GetNoiseValue( ix+1, iy, iz + 1, it + i ); 80 | back[2] = GetNoiseValue( ix, iy+1, iz + 1, it + i ); 81 | back[3] = GetNoiseValue( ix+1, iy+1, iz + 1, it + i ); 82 | 83 | fvalue = LERP( LERP( front[0], front[1], fx ), LERP( front[2], front[3], fx ), fy ); 84 | bvalue = LERP( LERP( back[0], back[1], fx ), LERP( back[2], back[3], fx ), fy ); 85 | 86 | value[i] = LERP( fvalue, bvalue, fz ); 87 | } 88 | 89 | finalvalue = LERP( value[0], value[1], ft ); 90 | 91 | return finalvalue; 92 | } 93 | -------------------------------------------------------------------------------- /code/renderercommon/vulkan/vulkan.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_H_ 2 | #define VULKAN_H_ 1 3 | 4 | /* 5 | ** Copyright 2015-2022 The Khronos Group Inc. 6 | ** 7 | ** SPDX-License-Identifier: Apache-2.0 8 | */ 9 | 10 | #include "vk_platform.h" 11 | #include "vulkan_core.h" 12 | 13 | #ifdef VK_USE_PLATFORM_ANDROID_KHR 14 | #include "vulkan_android.h" 15 | #endif 16 | 17 | #ifdef VK_USE_PLATFORM_FUCHSIA 18 | #include 19 | #include "vulkan_fuchsia.h" 20 | #endif 21 | 22 | #ifdef VK_USE_PLATFORM_IOS_MVK 23 | #include "vulkan_ios.h" 24 | #endif 25 | 26 | 27 | #ifdef VK_USE_PLATFORM_MACOS_MVK 28 | #include "vulkan_macos.h" 29 | #endif 30 | 31 | #ifdef VK_USE_PLATFORM_METAL_EXT 32 | #include "vulkan_metal.h" 33 | #endif 34 | 35 | #ifdef VK_USE_PLATFORM_VI_NN 36 | #include "vulkan_vi.h" 37 | #endif 38 | 39 | 40 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR 41 | #include 42 | #include "vulkan_wayland.h" 43 | #endif 44 | 45 | 46 | #ifdef VK_USE_PLATFORM_WIN32_KHR 47 | #include 48 | #include "vulkan_win32.h" 49 | #endif 50 | 51 | 52 | #ifdef VK_USE_PLATFORM_XCB_KHR 53 | #include 54 | #include "vulkan_xcb.h" 55 | #endif 56 | 57 | 58 | #ifdef VK_USE_PLATFORM_XLIB_KHR 59 | #include 60 | #include "vulkan_xlib.h" 61 | #endif 62 | 63 | 64 | #ifdef VK_USE_PLATFORM_DIRECTFB_EXT 65 | #include 66 | #include "vulkan_directfb.h" 67 | #endif 68 | 69 | 70 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT 71 | #include 72 | #include 73 | #include "vulkan_xlib_xrandr.h" 74 | #endif 75 | 76 | 77 | #ifdef VK_USE_PLATFORM_GGP 78 | #include 79 | #include "vulkan_ggp.h" 80 | #endif 81 | 82 | 83 | #ifdef VK_USE_PLATFORM_SCREEN_QNX 84 | #include 85 | #include "vulkan_screen.h" 86 | #endif 87 | 88 | #ifdef VK_ENABLE_BETA_EXTENSIONS 89 | #include "vulkan_beta.h" 90 | #endif 91 | 92 | #endif // VULKAN_H_ 93 | -------------------------------------------------------------------------------- /code/renderercommon/vulkan/vulkan_xlib.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XLIB_H_ 2 | #define VULKAN_XLIB_H_ 1 3 | 4 | /* 5 | ** Copyright 2015-2022 The Khronos Group Inc. 6 | ** 7 | ** SPDX-License-Identifier: Apache-2.0 8 | */ 9 | 10 | /* 11 | ** This header is generated from the Khronos Vulkan XML API Registry. 12 | ** 13 | */ 14 | 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | 21 | 22 | #define VK_KHR_xlib_surface 1 23 | #define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 24 | #define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" 25 | typedef VkFlags VkXlibSurfaceCreateFlagsKHR; 26 | typedef struct VkXlibSurfaceCreateInfoKHR { 27 | VkStructureType sType; 28 | const void* pNext; 29 | VkXlibSurfaceCreateFlagsKHR flags; 30 | Display* dpy; 31 | Window window; 32 | } VkXlibSurfaceCreateInfoKHR; 33 | 34 | typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 35 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); 36 | 37 | #ifndef VK_NO_PROTOTYPES 38 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( 39 | VkInstance instance, 40 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, 41 | const VkAllocationCallbacks* pAllocator, 42 | VkSurfaceKHR* pSurface); 43 | 44 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR( 45 | VkPhysicalDevice physicalDevice, 46 | uint32_t queueFamilyIndex, 47 | Display* dpy, 48 | VisualID visualID); 49 | #endif 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /code/renderercommon/vulkan/vulkan_xlib_xrandr.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XLIB_XRANDR_H_ 2 | #define VULKAN_XLIB_XRANDR_H_ 1 3 | 4 | /* 5 | ** Copyright 2015-2022 The Khronos Group Inc. 6 | ** 7 | ** SPDX-License-Identifier: Apache-2.0 8 | */ 9 | 10 | /* 11 | ** This header is generated from the Khronos Vulkan XML API Registry. 12 | ** 13 | */ 14 | 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | 21 | 22 | #define VK_EXT_acquire_xlib_display 1 23 | #define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1 24 | #define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display" 25 | typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display); 26 | typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); 27 | 28 | #ifndef VK_NO_PROTOTYPES 29 | VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( 30 | VkPhysicalDevice physicalDevice, 31 | Display* dpy, 32 | VkDisplayKHR display); 33 | 34 | VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( 35 | VkPhysicalDevice physicalDevice, 36 | Display* dpy, 37 | RROutput rrOutput, 38 | VkDisplayKHR* pDisplay); 39 | #endif 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /code/renderervk.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/renderervk.zip -------------------------------------------------------------------------------- /code/sdl/sdl_glw.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | 23 | #ifndef __GLW_LINUX_H__ 24 | #define __GLW_LINUX_H__ 25 | 26 | #include 27 | 28 | //#define USE_JOYSTICK 29 | 30 | typedef struct 31 | { 32 | FILE *log_fp; 33 | 34 | qboolean isFullscreen; 35 | 36 | glconfig_t *config; // feedback to renderer module 37 | 38 | int desktop_width; 39 | int desktop_height; 40 | 41 | int window_width; 42 | int window_height; 43 | 44 | int monitorCount; 45 | 46 | } glwstate_t; 47 | 48 | extern SDL_Window *SDL_window; 49 | extern glwstate_t glw_state; 50 | 51 | extern cvar_t *in_nograb; 52 | 53 | void IN_Init( void ); 54 | void IN_Shutdown( void ); 55 | 56 | // signals.c 57 | void InitSig( void ); 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /code/unix/linux_local.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | #ifndef __LINUX_LOCAL_H__ 23 | #define __LINUX_LOCAL_H__ 24 | 25 | // Input subsystem 26 | 27 | void IN_Init (void); 28 | void IN_Frame (void); 29 | void IN_Shutdown (void); 30 | 31 | 32 | void IN_JoyMove( void ); 33 | void IN_StartupJoystick( void ); 34 | 35 | // OpenGL subsystem 36 | qboolean QGL_Init( const char *dllname ); 37 | void QGL_Shutdown( qboolean unloadDLL ); 38 | 39 | // Vulkan subsystem 40 | qboolean QVK_Init( void ); 41 | void QVK_Shutdown( qboolean unloadDLL ); 42 | 43 | 44 | // bk001130 - win32 45 | // void IN_JoystickCommands (void); 46 | 47 | char *strlwr (char *s); 48 | 49 | // signals.c 50 | void InitSig(void); 51 | 52 | #endif // __LINUX_LOCAL_H__ 53 | -------------------------------------------------------------------------------- /code/unix/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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | #include 23 | 24 | #ifdef _DEBUG 25 | #include 26 | #include 27 | #include 28 | #include 29 | #endif 30 | 31 | #include "../qcommon/q_shared.h" 32 | #include "../qcommon/qcommon.h" 33 | #ifndef DEDICATED 34 | #include "../renderer/tr_local.h" 35 | #endif 36 | 37 | static qboolean signalcaught = qfalse; 38 | 39 | extern void NORETURN Sys_Exit( int code ); 40 | 41 | static void signal_handler( int sig ) 42 | { 43 | char msg[32]; 44 | 45 | if ( signalcaught == qtrue ) 46 | { 47 | printf( "DOUBLE SIGNAL FAULT: Received signal %d, exiting...\n", sig ); 48 | Sys_Exit( 1 ); // abstraction 49 | } 50 | 51 | printf( "Received signal %d, exiting...\n", sig ); 52 | 53 | #ifdef _DEBUG 54 | if ( sig == SIGSEGV || sig == SIGILL || sig == SIGBUS ) 55 | { 56 | void *syms[10]; 57 | const size_t size = backtrace( syms, ARRAY_LEN( syms ) ); 58 | backtrace_symbols_fd( syms, size, STDERR_FILENO ); 59 | } 60 | #endif 61 | 62 | signalcaught = qtrue; 63 | sprintf( msg, "Signal caught (%d)", sig ); 64 | VM_Forced_Unload_Start(); 65 | #ifndef DEDICATED 66 | CL_Shutdown( msg, qtrue ); 67 | #endif 68 | SV_Shutdown( msg ); 69 | VM_Forced_Unload_Done(); 70 | Sys_Exit( 0 ); // send a 0 to avoid DOUBLE SIGNAL FAULT 71 | } 72 | 73 | 74 | void InitSig( void ) 75 | { 76 | signal( SIGINT, SIG_IGN ); 77 | signal( SIGHUP, signal_handler ); 78 | signal( SIGQUIT, signal_handler ); 79 | signal( SIGILL, signal_handler ); 80 | signal( SIGTRAP, signal_handler ); 81 | signal( SIGIOT, signal_handler ); 82 | signal( SIGBUS, signal_handler ); 83 | signal( SIGFPE, signal_handler ); 84 | signal( SIGSEGV, signal_handler ); 85 | signal( SIGTERM, signal_handler ); 86 | } 87 | -------------------------------------------------------------------------------- /code/unix/quake3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/unix/quake3.png -------------------------------------------------------------------------------- /code/unix/quake3_flat.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/unix/quake3_flat.icns -------------------------------------------------------------------------------- /code/win32/background.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/win32/background.bmp -------------------------------------------------------------------------------- /code/win32/clear.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/win32/clear.bmp -------------------------------------------------------------------------------- /code/win32/glw_win.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | #ifndef _WIN32 23 | # error You should not be including this file on this platform 24 | #endif 25 | 26 | #ifndef __GLW_WIN_H__ 27 | #define __GLW_WIN_H__ 28 | 29 | #include 30 | 31 | typedef struct 32 | { 33 | HDC hDC; // handle to device context 34 | HGLRC hGLRC; // handle to GL rendering context 35 | 36 | HINSTANCE OpenGLLib; // HINSTANCE for the OpenGL library 37 | HINSTANCE VulkanLib; // HINSTANCE for the Vulkan library 38 | 39 | qboolean pixelFormatSet; 40 | 41 | int desktopBitsPixel; 42 | int desktopWidth; 43 | int desktopHeight; 44 | int desktopX; // can be negative 45 | int desktopY; // can be negative 46 | 47 | RECT workArea; 48 | 49 | HMONITOR hMonitor; // current monitor 50 | TCHAR displayName[CCHDEVICENAME]; 51 | qboolean deviceSupportsGamma; 52 | qboolean gammaSet; 53 | 54 | qboolean cdsFullscreen; 55 | int monitorCount; 56 | 57 | FILE *log_fp; // TODO: implement? 58 | 59 | glconfig_t *config; // feedback to renderer module 60 | 61 | } glwstate_t; 62 | 63 | extern glwstate_t glw_state; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /code/win32/q3.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | True/PM 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /code/win32/qe3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/win32/qe3.ico -------------------------------------------------------------------------------- /code/win32/resource.h: -------------------------------------------------------------------------------- 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 Quake III Arena source code; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | =========================================================================== 21 | */ 22 | //{{NO_DEPENDENCIES}} 23 | // Microsoft Developer Studio generated include file. 24 | // Used by winquake.rc 25 | // 26 | #define IDS_STRING1 1 27 | #define IDI_ICON1 1 28 | #define IDB_BITMAP1 1 29 | #define IDB_BITMAP2 128 30 | #define IDC_CURSOR1 129 31 | #define IDC_CURSOR2 130 32 | #define IDC_CURSOR3 131 33 | 34 | // Next default values for new objects 35 | // 36 | #ifdef APSTUDIO_INVOKED 37 | #ifndef APSTUDIO_READONLY_SYMBOLS 38 | #define _APS_NO_MFC 1 39 | #define _APS_NEXT_RESOURCE_VALUE 132 40 | #define _APS_NEXT_COMMAND_VALUE 40001 41 | #define _APS_NEXT_CONTROL_VALUE 1005 42 | #define _APS_NEXT_SYMED_VALUE 101 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /code/win32/win_resource.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE DISCARDABLE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE DISCARDABLE 36 | BEGIN 37 | "#include ""winres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE DISCARDABLE 42 | BEGIN 43 | "\0" 44 | END 45 | 46 | #endif // APSTUDIO_INVOKED 47 | 48 | 49 | ///////////////////////////////////////////////////////////////////////////// 50 | // 51 | // Icon 52 | // 53 | 54 | // Icon with lowest ID value placed first to ensure application icon 55 | // remains consistent on all systems. 56 | #ifndef __MINGW32__ 57 | IDI_ICON1 ICON DISCARDABLE "qe3.ico" 58 | #else 59 | IDI_ICON1 ICON DISCARDABLE "code/win32/qe3.ico" 60 | #endif 61 | 62 | 63 | ///////////////////////////////////////////////////////////////////////////// 64 | // 65 | // String Table 66 | // 67 | 68 | STRINGTABLE DISCARDABLE 69 | BEGIN 70 | IDS_STRING1 "Quake3" 71 | END 72 | 73 | #endif // English (U.S.) resources 74 | 75 | 76 | ///////////////////////////////////////////////////////////////////////////// 77 | // 78 | // Applicatioin manifest 79 | // 80 | #ifndef __MINGW32__ 81 | 1 RT_MANIFEST "q3.manifest" 82 | #else 83 | 1 RT_MANIFEST "code/win32/q3.manifest" 84 | #endif 85 | -------------------------------------------------------------------------------- /code/win32/win_syscon.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noire-dev/sourcetech/bea662eae07ba7d14de5164c3e5ee2b6ef9272d0/code/win32/win_syscon.c -------------------------------------------------------------------------------- /docs/LinuxSupport/INSTALL: -------------------------------------------------------------------------------- 1 | Quake III Arena 2 | Quake III: Team Arena 3 | Installation instructions 4 | ------ 5 | 6 | What you need: 7 | 8 | - retail CD-ROM of Quake III Arena for Windows or linux 9 | - optionally, retail CD-ROM of Quake III: Team Arena 10 | - a computer running linux (kernel >= 2.2 glibc >= 2.1) 11 | - running the client requires X11 and 3D hardware acceleration with OpenGL 12 | 13 | Installation: 14 | 15 | If you have the retail CD-ROM of Quake III Arena for linux: 16 | - install Quake III Arena from the CD-ROM 17 | - run the Point Release installer 18 | (to buy Quake III Arena for linux online, try http://www.tuxgames.com/) 19 | 20 | If you have the retail CD-ROM of Quake III Arena for Windows: 21 | - run the Point Release installer first 22 | - now you need to copy the main pak files from the CD-ROM 23 | or from your win32 partition. Namely, you need to copy baseq3/pak0.pk3 24 | and for Team Arena, missionpack/pak0.pk3 25 | see below for more instructions on how to copy the files: 26 | 27 | WARNING: Those instructions are provided as a reference, 28 | depending on your distribution the CD-ROM might not have the same 29 | mount point. Please refer to your linux documentation for additional 30 | information. 31 | 32 | - open a root shell and cd to the default installation path: 33 | cd /usr/local/games/quake3 34 | - mount the Quake III Arena CD-ROM and install the game content 35 | cp /mnt/cdrom/Quake3/baseq3/pak0.pk3 /usr/local/games/quake3/baseq3 36 | - optionally, mount the Quake III: Team Arena CD-ROM 37 | cp /mnt/cdrom/Setup/missionpack/pak0.pk3 /usr/local/games/quake3/missionpack 38 | 39 | NOTES: 40 | - If you are running Quake III Arena and Quake III: Team Arena on a 41 | Windows partition, you can save some space by symlinking the game 42 | assets to their windows installation: 43 | ln -s /win/quake3/baseq3/pak0.pk3 /usr/local/games/quake3/baseq3/pak0.pk3 44 | ln -s /win/quake3/missionpack/pak0.pk3 /usr/local/games/quake3/missionpack/pak0.pk3 45 | (Windows partition is mounted as /win and Quake III Arena installation is C:\quake3) 46 | 47 | Getting Help: 48 | 49 | - consult the FAQ in Help/Q3A_FAQ.html 50 | - head over to the Quake3World forums http://www.quake3world.com/forums 51 | - consult the list of known issues and tips at 52 | http://zerowing.idsoftware.com/linux 53 | -------------------------------------------------------------------------------- /docs/LinuxSupport/udp_wide_README.txt: -------------------------------------------------------------------------------- 1 | UDP Wide Broadcast Patch for Kernel 2.4.19 2 | 3 | Main purpose is to allow Quake 3 servers, and all games powered by the 4 | engine, to be visible in the server browser when the servers are being run on 5 | aliased IP addresses and multiple NICs using the +set net_ip option. 6 | 7 | To apply the patch run "patch -p1 < udp_wide_broadcast.patch" from your 8 | source directory and recompile. 9 | 10 | Add "echo "1" > /proc/sys/net/ipv4/udp_wide_broadcast" to one of your startup 11 | scripts, i.e./etc/rc.d/rc.local, and run thousands of servers from your 12 | computer. 13 | 14 | 15 | Patch by: 16 | Rogier Mulhujzen 17 | John Tobin 18 | 19 | A patch with the same functionality for FreeBSD is available from 20 | http://www.bsdchicks.com/patches 21 | -------------------------------------------------------------------------------- /docs/LinuxSupport/udp_wide_broadcast.patch: -------------------------------------------------------------------------------- 1 | --- linux/include/linux/sysctl.h.orig 2002-08-17 19:52:27.000000000 -0500 2 | +++ linux/include/linux/sysctl.h 2002-08-17 19:53:00.000000000 -0500 3 | @@ -291,7 +291,8 @@ 4 | NET_IPV4_NONLOCAL_BIND=88, 5 | NET_IPV4_ICMP_RATELIMIT=89, 6 | NET_IPV4_ICMP_RATEMASK=90, 7 | - NET_TCP_TW_REUSE=91 8 | + NET_TCP_TW_REUSE=91, 9 | + NET_UDP_WIDE_BROADCAST=92 10 | }; 11 | 12 | enum { 13 | --- linux-modified/net/ipv4/sysctl_net_ipv4.c.orig 2002-08-17 19:48:19.000000000 -0500 14 | +++ linux-modified/net/ipv4/sysctl_net_ipv4.c 2002-08-17 19:52:03.000000000 -0500 15 | @@ -45,6 +45,9 @@ 16 | extern int inet_peer_gc_mintime; 17 | extern int inet_peer_gc_maxtime; 18 | 19 | +/* From udp.c */ 20 | +extern int sysctl_udp_wide_broadcast; 21 | + 22 | #ifdef CONFIG_SYSCTL 23 | static int tcp_retr1_max = 255; 24 | static int ip_local_port_range_min[] = { 1, 1 }; 25 | @@ -221,6 +224,8 @@ 26 | &sysctl_icmp_ratemask, sizeof(int), 0644, NULL, &proc_dointvec}, 27 | {NET_TCP_TW_REUSE, "tcp_tw_reuse", 28 | &sysctl_tcp_tw_reuse, sizeof(int), 0644, NULL, &proc_dointvec}, 29 | + {NET_UDP_WIDE_BROADCAST, "udp_wide_broadcast", 30 | + &sysctl_udp_wide_broadcast, sizeof(int), 0644, NULL, &proc_dointvec}, 31 | {0} 32 | }; 33 | 34 | --- linux-modified/net/ipv4/udp.c.orig 2002-08-17 19:40:59.000000000 -0500 35 | +++ linux-modified/net/ipv4/udp.c 2002-08-17 23:37:47.000000000 -0500 36 | @@ -94,6 +94,8 @@ 37 | #include 38 | #include 39 | 40 | +int sysctl_udp_wide_broadcast = 0; 41 | + 42 | /* 43 | * Snmp MIB for the UDP layer 44 | */ 45 | @@ -272,9 +274,10 @@ 46 | if ((s->num != hnum) || 47 | (s->daddr && s->daddr!=rmt_addr) || 48 | (s->dport != rmt_port && s->dport != 0) || 49 | - (s->rcv_saddr && s->rcv_saddr != loc_addr) || 50 | - (s->bound_dev_if && s->bound_dev_if != dif)) 51 | + !(sysctl_udp_wide_broadcast || !(s->rcv_saddr && s->rcv_saddr != loc_addr)) || 52 | + (s->bound_dev_if && s->bound_dev_if != dif)) { 53 | continue; 54 | + } 55 | break; 56 | } 57 | return s; 58 | -------------------------------------------------------------------------------- /docs/firewall/fw-openwrt.txt: -------------------------------------------------------------------------------- 1 | Following custom firewall rule can be added in [Network] -> [Firewall] -> [Custom Rules]: 2 | 3 | iptables -A input_wan_rule -p udp --dport 27960 -m hashlimit --hashlimit-mode srcip --hashlimit-above 768/second --hashlimit-burst 128 --hashlimit-name q3server1 -j DROP 4 | 5 | Rate (--hashlimit-above) should be big enough to handle at least sv_maxclientsPerIP * cl_maxPackets * (cl_packetdup + 1) packets 6 | 7 | You may need to use other than input_wan_rule chains depending from your routing configuration 8 | 9 | LEDE/OpenWrt firmware MUST be built with following options: 10 | 11 | CONFIG_PACKAGE_iptables-mod-hashlimit=y 12 | 13 | CONFIG_PACKAGE_iptables-mod-u32=y (not required, but may be useful to inspect packet's contents) 14 | 15 | -------------------------------------------------------------------------------- /docs/firewall/fw-q3host.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # this can be called from another script as ./q3hostfw 4 | 5 | NAME=${1:-LIMITER} # you need to specify unique table name for each port 6 | 7 | PORT=${2:-27960} # and unique server port as well 8 | 9 | RATE=768/second 10 | BURST=128 11 | 12 | # flush INPUT table: 13 | #iptables -F INPUT 14 | 15 | # insert our rule at the beginning of the INPUT chain: 16 | iptables -I INPUT \ 17 | -p udp --dport $PORT -m hashlimit \ 18 | --hashlimit-mode srcip \ 19 | --hashlimit-above $RATE \ 20 | --hashlimit-burst $BURST \ 21 | --hashlimit-name $NAME \ 22 | -j DROP 23 | -------------------------------------------------------------------------------- /docs/q3url_add.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | set CWD=%~dp0 3 | set CWD=%CWD:~0,-2% 4 | set CWD=%CWD:\=\\% 5 | set F=%TEMP%\q3a.reg 6 | set RPATH=HKEY_CURRENT_USER\Software\Classes\q3a 7 | rem set RPATH=HKEY_CLASSES_ROOT\q3a 8 | echo REGEDIT4 > %F% 9 | echo [%RPATH%] >> %F% 10 | echo @="URL:Q3A (Quake III Arena)" >> %F% 11 | echo "URL Protocol"="" >> %F% 12 | echo [%RPATH%\shell\open\command] >> %F% 13 | echo @="\"%CWD%\\quake3e.exe\" +set fs_basepath \"%CWD%\" +set fs_homepath \"%CWD%\" +connect \"%%1\"" >> %F% 14 | regedit -s %F% 15 | del %F% -------------------------------------------------------------------------------- /docs/q3url_rem.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | set F=%TEMP%\q3a.reg 3 | echo REGEDIT4 > %F% 4 | rem echo [-HKEY_CLASSES_ROOT\q3a] >> %F% 5 | echo [-HKEY_CURRENT_USER\Software\Classes\q3a] >> %F% 6 | regedit -s %F% 7 | del %F% -------------------------------------------------------------------------------- /docs/quake3e-FAQ.txt: -------------------------------------------------------------------------------- 1 | Q: \r_mode doesn't work for fullscreen 2 | A: dedicated cvar \r_modeFullscreen now is used for fullscreen, 3 | set its value to "" if you want to use \r_mode again 4 | 5 | Q: what mouse mode is used for raw input? 6 | A: \in_mouse 1 7 | 8 | Q: cnq3' raw input feels different 9 | A: try \in_lagged 1 10 | 11 | Q: how to minimize/restore game window by ALT+X key, for example? 12 | A: set \in_minimize "alt+x" ; in_restart 13 | 14 | Q: non-US/EN keyboard input is not working as before 15 | A: \in_forceCharset 0 --------------------------------------------------------------------------------