├── .gitignore ├── LICENSE ├── README.md ├── _globals.v ├── am_map.v ├── build_whole_project.sh ├── chocolate-doom ├── AUTHORS ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── COPYING.md ├── ChangeLog ├── HACKING.md ├── Makefile.am ├── NEWS.md ├── NOT-BUGS.md ├── PHILOSOPHY.md ├── README.Music.md ├── README.Strife.md ├── README.md ├── TODO.md ├── autogen.sh ├── cmake │ ├── FindSDL2.cmake │ ├── FindSDL2_mixer.cmake │ ├── FindSDL2_net.cmake │ ├── Findm.cmake │ ├── Findsamplerate.cmake │ └── config.h.cin ├── configure.ac ├── data │ ├── .gitignore │ ├── Makefile.am │ ├── README │ ├── convert-icon │ ├── doom.ico │ ├── doom8.ico │ ├── setup.ico │ ├── setup.png │ └── setup8.ico ├── man │ ├── .gitignore │ ├── CMDLINE.template │ ├── CMDLINE.template.md │ ├── INSTALL.template │ ├── Makefile.am │ ├── bash-completion │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── doom.template.in │ │ ├── heretic.template.in │ │ ├── hexen.template.in │ │ └── strife.template.in │ ├── default.cfg.template │ ├── docgen │ ├── doom.template │ ├── environ.man │ ├── extra.cfg.template │ ├── heretic.template │ ├── hexen.template │ ├── iwad_paths.man │ ├── server.template │ ├── setup.template │ ├── simplecpp │ ├── strife.template │ └── wikipages ├── midiproc │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Makefile.am │ ├── buffer.c │ ├── buffer.h │ ├── main.c │ └── proto.h ├── opl │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Makefile.am │ ├── examples │ │ ├── .gitignore │ │ ├── Makefile.am │ │ └── droplay.c │ ├── ioperm_sys.c │ ├── ioperm_sys.h │ ├── opl.c │ ├── opl.h │ ├── opl3.c │ ├── opl3.h │ ├── opl_internal.h │ ├── opl_linux.c │ ├── opl_obsd.c │ ├── opl_queue.c │ ├── opl_queue.h │ ├── opl_sdl.c │ ├── opl_timer.c │ ├── opl_timer.h │ └── opl_win32.c ├── pcsound │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Makefile.am │ ├── pcsound.c │ ├── pcsound.h │ ├── pcsound_bsd.c │ ├── pcsound_internal.h │ ├── pcsound_linux.c │ ├── pcsound_sdl.c │ └── pcsound_win32.c ├── pkg │ ├── .gitignore │ ├── Makefile.am │ ├── config.make.in │ ├── osx │ │ ├── .gitignore │ │ ├── AppController.h │ │ ├── AppController.m │ │ ├── Execute.h │ │ ├── Execute.m │ │ ├── GNUmakefile │ │ ├── IWADController.h │ │ ├── IWADController.m │ │ ├── Info.plist.in │ │ ├── LauncherManager.h │ │ ├── LauncherManager.m │ │ ├── PkgInfo │ │ ├── Resources │ │ │ ├── 128x128.png │ │ │ ├── app.icns │ │ │ ├── app.png │ │ │ ├── launcher.nib │ │ │ │ ├── designable.nib │ │ │ │ └── keyedobjects.nib │ │ │ ├── wadfile.icns │ │ │ └── wadfile.png │ │ ├── cp-with-libs │ │ ├── disk │ │ │ ├── background.png │ │ │ └── dir.DS_Store │ │ ├── dmgfix │ │ └── main.m │ └── win32 │ │ ├── .gitignore │ │ ├── GNUmakefile │ │ ├── README │ │ └── cp-with-libs ├── rpm.spec.in ├── src │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Doom.desktop.in │ ├── Doom.metainfo.xml.in │ ├── Doom_Screensaver.desktop.in │ ├── Heretic.desktop.in │ ├── Heretic.metainfo.xml.in │ ├── Hexen.desktop.in │ ├── Hexen.metainfo.xml.in │ ├── Makefile.am │ ├── Strife.desktop.in │ ├── Strife.metainfo.xml.in │ ├── aes_prng.c │ ├── aes_prng.h │ ├── d_dedicated.c │ ├── d_event.c │ ├── d_event.h │ ├── d_iwad.c │ ├── d_iwad.h │ ├── d_loop.c │ ├── d_loop.h │ ├── d_mode.c │ ├── d_mode.h │ ├── d_ticcmd.h │ ├── deh_defs.h │ ├── deh_io.c │ ├── deh_io.h │ ├── deh_main.c │ ├── deh_main.h │ ├── deh_mapping.c │ ├── deh_mapping.h │ ├── deh_str.c │ ├── deh_str.h │ ├── deh_text.c │ ├── doom │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── Makefile.am │ │ ├── am_map.c │ │ ├── am_map.h │ │ ├── build_all.sh │ │ ├── c2v.toml │ │ ├── d_englsh.h │ │ ├── d_items.c │ │ ├── d_items.h │ │ ├── d_main.c │ │ ├── d_main.h │ │ ├── d_net.c │ │ ├── d_player.h │ │ ├── d_textur.h │ │ ├── d_think.h │ │ ├── deh_ammo.c │ │ ├── deh_bexstr.c │ │ ├── deh_cheat.c │ │ ├── deh_doom.c │ │ ├── deh_frame.c │ │ ├── deh_misc.c │ │ ├── deh_misc.h │ │ ├── deh_ptr.c │ │ ├── deh_sound.c │ │ ├── deh_thing.c │ │ ├── deh_weapon.c │ │ ├── doomdata.h │ │ ├── doomdef.c │ │ ├── doomdef.h │ │ ├── doomstat.c │ │ ├── doomstat.h │ │ ├── dstrings.c │ │ ├── dstrings.h │ │ ├── f_finale.c │ │ ├── f_finale.h │ │ ├── f_wipe.c │ │ ├── f_wipe.h │ │ ├── g_game.c │ │ ├── g_game.h │ │ ├── hu_lib.c │ │ ├── hu_lib.h │ │ ├── hu_stuff.c │ │ ├── hu_stuff.h │ │ ├── info.c │ │ ├── info.h │ │ ├── m_menu.c │ │ ├── m_menu.h │ │ ├── m_random.c │ │ ├── m_random.h │ │ ├── p_ceilng.c │ │ ├── p_doors.c │ │ ├── p_enemy.c │ │ ├── p_floor.c │ │ ├── p_inter.c │ │ ├── p_inter.h │ │ ├── p_lights.c │ │ ├── p_local.h │ │ ├── p_map.c │ │ ├── p_maputl.c │ │ ├── p_mobj.c │ │ ├── p_mobj.h │ │ ├── p_plats.c │ │ ├── p_pspr.c │ │ ├── p_pspr.h │ │ ├── p_saveg.c │ │ ├── p_saveg.h │ │ ├── p_setup.c │ │ ├── p_setup.h │ │ ├── p_sight.c │ │ ├── p_spec.c │ │ ├── p_spec.h │ │ ├── p_switch.c │ │ ├── p_telept.c │ │ ├── p_tick.c │ │ ├── p_tick.h │ │ ├── p_user.c │ │ ├── r_bsp.c │ │ ├── r_bsp.h │ │ ├── r_data.c │ │ ├── r_data.h │ │ ├── r_defs.h │ │ ├── r_draw.c │ │ ├── r_draw.h │ │ ├── r_local.h │ │ ├── r_main.c │ │ ├── r_main.h │ │ ├── r_plane.c │ │ ├── r_plane.h │ │ ├── r_segs.c │ │ ├── r_segs.h │ │ ├── r_sky.c │ │ ├── r_sky.h │ │ ├── r_state.h │ │ ├── r_things.c │ │ ├── r_things.h │ │ ├── s_sound.c │ │ ├── s_sound.h │ │ ├── sounds.c │ │ ├── sounds.h │ │ ├── st_lib.c │ │ ├── st_lib.h │ │ ├── st_stuff.c │ │ ├── st_stuff.h │ │ ├── statdump.c │ │ ├── statdump.h │ │ ├── wi_stuff.c │ │ └── wi_stuff.h │ ├── doomkeys.h │ ├── doomtype.h │ ├── gusconf.c │ ├── gusconf.h │ ├── i_cdmus.c │ ├── i_cdmus.h │ ├── i_endoom.c │ ├── i_endoom.h │ ├── i_glob.c │ ├── i_glob.h │ ├── i_input.c │ ├── i_input.h │ ├── i_joystick.c │ ├── i_joystick.h │ ├── i_main.c │ ├── i_midipipe.c │ ├── i_midipipe.h │ ├── i_musicpack.c │ ├── i_oplmusic.c │ ├── i_pcsound.c │ ├── i_sdlmusic.c │ ├── i_sdlsound.c │ ├── i_sound.c │ ├── i_sound.h │ ├── i_swap.h │ ├── i_system.c │ ├── i_system.h │ ├── i_timer.c │ ├── i_timer.h │ ├── i_video.c │ ├── i_video.h │ ├── i_videohr.c │ ├── i_videohr.h │ ├── icon.c │ ├── m_argv.c │ ├── m_argv.h │ ├── m_bbox.c │ ├── m_bbox.h │ ├── m_cheat.c │ ├── m_cheat.h │ ├── m_config.c │ ├── m_config.h │ ├── m_controls.c │ ├── m_controls.h │ ├── m_fixed.c │ ├── m_fixed.h │ ├── m_misc.c │ ├── m_misc.h │ ├── manifest.xml │ ├── memio.c │ ├── memio.h │ ├── midifile.c │ ├── midifile.h │ ├── mus2mid.c │ ├── mus2mid.h │ ├── net_client.c │ ├── net_client.h │ ├── net_common.c │ ├── net_common.h │ ├── net_dedicated.c │ ├── net_dedicated.h │ ├── net_defs.h │ ├── net_gui.c │ ├── net_gui.h │ ├── net_io.c │ ├── net_io.h │ ├── net_loop.c │ ├── net_loop.h │ ├── net_packet.c │ ├── net_packet.h │ ├── net_petname.c │ ├── net_petname.h │ ├── net_query.c │ ├── net_query.h │ ├── net_sdl.c │ ├── net_sdl.h │ ├── net_server.c │ ├── net_server.h │ ├── net_structrw.c │ ├── net_structrw.h │ ├── resource.rc.in │ ├── setup-res.rc.in │ ├── setup │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── Makefile.am │ │ ├── Setup.desktop.in │ │ ├── compatibility.c │ │ ├── compatibility.h │ │ ├── display.c │ │ ├── display.h │ │ ├── execute.c │ │ ├── execute.h │ │ ├── joystick.c │ │ ├── joystick.h │ │ ├── keyboard.c │ │ ├── keyboard.h │ │ ├── mainmenu.c │ │ ├── mode.c │ │ ├── mode.h │ │ ├── mouse.c │ │ ├── mouse.h │ │ ├── multiplayer.c │ │ ├── multiplayer.h │ │ ├── setup-manifest.xml.in │ │ ├── setup_icon.c │ │ ├── sound.c │ │ ├── sound.h │ │ ├── txt_joyaxis.c │ │ ├── txt_joyaxis.h │ │ ├── txt_joybinput.c │ │ ├── txt_joybinput.h │ │ ├── txt_keyinput.c │ │ ├── txt_keyinput.h │ │ ├── txt_mouseinput.c │ │ └── txt_mouseinput.h │ ├── sha1.c │ ├── sha1.h │ ├── tables.c │ ├── tables.h │ ├── v_diskicon.c │ ├── v_diskicon.h │ ├── v_patch.h │ ├── v_video.c │ ├── v_video.h │ ├── w_checksum.c │ ├── w_checksum.h │ ├── w_file.c │ ├── w_file.h │ ├── w_file_posix.c │ ├── w_file_stdc.c │ ├── w_file_win32.c │ ├── w_main.c │ ├── w_main.h │ ├── w_merge.c │ ├── w_merge.h │ ├── w_wad.c │ ├── w_wad.h │ ├── z_native.c │ ├── z_zone.c │ └── z_zone.h ├── textscreen │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Doxyfile │ ├── Makefile.am │ ├── examples │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── calculator.c │ │ └── guitest.c │ ├── fonts │ │ ├── Makefile.am │ │ ├── README │ │ ├── codepage.h │ │ ├── convert-font │ │ ├── large.h │ │ ├── large.png │ │ ├── normal.h │ │ ├── normal.png │ │ ├── small.h │ │ └── small.png │ ├── textscreen.h │ ├── txt_button.c │ ├── txt_button.h │ ├── txt_checkbox.c │ ├── txt_checkbox.h │ ├── txt_conditional.c │ ├── txt_conditional.h │ ├── txt_desktop.c │ ├── txt_desktop.h │ ├── txt_dropdown.c │ ├── txt_dropdown.h │ ├── txt_fileselect.c │ ├── txt_fileselect.h │ ├── txt_gui.c │ ├── txt_gui.h │ ├── txt_inputbox.c │ ├── txt_inputbox.h │ ├── txt_io.c │ ├── txt_io.h │ ├── txt_label.c │ ├── txt_label.h │ ├── txt_main.h │ ├── txt_radiobutton.c │ ├── txt_radiobutton.h │ ├── txt_scrollpane.c │ ├── txt_scrollpane.h │ ├── txt_sdl.c │ ├── txt_sdl.h │ ├── txt_separator.c │ ├── txt_separator.h │ ├── txt_spinctrl.c │ ├── txt_spinctrl.h │ ├── txt_strut.c │ ├── txt_strut.h │ ├── txt_table.c │ ├── txt_table.h │ ├── txt_utf8.c │ ├── txt_utf8.h │ ├── txt_widget.c │ ├── txt_widget.h │ ├── txt_window.c │ ├── txt_window.h │ ├── txt_window_action.c │ └── txt_window_action.h └── win32 │ ├── win_opendir.c │ └── win_opendir.h ├── d_items.v ├── d_main.v ├── d_net.v ├── deh_ammo.v ├── deh_bexstr.v ├── deh_cheat.v ├── deh_doom.v ├── deh_frame.v ├── deh_misc.v ├── deh_ptr.v ├── deh_sound.v ├── deh_thing.v ├── deh_weapon.v ├── doomdef.v ├── doomstat.v ├── dstrings.v ├── f_finale.v ├── f_wipe.v ├── g_game.v ├── hu_lib.v ├── hu_stuff.v ├── info.v ├── m_menu.v ├── m_random.v ├── p_ceilng.v ├── p_doors.v ├── p_enemy.v ├── p_floor.v ├── p_inter.v ├── p_lights.v ├── p_map.v ├── p_maputl.v ├── p_mobj.v ├── p_plats.v ├── p_pspr.v ├── p_saveg.v ├── p_setup.v ├── p_sight.v ├── p_spec.v ├── p_switch.v ├── p_telept.v ├── p_tick.v ├── p_user.v ├── r_bsp.v ├── r_data.v ├── r_draw.v ├── r_main.v ├── r_plane.v ├── r_segs.v ├── r_sky.v ├── r_things.v ├── s_sound.v ├── sounds.v ├── st_lib.v ├── st_stuff.v ├── statdump.v ├── vdoom_patch_linux.v └── wi_stuff.v /.gitignore: -------------------------------------------------------------------------------- 1 | ##ignore editor backup files: 2 | *~ 3 | 4 | ## ignore intermediary files generated by c2v 5 | *.json 6 | 7 | ## ignore cmake generated files: 8 | CMakeLists.txt.user 9 | CMakeCache.txt 10 | CMakeFiles 11 | CMakeScripts 12 | Testing 13 | Makefile 14 | cmake_install.cmake 15 | install_manifest.txt 16 | compile_commands.json 17 | CTestTestfile.cmake 18 | _deps 19 | 20 | # ignore local Doom resource files: 21 | *.WAD 22 | *.wad 23 | -------------------------------------------------------------------------------- /build_whole_project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e; 4 | set -x; 5 | 6 | if [ -z ${CC+x} ]; then export CC=clang; fi 7 | if [ -z ${DOOM_FOLDER+x} ]; then export DOOM_FOLDER=~/code/doom; fi 8 | if [ -z ${WAD_FILE+x} ]; then export WAD_FILE=~/Downloads/DOOM1.WAD; fi 9 | 10 | cd $DOOM_FOLDER/chocolate-doom ; 11 | git clean -xf ; 12 | rm -rf src/doom/doom_v/ ; 13 | cmake -DCMAKE_BUILD_TYPE=Debug . ; 14 | make chocolate-doom ; 15 | 16 | v translate src/doom ; 17 | 18 | cat << EOF > src/doom/doom_v/vdoom_patch_linux.v 19 | module main 20 | const _is_space = 8192 21 | type U16 = u16 22 | fn C.__ctype_b_loc() &&U16 23 | fn __ctype_b_loc() &&U16 { return C.__ctype_b_loc() } 24 | EOF 25 | 26 | cd $DOOM_FOLDER/chocolate-doom/src/doom ; 27 | ## compile the produced V source code to an .o file that can be linked to the rest: 28 | v -cc $CC -o doom_v/doom.o -w -translated doom_v/ 29 | 30 | $CC -o doomv \ 31 | $DOOM_FOLDER/chocolate-doom/src/CMakeFiles/chocolate-doom.dir/*.o \ 32 | $DOOM_FOLDER/chocolate-doom/textscreen/CMakeFiles/textscreen.dir/*.o \ 33 | $DOOM_FOLDER/chocolate-doom/pcsound/CMakeFiles/pcsound.dir/*.o \ 34 | $DOOM_FOLDER/chocolate-doom/opl/CMakeFiles/opl.dir/*.o \ 35 | $DOOM_FOLDER/chocolate-doom/src/doom/doom_v/doom.o \ 36 | $(sdl2-config --libs) -lSDL2_mixer -lSDL2_net -lpng -lsamplerate -lm 37 | 38 | cp $WAD_FILE . 39 | 40 | echo "Run doom with:" 41 | echo "$DOOM_FOLDER/chocolate-doom/src/doom/doomv" 42 | -------------------------------------------------------------------------------- /chocolate-doom/AUTHORS: -------------------------------------------------------------------------------- 1 | Simon Howard 2 | James Haley 3 | Samuel Villarreal 4 | Fabian Greffrath 5 | Jonathan Dowland 6 | Alexey Khokholov 7 | -------------------------------------------------------------------------------- /chocolate-doom/ChangeLog: -------------------------------------------------------------------------------- 1 | Chocolate Doom's version history is stored in Git. For a full 2 | change log, clone the repository on Github: 3 | 4 | https://github.com/chocolate-doom/chocolate-doom 5 | 6 | -------------------------------------------------------------------------------- /chocolate-doom/TODO.md: -------------------------------------------------------------------------------- 1 | This is Chocolate Doom’s “to do” list. Note that this is kind of an arbitrary 2 | and unstructured wish list of features and improvements. The bug tracker 3 | (http://chocolate-doom.org/bugs) has more feature requests. 4 | 5 | * Multiplayer: 6 | - Use UPnP to automatically configure port forwarding for NATed 7 | networks. 8 | - Multiplayer options and configuration file (server name, etc) 9 | * Improve multiplayer startup: 10 | - Select an IWAD automatically from the server’s game type rather than 11 | all players having to specify -iwad. 12 | - Send list of WADs to load instead of all clients having to specify -file. 13 | - Same applies to dehacked patches and wad merging parameters. 14 | * Portability improvements: 15 | - Test on and fix for architectures where `((-2) >> 1) != -1` 16 | - Use size-specific types (eg. `int32_t` instead of int) 17 | - Don’t make structure packing assumptions when loading levels. 18 | - Port to every OS and architecture under the sun 19 | - Port to Emscripten and release a web-based version. 20 | * Video capture mode 21 | - Real-time recording of gameplay 22 | - Batch conversion of demos into videos 23 | * Heretic/Hexen/Strife: 24 | - Merge r_draw.c to common version and delete duplicates 25 | - Heretic v1.2 emulation (if possible) 26 | - Hexen v1.0 emulation (if possible/necessary) 27 | - Strife v1.1 emulation (for demo IWAD support) 28 | - Screensaver mode 29 | 30 | Crazy pie in the sky ideas: 31 | 32 | * Automatic WAD installer - download and run TCs from a list automatically 33 | (automating the current “instructions on wiki” system). 34 | * Textscreen interface to the Compet-N database: menu driven system to 35 | automatically download and play speedruns. 36 | * DWANGO-like interface for finding players and setting up games. 37 | -------------------------------------------------------------------------------- /chocolate-doom/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | autoreconf -fi 4 | ./configure "$@" 5 | -------------------------------------------------------------------------------- /chocolate-doom/cmake/Findm.cmake: -------------------------------------------------------------------------------- 1 | # Findm.cmake 2 | # 3 | # Copyright (c) 2018, Alex Mayfield 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are met: 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 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 | # * Neither the name of the nor the 14 | # names of its contributors may be used to endorse or promote products 15 | # derived from this software without specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | # DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 21 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | # 28 | # Finds libm, so we can link against it for math functions. If libm doesn't 29 | # exist, linking against the m target will have no effect. 30 | 31 | find_library(M_LIBRARY m) 32 | 33 | add_library(m INTERFACE) 34 | if(M_LIBRARY) 35 | target_link_libraries(m INTERFACE "${M_LIBRARY}") 36 | endif() 37 | -------------------------------------------------------------------------------- /chocolate-doom/cmake/config.h.cin: -------------------------------------------------------------------------------- 1 | #cmakedefine PACKAGE_NAME "@PACKAGE_NAME@" 2 | #cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@" 3 | #cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@" 4 | #cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" 5 | #cmakedefine PROGRAM_PREFIX "@PROGRAM_PREFIX@" 6 | 7 | #cmakedefine HAVE_LIBSAMPLERATE 8 | #cmakedefine HAVE_LIBPNG 9 | #cmakedefine HAVE_DIRENT_H 10 | #cmakedefine01 HAVE_DECL_STRCASECMP 11 | #cmakedefine01 HAVE_DECL_STRNCASECMP 12 | -------------------------------------------------------------------------------- /chocolate-doom/data/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | Makefile 3 | *-doom.png 4 | *-setup.png 5 | -------------------------------------------------------------------------------- /chocolate-doom/data/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST= \ 3 | README \ 4 | doom.ico \ 5 | doom8.ico \ 6 | doom.png \ 7 | setup.ico \ 8 | setup8.ico \ 9 | setup.png \ 10 | convert-icon 11 | 12 | iconsdir = $(prefix)/share/icons/hicolor/128x128/apps 13 | icons_DATA = @PROGRAM_PREFIX@doom.png \ 14 | @PROGRAM_PREFIX@setup.png 15 | 16 | @PROGRAM_PREFIX@doom.png : doom.png 17 | cp $(top_srcdir)/data/doom.png $@ 18 | 19 | @PROGRAM_PREFIX@setup.png : setup.png 20 | cp $(top_srcdir)/data/setup.png $@ 21 | 22 | CLEANFILES = $(icons_DATA) 23 | -------------------------------------------------------------------------------- /chocolate-doom/data/README: -------------------------------------------------------------------------------- 1 | The Chocolate Doom icon is based on an image by Chris Metcalf 2 | (http://www.chrismetcalf.org/) which is copyrighted to him: 3 | 4 | http://www.flickr.com/photos/laffy4k/448920776/ 5 | 6 | Chris has kindly agreed that the Chocolate Doom icon may be used under 7 | the GNU GPL, so the copyright status of the icon is the same as that of 8 | the rest of the project. 9 | 10 | The "foo8.ico" files are 8-bit depth only, while the "foo.ico" files 11 | contain full 32-bit versions, scaled to different sizes and with proper 12 | alpha masks (as well as the 8-bit versions). The 8-bit versions are 13 | used when setting the icon within SDL, as SDL under Windows displays 14 | full color icons in a very poor quality. The full-color versions are 15 | used in the resource files. 16 | 17 | -------------------------------------------------------------------------------- /chocolate-doom/data/doom.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/data/doom.ico -------------------------------------------------------------------------------- /chocolate-doom/data/doom8.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/data/doom8.ico -------------------------------------------------------------------------------- /chocolate-doom/data/setup.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/data/setup.ico -------------------------------------------------------------------------------- /chocolate-doom/data/setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/data/setup.png -------------------------------------------------------------------------------- /chocolate-doom/data/setup8.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/data/setup8.ico -------------------------------------------------------------------------------- /chocolate-doom/man/.gitignore: -------------------------------------------------------------------------------- 1 | CMDLINE.doom 2 | CMDLINE.doom.md 3 | CMDLINE.heretic 4 | CMDLINE.heretic.md 5 | CMDLINE.hexen 6 | CMDLINE.hexen.md 7 | CMDLINE.strife 8 | CMDLINE.strife.md 9 | INSTALL.doom 10 | INSTALL.heretic 11 | INSTALL.hexen 12 | INSTALL.strife 13 | Makefile.in 14 | Makefile 15 | *.6 16 | *.5 17 | -------------------------------------------------------------------------------- /chocolate-doom/man/CMDLINE.template: -------------------------------------------------------------------------------- 1 | == Command line parameters == 2 | 3 | This is a full list of the supported command line parameters. A number of 4 | additional parameters are supported in addition to those present in the DOS 5 | version. 6 | 7 | @content 8 | 9 | -------------------------------------------------------------------------------- /chocolate-doom/man/CMDLINE.template.md: -------------------------------------------------------------------------------- 1 | # Command line parameters 2 | 3 | This is a full list of the supported command line parameters. A number of 4 | additional parameters are supported in addition to those present in the DOS 5 | version. 6 | 7 | @content 8 | 9 | -------------------------------------------------------------------------------- /chocolate-doom/man/bash-completion/.gitignore: -------------------------------------------------------------------------------- 1 | *doom 2 | *heretic 3 | *hexen 4 | *strife 5 | *.template 6 | -------------------------------------------------------------------------------- /chocolate-doom/man/bash-completion/Makefile.am: -------------------------------------------------------------------------------- 1 | bashcompletiondir=@datadir@/bash-completion/completions 2 | 3 | BASH_COMPLETION_TEMPLATES = \ 4 | doom.template \ 5 | heretic.template \ 6 | hexen.template \ 7 | strife.template 8 | 9 | if HAVE_PYTHON 10 | 11 | BASH_COMPLETION_SCRIPTLETS = \ 12 | @PROGRAM_PREFIX@doom \ 13 | @PROGRAM_PREFIX@heretic \ 14 | @PROGRAM_PREFIX@hexen \ 15 | @PROGRAM_PREFIX@strife 16 | 17 | bashcompletion_DATA = $(BASH_COMPLETION_SCRIPTLETS) 18 | CLEANFILES = $(BASH_COMPLETION_SCRIPTLETS) 19 | 20 | DOCGEN = $(top_srcdir)/man/docgen 21 | DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@" -z "@PACKAGE_SHORTNAME@" 22 | 23 | @PROGRAM_PREFIX@doom: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES) 24 | $(DOCGEN) $(DOCGEN_COMMON_ARGS) \ 25 | -g doom -b doom.template \ 26 | $(top_srcdir)/src $(top_srcdir)/src/doom > $@ 27 | 28 | @PROGRAM_PREFIX@heretic: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES) 29 | $(DOCGEN) $(DOCGEN_COMMON_ARGS) \ 30 | -g heretic -b heretic.template \ 31 | $(top_srcdir)/src $(top_srcdir)/src/heretic > $@ 32 | 33 | @PROGRAM_PREFIX@hexen: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES) 34 | $(DOCGEN) $(DOCGEN_COMMON_ARGS) \ 35 | -g hexen -b hexen.template \ 36 | $(top_srcdir)/src $(top_srcdir)/src/hexen > $@ 37 | 38 | @PROGRAM_PREFIX@strife: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES) 39 | $(DOCGEN) $(DOCGEN_COMMON_ARGS) \ 40 | -g strife -b strife.template \ 41 | $(top_srcdir)/src $(top_srcdir)/src/strife > $@ 42 | 43 | EXTRA_DIST = \ 44 | $(BASH_COMPLETION_TEMPLATES) \ 45 | $(BASH_COMPLETION_SCRIPTLETS) 46 | 47 | else 48 | 49 | EXTRA_DIST = \ 50 | $(BASH_COMPLETION_TEMPLATES) 51 | 52 | endif 53 | -------------------------------------------------------------------------------- /chocolate-doom/man/bash-completion/doom.template.in: -------------------------------------------------------------------------------- 1 | # bash completion for @PACKAGE_SHORTNAME@ Doom -*- shell-script -*- 2 | 3 | _@PROGRAM_SPREFIX@_doom() 4 | { 5 | local cur prev words cword 6 | _init_completion || return 7 | 8 | # Save the previous switch on the command line in the prevsw variable 9 | local i prevsw="" 10 | for (( i=1; $cword > 1 && i <= $cword; i++ )); do 11 | if [[ ${words[i]} == -* ]]; then 12 | prevsw=${words[i]} 13 | fi 14 | done 15 | 16 | # Allow adding more than one file with the same extension to the same switch 17 | case $prevsw in 18 | -config|-extraconfig) 19 | _filedir cfg 20 | ;; 21 | -file|-iwad|-aa|-af|-as|-merge|-nwtmerge) 22 | _filedir wad 23 | ;; 24 | -playdemo|-timedemo) 25 | _filedir lmp 26 | ;; 27 | -deh) 28 | _filedir '@(bex|deh)' 29 | ;; 30 | esac 31 | 32 | case $prev in 33 | -pack) 34 | COMPREPLY=(doom2 tnt plutonia) 35 | ;; 36 | -gameversion) 37 | COMPREPLY=(1.666 1.7 1.8 1.9 ultimate final final2 hacx chex) 38 | ;; 39 | -setmem) 40 | COMPREPLY=(dos622 dos71 dosbox) 41 | ;; 42 | esac 43 | 44 | if [[ $cur == -* ]]; then 45 | COMPREPLY=( $( compgen -W '@content' -- "$cur" ) ) 46 | fi 47 | } && 48 | 49 | complete -F _@PROGRAM_SPREFIX@_doom @PROGRAM_PREFIX@doom 50 | 51 | # ex: ts=4 sw=4 et filetype=sh 52 | -------------------------------------------------------------------------------- /chocolate-doom/man/bash-completion/heretic.template.in: -------------------------------------------------------------------------------- 1 | # bash completion for @PACKAGE_SHORTNAME@ Heretic -*- shell-script -*- 2 | 3 | _@PROGRAM_SPREFIX@_heretic() 4 | { 5 | local cur prev words cword 6 | _init_completion || return 7 | 8 | # Save the previous switch on the command line in the prevsw variable 9 | local i prevsw="" 10 | for (( i=1; $cword > 1 && i <= $cword; i++ )); do 11 | if [[ ${words[i]} == -* ]]; then 12 | prevsw=${words[i]} 13 | fi 14 | done 15 | 16 | # Allow adding more than one file with the same extension to the same switch 17 | case $prevsw in 18 | -config|-extraconfig) 19 | _filedir cfg 20 | ;; 21 | -file|-iwad|-aa|-af|-as|-merge|-nwtmerge) 22 | _filedir wad 23 | ;; 24 | -playdemo|-timedemo) 25 | _filedir lmp 26 | ;; 27 | -deh) 28 | _filedir hhe 29 | ;; 30 | esac 31 | 32 | case $prev in 33 | -hhever) 34 | COMPREPLY=(1.0 1.2 1.3) 35 | ;; 36 | -setmem) 37 | COMPREPLY=(dos622 dos71 dosbox) 38 | ;; 39 | esac 40 | 41 | if [[ $cur == -* ]]; then 42 | COMPREPLY=( $( compgen -W '@content' -- "$cur" ) ) 43 | fi 44 | } && 45 | 46 | complete -F _@PROGRAM_SPREFIX@_heretic @PROGRAM_PREFIX@heretic 47 | 48 | # ex: ts=4 sw=4 et filetype=sh 49 | -------------------------------------------------------------------------------- /chocolate-doom/man/bash-completion/hexen.template.in: -------------------------------------------------------------------------------- 1 | # bash completion for @PACKAGE_SHORTNAME@ Hexen -*- shell-script -*- 2 | 3 | _@PROGRAM_SPREFIX@_hexen() 4 | { 5 | local cur prev words cword 6 | _init_completion || return 7 | 8 | # Save the previous switch on the command line in the prevsw variable 9 | local i prevsw="" 10 | for (( i=1; $cword > 1 && i <= $cword; i++ )); do 11 | if [[ ${words[i]} == -* ]]; then 12 | prevsw=${words[i]} 13 | fi 14 | done 15 | 16 | # Allow adding more than one file with the same extension to the same switch 17 | case $prevsw in 18 | -config|-extraconfig) 19 | _filedir cfg 20 | ;; 21 | -file|-iwad|-aa|-af|-as|-merge|-nwtmerge) 22 | _filedir wad 23 | ;; 24 | -playdemo|-timedemo) 25 | _filedir lmp 26 | ;; 27 | esac 28 | 29 | case $prev in 30 | -setmem) 31 | COMPREPLY=(dos622 dos71 dosbox) 32 | ;; 33 | esac 34 | 35 | if [[ $cur == -* ]]; then 36 | COMPREPLY=( $( compgen -W '@content' -- "$cur" ) ) 37 | fi 38 | } && 39 | 40 | complete -F _@PROGRAM_SPREFIX@_hexen @PROGRAM_PREFIX@hexen 41 | 42 | # ex: ts=4 sw=4 et filetype=sh 43 | -------------------------------------------------------------------------------- /chocolate-doom/man/bash-completion/strife.template.in: -------------------------------------------------------------------------------- 1 | # bash completion for @PACKAGE_SHORTNAME@ Strife -*- shell-script -*- 2 | 3 | _@PROGRAM_SPREFIX@_strife() 4 | { 5 | local cur prev words cword 6 | _init_completion || return 7 | 8 | # Save the previous switch on the command line in the prevsw variable 9 | local i prevsw="" 10 | for (( i=1; $cword > 1 && i <= $cword; i++ )); do 11 | if [[ ${words[i]} == -* ]]; then 12 | prevsw=${words[i]} 13 | fi 14 | done 15 | 16 | # Allow adding more than one file with the same extension to the same switch 17 | case $prevsw in 18 | -config|-extraconfig) 19 | _filedir cfg 20 | ;; 21 | -file|-iwad|-aa|-af|-as|-merge|-nwtmerge) 22 | _filedir wad 23 | ;; 24 | -playdemo|-timedemo) 25 | _filedir lmp 26 | ;; 27 | -deh) 28 | _filedir seh 29 | ;; 30 | esac 31 | 32 | case $prev in 33 | -gameversion) 34 | COMPREPLY=(1.2 1.31) 35 | ;; 36 | -setmem) 37 | COMPREPLY=(dos622 dos71 dosbox) 38 | ;; 39 | esac 40 | 41 | if [[ $cur == -* ]]; then 42 | COMPREPLY=( $( compgen -W '@content' -- "$cur" ) ) 43 | fi 44 | } && 45 | 46 | complete -F _@PROGRAM_SPREFIX@_strife @PROGRAM_PREFIX@strife 47 | 48 | # ex: ts=4 sw=4 et filetype=sh 49 | -------------------------------------------------------------------------------- /chocolate-doom/man/doom.template: -------------------------------------------------------------------------------- 1 | .TH @PROGRAM_SPREFIX@\-doom 6 2 | .SH NAME 3 | @PROGRAM_SPREFIX@\-doom \- historically compatible Doom engine 4 | .SH SYNOPSIS 5 | .B @PROGRAM_SPREFIX@\-doom 6 | [\fIOPTIONS\fR] 7 | .SH DESCRIPTION 8 | .PP 9 | @PACKAGE_SHORTNAME@ Doom is a port of Id Software's 1993 game "Doom" that is designed 10 | to behave as similar to the original DOS version of Doom as is possible. 11 | .br 12 | @content 13 | .SH IWAD SEARCH PATHS 14 | @include iwad_paths.man 15 | .SH ENVIRONMENT 16 | This section describes environment variables that control @PACKAGE_NAME@'s 17 | behavior. 18 | @include environ.man 19 | .SH FILES 20 | .TP 21 | \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/default.cfg\fR 22 | The main configuration file for @PACKAGE_NAME@. See \fBdefault.cfg\fR(5). 23 | .TP 24 | \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-doom.cfg\fR 25 | Extra configuration values that are specific to @PACKAGE_NAME@ and not 26 | present in Vanilla Doom. See \fB@PROGRAM_SPREFIX@\-doom.cfg\fR(5). 27 | .SH SEE ALSO 28 | \fB@PROGRAM_SPREFIX@\-server\fR(6), 29 | \fB@PROGRAM_SPREFIX@\-setup\fR(6), 30 | \fB@PROGRAM_SPREFIX@\-heretic\fR(6), 31 | \fB@PROGRAM_SPREFIX@\-hexen\fR(6), 32 | \fB@PROGRAM_SPREFIX@\-strife\fR(6) 33 | .SH AUTHOR 34 | Chocolate Doom is written and maintained by Simon Howard. It is based on 35 | the LinuxDoom source code, released by Id Software. 36 | .SH COPYRIGHT 37 | Copyright \(co id Software Inc. 38 | Copyright \(co 2005-2016 Simon Howard. 39 | .br 40 | This is free software. You may redistribute copies of it under the terms of 41 | the GNU General Public License . 42 | There is NO WARRANTY, to the extent permitted by law. 43 | 44 | -------------------------------------------------------------------------------- /chocolate-doom/man/environ.man: -------------------------------------------------------------------------------- 1 | .TP 2 | \fBDOOMWADDIR\fR, \fBDOOMWADPATH\fR 3 | See the section, \fBIWAD SEARCH PATHS\fR above. 4 | .TP 5 | \fBPCSOUND_DRIVER\fR 6 | When running in PC speaker sound effect mode, this environment variable 7 | specifies a PC speaker driver to use for sound effect playback. Valid 8 | options are "Linux" for the Linux console mode driver, "BSD" for the 9 | NetBSD/OpenBSD PC speaker driver, and "SDL" for SDL-based emulated PC speaker 10 | playback (using the digital output). 11 | .TP 12 | \fBOPL_DRIVER\fR 13 | When using OPL MIDI playback, this environment variable specifies an 14 | OPL backend driver to use. Valid options are "SDL" for an SDL-based 15 | software emulated OPL chip, "Linux" for the Linux hardware OPL driver, 16 | and "OpenBSD" for the OpenBSD/NetBSD hardware OPL driver. 17 | 18 | Generally speaking, a real hardware OPL chip sounds better than software 19 | emulation; however, modern machines do not often include one. If 20 | present, it may still require extra work to set up and elevated 21 | security privileges to access. 22 | 23 | -------------------------------------------------------------------------------- /chocolate-doom/man/extra.cfg.template: -------------------------------------------------------------------------------- 1 | .TH @PROGRAM_SPREFIX@\-doom.cfg 5 2 | .SH NAME 3 | @PROGRAM_SPREFIX@\-doom.cfg \- @PACKAGE_NAME@ configuration file 4 | .SH DESCRIPTION 5 | .PP 6 | \fI@PROGRAM_SPREFIX@\-doom.cfg\fR 7 | is a configuration file for \fB@PROGRAM_SPREFIX@\-doom\fR(6). This file acts 8 | as an auxiliary configuration file; the main configuration options 9 | are stored in \fBdefault.cfg\fR, which contains the same configuration 10 | options as Vanilla Doom (for compatibility). \fI@PROGRAM_SPREFIX@\-doom.cfg\fR 11 | contains configuration options that are specific to @PACKAGE_NAME@ 12 | only. 13 | .PP 14 | \fI@PROGRAM_SPREFIX@\-doom.cfg\fR is normally stored in the user's home directory, 15 | as \fI~/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-doom.cfg\fR. The path can be 16 | overridden using the \fBXDG_DATA_HOME\fR environment variable (see the XDG 17 | Base Directory Specification). 18 | .PP 19 | The \fB@PROGRAM_SPREFIX@\-setup\fR(6) tool provides a simple to use front-end 20 | for editing \fI@PROGRAM_SPREFIX@\-doom.cfg\fR. 21 | .SH FILE FORMAT 22 | .PP 23 | The file format is the same as that used for \fBdefault.cfg\fR(5). 24 | .br 25 | 26 | @content 27 | 28 | .SH SEE ALSO 29 | \fB@PROGRAM_SPREFIX@\-doom\fR(6), 30 | \fBdefault.cfg\fR(5), 31 | \fB@PROGRAM_SPREFIX@\-setup\fR(6) 32 | 33 | -------------------------------------------------------------------------------- /chocolate-doom/man/heretic.template: -------------------------------------------------------------------------------- 1 | .TH @PROGRAM_SPREFIX@\-heretic 6 2 | .SH NAME 3 | @PROGRAM_SPREFIX@\-heretic \- historically compatible Heretic engine 4 | .SH SYNOPSIS 5 | .B @PROGRAM_SPREFIX@\-heretic 6 | [\fIOPTIONS\fR] 7 | .SH DESCRIPTION 8 | .PP 9 | @PACKAGE_SHORTNAME@ Heretic is a port of Raven Software's 1994 game "Heretic" that 10 | aims to behave as similar to the original DOS version of Heretic as 11 | possible. 12 | .br 13 | @content 14 | .SH IWAD SEARCH PATHS 15 | @include iwad_paths.man 16 | .SH ENVIRONMENT 17 | This section describes environment variables that control @PACKAGE_SHORTNAME@ Heretic's 18 | behavior. 19 | @include environ.man 20 | .SH FILES 21 | .TP 22 | \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/heretic.cfg\fR 23 | The main configuration file for @PACKAGE_SHORTNAME@ Heretic. See \fBheretic.cfg\fR(5). 24 | .TP 25 | \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-heretic.cfg\fR 26 | Extra configuration values that are specific to @PACKAGE_SHORTNAME@ Heretic and not 27 | present in Vanilla Heretic. See \fB@PROGRAM_SPREFIX@\-heretic.cfg\fR(5). 28 | .SH SEE ALSO 29 | \fB@PROGRAM_SPREFIX@\-doom\fR(6), 30 | \fB@PROGRAM_SPREFIX@\-hexen\fR(6), 31 | \fB@PROGRAM_SPREFIX@\-server\fR(6), 32 | \fB@PROGRAM_SPREFIX@\-setup\fR(6) 33 | .SH AUTHOR 34 | Chocolate Heretic is part of the Chocolate Doom project, written and 35 | maintained by Simon Howard. It is based on the Heretic source code, 36 | released by Raven Software. 37 | .SH COPYRIGHT 38 | Copyright \(co id Software Inc. 39 | Copyright \(co Raven Software Inc. 40 | Copyright \(co 2005-2013 Simon Howard. 41 | .br 42 | This is free software. You may redistribute copies of it under the terms of 43 | the GNU General Public License . 44 | There is NO WARRANTY, to the extent permitted by law. 45 | 46 | -------------------------------------------------------------------------------- /chocolate-doom/man/hexen.template: -------------------------------------------------------------------------------- 1 | .TH @PROGRAM_SPREFIX@\-hexen 6 2 | .SH NAME 3 | @PROGRAM_SPREFIX@\-hexen \- historically compatible Hexen engine 4 | .SH SYNOPSIS 5 | .B @PROGRAM_SPREFIX@\-hexen 6 | [\fIOPTIONS\fR] 7 | .SH DESCRIPTION 8 | .PP 9 | @PACKAGE_SHORTNAME@ Hexen is a port of Raven Software's 1995 game "Hexen" that 10 | aims to behave as similar to the original DOS version of Hexen as 11 | possible. 12 | .br 13 | @content 14 | .SH IWAD SEARCH PATHS 15 | @include iwad_paths.man 16 | .SH ENVIRONMENT 17 | This section describes environment variables that control @PACKAGE_SHORTNAME@ Hexen's 18 | behavior. 19 | @include environ.man 20 | .SH FILES 21 | .TP 22 | \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/hexen.cfg\fR 23 | The main configuration file for @PACKAGE_SHORTNAME@ Hexen. See \fBhexen.cfg\fR(5). 24 | .TP 25 | \fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-hexen.cfg\fR 26 | Extra configuration values that are specific to @PACKAGE_SHORTNAME@ Hexen and not 27 | present in Vanilla Hexen. See \fB@PROGRAM_SPREFIX@\-hexen.cfg\fR(5). 28 | .SH SEE ALSO 29 | \fB@PROGRAM_SPREFIX@\-doom\fR(6), 30 | \fB@PROGRAM_SPREFIX@\-heretic\fR(6), 31 | \fB@PROGRAM_SPREFIX@\-server\fR(6), 32 | \fB@PROGRAM_SPREFIX@\-setup\fR(6) 33 | .SH AUTHOR 34 | Chocolate Hexen is part of the Chocolate Doom project, written and 35 | maintained by Simon Howard. It is based on the Hexen source code, 36 | released by Raven Software. 37 | .SH COPYRIGHT 38 | Copyright \(co id Software Inc. 39 | Copyright \(co Raven Software Inc. 40 | Copyright \(co 2005-2013 Simon Howard. 41 | .br 42 | This is free software. You may redistribute copies of it under the terms of 43 | the GNU General Public License . 44 | There is NO WARRANTY, to the extent permitted by law. 45 | 46 | -------------------------------------------------------------------------------- /chocolate-doom/man/server.template: -------------------------------------------------------------------------------- 1 | .TH @PROGRAM_SPREFIX@\-server 6 2 | .SH NAME 3 | @PROGRAM_SPREFIX@\-server \- dedicated server for @PROGRAM_SPREFIX@\-doom 4 | .SH SYNOPSIS 5 | .B @PROGRAM_SPREFIX@\-server 6 | [OPTIONS] 7 | .SH DESCRIPTION 8 | .PP 9 | @PACKAGE_NAME@ is a modern doom engine designed to behave 10 | as similar to the original doom game as is possible. 11 | .PP 12 | .B @PROGRAM_SPREFIX@\-server 13 | is a dedicated server for @PACKAGE_SHORTNAME@. It is equivalent to 14 | running 15 | .B @PROGRAM_SPREFIX@\-doom 16 | with the "\-dedicated" option. 17 | .PP 18 | Game options are not specified to the server, which merely acts to 19 | retransmit data between players in the game; parameters for the 20 | game should be specified by the first player to connect to the server, 21 | who is designated the controlling player. 22 | .br 23 | .SH OPTIONS 24 | .TP 25 | \fB-ignoreversion\fR 26 | Ignore version mismatches between the server and the client. Using this 27 | option may cause game desyncs to occur, or differences in protocol may 28 | mean the netgame will simply not function at all. 29 | .TP 30 | \fB-port \fR 31 | Use the specified UDP port for communications, instead of the default (2342). 32 | .TP 33 | \fB-privateserver\fR 34 | Don't register with the global master server. 35 | .TP 36 | \fB-servername \fR 37 | Specify a name for the server. 38 | .SH SEE ALSO 39 | \fB@PROGRAM_SPREFIX@-doom\fR(6), 40 | \fB@PROGRAM_SPREFIX@-setup\fR(6) 41 | .SH AUTHOR 42 | Chocolate Doom is written and maintained by Simon Howard. 43 | .PP 44 | This manual was written by Jonathan Dowland. 45 | .SH COPYRIGHT 46 | Copyright \(co id Software Inc. 47 | Copyright \(co 2005-8 Simon Howard. 48 | .br 49 | This is free software. You may redistribute copies of it under the terms of 50 | the GNU General Public License . 51 | There is NO WARRANTY, to the extent permitted by law. 52 | 53 | -------------------------------------------------------------------------------- /chocolate-doom/man/setup.template: -------------------------------------------------------------------------------- 1 | .TH @PROGRAM_SPREFIX@\-@GAME@-setup 6 2 | .SH NAME 3 | @PROGRAM_SPREFIX@\-@GAME@-setup \- configuration tool for @PROGRAM_SPREFIX@\-@GAME@ 4 | .SH SYNOPSIS 5 | .B @PROGRAM_SPREFIX@\-@GAME@-setup 6 | [OPTIONS] 7 | .SH DESCRIPTION 8 | .PP 9 | @PACKAGE_SHORTNAME@ @GAME_UPPER@ is a modern @GAME_UPPER@ engine designed to behave 10 | as similar to the original @GAME_UPPER@ game as is possible. 11 | .PP 12 | .B @PROGRAM_SPREFIX@\-@GAME@-setup 13 | is a tool for configuring @PACKAGE_SHORTNAME@ @GAME_UPPER@. It provides a menu\-based 14 | interface for the display, joystick, keyboard, mouse, sound and 15 | compatibility settings. 16 | .PP 17 | .B @PROGRAM_SPREFIX@\-@GAME@-setup 18 | can also be used to start and join network games. 19 | .PP 20 | .SH OPTIONS 21 | .TP 22 | \fB-config \fR 23 | Load configuration from the specified file, instead of @CFGFILE@. 24 | .TP 25 | \fB-extraconfig \fR 26 | Load extra configuration from the specified file, instead of @PROGRAM_SPREFIX@\-@GAME@.cfg. 27 | .SH SEE ALSO 28 | \fB@PROGRAM_SPREFIX@\-@GAME@\fR(6), 29 | \fBdefault.cfg\fR(5), 30 | \fB@PROGRAM_SPREFIX@\-@GAME@.cfg\fR(5) 31 | .SH AUTHOR 32 | Chocolate Doom is written and maintained by Simon Howard. 33 | .PP 34 | This manual was written by Jonathan Dowland. 35 | .SH COPYRIGHT 36 | Copyright \(co id Software Inc. 37 | Copyright \(co 2005-8 Simon Howard. 38 | .br 39 | This is free software. You may redistribute copies of it under the terms of 40 | the GNU General Public License . 41 | There is NO WARRANTY, to the extent permitted by law. 42 | 43 | -------------------------------------------------------------------------------- /chocolate-doom/man/wikipages: -------------------------------------------------------------------------------- 1 | # This is a list of wiki pages to automatically link to when generating 2 | # wikitext output. 3 | Dehacked 4 | Doom 1.91 5 | Merging 6 | Multiplayer 7 | Three screen mode 8 | -------------------------------------------------------------------------------- /chocolate-doom/midiproc/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | Makefile 3 | *.exe 4 | .deps 5 | tags 6 | TAGS 7 | -------------------------------------------------------------------------------- /chocolate-doom/midiproc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(WIN32) 2 | add_executable("${PROGRAM_PREFIX}midiproc" WIN32 buffer.c buffer.h main.c proto.h) 3 | target_include_directories("${PROGRAM_PREFIX}midiproc" 4 | PRIVATE "../src/" "${CMAKE_CURRENT_BINARY_DIR}/../") 5 | target_link_libraries("${PROGRAM_PREFIX}midiproc" SDL2::SDL2main SDL2::mixer) 6 | endif() 7 | -------------------------------------------------------------------------------- /chocolate-doom/midiproc/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS=-I$(top_srcdir)/src @SDLMIXER_CFLAGS@ 3 | 4 | EXTRA_DIST=CMakeLists.txt 5 | 6 | if HAVE_WINDRES 7 | 8 | noinst_PROGRAMS = @PROGRAM_PREFIX@midiproc 9 | 10 | @PROGRAM_PREFIX@midiproc_LDADD = @SDLMIXER_LIBS@ 11 | @PROGRAM_PREFIX@midiproc_SOURCES = buffer.c buffer.h main.c proto.h 12 | 13 | endif 14 | -------------------------------------------------------------------------------- /chocolate-doom/midiproc/buffer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2017 Alex Mayfield 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // A simple buffer and reader implementation. 16 | // 17 | 18 | #ifndef __BUFFER__ 19 | #define __BUFFER__ 20 | 21 | #include "../src/doomtype.h" 22 | 23 | #define BUFFER_SIZE 1024 24 | 25 | typedef struct { 26 | byte buffer[BUFFER_SIZE]; // Buffer. 27 | byte *buffer_end; // End of Buffer. 28 | byte *data; // Start of actual data. 29 | byte *data_end; // End of actual data. 30 | int data_len; // Length of actual data. 31 | } buffer_t; 32 | 33 | typedef struct { 34 | buffer_t *buffer; 35 | byte *pos; 36 | } buffer_reader_t; 37 | 38 | buffer_t *NewBuffer(); 39 | void DeleteBuffer(buffer_t* buf); 40 | int Buffer_Data(buffer_t *buf, byte **data); 41 | boolean Buffer_Push(buffer_t *buf, const void *data, int len); 42 | void Buffer_Shift(buffer_t *buf, int len); 43 | void Buffer_Clear(buffer_t *buf); 44 | 45 | buffer_reader_t *NewReader(buffer_t* buffer); 46 | void DeleteReader(buffer_reader_t *reader); 47 | int Reader_BytesRead(buffer_reader_t *reader); 48 | boolean Reader_ReadInt8(buffer_reader_t *reader, uint8_t *out); 49 | boolean Reader_ReadInt16(buffer_reader_t *reader, uint16_t *out); 50 | boolean Reader_ReadInt32(buffer_reader_t *reader, uint32_t *out); 51 | char *Reader_ReadString(buffer_reader_t *reader); 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /chocolate-doom/midiproc/proto.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2017 Alex Mayfield 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Headers for all types of midipipe messages. 16 | // 17 | 18 | #ifndef __PROTO__ 19 | #define __PROTO__ 20 | 21 | typedef enum { 22 | MIDIPIPE_PACKET_TYPE_REGISTER_SONG, 23 | MIDIPIPE_PACKET_TYPE__DEPRECATED_1, 24 | MIDIPIPE_PACKET_TYPE_SET_VOLUME, 25 | MIDIPIPE_PACKET_TYPE_PLAY_SONG, 26 | MIDIPIPE_PACKET_TYPE_STOP_SONG, 27 | MIDIPIPE_PACKET_TYPE_SHUTDOWN, 28 | MIDIPIPE_PACKET_TYPE_UNREGISTER_SONG, 29 | MIDIPIPE_PACKET_TYPE_ACK, 30 | } net_midipipe_packet_type_t; 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /chocolate-doom/opl/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | Makefile 3 | .deps 4 | libopl.a 5 | *.rc 6 | tags 7 | TAGS 8 | -------------------------------------------------------------------------------- /chocolate-doom/opl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(opl STATIC 2 | opl_internal.h 3 | opl.c opl.h 4 | opl_linux.c 5 | opl_obsd.c 6 | opl_queue.c opl_queue.h 7 | opl_sdl.c 8 | opl_timer.c opl_timer.h 9 | opl_win32.c 10 | ioperm_sys.c ioperm_sys.h 11 | opl3.c opl3.h) 12 | target_include_directories(opl 13 | INTERFACE "." 14 | PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../") 15 | target_link_libraries(opl SDL2::mixer) 16 | -------------------------------------------------------------------------------- /chocolate-doom/opl/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS=@SDLMIXER_CFLAGS@ 3 | 4 | EXTRA_DIST=CMakeLists.txt 5 | 6 | SUBDIRS = . examples 7 | 8 | noinst_LIBRARIES=libopl.a 9 | 10 | libopl_a_SOURCES = \ 11 | opl_internal.h \ 12 | opl.c opl.h \ 13 | opl_linux.c \ 14 | opl_obsd.c \ 15 | opl_queue.c opl_queue.h \ 16 | opl_sdl.c \ 17 | opl_timer.c opl_timer.h \ 18 | opl_win32.c \ 19 | ioperm_sys.c ioperm_sys.h \ 20 | opl3.c opl3.h 21 | 22 | -------------------------------------------------------------------------------- /chocolate-doom/opl/examples/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | Makefile 3 | .deps 4 | droplay 5 | *.exe 6 | tags 7 | TAGS 8 | -------------------------------------------------------------------------------- /chocolate-doom/opl/examples/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS = -I$(top_srcdir)/opl 3 | 4 | noinst_PROGRAMS=droplay 5 | 6 | droplay_LDADD = ../libopl.a @LDFLAGS@ @SDL_LIBS@ @SDLMIXER_LIBS@ 7 | droplay_SOURCES = droplay.c 8 | 9 | -------------------------------------------------------------------------------- /chocolate-doom/opl/ioperm_sys.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2002, 2003 Marcel Telka 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Interface to the ioperm.sys driver, based on code from the 17 | // Cygwin ioperm library. 18 | // 19 | 20 | #ifndef IOPERM_SYS_H 21 | #define IOPERM_SYS_H 22 | 23 | int IOperm_EnablePortRange(unsigned int from, unsigned int num, int turn_on); 24 | int IOperm_InstallDriver(void); 25 | int IOperm_UninstallDriver(void); 26 | 27 | #endif /* #ifndef IOPERM_SYS_H */ 28 | 29 | -------------------------------------------------------------------------------- /chocolate-doom/opl/opl_queue.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // OPL callback queue. 16 | // 17 | 18 | #ifndef OPL_QUEUE_H 19 | #define OPL_QUEUE_H 20 | 21 | #include "opl.h" 22 | 23 | typedef struct opl_callback_queue_s opl_callback_queue_t; 24 | 25 | opl_callback_queue_t *OPL_Queue_Create(void); 26 | int OPL_Queue_IsEmpty(opl_callback_queue_t *queue); 27 | void OPL_Queue_Clear(opl_callback_queue_t *queue); 28 | void OPL_Queue_Destroy(opl_callback_queue_t *queue); 29 | void OPL_Queue_Push(opl_callback_queue_t *queue, 30 | opl_callback_t callback, void *data, 31 | uint64_t time); 32 | int OPL_Queue_Pop(opl_callback_queue_t *queue, 33 | opl_callback_t *callback, void **data); 34 | uint64_t OPL_Queue_Peek(opl_callback_queue_t *queue); 35 | void OPL_Queue_AdjustCallbacks(opl_callback_queue_t *queue, 36 | uint64_t time, float factor); 37 | 38 | #endif /* #ifndef OPL_QUEUE_H */ 39 | 40 | -------------------------------------------------------------------------------- /chocolate-doom/opl/opl_timer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // OPL timer thread. 16 | // 17 | 18 | #ifndef OPL_TIMER_H 19 | #define OPL_TIMER_H 20 | 21 | #include "opl.h" 22 | 23 | int OPL_Timer_StartThread(void); 24 | void OPL_Timer_StopThread(void); 25 | void OPL_Timer_SetCallback(uint64_t us, opl_callback_t callback, void *data); 26 | void OPL_Timer_ClearCallbacks(void); 27 | void OPL_Timer_Lock(void); 28 | void OPL_Timer_Unlock(void); 29 | void OPL_Timer_SetPaused(int paused); 30 | void OPL_Timer_AdjustCallbacks(float factor); 31 | 32 | #endif /* #ifndef OPL_TIMER_H */ 33 | 34 | -------------------------------------------------------------------------------- /chocolate-doom/pcsound/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | Makefile 3 | .deps 4 | libpcsound.a 5 | *.rc 6 | tags 7 | TAGS 8 | 9 | -------------------------------------------------------------------------------- /chocolate-doom/pcsound/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(pcsound STATIC 2 | pcsound.c pcsound.h 3 | pcsound_bsd.c 4 | pcsound_sdl.c 5 | pcsound_linux.c 6 | pcsound_win32.c 7 | pcsound_internal.h) 8 | target_include_directories(pcsound 9 | INTERFACE "." 10 | PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../") 11 | target_link_libraries(pcsound SDL2::mixer) 12 | -------------------------------------------------------------------------------- /chocolate-doom/pcsound/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS=@SDLMIXER_CFLAGS@ 3 | 4 | EXTRA_DIST=CMakeLists.txt 5 | 6 | noinst_LIBRARIES=libpcsound.a 7 | 8 | libpcsound_a_SOURCES = \ 9 | pcsound.c pcsound.h \ 10 | pcsound_bsd.c \ 11 | pcsound_sdl.c \ 12 | pcsound_linux.c \ 13 | pcsound_win32.c \ 14 | pcsound_internal.h 15 | 16 | -------------------------------------------------------------------------------- /chocolate-doom/pcsound/pcsound.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // PC speaker interface. 16 | // 17 | 18 | #ifndef PCSOUND_H 19 | #define PCSOUND_H 20 | 21 | typedef void (*pcsound_callback_func)(int *duration, int *frequency); 22 | 23 | // Initialise the PC speaker subsystem. The given function is called 24 | // periodically to request more sound data to play. 25 | 26 | int PCSound_Init(pcsound_callback_func callback_func); 27 | 28 | // Shut down the PC speaker subsystem. 29 | 30 | void PCSound_Shutdown(void); 31 | 32 | // Set the preferred output sample rate when emulating a PC speaker. 33 | // This must be called before PCSound_Init. 34 | 35 | void PCSound_SetSampleRate(int rate); 36 | 37 | #endif /* #ifndef PCSOUND_H */ 38 | 39 | -------------------------------------------------------------------------------- /chocolate-doom/pcsound/pcsound_internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // PC speaker interface. 16 | // 17 | 18 | #ifndef PCSOUND_INTERNAL_H 19 | #define PCSOUND_INTERNAL_H 20 | 21 | #include "pcsound.h" 22 | 23 | #define PCSOUND_8253_FREQUENCY 1193280 24 | 25 | typedef struct pcsound_driver_s pcsound_driver_t; 26 | typedef int (*pcsound_init_func)(pcsound_callback_func callback); 27 | typedef void (*pcsound_shutdown_func)(void); 28 | 29 | struct pcsound_driver_s 30 | { 31 | const char *name; 32 | pcsound_init_func init_func; 33 | pcsound_shutdown_func shutdown_func; 34 | }; 35 | 36 | extern int pcsound_sample_rate; 37 | 38 | #endif /* #ifndef PCSOUND_INTERNAL_H */ 39 | 40 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | config.make 4 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | OSX_FILES= \ 3 | osx/Resources/128x128.png \ 4 | osx/Resources/app.icns \ 5 | osx/Resources/app.png \ 6 | osx/Resources/wadfile.icns \ 7 | osx/Resources/wadfile.png \ 8 | osx/Resources/launcher.nib/designable.nib \ 9 | osx/Resources/launcher.nib/keyedobjects.nib \ 10 | osx/disk/dir.DS_Store \ 11 | osx/disk/background.png \ 12 | osx/GNUmakefile \ 13 | osx/Info.plist.in \ 14 | osx/PkgInfo \ 15 | osx/cp-with-libs \ 16 | osx/dmgfix \ 17 | osx/main.m \ 18 | osx/AppController.m osx/AppController.h \ 19 | osx/Execute.m osx/Execute.h \ 20 | osx/IWADController.m osx/IWADController.h \ 21 | osx/LauncherManager.m osx/LauncherManager.h 22 | 23 | WIN32_FILES= \ 24 | win32/GNUmakefile \ 25 | win32/cp-with-libs \ 26 | win32/README 27 | 28 | EXTRA_DIST=$(OSX_FILES) $(WIN32_FILES) 29 | 30 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/config.make.in: -------------------------------------------------------------------------------- 1 | # Shared file included by the makefiles used to build packages. 2 | # This contains various information needed by the makefiles, 3 | # and is autogenerated by configure to include various 4 | # necessary details. 5 | 6 | # Tools needed: 7 | 8 | CC = @CC@ 9 | OBJDUMP = @OBJDUMP@ 10 | STRIP = @STRIP@ 11 | LDFLAGS = @LDFLAGS@ 12 | 13 | # Package name and version number: 14 | 15 | PROGRAM_PREFIX = @PROGRAM_PREFIX@ 16 | PACKAGE = @PACKAGE@ 17 | PACKAGE_NAME = @PACKAGE_NAME@ 18 | PACKAGE_STRING = @PACKAGE_STRING@ 19 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 20 | PACKAGE_VERSION = @PACKAGE_VERSION@ 21 | 22 | # Documentation files to distribute with packages. 23 | 24 | DOC_FILES = README.md \ 25 | README.Music.md \ 26 | COPYING.md \ 27 | NEWS.md 28 | 29 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/.gitignore: -------------------------------------------------------------------------------- 1 | Info.plist 2 | launcher 3 | *.o 4 | *.d 5 | *.dmg 6 | staging 7 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/AppController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef LAUNCHER_APPCONTROLLER_H 16 | #define LAUNCHER_APPCONTROLLER_H 17 | 18 | #include 19 | 20 | #include "LauncherManager.h" 21 | 22 | @interface AppController : NSObject 23 | { 24 | LauncherManager *launcherManager; 25 | BOOL filesAdded; 26 | } 27 | 28 | + (void)initialize; 29 | 30 | - (id)init; 31 | - (void)dealloc; 32 | 33 | - (void)awakeFromNib; 34 | 35 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotif; 36 | - (BOOL)applicationShouldTerminate:(id)sender; 37 | - (void)applicationWillTerminate:(NSNotification *)aNotif; 38 | - (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName; 39 | 40 | - (void)showPrefPanel:(id)sender; 41 | 42 | @end 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/Execute.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef LAUNCHER_EXECUTE_H 16 | #define LAUNCHER_EXECUTE_H 17 | 18 | void SetProgramLocation(const char *path); 19 | void ExecuteProgram(const char *executable, const char *iwad, const char *args); 20 | void OpenTerminalWindow(const char *doomwadpath); 21 | void OpenDocumentation(const char *filename); 22 | 23 | #endif /* #ifndef LAUNCHER_EXECUTE_H */ 24 | 25 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/IWADController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef LAUNCHER_IWADCONTROLLER_H 16 | #define LAUNCHER_IWADCONTROLLER_H 17 | 18 | #include 19 | #include 20 | 21 | @interface IWADController : NSObject 22 | { 23 | id iwadSelector; 24 | id configWindow; 25 | 26 | id chex; 27 | id doom1; 28 | id doom2; 29 | id plutonia; 30 | id tnt; 31 | id freedoom1; 32 | id freedoom2; 33 | id freedm; 34 | 35 | id heretic; 36 | id hexen; 37 | id strife; 38 | } 39 | 40 | - (void) closeConfigWindow: (id)sender; 41 | - (void) openConfigWindow: (id)sender; 42 | - (NSString *) getIWADLocation; 43 | - (NSString *) autoloadPath; 44 | - (void) awakeFromNib; 45 | - (BOOL) setDropdownList; 46 | - (void) setDropdownSelection; 47 | - (void) saveConfig; 48 | - (char *) doomWadPath; 49 | - (void) setEnvironment; 50 | - (const char *) getGameName; 51 | - (BOOL) addIWADPath: (NSString *) path; 52 | - (BOOL) selectGameByName: (const char *) name; 53 | 54 | @end 55 | 56 | #endif /* #ifndef LAUNCHER_IWADCONTROLLER_H */ 57 | 58 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/LauncherManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef LAUNCHER_LAUNCHERMANAGER_H 16 | #define LAUNCHER_LAUNCHERMANAGER_H 17 | 18 | #include 19 | #include 20 | #include "IWADController.h" 21 | 22 | @interface LauncherManager : NSObject 23 | { 24 | IWADController *iwadController; 25 | 26 | id launcherWindow; 27 | id launchButton; 28 | 29 | id commandLineArguments; 30 | } 31 | 32 | - (void) launch: (id)sender; 33 | - (void) runSetup: (id)sender; 34 | - (void) awakeFromNib; 35 | - (void) clearCommandLine; 36 | - (BOOL) addIWADPath: (NSString *) path; 37 | - (void) addFileToCommandLine: (NSString *) fileName 38 | forArgument: (NSString *) args; 39 | - (BOOL) selectGameByName: (const char *) name; 40 | - (void) openTerminal: (id) sender; 41 | 42 | - (void) openREADME: (id) sender; 43 | - (void) openINSTALL: (id) sender; 44 | - (void) openCMDLINE: (id) sender; 45 | - (void) openCOPYING: (id) sender; 46 | - (void) openDocumentation: (id) sender; 47 | 48 | @end 49 | 50 | #endif /* #ifndef LAUNCHER_LAUNCHERMANAGER_H */ 51 | 52 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? 2 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/Resources/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/pkg/osx/Resources/128x128.png -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/Resources/app.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/pkg/osx/Resources/app.icns -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/Resources/app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/pkg/osx/Resources/app.png -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/Resources/launcher.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/pkg/osx/Resources/launcher.nib/keyedobjects.nib -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/Resources/wadfile.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/pkg/osx/Resources/wadfile.icns -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/Resources/wadfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/pkg/osx/Resources/wadfile.png -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/disk/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/pkg/osx/disk/background.png -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/disk/dir.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/pkg/osx/disk/dir.DS_Store -------------------------------------------------------------------------------- /chocolate-doom/pkg/osx/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #include 16 | #include "Execute.h" 17 | 18 | int main(int argc, const char *argv[]) 19 | { 20 | SetProgramLocation(argv[0]); 21 | 22 | return NSApplicationMain (argc, argv); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/win32/.gitignore: -------------------------------------------------------------------------------- 1 | staging-* 2 | *.zip 3 | -------------------------------------------------------------------------------- /chocolate-doom/pkg/win32/README: -------------------------------------------------------------------------------- 1 | Makefile to build Windows packages. Requires zip and unix2dos 2 | packages to be installed. 3 | -------------------------------------------------------------------------------- /chocolate-doom/src/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | .deps 4 | *.rc 5 | chocolate-doom 6 | chocolate-heretic 7 | chocolate-hexen 8 | chocolate-server 9 | chocolate-strife 10 | chocolate-doom-setup 11 | chocolate-heretic-setup 12 | chocolate-hexen-setup 13 | chocolate-strife-setup 14 | chocolate-setup 15 | *.cfg 16 | *.exe 17 | *.desktop 18 | *.txt 19 | !CMakeLists.txt 20 | *.metainfo.xml 21 | tags 22 | TAGS 23 | -------------------------------------------------------------------------------- /chocolate-doom/src/Doom.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=@PACKAGE_SHORTNAME@ Doom 3 | Exec=@PROGRAM_PREFIX@doom 4 | Icon=@PROGRAM_PREFIX@doom 5 | Type=Application 6 | Comment=@PACKAGE_SHORTDESC@ 7 | Categories=Game;ActionGame; 8 | Keywords=first;person;shooter;vanilla; 9 | -------------------------------------------------------------------------------- /chocolate-doom/src/Doom_Screensaver.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=@PACKAGE_SHORTNAME@ Doom 3 | Comment=@PACKAGE_SHORTDESC@ 4 | TryExec=@PROGRAM_PREFIX@doom 5 | Exec=@PROGRAM_PREFIX@doom 6 | StartupNotify=false 7 | Terminal=false 8 | Type=Application 9 | OnlyShowIn=GNOME;MATE; 10 | Categories=Screensaver; 11 | -------------------------------------------------------------------------------- /chocolate-doom/src/Heretic.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=@PACKAGE_SHORTNAME@ Heretic 3 | Exec=@PROGRAM_PREFIX@heretic 4 | Icon=@PROGRAM_PREFIX@doom 5 | Type=Application 6 | Comment=@PACKAGE_SHORTDESC@ 7 | Categories=Game;ActionGame; 8 | Keywords=first;person;shooter;doom;vanilla; 9 | -------------------------------------------------------------------------------- /chocolate-doom/src/Hexen.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=@PACKAGE_SHORTNAME@ Hexen 3 | Exec=@PROGRAM_PREFIX@hexen 4 | Icon=@PROGRAM_PREFIX@doom 5 | Type=Application 6 | Comment=@PACKAGE_SHORTDESC@ 7 | Categories=Game;ActionGame; 8 | Keywords=first;person;shooter;doom;vanilla; 9 | -------------------------------------------------------------------------------- /chocolate-doom/src/Hexen.metainfo.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @PACKAGE_RDNS@.Hexen 5 | @PACKAGE_SHORTNAME@ Hexen 6 | @PACKAGE_SHORTDESC@ 7 | CC0-1.0 8 | GPL-2.0+ 9 | @PACKAGE_MAINTAINER@ 10 | @PACKAGE_URL@ 11 | @PACKAGE_ISSUES@ 12 | 13 |

14 | @PACKAGE_SHORTNAME@ Hexen is a conservative, 15 | historically-accurate Hexen source port, which is compatible 16 | with mods and levels that were made before the Hexen source code 17 | was released. Unlike other source ports, the goal is to 18 | preserve the original look, feel, limitations, and bugs of the 19 | original DOS executable. 20 |

21 |

22 | Full support for single- and multi-player games is provided. 23 | Unlike the original executable, network play is implemented on 24 | the IP network stack, allowing it to function on modern LANs and 25 | the Internet. 26 |

27 |
28 | 29 | 30 | https://www.chocolate-doom.org/wiki/images/0/0f/GNOME_Hexen_Guardian_of_Fire.png 31 | Level "Guardian of Fire" 32 | 33 | 34 | https://www.chocolate-doom.org/wiki/images/5/5c/GNOME_Hexen_Effluvium.png 35 | Level "Effluvium" 36 | 37 | 38 | https://www.chocolate-doom.org/wiki/images/c/c1/GNOME_Hexen_Dragon_Chapel.png 39 | Level "Dragon Chapel" 40 | 41 | 42 | https://www.chocolate-doom.org/wiki/images/a/a7/GNOME_Hexen_Darkmere.png 43 | Level "Darkmere" 44 | 45 | 46 |
47 | -------------------------------------------------------------------------------- /chocolate-doom/src/Strife.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=@PACKAGE_SHORTNAME@ Strife 3 | Exec=@PROGRAM_PREFIX@strife 4 | Icon=@PROGRAM_PREFIX@doom 5 | Type=Application 6 | Comment=@PACKAGE_SHORTDESC@ 7 | Categories=Game;ActionGame; 8 | Keywords=first;person;shooter;doom;vanilla; 9 | -------------------------------------------------------------------------------- /chocolate-doom/src/aes_prng.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Pseudo-random number generator for secure demos. 16 | // 17 | 18 | #ifndef __AES_PRNG_H__ 19 | #define __AES_PRNG_H__ 20 | 21 | #include "doomtype.h" 22 | 23 | // Nonce value used as random seed for secure demos. 24 | 25 | typedef byte prng_seed_t[16]; 26 | 27 | void PRNG_Start(prng_seed_t seed); 28 | void PRNG_Stop(void); 29 | unsigned int PRNG_Random(void); 30 | 31 | #endif /* #ifndef __AES_PRNG_H__ */ 32 | 33 | -------------------------------------------------------------------------------- /chocolate-doom/src/d_dedicated.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // Code specific to the standalone dedicated server. 15 | // 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "config.h" 22 | 23 | #include "m_argv.h" 24 | #include "net_defs.h" 25 | 26 | #include "net_dedicated.h" 27 | #include "net_server.h" 28 | #include "z_zone.h" 29 | 30 | void NET_CL_Run(void) 31 | { 32 | // No client present :-) 33 | // 34 | // This is here because the server code sometimes runs this 35 | // to let the client do some processing if it needs to. 36 | // In a standalone dedicated server, we don't have a client. 37 | } 38 | 39 | void D_DoomMain(void) 40 | { 41 | printf(PACKAGE_NAME " standalone dedicated server\n"); 42 | 43 | Z_Init(); 44 | 45 | NET_DedicatedServer(); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /chocolate-doom/src/d_event.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // 16 | // DESCRIPTION: Event handling. 17 | // 18 | // Events are asynchronous inputs generally generated by the game user. 19 | // Events can be discarded if no responder claims them 20 | // 21 | 22 | #include 23 | #include "d_event.h" 24 | 25 | #define MAXEVENTS 64 26 | 27 | static event_t events[MAXEVENTS]; 28 | static int eventhead; 29 | static int eventtail; 30 | 31 | // 32 | // D_PostEvent 33 | // Called by the I/O functions when input is detected 34 | // 35 | void D_PostEvent (event_t* ev) 36 | { 37 | events[eventhead] = *ev; 38 | eventhead = (eventhead + 1) % MAXEVENTS; 39 | } 40 | 41 | // Read an event from the queue. 42 | 43 | event_t *D_PopEvent(void) 44 | { 45 | event_t *result; 46 | 47 | // No more events waiting. 48 | 49 | if (eventtail == eventhead) 50 | { 51 | return NULL; 52 | } 53 | 54 | result = &events[eventtail]; 55 | 56 | // Advance to the next event in the queue. 57 | 58 | eventtail = (eventtail + 1) % MAXEVENTS; 59 | 60 | return result; 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /chocolate-doom/src/d_iwad.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Find IWAD and initialize according to IWAD type. 16 | // 17 | 18 | 19 | #ifndef __D_IWAD__ 20 | #define __D_IWAD__ 21 | 22 | #include "d_mode.h" 23 | 24 | #define IWAD_MASK_DOOM ((1 << doom) \ 25 | | (1 << doom2) \ 26 | | (1 << pack_tnt) \ 27 | | (1 << pack_plut) \ 28 | | (1 << pack_chex) \ 29 | | (1 << pack_hacx)) 30 | #define IWAD_MASK_HERETIC (1 << heretic) 31 | #define IWAD_MASK_HEXEN (1 << hexen) 32 | #define IWAD_MASK_STRIFE (1 << strife) 33 | 34 | typedef struct 35 | { 36 | const char *name; 37 | GameMission_t mission; 38 | GameMode_t mode; 39 | const char *description; 40 | } iwad_t; 41 | 42 | boolean D_IsIWADName(const char *name); 43 | char *D_FindWADByName(const char *filename); 44 | char *D_TryFindWADByName(const char *filename); 45 | char *D_FindIWAD(int mask, GameMission_t *mission); 46 | const iwad_t **D_FindAllIWADs(int mask); 47 | const char *D_SaveGameIWADName(GameMission_t gamemission); 48 | const char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode); 49 | const char *D_SuggestGameName(GameMission_t mission, GameMode_t mode); 50 | void D_CheckCorrectIWAD(GameMission_t mission); 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /chocolate-doom/src/d_ticcmd.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 1993-2008 Raven Software 4 | // Copyright(C) 2005-2014 Simon Howard 5 | // 6 | // This program is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU General Public License 8 | // as published by the Free Software Foundation; either version 2 9 | // of the License, or (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // DESCRIPTION: 17 | // System specific interface stuff. 18 | // 19 | 20 | 21 | #ifndef __D_TICCMD__ 22 | #define __D_TICCMD__ 23 | 24 | #include "doomtype.h" 25 | 26 | 27 | // The data sampled per tick (single player) 28 | // and transmitted to other peers (multiplayer). 29 | // Mainly movements/button commands per game tick, 30 | // plus a checksum for internal state consistency. 31 | 32 | typedef struct 33 | { 34 | signed char forwardmove; // *2048 for move 35 | signed char sidemove; // *2048 for move 36 | short angleturn; // <<16 for angle delta 37 | byte chatchar; 38 | byte buttons; 39 | // villsa [STRIFE] according to the asm, 40 | // consistancy is a short, not a byte 41 | byte consistancy; // checks for net game 42 | 43 | // villsa - Strife specific: 44 | 45 | byte buttons2; 46 | int inventory; 47 | 48 | // Heretic/Hexen specific: 49 | 50 | byte lookfly; // look/fly up/down/centering 51 | byte arti; // artitype_t to use 52 | } ticcmd_t; 53 | 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /chocolate-doom/src/deh_io.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Dehacked I/O code (does all reads from dehacked files) 16 | // 17 | 18 | #ifndef DEH_IO_H 19 | #define DEH_IO_H 20 | 21 | #include "deh_defs.h" 22 | 23 | deh_context_t *DEH_OpenFile(const char *filename); 24 | deh_context_t *DEH_OpenLump(int lumpnum); 25 | void DEH_CloseFile(deh_context_t *context); 26 | int DEH_GetChar(deh_context_t *context); 27 | char *DEH_ReadLine(deh_context_t *context, boolean extended); 28 | void DEH_Error(deh_context_t *context, const char *msg, ...) PRINTF_ATTR(2, 3); 29 | void DEH_Warning(deh_context_t *context, const char *msg, ...) PRINTF_ATTR(2, 3); 30 | boolean DEH_HadError(deh_context_t *context); 31 | 32 | #endif /* #ifndef DEH_IO_H */ 33 | 34 | -------------------------------------------------------------------------------- /chocolate-doom/src/deh_main.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Dehacked entrypoint and common code 16 | // 17 | 18 | #ifndef DEH_MAIN_H 19 | #define DEH_MAIN_H 20 | 21 | #include "doomtype.h" 22 | #include "deh_str.h" 23 | #include "sha1.h" 24 | 25 | // These are the limits that dehacked uses (from dheinit.h in the dehacked 26 | // source). If these limits are exceeded, it does not generate an error, but 27 | // a warning is displayed. 28 | 29 | #define DEH_VANILLA_NUMSTATES 966 30 | #define DEH_VANILLA_NUMSFX 107 31 | 32 | void DEH_ParseCommandLine(void); 33 | int DEH_LoadFile(const char *filename); 34 | void DEH_AutoLoadPatches(const char *path); 35 | int DEH_LoadLump(int lumpnum, boolean allow_long, boolean allow_error); 36 | int DEH_LoadLumpByName(const char *name, boolean allow_long, boolean allow_error); 37 | 38 | boolean DEH_ParseAssignment(char *line, char **variable_name, char **value); 39 | 40 | void DEH_Checksum(sha1_digest_t digest); 41 | 42 | extern boolean deh_allow_extended_strings; 43 | extern boolean deh_allow_long_strings; 44 | extern boolean deh_allow_long_cheats; 45 | extern boolean deh_apply_cheats; 46 | 47 | #endif /* #ifndef DEH_MAIN_H */ 48 | 49 | -------------------------------------------------------------------------------- /chocolate-doom/src/deh_str.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Dehacked string replacements 16 | // 17 | 18 | #ifndef DEH_STR_H 19 | #define DEH_STR_H 20 | 21 | #include 22 | 23 | #include "doomtype.h" 24 | 25 | // Used to do dehacked text substitutions throughout the program 26 | 27 | const char *DEH_String(const char *s) PRINTF_ARG_ATTR(1); 28 | void DEH_printf(const char *fmt, ...) PRINTF_ATTR(1, 2); 29 | void DEH_fprintf(FILE *fstream, const char *fmt, ...) PRINTF_ATTR(2, 3); 30 | void DEH_snprintf(char *buffer, size_t len, const char *fmt, ...) PRINTF_ATTR(3, 4); 31 | void DEH_AddStringReplacement(const char *from_text, const char *to_text); 32 | 33 | 34 | #if 0 35 | // Static macro versions of the functions above 36 | 37 | #define DEH_String(x) (x) 38 | #define DEH_printf printf 39 | #define DEH_fprintf fprintf 40 | #define DEH_snprintf snprintf 41 | 42 | #endif 43 | 44 | #endif /* #ifndef DEH_STR_H */ 45 | 46 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | .deps 4 | tags 5 | TAGS 6 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/am_map.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // AutoMap module. 17 | // 18 | 19 | #ifndef __AMMAP_H__ 20 | #define __AMMAP_H__ 21 | 22 | #include "d_event.h" 23 | #include "m_cheat.h" 24 | 25 | // Used by ST StatusBar stuff. 26 | #define AM_MSGHEADER (('a'<<24)+('m'<<16)) 27 | #define AM_MSGENTERED (AM_MSGHEADER | ('e'<<8)) 28 | #define AM_MSGEXITED (AM_MSGHEADER | ('x'<<8)) 29 | 30 | 31 | // Called by main loop. 32 | boolean AM_Responder (event_t* ev); 33 | 34 | // Called by main loop. 35 | void AM_Ticker (void); 36 | 37 | // Called by main loop, 38 | // called instead of view drawer if automap active. 39 | void AM_Drawer (void); 40 | 41 | // Called to force the automap to quit 42 | // if the level is completed while it is up. 43 | void AM_Stop (void); 44 | 45 | 46 | extern cheatseq_t cheat_amap; 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/build_all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Note: LDFLAGS needs to have: -lsamplerate , if you get this error: 4 | #### Undefined symbols for architecture arm64: 5 | #### "_src_simple", referenced from: 6 | #### _ExpandSoundData_SRC in i_sdlsound.c.o 7 | #### ld: symbol(s) not found for architecture arm64 8 | #### clang: error: linker command failed with exit code 1 (use -v to see invocation) 9 | 10 | set -e 11 | 12 | export DOOM=~/code/doom/chocolate-doom 13 | 14 | v -cg -o doom_v/doom.o -w -translated doom_v 15 | 16 | cc -o doomv \ 17 | $DOOM/src/doom/doom_v/doom.o \ 18 | $DOOM/src/CMakeFiles/chocolate-doom.dir/*.o \ 19 | $DOOM/textscreen/CMakeFiles/textscreen.dir/*.o \ 20 | $DOOM/pcsound/CMakeFiles/pcsound.dir/*.o \ 21 | $DOOM/opl/CMakeFiles/opl.dir/*.o \ 22 | $(sdl2-config --libs) -lSDL2_mixer -lSDL2_net -lpng $LDFLAGS 23 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/c2v.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | uses_sdl = true 3 | output_dirname = "doom_v" 4 | additional_flags = "-I. -I.. -I../.." 5 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/d_items.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Items: key cards, artifacts, weapon, ammunition. 17 | // 18 | 19 | 20 | #ifndef __D_ITEMS__ 21 | #define __D_ITEMS__ 22 | 23 | #include "doomdef.h" 24 | 25 | 26 | 27 | // Weapon info: sprite frames, ammunition use. 28 | typedef struct 29 | { 30 | ammotype_t ammo; 31 | int upstate; 32 | int downstate; 33 | int readystate; 34 | int atkstate; 35 | int flashstate; 36 | 37 | } weaponinfo_t; 38 | 39 | extern weaponinfo_t weaponinfo[NUMWEAPONS]; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/d_main.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // System specific interface stuff. 17 | // 18 | 19 | 20 | #ifndef __D_MAIN__ 21 | #define __D_MAIN__ 22 | 23 | #include "doomdef.h" 24 | 25 | 26 | 27 | 28 | // Read events from all input devices 29 | 30 | void D_ProcessEvents (void); 31 | 32 | 33 | // 34 | // BASE LEVEL 35 | // 36 | void D_PageTicker (void); 37 | void D_PageDrawer (void); 38 | void D_AdvanceDemo (void); 39 | void D_DoAdvanceDemo (void); 40 | void D_StartTitle (void); 41 | 42 | // 43 | // GLOBAL VARIABLES 44 | // 45 | 46 | extern gameaction_t gameaction; 47 | 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/d_textur.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Typedefs related to to textures etc., 17 | // isolated here to make it easier separating modules. 18 | // 19 | 20 | 21 | #ifndef __D_TEXTUR__ 22 | #define __D_TEXTUR__ 23 | 24 | #include "doomtype.h" 25 | 26 | 27 | 28 | 29 | // 30 | // Flats? 31 | // 32 | // a pic is an unmasked block of pixels 33 | typedef struct 34 | { 35 | byte width; 36 | byte height; 37 | byte data; 38 | } pic_t; 39 | 40 | 41 | 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/d_think.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // MapObj data. Map Objects or mobjs are actors, entities, 17 | // thinker, take-your-pick... anything that moves, acts, or 18 | // suffers state changes of more or less violent nature. 19 | // 20 | 21 | 22 | #ifndef __D_THINK__ 23 | #define __D_THINK__ 24 | 25 | 26 | 27 | 28 | 29 | // 30 | // Experimental stuff. 31 | // To compile this as "ANSI C with classes" 32 | // we will need to handle the various 33 | // action functions cleanly. 34 | // 35 | typedef void (*actionf_v)(); 36 | typedef void (*actionf_p1)( void* ); 37 | typedef void (*actionf_p2)( void*, void* ); 38 | 39 | typedef union 40 | { 41 | actionf_v acv; 42 | actionf_p1 acp1; 43 | actionf_p2 acp2; 44 | 45 | } actionf_t; 46 | 47 | 48 | 49 | 50 | 51 | // Historically, "think_t" is yet another 52 | // function pointer to a routine to handle 53 | // an actor. 54 | typedef actionf_t think_t; 55 | 56 | 57 | // Doubly linked list of actors. 58 | typedef struct thinker_s 59 | { 60 | struct thinker_s* prev; 61 | struct thinker_s* next; 62 | think_t function; 63 | 64 | } thinker_t; 65 | 66 | 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/deh_doom.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Top-level dehacked definitions for Doom dehacked. 16 | // 17 | 18 | #include 19 | #include "deh_defs.h" 20 | #include "deh_main.h" 21 | 22 | const char *deh_signatures[] = 23 | { 24 | "Patch File for DeHackEd v2.3", 25 | "Patch File for DeHackEd v3.0", 26 | NULL 27 | }; 28 | 29 | // deh_ammo.c: 30 | extern deh_section_t deh_section_ammo; 31 | // deh_cheat.c: 32 | extern deh_section_t deh_section_cheat; 33 | // deh_frame.c: 34 | extern deh_section_t deh_section_frame; 35 | // deh_misc.c: 36 | extern deh_section_t deh_section_misc; 37 | // deh_ptr.c: 38 | extern deh_section_t deh_section_pointer; 39 | // deh_sound.c 40 | extern deh_section_t deh_section_sound; 41 | // deh_text.c: 42 | extern deh_section_t deh_section_text; 43 | // deh_thing.c: 44 | extern deh_section_t deh_section_thing; 45 | // deh_weapon.c: 46 | extern deh_section_t deh_section_weapon; 47 | // deh_bexstr.c: 48 | extern deh_section_t deh_section_bexstr; 49 | 50 | // 51 | // List of section types: 52 | // 53 | 54 | deh_section_t *deh_section_types[] = 55 | { 56 | &deh_section_ammo, 57 | &deh_section_cheat, 58 | &deh_section_frame, 59 | &deh_section_misc, 60 | &deh_section_pointer, 61 | &deh_section_sound, 62 | &deh_section_text, 63 | &deh_section_thing, 64 | &deh_section_weapon, 65 | &deh_section_bexstr, 66 | NULL 67 | }; 68 | 69 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/doomdef.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // DoomDef - basic defines for DOOM, e.g. Version, game mode 17 | // and skill level, and display parameters. 18 | // 19 | 20 | 21 | 22 | #include "doomdef.h" 23 | 24 | // Location for any defines turned variables. 25 | 26 | // None. 27 | 28 | 29 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/doomstat.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Put all global tate variables here. 17 | // 18 | 19 | #include 20 | 21 | #include "doomstat.h" 22 | #include "r_defs.h" // XTODO 23 | 24 | 25 | // Game Mode - identify IWAD as shareware, retail etc. 26 | GameMode_t gamemode = indetermined; 27 | GameMission_t gamemission = doom; 28 | GameVersion_t gameversion = exe_final2; 29 | GameVariant_t gamevariant = vanilla; 30 | const char *gamedescription; 31 | 32 | // Set if homebrew PWAD stuff has been added. 33 | boolean modifiedgame; 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/dstrings.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // 16 | // DESCRIPTION: 17 | // DOOM strings, by language. 18 | // 19 | 20 | 21 | #ifndef __DSTRINGS__ 22 | #define __DSTRINGS__ 23 | 24 | 25 | // All important printed strings. 26 | 27 | #include "d_englsh.h" 28 | 29 | // Misc. other strings. 30 | #define SAVEGAMENAME "doomsav" 31 | 32 | 33 | // QuitDOOM messages 34 | // 8 per each game type 35 | #define NUM_QUITMESSAGES 8 36 | 37 | extern const char *doom1_endmsg[]; 38 | extern const char *doom2_endmsg[]; 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/f_finale.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // 17 | // 18 | 19 | 20 | #ifndef __F_FINALE__ 21 | #define __F_FINALE__ 22 | 23 | 24 | #include "doomtype.h" 25 | #include "d_event.h" 26 | // 27 | // FINALE 28 | // 29 | 30 | // Called by main loop. 31 | boolean F_Responder (event_t* ev); 32 | 33 | // Called by main loop. 34 | void F_Ticker (void); 35 | 36 | // Called by main loop. 37 | void F_Drawer (void); 38 | 39 | 40 | void F_StartFinale (void); 41 | 42 | 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/f_wipe.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Mission start screen wipe/melt, special effects. 17 | // 18 | 19 | 20 | #ifndef __F_WIPE_H__ 21 | #define __F_WIPE_H__ 22 | 23 | // 24 | // SCREEN WIPE PACKAGE 25 | // 26 | 27 | enum 28 | { 29 | // simple gradual pixel change for 8-bit only 30 | wipe_ColorXForm, 31 | 32 | // weird screen melt 33 | wipe_Melt, 34 | 35 | wipe_NUMWIPES 36 | }; 37 | 38 | int 39 | wipe_StartScreen 40 | ( int x, 41 | int y, 42 | int width, 43 | int height ); 44 | 45 | 46 | int 47 | wipe_EndScreen 48 | ( int x, 49 | int y, 50 | int width, 51 | int height ); 52 | 53 | 54 | int 55 | wipe_ScreenWipe 56 | ( int wipeno, 57 | int x, 58 | int y, 59 | int width, 60 | int height, 61 | int ticks ); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/hu_stuff.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: Head up display 16 | // 17 | 18 | #ifndef __HU_STUFF_H__ 19 | #define __HU_STUFF_H__ 20 | 21 | #include "d_event.h" 22 | 23 | 24 | // 25 | // Globally visible constants. 26 | // 27 | #define HU_FONTSTART '!' // the first font characters 28 | #define HU_FONTEND '_' // the last font characters 29 | 30 | // Calculate # of glyphs in font. 31 | #define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1) 32 | 33 | #define HU_BROADCAST 5 34 | 35 | #define HU_MSGX 0 36 | #define HU_MSGY 0 37 | #define HU_MSGWIDTH 64 // in characters 38 | #define HU_MSGHEIGHT 1 // in lines 39 | 40 | #define HU_MSGTIMEOUT (4*TICRATE) 41 | 42 | // 43 | // HEADS UP TEXT 44 | // 45 | 46 | void HU_Init(void); 47 | void HU_Start(void); 48 | 49 | boolean HU_Responder(event_t* ev); 50 | 51 | void HU_Ticker(void); 52 | void HU_Drawer(void); 53 | char HU_dequeueChatChar(void); 54 | void HU_Erase(void); 55 | 56 | extern char *chat_macros[10]; 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/m_menu.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Menu widget stuff, episode selection and such. 17 | // 18 | 19 | 20 | #ifndef __M_MENU__ 21 | #define __M_MENU__ 22 | 23 | 24 | 25 | #include "d_event.h" 26 | 27 | // 28 | // MENUS 29 | // 30 | // Called by main loop, 31 | // saves config file and calls I_Quit when user exits. 32 | // Even when the menu is not displayed, 33 | // this can resize the view and change game parameters. 34 | // Does all the real work of the menu interaction. 35 | boolean M_Responder (event_t *ev); 36 | 37 | 38 | // Called by main loop, 39 | // only used for menu (skull cursor) animation. 40 | void M_Ticker (void); 41 | 42 | // Called by main loop, 43 | // draws the menus directly into the screen buffer. 44 | void M_Drawer (void); 45 | 46 | // Called by D_DoomMain, 47 | // loads the config file. 48 | void M_Init (void); 49 | 50 | // Called by intro code to force menu up upon a keypress, 51 | // does nothing if menu is already up. 52 | void M_StartControlPanel (void); 53 | 54 | 55 | 56 | extern int detailLevel; 57 | extern int screenblocks; 58 | 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/m_random.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // 17 | // 18 | 19 | 20 | #ifndef __M_RANDOM__ 21 | #define __M_RANDOM__ 22 | 23 | 24 | #include "doomtype.h" 25 | 26 | 27 | // Returns a number from 0 to 255, 28 | // from a lookup table. 29 | int M_Random (void); 30 | 31 | // As M_Random, but used only by the play simulation. 32 | int P_Random (void); 33 | 34 | // Fix randoms for demos. 35 | void M_ClearRandom (void); 36 | 37 | // Defined version of P_Random() - P_Random() 38 | int P_SubRandom (void); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/p_inter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // 17 | // 18 | 19 | 20 | #ifndef __P_INTER__ 21 | #define __P_INTER__ 22 | 23 | 24 | 25 | 26 | boolean P_GivePower(player_t*, int); 27 | 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/p_pspr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Sprite animation. 17 | // 18 | 19 | 20 | #ifndef __P_PSPR__ 21 | #define __P_PSPR__ 22 | 23 | // Basic data types. 24 | // Needs fixed point, and BAM angles. 25 | #include "m_fixed.h" 26 | #include "tables.h" 27 | 28 | 29 | // 30 | // Needs to include the precompiled 31 | // sprite animation tables. 32 | // Header generated by multigen utility. 33 | // This includes all the data for thing animation, 34 | // i.e. the Thing Atrributes table 35 | // and the Frame Sequence table. 36 | #include "info.h" 37 | 38 | 39 | 40 | // 41 | // Frame flags: 42 | // handles maximum brightness (torches, muzzle flare, light sources) 43 | // 44 | #define FF_FULLBRIGHT 0x8000 // flag in thing->frame 45 | #define FF_FRAMEMASK 0x7fff 46 | 47 | 48 | 49 | // 50 | // Overlay psprites are scaled shapes 51 | // drawn directly on the view screen, 52 | // coordinates are given for a 320*200 view screen. 53 | // 54 | typedef enum 55 | { 56 | ps_weapon, 57 | ps_flash, 58 | NUMPSPRITES 59 | 60 | } psprnum_t; 61 | 62 | typedef struct 63 | { 64 | state_t* state; // a NULL state means not active 65 | int tics; 66 | fixed_t sx; 67 | fixed_t sy; 68 | 69 | } pspdef_t; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/p_saveg.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Savegame I/O, archiving, persistence. 17 | // 18 | 19 | 20 | #ifndef __P_SAVEG__ 21 | #define __P_SAVEG__ 22 | 23 | #include 24 | 25 | #define SAVEGAME_EOF 0x1d 26 | #define VERSIONSIZE 16 27 | 28 | // maximum size of a savegame description 29 | 30 | #define SAVESTRINGSIZE 24 31 | 32 | // temporary filename to use while saving. 33 | 34 | char *P_TempSaveGameFile(void); 35 | 36 | // filename to use for a savegame slot 37 | 38 | char *P_SaveGameFile(int slot); 39 | 40 | // Savegame file header read/write functions 41 | 42 | boolean P_ReadSaveGameHeader(void); 43 | void P_WriteSaveGameHeader(char *description); 44 | 45 | // Savegame end-of-file read/write functions 46 | 47 | boolean P_ReadSaveGameEOF(void); 48 | void P_WriteSaveGameEOF(void); 49 | 50 | // Persistent storage/archiving. 51 | // These are the load / save game routines. 52 | void P_ArchivePlayers (void); 53 | void P_UnArchivePlayers (void); 54 | void P_ArchiveWorld (void); 55 | void P_UnArchiveWorld (void); 56 | void P_ArchiveThinkers (void); 57 | void P_UnArchiveThinkers (void); 58 | void P_ArchiveSpecials (void); 59 | void P_UnArchiveSpecials (void); 60 | 61 | extern FILE *save_stream; 62 | extern boolean savegame_error; 63 | 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/p_setup.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Setup a game, startup stuff. 17 | // 18 | 19 | 20 | #ifndef __P_SETUP__ 21 | #define __P_SETUP__ 22 | 23 | #include "w_wad.h" 24 | 25 | 26 | extern lumpinfo_t *maplumpinfo; 27 | 28 | // NOT called by W_Ticker. Fixme. 29 | void 30 | P_SetupLevel 31 | ( int episode, 32 | int map, 33 | int playermask, 34 | skill_t skill); 35 | 36 | // Called by startup code. 37 | void P_Init (void); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/p_tick.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // ? 17 | // 18 | 19 | 20 | #ifndef __P_TICK__ 21 | #define __P_TICK__ 22 | 23 | 24 | 25 | 26 | // Called by C_Ticker, 27 | // can call G_PlayerExited. 28 | // Carries out all thinking of monsters and players. 29 | void P_Ticker (void); 30 | 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/r_bsp.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Refresh module, BSP traversal and handling. 17 | // 18 | 19 | 20 | #ifndef __R_BSP__ 21 | #define __R_BSP__ 22 | 23 | 24 | 25 | extern seg_t* curline; 26 | extern side_t* sidedef; 27 | extern line_t* linedef; 28 | extern sector_t* frontsector; 29 | extern sector_t* backsector; 30 | 31 | extern int rw_x; 32 | extern int rw_stopx; 33 | 34 | extern boolean segtextured; 35 | 36 | // false if the back side is the same plane 37 | extern boolean markfloor; 38 | extern boolean markceiling; 39 | 40 | extern boolean skymap; 41 | 42 | extern drawseg_t drawsegs[MAXDRAWSEGS]; 43 | extern drawseg_t* ds_p; 44 | 45 | extern lighttable_t** hscalelight; 46 | extern lighttable_t** vscalelight; 47 | extern lighttable_t** dscalelight; 48 | 49 | 50 | typedef void (*drawfunc_t) (int start, int stop); 51 | 52 | 53 | // BSP? 54 | void R_ClearClipSegs (void); 55 | void R_ClearDrawSegs (void); 56 | 57 | 58 | void R_RenderBSPNode (int bspnum); 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/r_data.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Refresh module, data I/O, caching, retrieval of graphics 17 | // by name. 18 | // 19 | 20 | 21 | #ifndef __R_DATA__ 22 | #define __R_DATA__ 23 | 24 | #include "r_defs.h" 25 | #include "r_state.h" 26 | 27 | 28 | // Retrieve column data for span blitting. 29 | byte* 30 | R_GetColumn 31 | ( int tex, 32 | int col ); 33 | 34 | 35 | // I/O, setting up the stuff. 36 | void R_InitData (void); 37 | void R_PrecacheLevel (void); 38 | 39 | 40 | // Retrieval. 41 | // Floor/ceiling opaque texture tiles, 42 | // lookup by name. For animation? 43 | int R_FlatNumForName(const char *name); 44 | 45 | 46 | // Called by P_Ticker for switches and animations, 47 | // returns the texture number for the texture name. 48 | int R_TextureNumForName(const char *name); 49 | int R_CheckTextureNumForName(const char *name); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/r_local.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Refresh (R_*) module, global header. 17 | // All the rendering/drawing stuff is here. 18 | // 19 | 20 | #ifndef __R_LOCAL__ 21 | #define __R_LOCAL__ 22 | 23 | // Binary Angles, sine/cosine/atan lookups. 24 | #include "tables.h" 25 | 26 | // Screen size related parameters. 27 | #include "doomdef.h" 28 | 29 | // Include the refresh/render data structs. 30 | #include "r_data.h" 31 | 32 | 33 | 34 | // 35 | // Separate header file for each module. 36 | // 37 | #include "r_main.h" 38 | #include "r_bsp.h" 39 | #include "r_segs.h" 40 | #include "r_plane.h" 41 | #include "r_data.h" 42 | #include "r_things.h" 43 | #include "r_draw.h" 44 | 45 | #endif // __R_LOCAL__ 46 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/r_plane.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Refresh, visplane stuff (floor, ceilings). 17 | // 18 | 19 | 20 | #ifndef __R_PLANE__ 21 | #define __R_PLANE__ 22 | 23 | 24 | #include "r_data.h" 25 | 26 | 27 | 28 | // Visplane related. 29 | extern short* lastopening; 30 | 31 | 32 | typedef void (*planefunction_t) (int top, int bottom); 33 | 34 | extern planefunction_t floorfunc; 35 | extern planefunction_t ceilingfunc_t; 36 | 37 | extern short floorclip[SCREENWIDTH]; 38 | extern short ceilingclip[SCREENWIDTH]; 39 | 40 | extern fixed_t yslope[SCREENHEIGHT]; 41 | extern fixed_t distscale[SCREENWIDTH]; 42 | 43 | void R_InitPlanes (void); 44 | void R_ClearPlanes (void); 45 | 46 | void 47 | R_MapPlane 48 | ( int y, 49 | int x1, 50 | int x2 ); 51 | 52 | void 53 | R_MakeSpans 54 | ( int x, 55 | int t1, 56 | int b1, 57 | int t2, 58 | int b2 ); 59 | 60 | void R_DrawPlanes (void); 61 | 62 | visplane_t* 63 | R_FindPlane 64 | ( fixed_t height, 65 | int picnum, 66 | int lightlevel ); 67 | 68 | visplane_t* 69 | R_CheckPlane 70 | ( visplane_t* pl, 71 | int start, 72 | int stop ); 73 | 74 | 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/r_segs.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Refresh module, drawing LineSegs from BSP. 17 | // 18 | 19 | 20 | #ifndef __R_SEGS__ 21 | #define __R_SEGS__ 22 | 23 | 24 | 25 | 26 | void 27 | R_RenderMaskedSegRange 28 | ( drawseg_t* ds, 29 | int x1, 30 | int x2 ); 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/r_sky.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Sky rendering. The DOOM sky is a texture map like any 17 | // wall, wrapping around. A 1024 columns equal 360 degrees. 18 | // The default sky map is 256 columns and repeats 4 times 19 | // on a 320 screen? 20 | // 21 | // 22 | 23 | 24 | 25 | // Needed for FRACUNIT. 26 | #include "m_fixed.h" 27 | 28 | // Needed for Flat retrieval. 29 | #include "r_data.h" 30 | 31 | 32 | #include "r_sky.h" 33 | 34 | // 35 | // sky mapping 36 | // 37 | int skyflatnum; 38 | int skytexture; 39 | int skytexturemid; 40 | 41 | 42 | 43 | // 44 | // R_InitSkyMap 45 | // Called whenever the view size changes. 46 | // 47 | void R_InitSkyMap (void) 48 | { 49 | // skyflatnum = R_FlatNumForName ( SKYFLATNAME ); 50 | skytexturemid = SCREENHEIGHT/2*FRACUNIT; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/r_sky.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Sky rendering. 17 | // 18 | 19 | 20 | #ifndef __R_SKY__ 21 | #define __R_SKY__ 22 | 23 | 24 | 25 | // SKY, store the number for name. 26 | #define SKYFLATNAME "F_SKY1" 27 | 28 | // The sky map is 256*128*4 maps. 29 | #define ANGLETOSKYSHIFT 22 30 | 31 | extern int skytexture; 32 | extern int skytexturemid; 33 | 34 | // Called whenever the view size changes. 35 | void R_InitSkyMap (void); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/r_things.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Rendering of moving objects, sprites. 17 | // 18 | 19 | 20 | #ifndef __R_THINGS__ 21 | #define __R_THINGS__ 22 | 23 | 24 | 25 | #define MAXVISSPRITES 128 26 | 27 | extern vissprite_t vissprites[MAXVISSPRITES]; 28 | extern vissprite_t* vissprite_p; 29 | extern vissprite_t vsprsortedhead; 30 | 31 | // Constant arrays used for psprite clipping 32 | // and initializing clipping. 33 | extern short negonearray[SCREENWIDTH]; 34 | extern short screenheightarray[SCREENWIDTH]; 35 | 36 | // vars for R_DrawMaskedColumn 37 | extern short* mfloorclip; 38 | extern short* mceilingclip; 39 | extern fixed_t spryscale; 40 | extern fixed_t sprtopscreen; 41 | 42 | extern fixed_t pspritescale; 43 | extern fixed_t pspriteiscale; 44 | 45 | 46 | void R_DrawMaskedColumn (column_t* column); 47 | 48 | 49 | void R_SortVisSprites (void); 50 | 51 | void R_AddSprites (sector_t* sec); 52 | void R_AddPSprites (void); 53 | void R_DrawSprites (void); 54 | void R_InitSprites(const char **namelist); 55 | void R_ClearSprites (void); 56 | void R_DrawMasked (void); 57 | 58 | void 59 | R_ClipVisSprite 60 | ( vissprite_t* vis, 61 | int xl, 62 | int xh ); 63 | 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/statdump.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright(C) 2005-2014 Simon Howard 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #ifndef DOOM_STATDUMP_H 18 | #define DOOM_STATDUMP_H 19 | 20 | void StatCopy(wbstartstruct_t *stats); 21 | void StatDump(void); 22 | 23 | #endif /* #ifndef DOOM_STATDUMP_H */ 24 | -------------------------------------------------------------------------------- /chocolate-doom/src/doom/wi_stuff.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Intermission. 17 | // 18 | 19 | #ifndef __WI_STUFF__ 20 | #define __WI_STUFF__ 21 | 22 | //#include "v_video.h" 23 | 24 | #include "doomdef.h" 25 | 26 | // States for the intermission 27 | 28 | typedef enum 29 | { 30 | NoState = -1, 31 | StatCount, 32 | ShowNextLoc, 33 | } stateenum_t; 34 | 35 | // Called by main loop, animate the intermission. 36 | void WI_Ticker (void); 37 | 38 | // Called by main loop, 39 | // draws the intermission directly into the screen buffer. 40 | void WI_Drawer (void); 41 | 42 | // Setup for an intermission screen. 43 | void WI_Start(wbstartstruct_t* wbstartstruct); 44 | 45 | // Shut down the intermission screen 46 | void WI_End(void); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /chocolate-doom/src/gusconf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // GUS emulation code. 16 | // 17 | 18 | #ifndef __GUSCONF_H__ 19 | #define __GUSCONF_H__ 20 | 21 | #include "doomtype.h" 22 | 23 | extern char *gus_patch_path; 24 | extern int gus_ram_kb; 25 | 26 | boolean GUS_WriteConfig(char *path); 27 | 28 | #endif /* #ifndef __GUSCONF_H__ */ 29 | 30 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_cdmus.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 1993-2008 Raven Software 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // 16 | // Hexen CD interface. 17 | // 18 | 19 | #include 20 | 21 | #include "SDL.h" 22 | 23 | #include "doomtype.h" 24 | 25 | #include "i_cdmus.h" 26 | 27 | int cd_Error; 28 | 29 | int I_CDMusInit(void) 30 | { 31 | fprintf(stderr, 32 | "I_CDMusInit: CD music playback is no longer supported! " 33 | "Please use digital music packs instead:\n" 34 | "https://www.chocolate-doom.org/wiki/index.php/Digital_music_packs\n"); 35 | return -1; 36 | } 37 | 38 | // We cannot print status messages inline during startup, they must 39 | // be deferred until after I_CDMusInit has returned. 40 | 41 | void I_CDMusPrintStartup(void) 42 | { 43 | } 44 | 45 | int I_CDMusPlay(int track) 46 | { 47 | return 0; 48 | } 49 | 50 | int I_CDMusStop(void) 51 | { 52 | return 0; 53 | } 54 | 55 | int I_CDMusResume(void) 56 | { 57 | return 0; 58 | } 59 | 60 | int I_CDMusSetVolume(int volume) 61 | { 62 | return 0; 63 | } 64 | 65 | int I_CDMusFirstTrack(void) 66 | { 67 | return 0; 68 | } 69 | 70 | int I_CDMusLastTrack(void) 71 | { 72 | return 0; 73 | } 74 | 75 | int I_CDMusTrackLength(int track_num) 76 | { 77 | return 0; 78 | } 79 | 80 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_cdmus.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 1993-2008 Raven Software 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | 16 | // i_cdmus.h 17 | 18 | #ifndef __ICDMUS__ 19 | #define __ICDMUS__ 20 | 21 | #define CDERR_NOTINSTALLED 10 // MSCDEX not installed 22 | #define CDERR_NOAUDIOSUPPORT 11 // CD-ROM Doesn't support audio 23 | #define CDERR_NOAUDIOTRACKS 12 // Current CD has no audio tracks 24 | #define CDERR_BADDRIVE 20 // Bad drive number 25 | #define CDERR_BADTRACK 21 // Bad track number 26 | #define CDERR_IOCTLBUFFMEM 22 // Not enough low memory for IOCTL 27 | #define CDERR_DEVREQBASE 100 // DevReq errors 28 | 29 | extern int cd_Error; 30 | 31 | int I_CDMusInit(void); 32 | void I_CDMusPrintStartup(void); 33 | int I_CDMusPlay(int track); 34 | int I_CDMusStop(void); 35 | int I_CDMusResume(void); 36 | int I_CDMusSetVolume(int volume); 37 | int I_CDMusFirstTrack(void); 38 | int I_CDMusLastTrack(void); 39 | int I_CDMusTrackLength(int track); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_endoom.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Exit text-mode ENDOOM screen. 16 | // 17 | 18 | #include 19 | #include 20 | 21 | #include "config.h" 22 | #include "doomtype.h" 23 | #include "i_video.h" 24 | 25 | #include "txt_main.h" 26 | 27 | #define ENDOOM_W 80 28 | #define ENDOOM_H 25 29 | 30 | // 31 | // Displays the text mode ending screen after the game quits 32 | // 33 | 34 | void I_Endoom(byte *endoom_data) 35 | { 36 | unsigned char *screendata; 37 | int y; 38 | int indent; 39 | 40 | // Set up text mode screen 41 | 42 | TXT_Init(); 43 | 44 | TXT_SetWindowTitle(PACKAGE_STRING); 45 | // SDL2-TODO I_InitWindowTitle(); 46 | // SDL2-TODO I_InitWindowIcon(); 47 | 48 | // Write the data to the screen memory 49 | 50 | screendata = TXT_GetScreenData(); 51 | 52 | indent = (ENDOOM_W - TXT_SCREEN_W) / 2; 53 | 54 | for (y=0; y 0) 68 | { 69 | break; 70 | } 71 | 72 | TXT_Sleep(0); 73 | } 74 | 75 | // Shut down text mode screen 76 | 77 | TXT_Shutdown(); 78 | } 79 | 80 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_endoom.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Exit text-mode ENDOOM screen. 17 | // 18 | 19 | 20 | #ifndef __I_ENDOOM__ 21 | #define __I_ENDOOM__ 22 | 23 | // Display the Endoom screen on shutdown. Pass a pointer to the 24 | // ENDOOM lump. 25 | 26 | void I_Endoom(byte *data); 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_glob.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2018 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // System specific file globbing interface. 16 | // 17 | 18 | 19 | #ifndef __I_GLOB__ 20 | #define __I_GLOB__ 21 | 22 | #define GLOB_FLAG_NOCASE 0x01 23 | #define GLOB_FLAG_SORTED 0x02 24 | 25 | typedef struct glob_s glob_t; 26 | 27 | // Start reading a list of file paths from the given directory which match 28 | // the given glob pattern. I_EndGlob() must be called on completion. 29 | glob_t *I_StartGlob(const char *directory, const char *glob, int flags); 30 | 31 | // Same as I_StartGlob but multiple glob patterns can be provided. The list 32 | // of patterns must be terminated with NULL. 33 | glob_t *I_StartMultiGlob(const char *directory, int flags, 34 | const char *glob, ...); 35 | 36 | // Finish reading file list. 37 | void I_EndGlob(glob_t *glob); 38 | 39 | // Read the name of the next globbed filename. NULL is returned if there 40 | // are no more found. 41 | const char *I_NextGlob(glob_t *glob); 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_input.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // System-specific keyboard/mouse input. 17 | // 18 | 19 | 20 | #ifndef __I_INPUT__ 21 | #define __I_INPUT__ 22 | 23 | #include "doomtype.h" 24 | 25 | #define MAX_MOUSE_BUTTONS 8 26 | 27 | extern float mouse_acceleration; 28 | extern int mouse_threshold; 29 | 30 | void I_BindInputVariables(void); 31 | void I_ReadMouse(void); 32 | 33 | // I_StartTextInput begins text input, activating the on-screen keyboard 34 | // (if one is used). The caller indicates that any entered text will be 35 | // displayed in the rectangle given by the provided set of coordinates. 36 | void I_StartTextInput(int x1, int y1, int x2, int y2); 37 | 38 | // I_StopTextInput finishes text input, deactivating the on-screen keyboard 39 | // (if one is used). 40 | void I_StopTextInput(void); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_main.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Main program, simply calls D_DoomMain high level loop. 17 | // 18 | 19 | #include "config.h" 20 | 21 | #include 22 | 23 | #include "SDL.h" 24 | 25 | #include "doomtype.h" 26 | #include "i_system.h" 27 | #include "m_argv.h" 28 | 29 | // 30 | // D_DoomMain() 31 | // Not a globally visible function, just included for source reference, 32 | // calls all startup code, parses command line options. 33 | // 34 | 35 | void D_DoomMain (void); 36 | 37 | int main(int argc, char **argv) 38 | { 39 | // save arguments 40 | 41 | myargc = argc; 42 | myargv = argv; 43 | 44 | //! 45 | // Print the program version and exit. 46 | // 47 | if (M_ParmExists("-version") || M_ParmExists("--version")) { 48 | puts(PACKAGE_STRING); 49 | exit(0); 50 | } 51 | 52 | #if defined(_WIN32) 53 | // compose a proper command line from loose file paths passed as arguments 54 | // to allow for loading WADs and DEHACKED patches by drag-and-drop 55 | M_AddLooseFiles(); 56 | #endif 57 | 58 | M_FindResponseFile(); 59 | 60 | #ifdef SDL_HINT_NO_SIGNAL_HANDLERS 61 | SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1"); 62 | #endif 63 | 64 | // start doom 65 | 66 | D_DoomMain (); 67 | 68 | return 0; 69 | } 70 | 71 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_midipipe.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2013 James Haley et al. 3 | // Copyright(C) 2017 Alex Mayfield 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Client Interface to Midi Server 17 | // 18 | 19 | #ifndef __I_MIDIPIPE__ 20 | #define __I_MIDIPIPE__ 21 | 22 | #if _WIN32 23 | 24 | #include "SDL_mixer.h" 25 | 26 | #include "doomtype.h" 27 | 28 | extern boolean midi_server_initialized; 29 | extern boolean midi_server_registered; 30 | 31 | boolean I_MidiPipe_RegisterSong(char *filename); 32 | void I_MidiPipe_UnregisterSong(void); 33 | void I_MidiPipe_SetVolume(int vol); 34 | void I_MidiPipe_PlaySong(int loops); 35 | void I_MidiPipe_StopSong(); 36 | void I_MidiPipe_ShutdownServer(); 37 | 38 | boolean I_MidiPipe_InitServer(); 39 | 40 | #else 41 | 42 | #include "doomtype.h" 43 | 44 | static const boolean midi_server_registered = false; 45 | 46 | #endif 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_swap.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Endianess handling, swapping 16bit and 32bit. 17 | // 18 | 19 | 20 | #ifndef __I_SWAP__ 21 | #define __I_SWAP__ 22 | 23 | #include "SDL_endian.h" 24 | 25 | // Endianess handling. 26 | // WAD files are stored little endian. 27 | 28 | // Just use SDL's endianness swapping functions. 29 | 30 | // These are deliberately cast to signed values; this is the behaviour 31 | // of the macros in the original source and some code relies on it. 32 | 33 | #define SHORT(x) ((signed short) SDL_SwapLE16(x)) 34 | #define LONG(x) ((signed int) SDL_SwapLE32(x)) 35 | 36 | // Defines for checking the endianness of the system. 37 | 38 | #if SDL_BYTEORDER == SDL_BIG_ENDIAN 39 | #define SYS_BIG_ENDIAN 40 | #endif 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_timer.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Timer functions. 17 | // 18 | 19 | #include "SDL.h" 20 | 21 | #include "i_timer.h" 22 | #include "doomtype.h" 23 | 24 | // 25 | // I_GetTime 26 | // returns time in 1/35th second tics 27 | // 28 | 29 | static Uint32 basetime = 0; 30 | 31 | int I_GetTime (void) 32 | { 33 | Uint32 ticks; 34 | 35 | ticks = SDL_GetTicks(); 36 | 37 | if (basetime == 0) 38 | basetime = ticks; 39 | 40 | ticks -= basetime; 41 | 42 | return (ticks * TICRATE) / 1000; 43 | } 44 | 45 | // 46 | // Same as I_GetTime, but returns time in milliseconds 47 | // 48 | 49 | int I_GetTimeMS(void) 50 | { 51 | Uint32 ticks; 52 | 53 | ticks = SDL_GetTicks(); 54 | 55 | if (basetime == 0) 56 | basetime = ticks; 57 | 58 | return ticks - basetime; 59 | } 60 | 61 | // Sleep for a specified number of ms 62 | 63 | void I_Sleep(int ms) 64 | { 65 | SDL_Delay(ms); 66 | } 67 | 68 | void I_WaitVBL(int count) 69 | { 70 | I_Sleep((count * 1000) / 70); 71 | } 72 | 73 | 74 | void I_InitTimer(void) 75 | { 76 | // initialize timer 77 | 78 | #if SDL_VERSION_ATLEAST(2, 0, 5) 79 | SDL_SetHint(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, "1"); 80 | #endif 81 | SDL_Init(SDL_INIT_TIMER); 82 | } 83 | 84 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_timer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // System-specific timer interface 17 | // 18 | 19 | 20 | #ifndef __I_TIMER__ 21 | #define __I_TIMER__ 22 | 23 | #define TICRATE 35 24 | 25 | // Called by D_DoomLoop, 26 | // returns current time in tics. 27 | int I_GetTime (void); 28 | 29 | // returns current time in ms 30 | int I_GetTimeMS (void); 31 | 32 | // Pause for a specified number of ms 33 | void I_Sleep(int ms); 34 | 35 | // Initialize timer 36 | void I_InitTimer(void); 37 | 38 | // Wait for vertical retrace or pause a bit. 39 | void I_WaitVBL(int count); 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /chocolate-doom/src/i_videohr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // SDL emulation of VGA 640x480x4 planar video mode, 16 | // for Hexen startup loading screen. 17 | // 18 | 19 | #ifndef I_VIDEOHR_H 20 | #define I_VIDEOHR_H 21 | 22 | boolean I_SetVideoModeHR(void); 23 | void I_UnsetVideoModeHR(void); 24 | void I_SetWindowTitleHR(const char *title); 25 | void I_ClearScreenHR(void); 26 | void I_SlamBlockHR(int x, int y, int w, int h, const byte *src); 27 | void I_SlamHR(const byte *buffer); 28 | void I_InitPaletteHR(void); 29 | void I_SetPaletteHR(const byte *palette); 30 | void I_FadeToPaletteHR(const byte *palette); 31 | void I_BlackPaletteHR(void); 32 | boolean I_CheckAbortHR(void); 33 | 34 | #endif /* #ifndef I_VIDEOHR_H */ 35 | 36 | -------------------------------------------------------------------------------- /chocolate-doom/src/m_argv.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Nil. 17 | // 18 | 19 | 20 | #ifndef __M_ARGV__ 21 | #define __M_ARGV__ 22 | 23 | #include "doomtype.h" 24 | 25 | // 26 | // MISC 27 | // 28 | extern int myargc; 29 | extern char** myargv; 30 | 31 | // Returns the position of the given parameter 32 | // in the arg list (0 if not found). 33 | int M_CheckParm (const char* check); 34 | 35 | // Same as M_CheckParm, but checks that num_args arguments are available 36 | // following the specified argument. 37 | int M_CheckParmWithArgs(const char *check, int num_args); 38 | 39 | void M_FindResponseFile(void); 40 | void M_AddLooseFiles(void); 41 | 42 | // Parameter has been specified? 43 | 44 | boolean M_ParmExists(const char *check); 45 | 46 | // Get name of executable used to run this program: 47 | 48 | const char *M_GetExecutableName(void); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /chocolate-doom/src/m_bbox.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Main loop menu stuff. 17 | // Random number LUT. 18 | // Default Config File. 19 | // PCX Screenshots. 20 | // 21 | 22 | 23 | 24 | #include "m_bbox.h" 25 | 26 | 27 | 28 | 29 | void M_ClearBox (fixed_t *box) 30 | { 31 | box[BOXTOP] = box[BOXRIGHT] = INT_MIN; 32 | box[BOXBOTTOM] = box[BOXLEFT] = INT_MAX; 33 | } 34 | 35 | void 36 | M_AddToBox 37 | ( fixed_t* box, 38 | fixed_t x, 39 | fixed_t y ) 40 | { 41 | if (xbox[BOXRIGHT]) 44 | box[BOXRIGHT] = x; 45 | if (ybox[BOXTOP]) 48 | box[BOXTOP] = y; 49 | } 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /chocolate-doom/src/m_bbox.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Nil. 17 | // 18 | 19 | 20 | #ifndef __M_BBOX__ 21 | #define __M_BBOX__ 22 | 23 | #include 24 | 25 | #include "m_fixed.h" 26 | 27 | 28 | // Bounding box coordinate storage. 29 | enum 30 | { 31 | BOXTOP, 32 | BOXBOTTOM, 33 | BOXLEFT, 34 | BOXRIGHT 35 | }; // bbox coordinates 36 | 37 | // Bounding box functions. 38 | void M_ClearBox (fixed_t* box); 39 | 40 | void 41 | M_AddToBox 42 | ( fixed_t* box, 43 | fixed_t x, 44 | fixed_t y ); 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /chocolate-doom/src/m_cheat.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Cheat code checking. 17 | // 18 | 19 | 20 | #ifndef __M_CHEAT__ 21 | #define __M_CHEAT__ 22 | 23 | // 24 | // CHEAT SEQUENCE PACKAGE 25 | // 26 | 27 | // declaring a cheat 28 | 29 | #define CHEAT(value, parameters) \ 30 | { value, sizeof(value) - 1, parameters, 0, 0, "" } 31 | 32 | #define MAX_CHEAT_LEN 25 33 | #define MAX_CHEAT_PARAMS 5 34 | 35 | typedef struct 36 | { 37 | // settings for this cheat 38 | 39 | char sequence[MAX_CHEAT_LEN]; 40 | size_t sequence_len; 41 | int parameter_chars; 42 | 43 | // state used during the game 44 | 45 | size_t chars_read; 46 | int param_chars_read; 47 | char parameter_buf[MAX_CHEAT_PARAMS]; 48 | } cheatseq_t; 49 | 50 | int 51 | cht_CheckCheat 52 | ( cheatseq_t* cht, 53 | char key ); 54 | 55 | 56 | void 57 | cht_GetParam 58 | ( cheatseq_t* cht, 59 | char* buffer ); 60 | 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /chocolate-doom/src/m_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Configuration file interface. 17 | // 18 | 19 | 20 | #ifndef __M_CONFIG__ 21 | #define __M_CONFIG__ 22 | 23 | #include "doomtype.h" 24 | 25 | void M_LoadDefaults(void); 26 | void M_SaveDefaults(void); 27 | void M_SaveDefaultsAlternate(const char *main, const char *extra); 28 | void M_SetConfigDir(const char *dir); 29 | void M_SetMusicPackDir(void); 30 | void M_BindIntVariable(const char *name, int *variable); 31 | void M_BindFloatVariable(const char *name, float *variable); 32 | void M_BindStringVariable(const char *name, char **variable); 33 | boolean M_SetVariable(const char *name, const char *value); 34 | int M_GetIntVariable(const char *name); 35 | const char *M_GetStringVariable(const char *name); 36 | float M_GetFloatVariable(const char *name); 37 | void M_SetConfigFilenames(const char *main_config, const char *extra_config); 38 | char *M_GetSaveGameDir(const char *iwadname); 39 | char *M_GetAutoloadDir(const char *iwadname); 40 | 41 | extern const char *configdir; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /chocolate-doom/src/m_fixed.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Fixed point implementation. 17 | // 18 | 19 | 20 | 21 | #include "stdlib.h" 22 | 23 | #include "doomtype.h" 24 | #include "i_system.h" 25 | 26 | #include "m_fixed.h" 27 | 28 | 29 | 30 | 31 | // Fixme. __USE_C_FIXED__ or something. 32 | 33 | fixed_t 34 | FixedMul 35 | ( fixed_t a, 36 | fixed_t b ) 37 | { 38 | return ((int64_t) a * (int64_t) b) >> FRACBITS; 39 | } 40 | 41 | 42 | 43 | // 44 | // FixedDiv, C version. 45 | // 46 | 47 | fixed_t FixedDiv(fixed_t a, fixed_t b) 48 | { 49 | if ((abs(a) >> 14) >= abs(b)) 50 | { 51 | return (a^b) < 0 ? INT_MIN : INT_MAX; 52 | } 53 | else 54 | { 55 | int64_t result; 56 | 57 | result = ((int64_t) a << FRACBITS) / b; 58 | 59 | return (fixed_t) result; 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /chocolate-doom/src/m_fixed.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Fixed point arithemtics, implementation. 17 | // 18 | 19 | 20 | #ifndef __M_FIXED__ 21 | #define __M_FIXED__ 22 | 23 | 24 | 25 | 26 | // 27 | // Fixed point, 32bit as 16.16. 28 | // 29 | #define FRACBITS 16 30 | #define FRACUNIT (1< 2 | 3 | 5 | 6 | 7 | 8 | true 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /chocolate-doom/src/memio.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | 16 | #ifndef MEMIO_H 17 | #define MEMIO_H 18 | 19 | typedef struct _MEMFILE MEMFILE; 20 | 21 | typedef enum 22 | { 23 | MEM_SEEK_SET, 24 | MEM_SEEK_CUR, 25 | MEM_SEEK_END, 26 | } mem_rel_t; 27 | 28 | MEMFILE *mem_fopen_read(void *buf, size_t buflen); 29 | size_t mem_fread(void *buf, size_t size, size_t nmemb, MEMFILE *stream); 30 | MEMFILE *mem_fopen_write(void); 31 | size_t mem_fwrite(const void *ptr, size_t size, size_t nmemb, MEMFILE *stream); 32 | void mem_get_buf(MEMFILE *stream, void **buf, size_t *buflen); 33 | void mem_fclose(MEMFILE *stream); 34 | long mem_ftell(MEMFILE *stream); 35 | int mem_fseek(MEMFILE *stream, signed long offset, mem_rel_t whence); 36 | 37 | #endif /* #ifndef MEMIO_H */ 38 | 39 | -------------------------------------------------------------------------------- /chocolate-doom/src/mus2mid.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // Copyright(C) 2006 Ben Ryves 2006 5 | // 6 | // This program is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU General Public License 8 | // as published by the Free Software Foundation; either version 2 9 | // of the License, or (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // 17 | // mus2mid.h - Ben Ryves 2006 - http://benryves.com - benryves@benryves.com 18 | // Use to convert a MUS file into a single track, type 0 MIDI file. 19 | 20 | #ifndef MUS2MID_H 21 | #define MUS2MID_H 22 | 23 | #include "doomtype.h" 24 | #include "memio.h" 25 | 26 | boolean mus2mid(MEMFILE *musinput, MEMFILE *midioutput); 27 | 28 | #endif /* #ifndef MUS2MID_H */ 29 | 30 | -------------------------------------------------------------------------------- /chocolate-doom/src/net_client.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // Network client code 15 | // 16 | 17 | #ifndef NET_CLIENT_H 18 | #define NET_CLIENT_H 19 | 20 | #include "doomtype.h" 21 | #include "d_ticcmd.h" 22 | #include "sha1.h" 23 | #include "net_defs.h" 24 | 25 | boolean NET_CL_Connect(net_addr_t *addr, net_connect_data_t *data); 26 | void NET_CL_Disconnect(void); 27 | void NET_CL_Run(void); 28 | void NET_CL_Init(void); 29 | void NET_CL_LaunchGame(void); 30 | void NET_CL_StartGame(net_gamesettings_t *settings); 31 | void NET_CL_SendTiccmd(ticcmd_t *ticcmd, int maketic); 32 | boolean NET_CL_GetSettings(net_gamesettings_t *_settings); 33 | void NET_Init(void); 34 | 35 | void NET_BindVariables(void); 36 | 37 | extern boolean net_client_connected; 38 | extern boolean net_client_received_wait_data; 39 | extern net_waitdata_t net_client_wait_data; 40 | extern char *net_client_reject_reason; 41 | extern boolean net_waiting_for_launch; 42 | extern char *net_player_name; 43 | 44 | extern sha1_digest_t net_server_wad_sha1sum; 45 | extern sha1_digest_t net_server_deh_sha1sum; 46 | extern unsigned int net_server_is_freedoom; 47 | extern sha1_digest_t net_local_wad_sha1sum; 48 | extern sha1_digest_t net_local_deh_sha1sum; 49 | extern unsigned int net_local_is_freedoom; 50 | 51 | extern boolean drone; 52 | 53 | #endif /* #ifndef NET_CLIENT_H */ 54 | -------------------------------------------------------------------------------- /chocolate-doom/src/net_dedicated.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Dedicated server code. 16 | // 17 | 18 | #ifndef NET_DEDICATED_H 19 | #define NET_DEDICATED_H 20 | 21 | void NET_DedicatedServer(void); 22 | 23 | #endif /* #ifndef NET_DEDICATED_H */ 24 | 25 | 26 | -------------------------------------------------------------------------------- /chocolate-doom/src/net_gui.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // Graphical stuff related to the networking code: 15 | // 16 | // * The client waiting screen when we are waiting for the server to 17 | // start the game. 18 | // 19 | 20 | 21 | #ifndef NET_GUI_H 22 | #define NET_GUI_H 23 | 24 | #include "doomtype.h" 25 | 26 | extern void NET_WaitForLaunch(void); 27 | 28 | #endif /* #ifndef NET_GUI_H */ 29 | 30 | -------------------------------------------------------------------------------- /chocolate-doom/src/net_loop.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Loopback network module for server compiled into the client 16 | // 17 | 18 | #ifndef NET_LOOP_H 19 | #define NET_LOOP_H 20 | 21 | #include "net_defs.h" 22 | 23 | extern net_module_t net_loop_client_module; 24 | extern net_module_t net_loop_server_module; 25 | 26 | #endif /* #ifndef NET_LOOP_H */ 27 | 28 | -------------------------------------------------------------------------------- /chocolate-doom/src/net_packet.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Definitions for use in networking code. 16 | // 17 | 18 | #ifndef NET_PACKET_H 19 | #define NET_PACKET_H 20 | 21 | #include "net_defs.h" 22 | 23 | net_packet_t *NET_NewPacket(int initial_size); 24 | net_packet_t *NET_PacketDup(net_packet_t *packet); 25 | void NET_FreePacket(net_packet_t *packet); 26 | 27 | boolean NET_ReadInt8(net_packet_t *packet, unsigned int *data); 28 | boolean NET_ReadInt16(net_packet_t *packet, unsigned int *data); 29 | boolean NET_ReadInt32(net_packet_t *packet, unsigned int *data); 30 | 31 | boolean NET_ReadSInt8(net_packet_t *packet, signed int *data); 32 | boolean NET_ReadSInt16(net_packet_t *packet, signed int *data); 33 | boolean NET_ReadSInt32(net_packet_t *packet, signed int *data); 34 | 35 | char *NET_ReadString(net_packet_t *packet); 36 | char *NET_ReadSafeString(net_packet_t *packet); 37 | 38 | void NET_WriteInt8(net_packet_t *packet, unsigned int i); 39 | void NET_WriteInt16(net_packet_t *packet, unsigned int i); 40 | void NET_WriteInt32(net_packet_t *packet, unsigned int i); 41 | 42 | void NET_WriteString(net_packet_t *packet, const char *string); 43 | 44 | #endif /* #ifndef NET_PACKET_H */ 45 | 46 | -------------------------------------------------------------------------------- /chocolate-doom/src/net_petname.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2019 Jonathan Dowland 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Generate a randomized, private, memorable name for a Player 16 | // 17 | 18 | char *NET_GetRandomPetName(); 19 | -------------------------------------------------------------------------------- /chocolate-doom/src/net_query.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Querying servers to find their current status. 16 | // 17 | 18 | #ifndef NET_QUERY_H 19 | #define NET_QUERY_H 20 | 21 | #include "net_defs.h" 22 | 23 | typedef void (*net_query_callback_t)(net_addr_t *addr, 24 | net_querydata_t *querydata, 25 | unsigned int ping_time, 26 | void *user_data); 27 | 28 | extern int NET_StartLANQuery(void); 29 | extern int NET_StartMasterQuery(void); 30 | 31 | extern void NET_LANQuery(void); 32 | extern void NET_MasterQuery(void); 33 | extern void NET_QueryAddress(char *addr); 34 | extern net_addr_t *NET_FindLANServer(void); 35 | 36 | extern int NET_Query_Poll(net_query_callback_t callback, void *user_data); 37 | 38 | extern net_addr_t *NET_Query_ResolveMaster(net_context_t *context); 39 | extern void NET_Query_AddToMaster(net_addr_t *master_addr); 40 | extern boolean NET_Query_CheckAddedToMaster(boolean *result); 41 | extern void NET_Query_AddResponse(net_packet_t *packet); 42 | extern void NET_RequestHolePunch(net_context_t *context, net_addr_t *addr); 43 | 44 | #endif /* #ifndef NET_QUERY_H */ 45 | 46 | -------------------------------------------------------------------------------- /chocolate-doom/src/net_sdl.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Networking module which uses SDL_net 16 | // 17 | 18 | #ifndef NET_SDL_H 19 | #define NET_SDL_H 20 | 21 | #include "net_defs.h" 22 | 23 | extern net_module_t net_sdl_module; 24 | 25 | #endif /* #ifndef NET_SDL_H */ 26 | 27 | -------------------------------------------------------------------------------- /chocolate-doom/src/net_server.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // Network server code 15 | // 16 | 17 | #ifndef NET_SERVER_H 18 | #define NET_SERVER_H 19 | 20 | // initialize server and wait for connections 21 | 22 | void NET_SV_Init(void); 23 | 24 | // run server: check for new packets received etc. 25 | 26 | void NET_SV_Run(void); 27 | 28 | // Shut down the server 29 | // Blocks until all clients disconnect, or until a 5 second timeout 30 | 31 | void NET_SV_Shutdown(void); 32 | 33 | // Add a network module to the context used by the server 34 | 35 | void NET_SV_AddModule(net_module_t *module); 36 | 37 | // Register server with master server. 38 | 39 | void NET_SV_RegisterWithMaster(void); 40 | 41 | #endif /* #ifndef NET_SERVER_H */ 42 | 43 | -------------------------------------------------------------------------------- /chocolate-doom/src/resource.rc.in: -------------------------------------------------------------------------------- 1 | 1 ICON "@top_srcdir@/data/doom.ico" 2 | 3 | #include 4 | 5 | CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "@top_srcdir@/src/manifest.xml" 6 | 7 | 1 VERSIONINFO 8 | PRODUCTVERSION @WINDOWS_RC_VERSION@ 9 | FILEVERSION @WINDOWS_RC_VERSION@ 10 | FILETYPE 1 11 | { 12 | BLOCK "StringFileInfo" 13 | { 14 | BLOCK "040904E4" 15 | { 16 | VALUE "FileVersion", "@PACKAGE_VERSION@.0" 17 | VALUE "FileDescription", "@PACKAGE_STRING@" 18 | VALUE "InternalName", "@PACKAGE_TARNAME@" 19 | VALUE "CompanyName", "@PACKAGE_BUGREPORT@" 20 | VALUE "LegalCopyright", "@PACKAGE_COPYRIGHT@. Licensed under @PACKAGE_LICENSE@" 21 | VALUE "ProductName", "@PACKAGE_NAME@" 22 | VALUE "ProductVersion", "@PACKAGE_VERSION@" 23 | } 24 | } 25 | BLOCK "VarFileInfo" 26 | { 27 | VALUE "Translation", 0x409, 1252 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup-res.rc.in: -------------------------------------------------------------------------------- 1 | 1 ICON "@top_srcdir@/data/setup.ico" 2 | 3 | 1 24 MOVEABLE PURE "@top_builddir@/src/setup/setup-manifest.xml" 4 | 5 | 1 VERSIONINFO 6 | PRODUCTVERSION @WINDOWS_RC_VERSION@ 7 | FILEVERSION @WINDOWS_RC_VERSION@ 8 | FILETYPE 1 9 | { 10 | BLOCK "StringFileInfo" 11 | { 12 | BLOCK "040904E4" 13 | { 14 | VALUE "FileVersion", "@PACKAGE_VERSION@.0" 15 | VALUE "FileDescription", "@PACKAGE_STRING@ Setup" 16 | VALUE "InternalName", "@PACKAGE_TARNAME@" 17 | VALUE "CompanyName", "@PACKAGE_BUGREPORT@" 18 | VALUE "LegalCopyright", "GNU General Public License" 19 | VALUE "ProductName", "@PACKAGE_NAME@ Setup" 20 | VALUE "ProductVersion", "@PACKAGE_VERSION@" 21 | } 22 | } 23 | BLOCK "VarFileInfo" 24 | { 25 | VALUE "Translation", 0x409, 1252 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | Makefile 3 | .deps 4 | setup-manifest.xml 5 | *.rc 6 | tags 7 | TAGS 8 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(setup STATIC 2 | compatibility.c compatibility.h 3 | display.c display.h 4 | joystick.c joystick.h 5 | keyboard.c keyboard.h 6 | mainmenu.c 7 | mode.c mode.h 8 | mouse.c mouse.h 9 | multiplayer.c multiplayer.h 10 | sound.c sound.h 11 | execute.c execute.h 12 | txt_joyaxis.c txt_joyaxis.h 13 | txt_joybinput.c txt_joybinput.h 14 | txt_keyinput.c txt_keyinput.h 15 | txt_mouseinput.c txt_mouseinput.h) 16 | 17 | target_include_directories(setup PRIVATE "../" "${CMAKE_CURRENT_BINARY_DIR}/../../") 18 | target_link_libraries(setup textscreen SDL2::SDL2 SDL2::mixer) 19 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS = @SDL_CFLAGS@ \ 3 | @SDLMIXER_CFLAGS@ \ 4 | -I$(top_srcdir)/textscreen -I$(top_srcdir)/src 5 | 6 | noinst_LIBRARIES = libsetup.a 7 | 8 | libsetup_a_SOURCES = \ 9 | compatibility.c compatibility.h \ 10 | display.c display.h \ 11 | joystick.c joystick.h \ 12 | keyboard.c keyboard.h \ 13 | mainmenu.c \ 14 | mode.c mode.h \ 15 | mouse.c mouse.h \ 16 | multiplayer.c multiplayer.h \ 17 | sound.c sound.h \ 18 | execute.c execute.h \ 19 | txt_joyaxis.c txt_joyaxis.h \ 20 | txt_joybinput.c txt_joybinput.h \ 21 | txt_keyinput.c txt_keyinput.h \ 22 | txt_mouseinput.c txt_mouseinput.h 23 | 24 | EXTRA_DIST= \ 25 | CMakeLists.txt \ 26 | setup_icon.c 27 | 28 | appdir = $(prefix)/share/applications 29 | app_DATA = @PACKAGE_RDNS@.Setup.desktop 30 | 31 | CLEANFILES = $(app_DATA) 32 | 33 | @PACKAGE_RDNS@.Setup.desktop : Setup.desktop 34 | cp Setup.desktop $@ 35 | 36 | if HAVE_PYTHON 37 | 38 | setup_icon.c : $(top_builddir)/data/setup.png 39 | $(top_builddir)/data/convert-icon $(top_builddir)/data/setup.png $@ 40 | 41 | endif 42 | 43 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/Setup.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=@PACKAGE_SHORTNAME@ Setup 3 | Exec=@PROGRAM_PREFIX@setup 4 | Icon=@PROGRAM_PREFIX@setup 5 | Type=Application 6 | Comment=Setup tool for @PACKAGE_SHORTNAME@ 7 | Categories=Settings; 8 | Keywords=first;person;shooter;doom;heretic;hexen;strife;vanilla; 9 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/compatibility.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | // Sound control menu 16 | 17 | #include 18 | 19 | #include "m_config.h" 20 | #include "textscreen.h" 21 | #include "mode.h" 22 | 23 | #include "compatibility.h" 24 | 25 | #define WINDOW_HELP_URL "https://www.chocolate-doom.org/setup-compat" 26 | 27 | int vanilla_savegame_limit = 1; 28 | int vanilla_demo_limit = 1; 29 | 30 | void CompatibilitySettings(TXT_UNCAST_ARG(widget), void *user_data) 31 | { 32 | txt_window_t *window; 33 | 34 | window = TXT_NewWindow("Compatibility"); 35 | 36 | TXT_SetWindowHelpURL(window, WINDOW_HELP_URL); 37 | 38 | TXT_AddWidgets(window, 39 | TXT_NewCheckBox("Vanilla savegame limit", 40 | &vanilla_savegame_limit), 41 | TXT_NewCheckBox("Vanilla demo limit", 42 | &vanilla_demo_limit), 43 | NULL); 44 | } 45 | 46 | void BindCompatibilityVariables(void) 47 | { 48 | M_BindIntVariable("vanilla_savegame_limit", &vanilla_savegame_limit); 49 | M_BindIntVariable("vanilla_demo_limit", &vanilla_demo_limit); 50 | } 51 | 52 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/compatibility.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef SETUP_COMPATIBILITY_H 16 | #define SETUP_COMPATIBILITY_H 17 | 18 | void CompatibilitySettings(void *widget, void *user_data); 19 | void BindCompatibilityVariables(void); 20 | 21 | extern int vanilla_savegame_limit; 22 | extern int vanilla_demo_limit; 23 | 24 | #endif /* #ifndef SETUP_COMPATIBILITY_H */ 25 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/display.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef SETUP_DISPLAY_H 16 | #define SETUP_DISPLAY_H 17 | 18 | void ConfigDisplay(void *widget, void *user_data); 19 | void SetDisplayDriver(void); 20 | void BindDisplayVariables(void); 21 | 22 | extern int show_endoom; 23 | extern int graphical_startup; 24 | extern int png_screenshots; 25 | 26 | #endif /* #ifndef SETUP_DISPLAY_H */ 27 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/execute.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef TESTCONFIG_H 16 | #define TESTCONFIG_H 17 | 18 | #include "doomtype.h" 19 | #include "textscreen.h" 20 | 21 | typedef struct execute_context_s execute_context_t; 22 | 23 | #define IWAD_DOOM2 (1 << 0) /* doom2.wad */ 24 | #define IWAD_PLUTONIA (1 << 1) /* plutonia.wad */ 25 | #define IWAD_TNT (1 << 2) /* tnt.wad */ 26 | #define IWAD_DOOM (1 << 3) /* doom.wad */ 27 | #define IWAD_DOOM1 (1 << 4) /* doom1.wad */ 28 | #define IWAD_CHEX (1 << 5) /* chex.wad */ 29 | 30 | execute_context_t *NewExecuteContext(void); 31 | void AddCmdLineParameter(execute_context_t *context, const char *s, ...) PRINTF_ATTR(2, 3); 32 | void PassThroughArguments(execute_context_t *context); 33 | int ExecuteDoom(execute_context_t *context); 34 | int FindInstalledIWADs(void); 35 | boolean OpenFolder(const char *path); 36 | 37 | txt_window_action_t *TestConfigAction(void); 38 | 39 | #endif /* #ifndef TESTCONFIG_H */ 40 | 41 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/joystick.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef SETUP_JOYSTICK_H 16 | #define SETUP_JOYSTICK_H 17 | 18 | extern int joystick_index; 19 | 20 | void ConfigJoystick(void *widget, void *user_data); 21 | void BindJoystickVariables(void); 22 | 23 | #endif /* #ifndef SETUP_JOYSTICK_H */ 24 | 25 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/keyboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef SETUP_KEYBOARD_H 16 | #define SETUP_KEYBOARD_H 17 | 18 | void ConfigKeyboard(void *widget, void *user_data); 19 | void BindKeyboardVariables(void); 20 | 21 | extern int vanilla_keyboard_mapping; 22 | 23 | #endif /* #ifndef SETUP_KEYBOARD_H */ 24 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/mode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef SETUP_MODE_H 16 | #define SETUP_MODE_H 17 | 18 | #include "d_mode.h" 19 | #include "d_iwad.h" 20 | 21 | typedef void (*GameSelectCallback)(void); 22 | extern GameMission_t gamemission; 23 | 24 | void SetupMission(GameSelectCallback callback); 25 | void InitBindings(void); 26 | const char *GetExecutableName(void); 27 | const char *GetGameTitle(void); 28 | const iwad_t **GetIwads(void); 29 | 30 | #endif /* #ifndef SETUP_MODE_H */ 31 | 32 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/mouse.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef SETUP_MOUSE_H 16 | #define SETUP_MOUSE_H 17 | 18 | void ConfigMouse(void *widget, void *user_data); 19 | void BindMouseVariables(void); 20 | 21 | extern int novert; 22 | 23 | #endif /* #ifndef SETUP_MOUSE_H */ 24 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/multiplayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef SETUP_MULTIPLAYER_H 16 | #define SETUP_MULTIPLAYER_H 17 | 18 | void StartMultiGame(void *widget, void *user_data); 19 | void WarpMenu(void *widget, void *user_data); 20 | void JoinMultiGame(void *widget, void *user_data); 21 | void MultiplayerConfig(void *widget, void *user_data); 22 | 23 | void SetChatMacroDefaults(void); 24 | void SetPlayerNameDefault(void); 25 | 26 | void BindMultiplayerVariables(void); 27 | 28 | #endif /* #ifndef SETUP_MULTIPLAYER_H */ 29 | 30 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/setup-manifest.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 14 | 15 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | true 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/sound.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef SETUP_SOUND_H 16 | #define SETUP_SOUND_H 17 | 18 | #include "i_sound.h" 19 | 20 | void ConfigSound(void *widget, void *user_data); 21 | void BindSoundVariables(void); 22 | 23 | extern char *snd_dmxoption; 24 | 25 | #endif /* #ifndef SETUP_SOUND_H */ 26 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/txt_joybinput.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef TXT_JOYB_INPUT_H 16 | #define TXT_JOYB_INPUT_H 17 | 18 | typedef struct txt_joystick_input_s txt_joystick_input_t; 19 | 20 | #include "txt_widget.h" 21 | #include "txt_window.h" 22 | 23 | // 24 | // A joystick input is like an input box. When selected, a box pops up 25 | // allowing a joystick button to be pressed to select it. 26 | // 27 | 28 | struct txt_joystick_input_s 29 | { 30 | txt_widget_t widget; 31 | int *variable; 32 | txt_window_t *prompt_window; 33 | int check_conflicts; 34 | }; 35 | 36 | txt_joystick_input_t *TXT_NewJoystickInput(int *variable); 37 | 38 | #endif /* #ifndef TXT_JOYB_INPUT_H */ 39 | 40 | 41 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/txt_keyinput.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef TXT_KEY_INPUT_H 16 | #define TXT_KEY_INPUT_H 17 | 18 | typedef struct txt_key_input_s txt_key_input_t; 19 | 20 | #include "txt_widget.h" 21 | 22 | // 23 | // A key input is like an input box. When selected, a box pops up 24 | // allowing a key to be selected. 25 | // 26 | 27 | struct txt_key_input_s 28 | { 29 | txt_widget_t widget; 30 | int *variable; 31 | int check_conflicts; 32 | }; 33 | 34 | txt_key_input_t *TXT_NewKeyInput(int *variable); 35 | 36 | #endif /* #ifndef TXT_KEY_INPUT_H */ 37 | 38 | 39 | -------------------------------------------------------------------------------- /chocolate-doom/src/setup/txt_mouseinput.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef TXT_MOUSE_INPUT_H 16 | #define TXT_MOUSE_INPUT_H 17 | 18 | typedef struct txt_mouse_input_s txt_mouse_input_t; 19 | 20 | #include "txt_widget.h" 21 | 22 | // 23 | // A mouse input is like an input box. When selected, a box pops up 24 | // allowing a mouse to be selected. 25 | // 26 | 27 | struct txt_mouse_input_s 28 | { 29 | txt_widget_t widget; 30 | int *variable; 31 | int check_conflicts; 32 | }; 33 | 34 | txt_mouse_input_t *TXT_NewMouseInput(int *variable); 35 | 36 | #endif /* #ifndef TXT_MOUSE_INPUT_H */ 37 | 38 | 39 | -------------------------------------------------------------------------------- /chocolate-doom/src/sha1.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // SHA-1 digest. 16 | // 17 | 18 | #ifndef __SHA1_H__ 19 | #define __SHA1_H__ 20 | 21 | #include "doomtype.h" 22 | 23 | typedef struct sha1_context_s sha1_context_t; 24 | typedef byte sha1_digest_t[20]; 25 | 26 | struct sha1_context_s { 27 | uint32_t h0,h1,h2,h3,h4; 28 | uint32_t nblocks; 29 | byte buf[64]; 30 | int count; 31 | }; 32 | 33 | void SHA1_Init(sha1_context_t *context); 34 | void SHA1_Update(sha1_context_t *context, byte *buf, size_t len); 35 | void SHA1_Final(sha1_digest_t digest, sha1_context_t *context); 36 | void SHA1_UpdateInt32(sha1_context_t *context, unsigned int val); 37 | void SHA1_UpdateString(sha1_context_t *context, char *str); 38 | 39 | #endif /* #ifndef __SHA1_H__ */ 40 | 41 | -------------------------------------------------------------------------------- /chocolate-doom/src/v_diskicon.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Disk load indicator. 17 | // 18 | 19 | #ifndef __V_DISKICON__ 20 | #define __V_DISKICON__ 21 | 22 | // Dimensions of the flashing "loading" disk icon 23 | 24 | #define LOADING_DISK_W 16 25 | #define LOADING_DISK_H 16 26 | 27 | extern void V_EnableLoadingDisk(const char *lump_name, int xoffs, int yoffs); 28 | extern void V_BeginRead(size_t nbytes); 29 | extern void V_DrawDiskIcon(void); 30 | extern void V_RestoreDiskBackground(void); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /chocolate-doom/src/v_patch.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Refresh/rendering module, shared data struct definitions. 17 | // 18 | 19 | 20 | #ifndef V_PATCH_H 21 | #define V_PATCH_H 22 | 23 | // Patches. 24 | // A patch holds one or more columns. 25 | // Patches are used for sprites and all masked pictures, 26 | // and we compose textures from the TEXTURE1/2 lists 27 | // of patches. 28 | 29 | typedef PACKED_STRUCT ( 30 | { 31 | short width; // bounding box size 32 | short height; 33 | short leftoffset; // pixels to the left of origin 34 | short topoffset; // pixels below the origin 35 | int columnofs[8]; // only [width] used 36 | // the [0] is &columnofs[width] 37 | }) patch_t; 38 | 39 | // posts are runs of non masked source pixels 40 | typedef PACKED_STRUCT ( 41 | { 42 | byte topdelta; // -1 is the last post in a column 43 | byte length; // length data bytes follows 44 | }) post_t; 45 | 46 | // column_t is a list of 0 or more post_t, (byte)-1 terminated 47 | typedef post_t column_t; 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /chocolate-doom/src/w_checksum.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Generate a checksum of the WAD directory. 17 | // 18 | 19 | #ifndef W_CHECKSUM_H 20 | #define W_CHECKSUM_H 21 | 22 | #include "doomtype.h" 23 | 24 | extern void W_Checksum(sha1_digest_t digest); 25 | 26 | #endif /* #ifndef W_CHECKSUM_H */ 27 | 28 | -------------------------------------------------------------------------------- /chocolate-doom/src/w_main.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Common code to parse command line, identifying WAD files to load. 16 | // 17 | 18 | #ifndef W_MAIN_H 19 | #define W_MAIN_H 20 | 21 | #include "d_mode.h" 22 | 23 | boolean W_ParseCommandLine(void); 24 | void W_CheckCorrectIWAD(GameMission_t mission); 25 | 26 | // Autoload all .wad files from the given directory: 27 | void W_AutoLoadWADs(const char *path); 28 | 29 | #endif /* #ifndef W_MAIN_H */ 30 | 31 | -------------------------------------------------------------------------------- /chocolate-doom/src/w_merge.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Handles merging of PWADs, similar to deutex's -merge option 16 | // 17 | // Ideally this should work exactly the same as in deutex, but trying to 18 | // read the deutex source code made my brain hurt. 19 | // 20 | 21 | #ifndef W_MERGE_H 22 | #define W_MERGE_H 23 | 24 | #define W_NWT_MERGE_SPRITES 0x1 25 | #define W_NWT_MERGE_FLATS 0x2 26 | 27 | // Add a new WAD and merge it into the main directory 28 | 29 | void W_MergeFile(const char *filename); 30 | 31 | // NWT-style merging 32 | 33 | void W_NWTMergeFile(const char *filename, int flags); 34 | 35 | // Acts the same as NWT's "-merge" option. 36 | 37 | void W_NWTDashMerge(const char *filename); 38 | 39 | // Debug function that prints the WAD directory. 40 | 41 | void W_PrintDirectory(void); 42 | 43 | #endif /* #ifndef W_MERGE_H */ 44 | 45 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Makefile.in 3 | .deps 4 | *.a 5 | tags 6 | TAGS 7 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(textscreen STATIC 2 | textscreen.h 3 | txt_conditional.c txt_conditional.h 4 | txt_checkbox.c txt_checkbox.h 5 | txt_desktop.c txt_desktop.h 6 | txt_dropdown.c txt_dropdown.h 7 | txt_fileselect.c txt_fileselect.h 8 | txt_gui.c txt_gui.h 9 | txt_inputbox.c txt_inputbox.h 10 | txt_io.c txt_io.h 11 | txt_main.h 12 | txt_button.c txt_button.h 13 | txt_label.c txt_label.h 14 | txt_radiobutton.c txt_radiobutton.h 15 | txt_scrollpane.c txt_scrollpane.h 16 | txt_separator.c txt_separator.h 17 | txt_spinctrl.c txt_spinctrl.h 18 | txt_sdl.c txt_sdl.h 19 | txt_strut.c txt_strut.h 20 | txt_table.c txt_table.h 21 | txt_utf8.c txt_utf8.h 22 | txt_widget.c txt_widget.h 23 | txt_window.c txt_window.h 24 | txt_window_action.c txt_window_action.h) 25 | target_include_directories(textscreen 26 | INTERFACE "." 27 | PRIVATE "../src/") 28 | target_link_libraries(textscreen m SDL2::SDL2) 29 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS = -I$(top_srcdir)/src 3 | 4 | CTAGS_ARGS=-I TXT_UNCAST_ARG+ 5 | 6 | # build this directory before the examples directory. 7 | 8 | SUBDIRS = fonts . examples 9 | 10 | noinst_LIBRARIES=libtextscreen.a 11 | 12 | EXTRA_DIST=CMakeLists.txt Doxyfile 13 | 14 | libtextscreen_a_SOURCES = \ 15 | textscreen.h \ 16 | txt_conditional.c txt_conditional.h \ 17 | txt_checkbox.c txt_checkbox.h \ 18 | txt_desktop.c txt_desktop.h \ 19 | txt_dropdown.c txt_dropdown.h \ 20 | txt_fileselect.c txt_fileselect.h \ 21 | txt_gui.c txt_gui.h \ 22 | txt_inputbox.c txt_inputbox.h \ 23 | txt_io.c txt_io.h \ 24 | txt_main.h \ 25 | txt_button.c txt_button.h \ 26 | txt_label.c txt_label.h \ 27 | txt_radiobutton.c txt_radiobutton.h \ 28 | txt_scrollpane.c txt_scrollpane.h \ 29 | txt_separator.c txt_separator.h \ 30 | txt_spinctrl.c txt_spinctrl.h \ 31 | txt_sdl.c txt_sdl.h \ 32 | txt_strut.c txt_strut.h \ 33 | txt_table.c txt_table.h \ 34 | txt_utf8.c txt_utf8.h \ 35 | txt_widget.c txt_widget.h \ 36 | txt_window.c txt_window.h \ 37 | txt_window_action.c txt_window_action.h 38 | 39 | doc: 40 | doxygen 41 | 42 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/examples/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile.in 2 | Makefile 3 | .deps 4 | guitest 5 | calculator 6 | *.exe 7 | tags 8 | TAGS 9 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/examples/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/textscreen 3 | 4 | noinst_PROGRAMS=guitest calculator 5 | 6 | guitest_LDADD = ../libtextscreen.a @LDFLAGS@ @SDL_LIBS@ 7 | guitest_SOURCES = guitest.c 8 | 9 | calculator_LDADD = ../libtextscreen.a @LDFLAGS@ @SDL_LIBS@ 10 | calculator_SOURCES = calculator.c 11 | 12 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/fonts/Makefile.am: -------------------------------------------------------------------------------- 1 | FONT_HDRS = small.h normal.h large.h codepage.h 2 | EXTRA_DIST = small.png normal.png large.png convert-font $(FONT_HDRS) 3 | 4 | noinst_DATA = $(FONT_HDRS) 5 | 6 | if HAVE_PYTHON 7 | 8 | small.h: small.png convert-font 9 | ./convert-font small small.png small.h 10 | 11 | normal.h: normal.png convert-font 12 | ./convert-font normal normal.png normal.h 13 | 14 | large.h: large.png convert-font 15 | ./convert-font large large.png large.h 16 | 17 | endif 18 | 19 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/fonts/README: -------------------------------------------------------------------------------- 1 | 2 | This directory contains the fonts used by libtextscreen: 3 | 4 | * normal.png is the standard DOS font, from the DOSbox project. 5 | Copyright (C) 2002-2004 The DOSBox Team 6 | 7 | * small.png contains a miniature, half-size font for low-resolution 8 | displays. This is based on the Atari-Small font by Tom Fine. The 9 | original font was standard ASCII only; this has been extended to the 10 | full Extended ASCII range with scaled-down versions of the full-size 11 | DOS font. Original copyright notice: 12 | 13 | Copyright (c) 1999, Thomas A. Fine 14 | 15 | License to copy, modify, and distribute for both commercial and 16 | non-commercial use is herby granted, provided this notice 17 | is preserved. 18 | 19 | Email to my last name at head.cfa.harvard.edu 20 | http://hea-www.harvard.edu/~fine/ 21 | 22 | * large.png is a scaled-up version of normal.png with extra detail 23 | added; this is for use on modern high-resolution ("retina") displays. 24 | 25 | All modifications and enhancements to the above fonts are: 26 | 27 | Copyright (C) 2005-2016 Simon Howard 28 | 29 | This program is free software; you can redistribute it and/or modify 30 | it under the terms of the GNU General Public License as published by 31 | the Free Software Foundation; either version 2 of the License, or 32 | (at your option) any later version. 33 | 34 | This program is distributed in the hope that it will be useful, 35 | but WITHOUT ANY WARRANTY; without even the implied warranty of 36 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 37 | GNU General Public License for more details. 38 | 39 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/fonts/large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/textscreen/fonts/large.png -------------------------------------------------------------------------------- /chocolate-doom/textscreen/fonts/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/textscreen/fonts/normal.png -------------------------------------------------------------------------------- /chocolate-doom/textscreen/fonts/small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vlang/doom/74995f7b83d3969a23266f81a555959b508a4f22/chocolate-doom/textscreen/fonts/small.png -------------------------------------------------------------------------------- /chocolate-doom/textscreen/textscreen.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef TEXTSCREEN_H 16 | #define TEXTSCREEN_H 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #include "../src/doomkeys.h" 23 | #include "txt_main.h" 24 | 25 | #include "txt_button.h" 26 | #include "txt_checkbox.h" 27 | #include "txt_conditional.h" 28 | #include "txt_desktop.h" 29 | #include "txt_dropdown.h" 30 | #include "txt_fileselect.h" 31 | #include "txt_inputbox.h" 32 | #include "txt_label.h" 33 | #include "txt_radiobutton.h" 34 | #include "txt_scrollpane.h" 35 | #include "txt_separator.h" 36 | #include "txt_spinctrl.h" 37 | #include "txt_strut.h" 38 | #include "txt_table.h" 39 | #include "txt_widget.h" 40 | #include "txt_window_action.h" 41 | #include "txt_window.h" 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif /* #ifndef TEXTSCREEN_H */ 48 | 49 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/txt_gui.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Text mode emulation in SDL 16 | // 17 | 18 | #ifndef TXT_GUI_H 19 | #define TXT_GUI_H 20 | 21 | #define TXT_INACTIVE_WINDOW_BACKGROUND TXT_COLOR_BLACK 22 | #define TXT_ACTIVE_WINDOW_BACKGROUND TXT_COLOR_BLUE 23 | #define TXT_HOVER_BACKGROUND TXT_COLOR_CYAN 24 | 25 | void TXT_DrawDesktopBackground(const char *title); 26 | void TXT_DrawWindowFrame(const char *title, int x, int y, int w, int h); 27 | void TXT_DrawSeparator(int x, int y, int w); 28 | void TXT_DrawCodePageString(const char *s); 29 | void TXT_DrawString(const char *s); 30 | int TXT_CanDrawCharacter(unsigned int c); 31 | 32 | void TXT_DrawHorizScrollbar(int x, int y, int w, int cursor, int range); 33 | void TXT_DrawVertScrollbar(int x, int y, int h, int cursor, int range); 34 | 35 | void TXT_InitClipArea(void); 36 | void TXT_PushClipArea(int x1, int x2, int y1, int y2); 37 | void TXT_PopClipArea(void); 38 | 39 | #endif /* #ifndef TXT_GUI_H */ 40 | 41 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/txt_io.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Text mode emulation in SDL 16 | // 17 | 18 | #ifndef TXT_IO_H 19 | #define TXT_IO_H 20 | 21 | #include "txt_main.h" 22 | 23 | typedef struct 24 | { 25 | int bgcolor; 26 | int fgcolor; 27 | } txt_saved_colors_t; 28 | 29 | void TXT_PutSymbol(int c); 30 | void TXT_PutChar(int c); 31 | void TXT_Puts(const char *s); 32 | void TXT_GotoXY(int x, int y); 33 | void TXT_GetXY(int *x, int *y); 34 | void TXT_FGColor(txt_color_t color); 35 | void TXT_BGColor(int color, int blinking); 36 | void TXT_SaveColors(txt_saved_colors_t *save); 37 | void TXT_RestoreColors(txt_saved_colors_t *save); 38 | void TXT_ClearScreen(void); 39 | 40 | #endif /* #ifndef TXT_IO_H */ 41 | 42 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/txt_scrollpane.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef TXT_SCROLLPANE_H 16 | #define TXT_SCROLLPANE_H 17 | 18 | /** 19 | * @file txt_scrollpane.h 20 | * 21 | * Scrollable pane widget. 22 | */ 23 | 24 | /** 25 | * Scrollable pane widget. 26 | * 27 | * A scrollable pane widget is a widget that contains another widget 28 | * that is larger than it. Scroll bars appear on the side to allow 29 | * different areas of the contained widget to be seen. 30 | */ 31 | 32 | typedef struct txt_scrollpane_s txt_scrollpane_t; 33 | 34 | #include "txt_widget.h" 35 | 36 | struct txt_scrollpane_s 37 | { 38 | txt_widget_t widget; 39 | int w, h; 40 | int x, y; 41 | int expand_w, expand_h; 42 | txt_widget_t *child; 43 | }; 44 | 45 | /** 46 | * Create a new scroll pane widget. 47 | * 48 | * @param w Width of the scroll pane, in characters. 49 | * @param h Height of the scroll pane, in lines. 50 | * @param target The target widget that the scroll pane will 51 | * contain. 52 | * @return Pointer to the new scroll pane widget. 53 | */ 54 | 55 | txt_scrollpane_t *TXT_NewScrollPane(int w, int h, TXT_UNCAST_ARG(target)); 56 | 57 | #endif /* #ifndef TXT_SCROLLPANE_H */ 58 | 59 | 60 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/txt_sdl.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Text mode emulation in SDL 16 | // 17 | 18 | #ifndef TXT_SDL_H 19 | #define TXT_SDL_H 20 | 21 | // The textscreen API itself doesn't need SDL; however, SDL needs its 22 | // headers included where main() is defined. 23 | 24 | #include "SDL.h" 25 | 26 | // Event callback function type: a function of this type can be used 27 | // to intercept events in the textscreen event processing loop. 28 | // Returning 1 will cause the event to be eaten; the textscreen code 29 | // will not see it. 30 | 31 | typedef int (*TxtSDLEventCallbackFunc)(SDL_Event *event, void *user_data); 32 | 33 | // Set a callback function to call in the SDL event loop. Useful for 34 | // intercepting events. Pass callback=NULL to clear an existing 35 | // callback function. 36 | // user_data is a void pointer to be passed to the callback function. 37 | 38 | void TXT_SDL_SetEventCallback(TxtSDLEventCallbackFunc callback, void *user_data); 39 | 40 | #endif /* #ifndef TXT_SDL_H */ 41 | 42 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/txt_separator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef TXT_SEPARATOR_H 16 | #define TXT_SEPARATOR_H 17 | 18 | /** 19 | * @file txt_separator.h 20 | * 21 | * Horizontal separator widget. 22 | */ 23 | 24 | /** 25 | * Horizontal separator. 26 | * 27 | * A horizontal separator appears as a horizontal line divider across 28 | * the length of the window in which it is added. An optional label 29 | * allows the separator to be used as a section divider for grouping 30 | * related controls. 31 | */ 32 | 33 | typedef struct txt_separator_s txt_separator_t; 34 | 35 | #include "txt_widget.h" 36 | 37 | struct txt_separator_s 38 | { 39 | txt_widget_t widget; 40 | char *label; 41 | }; 42 | 43 | extern txt_widget_class_t txt_separator_class; 44 | 45 | /** 46 | * Create a new horizontal separator widget. 47 | * 48 | * @param label Label to display on the separator (UTF-8 format). 49 | * If this is set to NULL, no label is displayed. 50 | * @return The new separator widget. 51 | */ 52 | 53 | txt_separator_t *TXT_NewSeparator(const char *label); 54 | 55 | /** 56 | * Change the label on a separator. 57 | * 58 | * @param separator The separator. 59 | * @param label The new label (UTF-8 format). 60 | */ 61 | 62 | void TXT_SetSeparatorLabel(txt_separator_t *separator, const char *label); 63 | 64 | #endif /* #ifndef TXT_SEPARATOR_H */ 65 | 66 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/txt_strut.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #include 16 | #include 17 | 18 | #include "doomkeys.h" 19 | 20 | #include "txt_strut.h" 21 | #include "txt_io.h" 22 | #include "txt_main.h" 23 | #include "txt_window.h" 24 | 25 | static void TXT_StrutSizeCalc(TXT_UNCAST_ARG(strut)) 26 | { 27 | TXT_CAST_ARG(txt_strut_t, strut); 28 | 29 | // Minimum width is the string length + two spaces for padding 30 | 31 | strut->widget.w = strut->width; 32 | strut->widget.h = strut->height; 33 | } 34 | 35 | static void TXT_StrutDrawer(TXT_UNCAST_ARG(strut)) 36 | { 37 | // Nothing is drawn for a strut. 38 | } 39 | 40 | static void TXT_StrutDestructor(TXT_UNCAST_ARG(strut)) 41 | { 42 | } 43 | 44 | static int TXT_StrutKeyPress(TXT_UNCAST_ARG(strut), int key) 45 | { 46 | return 0; 47 | } 48 | 49 | txt_widget_class_t txt_strut_class = 50 | { 51 | TXT_NeverSelectable, 52 | TXT_StrutSizeCalc, 53 | TXT_StrutDrawer, 54 | TXT_StrutKeyPress, 55 | TXT_StrutDestructor, 56 | NULL, 57 | NULL, 58 | }; 59 | 60 | txt_strut_t *TXT_NewStrut(int width, int height) 61 | { 62 | txt_strut_t *strut; 63 | 64 | strut = malloc(sizeof(txt_strut_t)); 65 | 66 | TXT_InitWidget(strut, &txt_strut_class); 67 | strut->width = width; 68 | strut->height = height; 69 | 70 | return strut; 71 | } 72 | 73 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/txt_strut.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef TXT_STRUT_H 16 | #define TXT_STRUT_H 17 | 18 | /** 19 | * @file txt_strut.h 20 | * 21 | * Strut widget. 22 | */ 23 | 24 | /** 25 | * Strut widget. 26 | * 27 | * A strut is a widget that takes up a fixed amount of space. It can 28 | * be visualised as a transparent box. Struts are used to provide 29 | * spacing between widgets. 30 | */ 31 | 32 | typedef struct txt_strut_s txt_strut_t; 33 | 34 | #include "txt_widget.h" 35 | 36 | struct txt_strut_s 37 | { 38 | txt_widget_t widget; 39 | int width; 40 | int height; 41 | }; 42 | 43 | /** 44 | * Create a new strut. 45 | * 46 | * @param width Width of the strut, in characters. 47 | * @param height Height of the strut, in characters. 48 | */ 49 | 50 | txt_strut_t *TXT_NewStrut(int width, int height); 51 | 52 | #endif /* #ifndef TXT_STRUT_H */ 53 | 54 | 55 | -------------------------------------------------------------------------------- /chocolate-doom/textscreen/txt_utf8.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | 15 | #ifndef TXT_UTF8_H 16 | #define TXT_UTF8_H 17 | 18 | #include 19 | 20 | char *TXT_EncodeUTF8(char *p, unsigned int c); 21 | unsigned int TXT_DecodeUTF8(const char **ptr); 22 | unsigned int TXT_UTF8_Strlen(const char *s); 23 | char *TXT_UTF8_SkipChars(const char *s, unsigned int n); 24 | 25 | #endif /* #ifndef TXT_UTF8_H */ 26 | 27 | -------------------------------------------------------------------------------- /chocolate-doom/win32/win_opendir.h: -------------------------------------------------------------------------------- 1 | // 2 | // 03/10/2006 James Haley 3 | // 4 | // For this module only: 5 | // This code is public domain. No change sufficient enough to constitute a 6 | // significant or original work has been made, and thus it remains as such. 7 | // 8 | // 9 | // DESCRIPTION: 10 | // 11 | // Implementation of POSIX opendir for Visual C++. 12 | // Derived from the MinGW C Library Extensions Source (released to the 13 | // public domain). 14 | // 15 | 16 | #ifndef I_OPNDIR_H__ 17 | #define I_OPNDIR_H__ 18 | 19 | #include 20 | 21 | #ifndef FILENAME_MAX 22 | #define FILENAME_MAX 260 23 | #endif 24 | 25 | struct dirent 26 | { 27 | long d_ino; /* Always zero. */ 28 | unsigned short d_reclen; /* Always zero. */ 29 | unsigned short d_namlen; /* Length of name in d_name. */ 30 | char d_name[FILENAME_MAX]; /* File name. */ 31 | }; 32 | 33 | /* 34 | * This is an internal data structure. Good programmers will not use it 35 | * except as an argument to one of the functions below. 36 | * dd_stat field is now int (was short in older versions). 37 | */ 38 | typedef struct 39 | { 40 | /* disk transfer area for this dir */ 41 | struct _finddata_t dd_dta; 42 | 43 | /* dirent struct to return from dir (NOTE: this makes this thread 44 | * safe as long as only one thread uses a particular DIR struct at 45 | * a time) */ 46 | struct dirent dd_dir; 47 | 48 | /* _findnext handle */ 49 | intptr_t dd_handle; 50 | 51 | /* 52 | * Status of search: 53 | * 0 = not started yet (next entry to read is first entry) 54 | * -1 = off the end 55 | * positive = 0 based index of next entry 56 | */ 57 | int dd_stat; 58 | 59 | /* given path for dir with search pattern (struct is extended) */ 60 | char dd_name[1]; 61 | } DIR; 62 | 63 | DIR *opendir(const char *); 64 | struct dirent *readdir(DIR *); 65 | int closedir(DIR *); 66 | void rewinddir(DIR *); 67 | long telldir(DIR *); 68 | void seekdir(DIR *, long); 69 | 70 | #endif 71 | 72 | // EOF 73 | 74 | -------------------------------------------------------------------------------- /dstrings.v: -------------------------------------------------------------------------------- 1 | @[translated] 2 | module main 3 | 4 | // 5 | // Copyright(C) 1993-1996 Id Software, Inc. 6 | // Copyright(C) 2005-2014 Simon Howard 7 | // 8 | // This program is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU General Public License 10 | // as published by the Free Software Foundation; either version 2 11 | // of the License, or (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // 19 | // DESCRIPTION: 20 | // DOOM strings, by language. 21 | // 22 | // All important printed strings. 23 | // Misc. other strings. 24 | // QuitDOOM messages 25 | // 8 per each game type 26 | // skipped extern global doom1_endmsg 27 | // skipped extern global doom2_endmsg 28 | // 29 | // Copyright(C) 1993-1996 Id Software, Inc. 30 | // Copyright(C) 2005-2014 Simon Howard 31 | // 32 | // This program is free software; you can redistribute it and/or 33 | // modify it under the terms of the GNU General Public License 34 | // as published by the Free Software Foundation; either version 2 35 | // of the License, or (at your option) any later version. 36 | // 37 | // This program is distributed in the hope that it will be useful, 38 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 39 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 40 | // GNU General Public License for more details. 41 | // 42 | // DESCRIPTION: 43 | // Globally defined strings. 44 | // 45 | // UNUSED messages included in the source release 46 | // DOOM1 47 | // FinalDOOM? 48 | // Internal debug. Different style, too. 49 | -------------------------------------------------------------------------------- /m_random.v: -------------------------------------------------------------------------------- 1 | @[translated] 2 | module main 3 | 4 | // 5 | // Copyright(C) 1993-1996 Id Software, Inc. 6 | // Copyright(C) 2005-2014 Simon Howard 7 | // 8 | // This program is free software; you can redistribute it and/or 9 | // modify it under the terms of the GNU General Public License 10 | // as published by the Free Software Foundation; either version 2 11 | // of the License, or (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // DESCRIPTION: 19 | // Random number LUT. 20 | // 21 | // 22 | // M_Random 23 | // Returns a 0-255 number 24 | // 25 | // Which one is deterministic? 26 | @[c: 'P_Random'] 27 | fn p_random() int { 28 | prndindex = (prndindex + 1) & 255 29 | return rndtable[prndindex] 30 | } 31 | 32 | @[c: 'M_Random'] 33 | fn m_random() int { 34 | rndindex = (rndindex + 1) & 255 35 | return rndtable[rndindex] 36 | } 37 | 38 | @[c: 'M_ClearRandom'] 39 | fn m_clear_random() { 40 | rndindex = 0 41 | prndindex = rndindex 42 | } 43 | 44 | // inspired by the same routine in Eternity, thanks haleyjd 45 | @[c: 'P_SubRandom'] 46 | fn p_sub_random() int { 47 | r := p_random() 48 | return r - p_random() 49 | } 50 | -------------------------------------------------------------------------------- /vdoom_patch_linux.v: -------------------------------------------------------------------------------- 1 | module main 2 | const _is_space = 8192 3 | type U16 = u16 4 | fn C.__ctype_b_loc() &&U16 5 | fn __ctype_b_loc() &&U16 { return C.__ctype_b_loc() } 6 | --------------------------------------------------------------------------------