├── Packaging ├── debian │ ├── compat │ ├── devilution.docs │ ├── source │ │ ├── format │ │ └── lintian-overrides │ ├── devilutionx.links │ ├── watch │ ├── changelog │ ├── devilutionx.install │ ├── control │ ├── diablo-data.postinst │ ├── rules │ └── copyright ├── OpenDingux │ ├── .gitignore │ ├── build-rs90.sh │ ├── build-rg350.sh │ ├── diablo.ini │ ├── build-retrofw.sh │ ├── README.md │ ├── .editorconfig │ ├── devilutionx-retrofw.man.txt │ ├── buildroot_retrofw_defconfig │ ├── control │ ├── readme.gcw0.txt │ ├── buildroot_rs90_defconfig │ ├── buildroot_rg350_defconfig │ └── package-opk.sh ├── resources │ ├── 16.png │ ├── CharisSILB.ttf │ ├── Diablo_32.png │ └── Diablo_48.png ├── macOS │ └── AppIcon.icns └── fedora │ └── devilutionx.desktop ├── SourceS ├── devilution.h ├── config.h.in ├── miniwin │ ├── rand.h │ ├── ui.h │ ├── popdecl.inc │ ├── com_macro.h │ ├── thread.h │ ├── pushdecl.inc │ └── com.h ├── storm_full.h ├── macos_stdarg.h ├── .clang-format ├── miniwin.h └── sdl2_backports.h ├── vita ├── danzeffSDL │ ├── font.c │ └── danzeff │ │ ├── keys.png │ │ ├── nums.png │ │ ├── keys_c.png │ │ ├── keys_s.png │ │ ├── keys_t.png │ │ ├── nums_c.png │ │ ├── nums_s.png │ │ ├── nums_t.png │ │ ├── keys_c_t.png │ │ ├── keys_s_c.png │ │ ├── nums_c_t.png │ │ └── nums_s_c.png ├── sce_sys │ ├── icon0.png │ ├── pic0.png │ ├── manual │ │ ├── 001.png │ │ ├── 002.png │ │ ├── 003.png │ │ ├── 004.png │ │ ├── 005.png │ │ ├── 006.png │ │ ├── base.xcf │ │ ├── base-page.xcf │ │ ├── controls_p1.xcf │ │ ├── controls_p2.xcf │ │ ├── credits-page.xcf │ │ ├── debuts-page.xcf │ │ └── installation-page.xcf │ └── livearea │ │ └── contents │ │ ├── bg.png │ │ ├── logo0.png │ │ ├── startup.png │ │ └── template.xml ├── vitasdk_heap.cpp ├── touch.h ├── plrctrls.h └── common │ └── debugScreen_custom.h ├── .vscode ├── settings.json ├── cmake_configurations.json └── c_cpp_properties.json ├── Brewfile ├── 3rdParty ├── asio │ ├── README │ ├── include │ │ └── asio │ │ │ ├── unyield.hpp │ │ │ ├── yield.hpp │ │ │ ├── ts │ │ │ ├── io_context.hpp │ │ │ ├── buffer.hpp │ │ │ ├── net.hpp │ │ │ ├── timer.hpp │ │ │ ├── socket.hpp │ │ │ ├── executor.hpp │ │ │ └── internet.hpp │ │ │ ├── io_service_strand.hpp │ │ │ ├── experimental.hpp │ │ │ ├── buffered_stream_fwd.hpp │ │ │ ├── version.hpp │ │ │ ├── buffered_read_stream_fwd.hpp │ │ │ ├── buffered_write_stream_fwd.hpp │ │ │ ├── impl │ │ │ ├── src.cpp │ │ │ ├── system_context.hpp │ │ │ └── executor.ipp │ │ │ ├── detail │ │ │ ├── limits.hpp │ │ │ ├── cstddef.hpp │ │ │ ├── date_time_fwd.hpp │ │ │ ├── regex_fwd.hpp │ │ │ ├── dependent_type.hpp │ │ │ ├── win_iocp_thread_info.hpp │ │ │ ├── assert.hpp │ │ │ ├── operation.hpp │ │ │ ├── reactor.hpp │ │ │ ├── array_fwd.hpp │ │ │ ├── array.hpp │ │ │ ├── functional.hpp │ │ │ ├── noncopyable.hpp │ │ │ ├── wait_op.hpp │ │ │ ├── fd_set_adapter.hpp │ │ │ ├── scheduler_thread_info.hpp │ │ │ ├── null_fenced_block.hpp │ │ │ ├── resolve_op.hpp │ │ │ ├── signal_init.hpp │ │ │ ├── timer_scheduler.hpp │ │ │ ├── reactor_fwd.hpp │ │ │ ├── thread_context.hpp │ │ │ ├── signal_op.hpp │ │ │ ├── future.hpp │ │ │ ├── impl │ │ │ │ ├── posix_mutex.ipp │ │ │ │ └── posix_tss_ptr.ipp │ │ │ ├── timer_scheduler_fwd.hpp │ │ │ ├── mutex.hpp │ │ │ ├── event.hpp │ │ │ ├── null_static_mutex.hpp │ │ │ ├── null_mutex.hpp │ │ │ ├── signal_blocker.hpp │ │ │ ├── throw_error.hpp │ │ │ ├── global.hpp │ │ │ ├── handler_cont_helpers.hpp │ │ │ ├── null_global.hpp │ │ │ ├── null_tss_ptr.hpp │ │ │ ├── atomic_count.hpp │ │ │ └── select_interrupter.hpp │ │ │ ├── ssl.hpp │ │ │ ├── ssl │ │ │ ├── impl │ │ │ │ └── src.hpp │ │ │ ├── detail │ │ │ │ ├── openssl_types.hpp │ │ │ │ └── shutdown_op.hpp │ │ │ └── stream_base.hpp │ │ │ ├── streambuf.hpp │ │ │ ├── io_service.hpp │ │ │ ├── basic_streambuf_fwd.hpp │ │ │ ├── ip │ │ │ ├── host_name.hpp │ │ │ ├── resolver_query_base.hpp │ │ │ ├── impl │ │ │ │ ├── basic_endpoint.hpp │ │ │ │ └── host_name.ipp │ │ │ └── bad_address_cast.hpp │ │ │ ├── deadline_timer.hpp │ │ │ ├── steady_timer.hpp │ │ │ ├── system_timer.hpp │ │ │ ├── is_executor.hpp │ │ │ └── high_resolution_timer.hpp │ └── LICENSE_1_0.txt ├── Radon │ ├── Radon │ │ ├── include │ │ │ ├── Radon.hpp │ │ │ ├── Named.hpp │ │ │ ├── Section.hpp │ │ │ ├── File.hpp │ │ │ └── Key.hpp │ │ └── source │ │ │ ├── Named.cpp │ │ │ ├── Section.cpp │ │ │ └── Key.cpp │ └── LICENSE ├── StormLib │ ├── README │ └── LICENSE └── PKWare │ └── PKWare.vcxproj.filters ├── Source ├── restrict.h ├── spelldat.h ├── misdat.h ├── textdat.h ├── track.h ├── objdat.h ├── tmsg.h ├── .clang-format ├── monstdat.h ├── dead.h ├── itemdat.h ├── render.h ├── town.h ├── movie.h ├── codec.h ├── error.h ├── pack.h ├── dthread.h ├── spells.h ├── capture.h ├── restrict.cpp ├── interfac.h ├── help.h ├── sha.h ├── doom.h ├── wave.h ├── plrmsg.h ├── encrypt.h ├── setmaps.h ├── dx.h ├── sync.h ├── minitext.h ├── debug.h ├── portal.h ├── cursor.h ├── wave.cpp ├── scrollrt.h ├── automap.h ├── nthread.h ├── drlg_l1.h ├── effects.h ├── init.h ├── palette.h ├── loadsave.h ├── track.cpp ├── appfat.h ├── towners.h ├── sound.h ├── drlg_l4.h ├── gamemenu.h ├── mainmenu.h ├── trigs.h ├── tmsg.cpp ├── path.h └── gmenu.h ├── SourceX ├── DiabloUI │ ├── selconn.h │ ├── errorart.h │ ├── credits_lines.h │ ├── text.h │ ├── selyesno.h │ ├── art_draw.h │ ├── selgame.h │ ├── dialogs.h │ ├── scrollbar.cpp │ ├── selhero.h │ ├── text_draw.h │ ├── ttf_render_wrapped.h │ ├── art.h │ ├── fonts.h │ ├── button.h │ ├── button.cpp │ └── text.cpp ├── .clang-format ├── miniwin │ ├── rand.cpp │ ├── ddraw.cpp │ ├── dsound.h │ ├── ddraw.h │ └── misc_dx.cpp ├── dvlnet │ ├── frame_queue.h │ ├── abstract_net.cpp │ ├── tcp_client.h │ ├── loopback.h │ └── udp_p2p.h └── storm │ └── storm_dx.cpp ├── CMake ├── out_of_tree.cmake ├── git.cmake ├── mingwcc.cmake └── 32bit.cmake ├── .clang-format ├── docs └── TODO.md ├── resource.h ├── .travis.yml ├── .editorconfig ├── appveyor.yml ├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── types.h └── LICENSE /Packaging/debian/compat: -------------------------------------------------------------------------------- 1 | 11 2 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/.gitignore: -------------------------------------------------------------------------------- 1 | /tmp/ 2 | -------------------------------------------------------------------------------- /Packaging/debian/devilution.docs: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /Packaging/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/build-rs90.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ./build.sh rs90 3 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/build-rg350.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ./build.sh rg350 3 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/diablo.ini: -------------------------------------------------------------------------------- 1 | [devilutionx] 2 | upscale=0 3 | fullscreen=0 4 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/build-retrofw.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ./build.sh retrofw 3 | -------------------------------------------------------------------------------- /SourceS/devilution.h: -------------------------------------------------------------------------------- 1 | #include "diablo.h" 2 | #include "../3rdParty/Storm/Source/storm.h" 3 | -------------------------------------------------------------------------------- /vita/danzeffSDL/font.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/font.c -------------------------------------------------------------------------------- /vita/sce_sys/icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/icon0.png -------------------------------------------------------------------------------- /vita/sce_sys/pic0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/pic0.png -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnPaste": true, 3 | "editor.formatOnSave": true 4 | } 5 | -------------------------------------------------------------------------------- /Packaging/debian/devilutionx.links: -------------------------------------------------------------------------------- 1 | /usr/share/games/diablo/devilutionx /usr/games/devilutionx 2 | 3 | 4 | -------------------------------------------------------------------------------- /Packaging/resources/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/Packaging/resources/16.png -------------------------------------------------------------------------------- /vita/sce_sys/manual/001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/001.png -------------------------------------------------------------------------------- /vita/sce_sys/manual/002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/002.png -------------------------------------------------------------------------------- /vita/sce_sys/manual/003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/003.png -------------------------------------------------------------------------------- /vita/sce_sys/manual/004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/004.png -------------------------------------------------------------------------------- /vita/sce_sys/manual/005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/005.png -------------------------------------------------------------------------------- /vita/sce_sys/manual/006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/006.png -------------------------------------------------------------------------------- /Brewfile: -------------------------------------------------------------------------------- 1 | brew "cmake" 2 | brew "sdl2_mixer" 3 | brew "sdl2_ttf" 4 | brew "libsodium" 5 | brew "pkg-config" 6 | -------------------------------------------------------------------------------- /Packaging/macOS/AppIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/Packaging/macOS/AppIcon.icns -------------------------------------------------------------------------------- /vita/sce_sys/manual/base.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/base.xcf -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/keys.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/nums.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/nums.png -------------------------------------------------------------------------------- /Packaging/resources/CharisSILB.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/Packaging/resources/CharisSILB.ttf -------------------------------------------------------------------------------- /Packaging/resources/Diablo_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/Packaging/resources/Diablo_32.png -------------------------------------------------------------------------------- /Packaging/resources/Diablo_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/Packaging/resources/Diablo_48.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/keys_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/keys_c.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/keys_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/keys_s.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/keys_t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/keys_t.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/nums_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/nums_c.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/nums_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/nums_s.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/nums_t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/nums_t.png -------------------------------------------------------------------------------- /vita/sce_sys/manual/base-page.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/base-page.xcf -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/keys_c_t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/keys_c_t.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/keys_s_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/keys_s_c.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/nums_c_t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/nums_c_t.png -------------------------------------------------------------------------------- /vita/danzeffSDL/danzeff/nums_s_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/danzeffSDL/danzeff/nums_s_c.png -------------------------------------------------------------------------------- /vita/sce_sys/livearea/contents/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/livearea/contents/bg.png -------------------------------------------------------------------------------- /vita/sce_sys/manual/controls_p1.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/controls_p1.xcf -------------------------------------------------------------------------------- /vita/sce_sys/manual/controls_p2.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/controls_p2.xcf -------------------------------------------------------------------------------- /vita/sce_sys/manual/credits-page.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/credits-page.xcf -------------------------------------------------------------------------------- /vita/sce_sys/manual/debuts-page.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/debuts-page.xcf -------------------------------------------------------------------------------- /Packaging/OpenDingux/README.md: -------------------------------------------------------------------------------- 1 | # DevilutionX OpenDingux Port 2 | 3 | See README.md in the root directory for build instructions. 4 | -------------------------------------------------------------------------------- /Packaging/debian/source/lintian-overrides: -------------------------------------------------------------------------------- 1 | # no automatic test is possible 2 | devilutionx source: testsuite-autopkgtest-missing 3 | -------------------------------------------------------------------------------- /vita/sce_sys/livearea/contents/logo0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/livearea/contents/logo0.png -------------------------------------------------------------------------------- /vita/sce_sys/livearea/contents/startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/livearea/contents/startup.png -------------------------------------------------------------------------------- /vita/sce_sys/manual/installation-page.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gokuhs/devilutionX/HEAD/vita/sce_sys/manual/installation-page.xcf -------------------------------------------------------------------------------- /3rdParty/asio/README: -------------------------------------------------------------------------------- 1 | asio version 1.12.2 2 | Released Sunday, 09 December 2018. 3 | 4 | See doc/index.html for API documentation and a tutorial. 5 | -------------------------------------------------------------------------------- /SourceS/config.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define PROJECT_NAME "@PROJECT_NAME@" 4 | #define PROJECT_VERSION "@PROJECT_VERSION@@GIT_COMMIT_HASH@" 5 | -------------------------------------------------------------------------------- /SourceS/miniwin/rand.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace dvl { 4 | 5 | int rand(void); 6 | void srand(uint32_t seed); 7 | 8 | } // namespace dvl 9 | -------------------------------------------------------------------------------- /vita/vitasdk_heap.cpp: -------------------------------------------------------------------------------- 1 | // max heap size is approx. 330 MB with -d ATTRIBUTE2=12, otherwise max is 192 2 | int _newlib_heap_size_user = 100 * 1024 * 1024; 3 | -------------------------------------------------------------------------------- /Source/restrict.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __RESTRICT_H__ 3 | #define __RESTRICT_H__ 4 | 5 | void ReadOnlyTest(); 6 | 7 | #endif /* __RESTRICT_H__ */ 8 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/selconn.h: -------------------------------------------------------------------------------- 1 | namespace dvl { 2 | 3 | void selconn_Esc(); 4 | void selconn_Focus(int value); 5 | void selconn_Select(int value); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = tab 3 | end_of_line = lf 4 | charset = utf-8 5 | trim_trailing_whitespace = true 6 | insert_final_newline = true 7 | -------------------------------------------------------------------------------- /Source/spelldat.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __SPELLDAT_H__ 3 | #define __SPELLDAT_H__ 4 | 5 | extern SpellData spelldata[MAX_SPELLS]; 6 | 7 | #endif /* __SPELLDAT_H__ */ 8 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/errorart.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace dvl { 4 | 5 | extern const unsigned char btnData[]; 6 | extern const unsigned char popupData[]; 7 | 8 | } // namespace dvl 9 | -------------------------------------------------------------------------------- /CMake/out_of_tree.cmake: -------------------------------------------------------------------------------- 1 | if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) 2 | message(WARNING [[In-source build detected, please eg. create a new directory and use `cmake ..`]]) 3 | endif() 4 | -------------------------------------------------------------------------------- /Source/misdat.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __MISDAT_H__ 3 | #define __MISDAT_H__ 4 | 5 | extern MissileData missiledata[68]; 6 | extern MisFileData misfiledata[47]; 7 | 8 | #endif /* __MISDAT_H__ */ 9 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/credits_lines.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace dvl { 4 | 5 | extern const char *const CREDITS_LINES[]; 6 | extern const std::size_t CREDITS_LINES_SIZE; 7 | 8 | } // namespace dvl 9 | -------------------------------------------------------------------------------- /Source/textdat.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __TEXTDAT_H__ 3 | #define __TEXTDAT_H__ 4 | 5 | extern const TextDataStruct alltext[259]; 6 | extern const DWORD gdwAllTextEntries; 7 | 8 | #endif /* __TEXTDAT_H__ */ 9 | -------------------------------------------------------------------------------- /Source/track.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __TRACK_H__ 3 | #define __TRACK_H__ 4 | 5 | void track_process(); 6 | void track_repeat_walk(BOOL rep); 7 | BOOL track_isscrolling(); 8 | 9 | #endif /* __TRACK_H__ */ 10 | -------------------------------------------------------------------------------- /SourceS/miniwin/ui.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace dvl { 4 | 5 | BOOL EndDialog(HWND hDlg, INT_PTR nResult); 6 | void UiErrorOkDialog(const char *text, const char *caption, bool error = true); 7 | 8 | } // namespace dvl 9 | -------------------------------------------------------------------------------- /SourceS/storm_full.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace dvl { 4 | extern "C" { 5 | 6 | extern DWORD nLastError; 7 | 8 | void TranslateFileName(char *dst, int dstLen, const char *src); 9 | } 10 | } // namespace dvl 11 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/devilutionx-retrofw.man.txt: -------------------------------------------------------------------------------- 1 | Copy diabdat.mpq from your CD, or GoG install folder to: 2 | /home/retrofw/games/devilutionx/diabdat.mpq 3 | 4 | Game saves and diablo.ini are located at: 5 | /home/retrofw/.local/share/diasurgical/devilution 6 | -------------------------------------------------------------------------------- /Packaging/debian/watch: -------------------------------------------------------------------------------- 1 | version=4 2 | opts="uversionmangle=s/(\d)[\-_]?(rc\d+|pre-rc\d+|pre\d+a?)$/$1~$2/;s/[\-\.](source|Source|src|orig|unix)$//;s/-(bin|osx)$/~$1/;s/^v(\d)/$1/;" \ 3 | https://github.com/diasurgical/devilutionX/releases .*/([\d.]+).tar.gz 4 | -------------------------------------------------------------------------------- /Source/objdat.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __OBJDAT_H__ 3 | #define __OBJDAT_H__ 4 | 5 | extern int ObjTypeConv[113]; 6 | extern ObjDataStruct AllObjects[99]; 7 | extern char *ObjMasterLoadList[56]; 8 | 9 | #endif /* __OBJDAT_H__ */ 10 | -------------------------------------------------------------------------------- /3rdParty/Radon/Radon/include/Radon.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Dmitro bjornus Szewczuk 2017 under zlib license 2 | 3 | #pragma once 4 | 5 | #include "File.hpp" 6 | #include "Key.hpp" 7 | #include "Named.hpp" 8 | #include "Radon.hpp" 9 | #include "Section.hpp" 10 | -------------------------------------------------------------------------------- /SourceS/miniwin/popdecl.inc: -------------------------------------------------------------------------------- 1 | #pragma pop_macro("__cdecl") 2 | #pragma pop_macro("__fastcall") 3 | #pragma pop_macro("__stdcall") 4 | #pragma pop_macro("CALLBACK") 5 | #pragma pop_macro("APIENTRY") 6 | #pragma pop_macro("WINAPI") 7 | #pragma pop_macro("WINAPIV") 8 | -------------------------------------------------------------------------------- /Source/tmsg.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __TMSG_H__ 3 | #define __TMSG_H__ 4 | 5 | int tmsg_get(BYTE *pbMsg, DWORD dwMaxLen); 6 | void tmsg_add(BYTE *pbMsg, BYTE bLen); 7 | void tmsg_start(); 8 | void *tmsg_cleanup(); 9 | 10 | #endif /* __TMSG_H__ */ 11 | -------------------------------------------------------------------------------- /SourceS/macos_stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDARG_H 2 | #define __STDARG_H 3 | 4 | typedef __builtin_va_list va_list; 5 | #define _VA_LIST_T 6 | #define va_start(ap, param) __builtin_va_start(ap, param) 7 | #define va_end(ap) __builtin_va_end(ap) 8 | 9 | #endif /* __STDARG_H */ 10 | -------------------------------------------------------------------------------- /Source/.clang-format: -------------------------------------------------------------------------------- 1 | { 2 | BasedOnStyle: webkit, 3 | AlignTrailingComments: true, 4 | AllowShortBlocksOnASingleLine: true, 5 | AllowShortFunctionsOnASingleLine: None, 6 | PointerAlignment: Right, 7 | TabWidth: 4, 8 | UseTab: ForIndentation, 9 | SortIncludes: false, 10 | } 11 | -------------------------------------------------------------------------------- /SourceS/.clang-format: -------------------------------------------------------------------------------- 1 | { 2 | BasedOnStyle: webkit, 3 | AlignTrailingComments: true, 4 | AllowShortBlocksOnASingleLine: true, 5 | AllowShortFunctionsOnASingleLine: None, 6 | PointerAlignment: Right, 7 | TabWidth: 4, 8 | UseTab: ForIndentation, 9 | SortIncludes: false, 10 | } 11 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/buildroot_retrofw_defconfig: -------------------------------------------------------------------------------- 1 | BR2_mipsel=y 2 | # BR2_MIPS_SOFT_FLOAT is not set 3 | BR2_TOOLCHAIN_BUILDROOT_WCHAR=y 4 | BR2_TOOLCHAIN_BUILDROOT_CXX=y 5 | BR2_PACKAGE_SDL=y 6 | BR2_PACKAGE_SDL_MIXER=y 7 | BR2_PACKAGE_SDL_TTF=y 8 | BR2_PACKAGE_LIBZIP=y 9 | BR2_PACKAGE_LIBSODIUM=y 10 | -------------------------------------------------------------------------------- /Source/monstdat.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __MONSTDAT_H__ 3 | #define __MONSTDAT_H__ 4 | 5 | extern MonsterData monsterdata[112]; 6 | extern char MonstConvTbl[128]; 7 | extern BYTE MonstAvailTbl[112]; 8 | extern UniqMonstStruct UniqMonst[98]; 9 | 10 | #endif /* __MONSTDAT_H__ */ 11 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/text.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "DiabloUI/fonts.h" 6 | 7 | namespace dvl { 8 | 9 | std::size_t GetArtStrWidth(const char *str, std::size_t size); 10 | void WordWrapArtStr(char *text, std::size_t width); 11 | 12 | } // namespace dvl 13 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | { 2 | BasedOnStyle: webkit, 3 | AlignTrailingComments: true, 4 | AllowShortBlocksOnASingleLine: true, 5 | AllowShortFunctionsOnASingleLine: None, 6 | PointerAlignment: Right, 7 | AlignConsecutiveAssignments: true, 8 | TabWidth: 4, 9 | UseTab: ForIndentation, 10 | SortIncludes: false, 11 | } 12 | -------------------------------------------------------------------------------- /Packaging/fedora/devilutionx.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=devilutionX 3 | GenericName=DevilutionX 4 | Comment=Play Diablo I on Linux 5 | Exec=devilutionx 6 | Icon=devilutionx.png 7 | Terminal=false 8 | Type=Application 9 | X-DCOP-ServiceType=Multi 10 | X-KDE-StartupNotify=true 11 | Categories=Qt;Game;RolePlaying; 12 | -------------------------------------------------------------------------------- /Source/dead.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __DEAD_H__ 3 | #define __DEAD_H__ 4 | 5 | extern int spurtndx; 6 | extern DeadStruct dead[MAXDEAD]; 7 | extern int stonendx; 8 | 9 | void InitDead(); 10 | void AddDead(int dx, int dy, char dv, int ddir); 11 | void SetDead(); 12 | 13 | #endif /* __DEAD_H__ */ 14 | -------------------------------------------------------------------------------- /Source/itemdat.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __ITEMDAT_H__ 3 | #define __ITEMDAT_H__ 4 | 5 | extern ItemDataStruct AllItemsList[157]; 6 | extern const PLStruct PL_Prefix[84]; 7 | extern const PLStruct PL_Suffix[96]; 8 | extern const UItemStruct UniqueItemList[91]; 9 | 10 | #endif /* __ITEMDAT_H__ */ 11 | -------------------------------------------------------------------------------- /SourceS/miniwin/com_macro.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define SW_HIDE DVL_SW_HIDE 4 | #define SW_SHOWNORMAL DVL_SW_SHOWNORMAL 5 | 6 | #define E_FAIL DVL_E_FAIL 7 | #define S_OK DVL_S_OK 8 | 9 | #define DDBLTFAST_WAIT 0x00000010 10 | 11 | #define ERROR_SUCCESS DVL_ERROR_SUCCESS 12 | #define DS_OK DVL_DS_OK 13 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/selyesno.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "devilution.h" 4 | 5 | namespace dvl { 6 | BOOL UiSelHeroDelYesNoDialog(BOOL (*fnremove)(_uiheroinfo *), _uiheroinfo *selectHero, bool isMultiplayer); 7 | void selyesno_Free(); 8 | void selyesno_Select(int value); 9 | void selyesno_Esc(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /Source/render.h: -------------------------------------------------------------------------------- 1 | #ifndef __RENDER_H__ 2 | #define __RENDER_H__ 3 | 4 | void RenderTile(BYTE *pBuff); 5 | #define drawUpperScreen(p) RenderTile(p) 6 | #define drawLowerScreen(p) RenderTile(p) 7 | void world_draw_black_tile(int sx, int sy); 8 | void trans_rect(int sx, int sy, int width, int height); 9 | 10 | #endif /* __RENDER_H__ */ 11 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/control: -------------------------------------------------------------------------------- 1 | Package: devilutionx 2 | Version: 0.0.1 3 | Architecture: mipsel 4 | Section: games 5 | Maintainer: glex.spb@gmail.com 6 | Description: A port of DevilutionX for RetroFW. 7 | Priority: optional 8 | Homepage: https://github.com/diasurgical/devilutionX 9 | Depends: 10 | Source: https://github.com/diasurgical/devilutionX 11 | -------------------------------------------------------------------------------- /Source/town.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __TOWN_H__ 3 | #define __TOWN_H__ 4 | 5 | void SetTownMicros(); 6 | void T_FillSector(BYTE *P3Tiles, BYTE *pSector, int xi, int yi, int w, int h); 7 | void T_FillTile(BYTE *P3Tiles, int xx, int yy, int t); 8 | void T_Pass3(); 9 | void CreateTown(int entry); 10 | 11 | #endif /* __TOWN_H__ */ 12 | -------------------------------------------------------------------------------- /SourceX/.clang-format: -------------------------------------------------------------------------------- 1 | { 2 | BasedOnStyle: webkit, 3 | AlignTrailingComments: true, 4 | AllowShortBlocksOnASingleLine: true, 5 | AllowShortFunctionsOnASingleLine: None, 6 | PointerAlignment: Right, 7 | TabWidth: 4, 8 | UseTab: ForIndentation, 9 | SortIncludes: false, 10 | NamespaceIndentation: None, 11 | FixNamespaceComments: true, 12 | } 13 | -------------------------------------------------------------------------------- /docs/TODO.md: -------------------------------------------------------------------------------- 1 | ### Comments 2 | - `BUGFIX` known bugs in original (vanilla) code 3 | - `/* */` block comments are things to be fixed/checked 4 | - `FIX_ME` bad data 5 | 6 | Code issues (incorrect code that still works) 7 | - Critical sections should be constructors using `CCritSect` 8 | - Some functions/structures have incorrect signing (signed/unsigned BYTE) 9 | -------------------------------------------------------------------------------- /vita/touch.h: -------------------------------------------------------------------------------- 1 | #ifndef TOUCH_H 2 | #define TOUCH_H 3 | 4 | #ifdef USE_SDL1 5 | #include 6 | #else 7 | #include 8 | #endif 9 | #include 10 | 11 | void handle_touch(SDL_Event *event, int current_mouse_x, int current_mouse_y); 12 | void finish_simulated_mouse_clicks(int current_mouse_x, int current_mouse_y); 13 | 14 | #endif -------------------------------------------------------------------------------- /Source/movie.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __MOVIE_H__ 3 | #define __MOVIE_H__ 4 | 5 | extern BYTE movie_playing; 6 | extern BOOL loop_movie; 7 | 8 | void play_movie(char *pszMovie, BOOL user_can_close); 9 | LRESULT __stdcall MovieWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); 10 | 11 | /* rdata */ 12 | 13 | #endif /* __MOVIE_H__ */ 14 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/readme.gcw0.txt: -------------------------------------------------------------------------------- 1 | Copy diabdat.mpq from your CD, or GoG install folder to: 2 | /media/home/.local/share/diasurgical/devilution/diabdat.mpq 3 | 4 | diabdat.mpq filename must be lowercase. 5 | 6 | Game saves and diablo.ini are located at: 7 | /media/home/.local/share/diasurgical/devilution/ 8 | 9 | Source: https://github.com/diasurgical/devilutionX/ 10 | -------------------------------------------------------------------------------- /Source/codec.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __CODEC_H__ 3 | #define __CODEC_H__ 4 | 5 | int codec_decode(BYTE *pbSrcDst, DWORD size, char *pszPassword); 6 | void codec_init_key(int unused, char *pszPassword); 7 | DWORD codec_get_encoded_len(DWORD dwSrcBytes); 8 | void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword); 9 | 10 | #endif /* __CODEC_H__ */ 11 | -------------------------------------------------------------------------------- /SourceX/miniwin/rand.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "devilution.h" 4 | 5 | namespace dvl { 6 | 7 | static uint32_t rand_state = 0; 8 | 9 | int rand(void) 10 | { 11 | rand_state = rand_state * 214013 + 2531011; 12 | return (rand_state >> 16) & 0x7FFF; 13 | } 14 | 15 | void srand(uint32_t seed) 16 | { 17 | rand_state = seed; 18 | } 19 | 20 | } // namespace dvl 21 | -------------------------------------------------------------------------------- /Source/error.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __ERROR_H__ 3 | #define __ERROR_H__ 4 | 5 | extern char msgtable[MAX_SEND_STR_LEN]; 6 | extern char msgdelay; 7 | extern char msgflag; 8 | extern char msgcnt; 9 | 10 | void InitDiabloMsg(char e); 11 | void ClrDiabloMsg(); 12 | void DrawDiabloMsg(); 13 | 14 | /* data */ 15 | extern char *MsgStrings[44]; 16 | 17 | #endif /* __ERROR_H__ */ 18 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/buildroot_rs90_defconfig: -------------------------------------------------------------------------------- 1 | BR2_mipsel=y 2 | # BR2_MIPS_SOFT_FLOAT is not set 3 | BR2_OPTIMIZE_2=y 4 | BR2_TOOLCHAIN_BUILDROOT_MUSL=y 5 | BR2_KERNEL_HEADERS_4_20=y 6 | BR2_BINUTILS_VERSION_2_31_X=y 7 | BR2_GCC_VERSION_8_X=y 8 | BR2_TOOLCHAIN_BUILDROOT_CXX=y 9 | BR2_GCC_ENABLE_LTO=y 10 | BR2_PACKAGE_SDL=y 11 | BR2_PACKAGE_SDL_MIXER=y 12 | BR2_PACKAGE_SDL_TTF=y 13 | BR2_PACKAGE_LIBZIP=y 14 | BR2_PACKAGE_LIBSODIUM=y 15 | -------------------------------------------------------------------------------- /SourceX/miniwin/ddraw.cpp: -------------------------------------------------------------------------------- 1 | #include "miniwin/ddraw.h" 2 | 3 | namespace dvl { 4 | 5 | extern SDL_Surface *renderer_texture_surface; // defined in dx.cpp 6 | 7 | SDL_Surface *GetOutputSurface() { 8 | #ifdef USE_SDL1 9 | return SDL_GetVideoSurface(); 10 | #else 11 | if (renderer) 12 | return renderer_texture_surface; 13 | return SDL_GetWindowSurface(window); 14 | #endif 15 | } 16 | 17 | } // namespace dvl 18 | -------------------------------------------------------------------------------- /3rdParty/Radon/Radon/include/Named.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Dmitro bjornus Szewczuk 2017 under zlib license 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | namespace radon 8 | { 9 | class Named 10 | { 11 | public: 12 | 13 | Named(); 14 | 15 | Named(const std::string & name); 16 | 17 | void setName(const std::string & name); 18 | 19 | std::string getName(); 20 | 21 | protected: 22 | std::string name; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /Source/pack.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __PACK_H__ 3 | #define __PACK_H__ 4 | 5 | void PackPlayer(PkPlayerStruct *pPack, int pnum, BOOL manashield); 6 | void PackItem(PkItemStruct *id, ItemStruct *is); 7 | void VerifyGoldSeeds(PlayerStruct *pPlayer); 8 | void UnPackPlayer(PkPlayerStruct *pPack, int pnum, BOOL killok); 9 | void UnPackItem(PkItemStruct *is, ItemStruct *id); 10 | 11 | /* rdata */ 12 | 13 | #endif /* __PACK_H__ */ 14 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/art_draw.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "devilution.h" 4 | 5 | #include "DiabloUI/art.h" 6 | 7 | namespace dvl { 8 | 9 | void DrawArt(int screenX, int screenY, Art *art, int nFrame = 0, 10 | decltype(SDL_Rect().w) srcW = 0, decltype(SDL_Rect().h) srcH = 0); 11 | 12 | void DrawAnimatedArt(Art *art, int screenX, int screenY); 13 | 14 | int GetAnimationFrame(int frames, int fps = 60); 15 | 16 | } // namespace dvl 17 | -------------------------------------------------------------------------------- /Source/dthread.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __DTHREAD_H__ 3 | #define __DTHREAD_H__ 4 | 5 | extern unsigned int glpDThreadId; 6 | extern BOOLEAN dthread_running; 7 | 8 | void dthread_remove_player(int pnum); 9 | void dthread_send_delta(int pnum, char cmd, void *pbSrc, int dwLen); 10 | void dthread_start(); 11 | unsigned int __stdcall dthread_handler(void *); 12 | void dthread_cleanup(); 13 | 14 | /* data */ 15 | 16 | #endif /* __DTHREAD_H__ */ 17 | -------------------------------------------------------------------------------- /SourceS/miniwin/thread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace dvl { 4 | 5 | typedef void *CRITICAL_SECTION, **LPCRITICAL_SECTION; 6 | void WINAPI InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection); 7 | void WINAPI EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection); 8 | void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection); 9 | void WINAPI DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection); 10 | 11 | } // namespace dvl 12 | -------------------------------------------------------------------------------- /Source/spells.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __SPELLS_H__ 3 | #define __SPELLS_H__ 4 | 5 | int GetManaAmount(int id, int sn); 6 | void UseMana(int id, int sn); 7 | BOOL CheckSpell(int id, int sn, char st, BOOL manaonly); 8 | void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int caster, int spllvl); 9 | void DoResurrect(int pnum, int rid); 10 | void PlacePlayer(int pnum); 11 | void DoHealOther(int pnum, int rid); 12 | 13 | #endif /* __SPELLS_H__ */ 14 | -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by Diablo.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 103 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/unyield.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // unyield.hpp 3 | // ~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifdef reenter 12 | # undef reenter 13 | #endif 14 | 15 | #ifdef yield 16 | # undef yield 17 | #endif 18 | 19 | #ifdef fork 20 | # undef fork 21 | #endif 22 | -------------------------------------------------------------------------------- /Source/capture.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __CAPTURE_H__ 3 | #define __CAPTURE_H__ 4 | 5 | void CaptureScreen(); 6 | BOOL CaptureHdr(HANDLE hFile, short width, short height); 7 | BOOL CapturePal(HANDLE hFile, PALETTEENTRY *palette); 8 | BOOL CapturePix(HANDLE hFile, WORD width, WORD height, WORD stride, BYTE *pixels); 9 | BYTE *CaptureEnc(BYTE *src, BYTE *dst, int width); 10 | HANDLE CaptureFile(char *dst_path); 11 | void RedPalette(PALETTEENTRY *pal); 12 | 13 | #endif /* __CAPTURE_H__ */ 14 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/selgame.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace dvl { 4 | 5 | void selgame_GameSelection_Init(); 6 | void selgame_GameSelection_Focus(int value); 7 | void selgame_GameSelection_Select(int value); 8 | void selgame_GameSelection_Esc(); 9 | void selgame_Diff_Focus(int value); 10 | void selgame_Diff_Select(int value); 11 | void selgame_Diff_Esc(); 12 | void selgame_Password_Init(int value); 13 | void selgame_Password_Select(int value); 14 | void selgame_Password_Esc(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /3rdParty/Radon/Radon/source/Named.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Dmitro bjornus Szewczuk 2017 2 | 3 | #include "../include/Radon.hpp" 4 | 5 | namespace radon 6 | { 7 | Named::Named() 8 | { 9 | setName("You need to set name!"); 10 | } 11 | 12 | 13 | Named::Named(const std::string & name) 14 | { 15 | setName(name); 16 | } 17 | 18 | 19 | void Named::setName(const std::string & name) 20 | { 21 | this->name = name; 22 | } 23 | 24 | 25 | std::string Named::getName() 26 | { 27 | return name; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/dialogs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "DiabloUI/ui_item.h" 6 | 7 | namespace dvl { 8 | 9 | void UiErrorOkDialog(const char *text, UiItem *renderBehind, std::size_t renderBehindSize); 10 | void UiErrorOkDialog(const char *text, const char *caption, UiItem *render_behind, std::size_t render_behind_size); 11 | void UiOkDialog(const char *text, const char *caption, bool error, UiItem *render_behind, std::size_t render_behind_size); 12 | 13 | } // namespace dvl 14 | -------------------------------------------------------------------------------- /.vscode/cmake_configurations.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [{ 3 | "name": "Debug", 4 | "buildType": "Debug", 5 | "toolchain": "${VITASDK}" 6 | 7 | }, 8 | { 9 | "name": "Release", 10 | "buildType": "Release", 11 | "toolchain": "${VITASDK}" 12 | }, 13 | { 14 | "name": "RelWithDebInfo", 15 | "buildType": "RelWithDebInfo", 16 | "toolchain": "${VITASDK}" 17 | }, 18 | { 19 | "name": "MinSizeRel", 20 | "buildType": "MinSizeRel", 21 | "toolchain": "${VITASDK}" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | os: osx 4 | 5 | osx_image: xcode10.3 6 | 7 | git: 8 | depth: false 9 | quiet: true 10 | 11 | addons: 12 | homebrew: 13 | brewfile: true 14 | 15 | script: 16 | - cd build 17 | - cmake -DBINARY_RELEASE=ON .. 18 | - sudo cmake --build . --target package -j $(sysctl -n hw.physicalcpu) 19 | 20 | deploy: 21 | provider: releases 22 | api_key: "$GITHUB_TOKEN" 23 | file: "build/devilutionx.dmg" 24 | skip_cleanup: true 25 | on: 26 | tags: true 27 | -------------------------------------------------------------------------------- /Source/restrict.cpp: -------------------------------------------------------------------------------- 1 | #include "diablo.h" 2 | #include "../3rdParty/Storm/Source/storm.h" 3 | 4 | DEVILUTION_BEGIN_NAMESPACE 5 | 6 | void ReadOnlyTest() 7 | { 8 | FILE *f; 9 | char path[MAX_PATH], Filename[MAX_PATH]; 10 | 11 | GetPrefPath(path, MAX_PATH); 12 | snprintf(Filename, DVL_MAX_PATH, "%sDiablo1ReadOnlyTest.foo", path); 13 | 14 | f = fopen(Filename, "wt"); 15 | if (!f) { 16 | DirErrorDlg(path); 17 | } 18 | 19 | fclose(f); 20 | remove(Filename);; 21 | } 22 | 23 | DEVILUTION_END_NAMESPACE 24 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = crlf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | end_of_line = lf 13 | 14 | [*.sh] 15 | end_of_line = lf 16 | 17 | [.clang-format] 18 | end_of_line = lf 19 | 20 | [.gitignore] 21 | end_of_line = lf 22 | 23 | [CMakeLists.txt] 24 | indent_style = space 25 | indent_size = 2 26 | 27 | [*.cmake] 28 | indent_style = space 29 | indent_size = 2 30 | -------------------------------------------------------------------------------- /Source/interfac.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __INTERFAC_H__ 3 | #define __INTERFAC_H__ 4 | 5 | extern int progress_id; 6 | 7 | void interface_msg_pump(); 8 | BOOL IncProgress(); 9 | void DrawCutscene(); 10 | void DrawProgress(int screen_x, int screen_y, int progress_id); 11 | void ShowProgress(unsigned int uMsg); 12 | void FreeInterface(); 13 | void InitCutscene(unsigned int uMsg); 14 | 15 | /* rdata */ 16 | 17 | extern const BYTE BarColor[3]; 18 | extern const int BarPos[3][2]; 19 | 20 | #endif /* __INTERFAC_H__ */ 21 | -------------------------------------------------------------------------------- /Source/help.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __HELP_H__ 3 | #define __HELP_H__ 4 | 5 | extern int help_select_line; 6 | extern int dword_634494; 7 | extern int helpflag; 8 | extern int displayinghelp[22]; 9 | extern int HelpTop; 10 | 11 | void InitHelp(); 12 | void DrawHelp(); 13 | void DrawHelpLine(int always_0, int help_line_nr, char *text, char color); 14 | void DisplayHelp(); 15 | void HelpScrollUp(); 16 | void HelpScrollDown(); 17 | 18 | /* rdata */ 19 | extern const char gszHelpText[]; 20 | 21 | #endif /* __HELP_H__ */ 22 | -------------------------------------------------------------------------------- /Source/sha.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __SHA_H__ 3 | #define __SHA_H__ 4 | 5 | #define SHA1HashSize 20 6 | 7 | //sha 8 | 9 | void SHA1Clear(); 10 | void SHA1Result(int n, char Message_Digest[SHA1HashSize]); 11 | void SHA1Calculate(int n, const char *data, char Message_Digest[SHA1HashSize]); 12 | void SHA1Input(SHA1Context *context, const char *message_array, int len); 13 | void SHA1ProcessMessageBlock(SHA1Context *context); 14 | void SHA1Reset(int n); 15 | void SHA1Init(SHA1Context *context); 16 | 17 | #endif /* __SHA_H__ */ 18 | -------------------------------------------------------------------------------- /Source/doom.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __DOOM_H__ 3 | #define __DOOM_H__ 4 | 5 | extern int doom_quest_time; 6 | extern int doom_stars_drawn; 7 | extern BYTE *pDoomCel; 8 | extern BOOL doomflag; 9 | extern int DoomQuestState; 10 | 11 | /* 12 | void doom_reset_state(); 13 | void doom_play_movie(); 14 | */ 15 | int doom_get_frame_from_time(); 16 | void doom_alloc_cel(); 17 | void doom_cleanup(); 18 | void doom_load_graphics(); 19 | void doom_init(); 20 | void doom_close(); 21 | void doom_draw(); 22 | 23 | #endif /* __DOOM_H__ */ 24 | -------------------------------------------------------------------------------- /Source/wave.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __WAVE_H__ 3 | #define __WAVE_H__ 4 | 5 | BOOL WCloseFile(HANDLE file); 6 | LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh, const char *FileName); 7 | void WGetFileArchive(HANDLE hsFile, DWORD *retry, const char *FileName); 8 | BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist); 9 | void WReadFile(HANDLE hsFile, LPVOID buf, DWORD to_read, const char *FileName); 10 | int WSetFilePointer(HANDLE file1, int offset, HANDLE file2, int whence); 11 | 12 | #endif /* __WAVE_H__ */ 13 | -------------------------------------------------------------------------------- /3rdParty/Radon/Radon/include/Section.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Dmitro bjornus Szewczuk 2017 under zlib license 2 | 3 | #pragma once 4 | 5 | #include 6 | #include 7 | 8 | #include "Named.hpp" 9 | 10 | namespace radon 11 | { 12 | class Key; 13 | 14 | class Section 15 | : public Named 16 | { 17 | public: 18 | 19 | Section(); 20 | 21 | Section(const std::string & name); 22 | 23 | Key *getKey(const std::string & name); 24 | 25 | void addKey(Key variable); 26 | 27 | private: 28 | std::vector keys; 29 | 30 | friend class File; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/scrollbar.cpp: -------------------------------------------------------------------------------- 1 | #include "scrollbar.h" 2 | 3 | namespace dvl { 4 | 5 | Art ArtScrollBarBackground; 6 | Art ArtScrollBarThumb; 7 | Art ArtScrollBarArrow; 8 | 9 | void LoadScrollBar() { 10 | LoadArt("ui_art\\sb_bg.pcx", &ArtScrollBarBackground); 11 | LoadArt("ui_art\\sb_thumb.pcx", &ArtScrollBarThumb); 12 | LoadArt("ui_art\\sb_arrow.pcx", &ArtScrollBarArrow, 4); 13 | } 14 | 15 | void UnloadScrollBar() { 16 | ArtScrollBarArrow.Unload(); 17 | ArtScrollBarThumb.Unload(); 18 | ArtScrollBarBackground.Unload(); 19 | } 20 | 21 | } // namespace 22 | -------------------------------------------------------------------------------- /3rdParty/Radon/Radon/include/File.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Dmitro bjornus Szewczuk 2017 under zlib license 2 | 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace radon 10 | { 11 | class Section; 12 | 13 | class File 14 | { 15 | public: 16 | 17 | File(const std::string & path, bool reading = true); 18 | 19 | Section* getSection(const std::string & name); 20 | 21 | void addSection(const std::string & name); 22 | 23 | void saveToFile(); 24 | 25 | private: 26 | std::vector
sections; 27 | std::string path; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/yield.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // yield.hpp 3 | // ~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #include "coroutine.hpp" 12 | 13 | #ifndef reenter 14 | # define reenter(c) ASIO_CORO_REENTER(c) 15 | #endif 16 | 17 | #ifndef yield 18 | # define yield ASIO_CORO_YIELD 19 | #endif 20 | 21 | #ifndef fork 22 | # define fork ASIO_CORO_FORK 23 | #endif 24 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/selhero.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace dvl { 4 | 5 | void selhero_List_Init(); 6 | void selhero_List_Focus(int value); 7 | void selhero_List_Select(int value); 8 | bool selhero_List_DeleteYesNo(); 9 | void selhero_List_Esc(); 10 | void selhero_ClassSelector_Focus(int value); 11 | void selhero_ClassSelector_Select(int value); 12 | void selhero_ClassSelector_Esc(); 13 | void selhero_UiFocusNavigationYesNo(); 14 | void selhero_Name_Select(int value); 15 | void selhero_Name_Esc(); 16 | void selhero_Load_Focus(int value); 17 | void selhero_Load_Select(int value); 18 | } 19 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Linux", 5 | "includePath": [ 6 | "${workspaceFolder}/**" 7 | ], 8 | "defines": [], 9 | "compilerPath": "/usr/bin/clang", 10 | "cStandard": "c11", 11 | "cppStandard": "c++17", 12 | "intelliSenseMode": "clang-x64", 13 | "configurationProvider": "go2sh.cmake-integration", 14 | "compileCommands": "${workspaceFolder}/build/compile_commands.json" 15 | } 16 | ], 17 | "version": 4 18 | } -------------------------------------------------------------------------------- /Packaging/debian/changelog: -------------------------------------------------------------------------------- 1 | devilutionx (0.5.0.3) UNRELEASED; urgency=medium 2 | 3 | * Hardcoded font path fix 4 | 5 | -- Vítězslav Dvořák Mon, 07 Oct 2019 23:35:11 +0200 6 | 7 | devilutionx (0.5.0.2) UNRELEASED; urgency=medium 8 | 9 | [ Vítězslav Dvořák ] 10 | Missing font hotfix 11 | * 12 | 13 | -- root Sat, 05 Oct 2019 12:04:39 +0000 14 | 15 | devilutionx (0.4.0) bionic; urgency=medium 16 | 17 | [ Vítězslav Dvořák ] 18 | * Non-maintainer upload. 19 | 20 | -- Vítězslav Dvořák Fri, 28 Jun 2019 22:55:11 +0200 21 | -------------------------------------------------------------------------------- /3rdParty/StormLib/README: -------------------------------------------------------------------------------- 1 | This is a slightly modified version of ladislav-zezula/StormLib@4ad0bff21da0163917e1552960e6a43679586b89 2 | 3 | Cosmetic changes: 4 | * Remove all unused files. 5 | * Comment out unnecessary bits with `#ifndef FULL`. 6 | 7 | Implementation changes: 8 | * Redefine `bool` to `BOOL`. 9 | * Use STORMAPI instead of WINAPI for calling convention (and define it as nothing). 10 | * Use external Storm error handling (`SErrGetLastError()` etc.) 11 | * Convert pathnames to Unix-style slashes. 12 | * Bugfixes, with comment: // BUGFIX (devilutionX) 13 | * Fix missing header includes on macOS (devilutionX) 14 | -------------------------------------------------------------------------------- /Source/plrmsg.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __PLRMSG_H__ 3 | #define __PLRMSG_H__ 4 | 5 | extern _plrmsg plr_msgs[PMSG_COUNT]; 6 | 7 | void plrmsg_delay(BOOL delay); 8 | char *ErrorPlrMsg(const char *pszMsg); 9 | size_t __cdecl EventPlrMsg(const char *pszFmt, ...); 10 | void SendPlrMsg(int pnum, const char *pszStr); 11 | void ClearPlrMsg(); 12 | void InitPlrMsg(); 13 | void DrawPlrMsg(); 14 | void PrintPlrMsg(DWORD x, DWORD y, DWORD width, const char *str, BYTE col); 15 | 16 | /* rdata */ 17 | 18 | extern const char text_color_from_player_num[MAX_PLRS + 1]; 19 | 20 | #endif /* __PLRMSG_H__ */ 21 | -------------------------------------------------------------------------------- /SourceS/miniwin/pushdecl.inc: -------------------------------------------------------------------------------- 1 | #ifndef DEVILUTION_ENGINE 2 | #pragma push_macro("__cdecl") 3 | #pragma push_macro("__fastcall") 4 | #pragma push_macro("__stdcall") 5 | #pragma push_macro("CALLBACK") 6 | #pragma push_macro("APIENTRY") 7 | #pragma push_macro("WINAPI") 8 | #pragma push_macro("WINAPIV") 9 | #endif 10 | 11 | #undef __cdecl 12 | #undef __fastcall 13 | #undef __stdcall 14 | #undef CALLBACK 15 | #undef APIENTRY 16 | #undef WINAPI 17 | #undef WINAPIV 18 | #define __cdecl 19 | #define __fastcall 20 | #define __stdcall 21 | #define CALLBACK 22 | #define APIENTRY 23 | #define WINAPI 24 | #define WINAPIV 25 | -------------------------------------------------------------------------------- /3rdParty/Radon/Radon/source/Section.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Dmitro bjornus Szewczuk 2017 2 | 3 | #include "../include/Radon.hpp" 4 | 5 | #include 6 | 7 | namespace radon 8 | { 9 | Section::Section() 10 | : Named() 11 | { 12 | } 13 | 14 | 15 | Section::Section(const std::string & name) 16 | : Named(name) 17 | { 18 | } 19 | 20 | Key *Section::getKey(const std::string & name) 21 | { 22 | for (auto & key : keys) 23 | { 24 | if (key.getName() == name) 25 | return &key; 26 | } 27 | 28 | return nullptr; 29 | } 30 | 31 | void Section::addKey(Key key) 32 | { 33 | keys.push_back(key); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/encrypt.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __ENCRYPT_H__ 3 | #define __ENCRYPT_H__ 4 | 5 | extern DWORD hashtable[1280]; 6 | 7 | void Decrypt(void *block, DWORD size, DWORD key); 8 | void Encrypt(void *block, DWORD size, DWORD key); 9 | DWORD Hash(const char *s, int type); 10 | void InitHash(); 11 | int PkwareCompress(void *buf, int size); 12 | unsigned int __cdecl PkwareBufferRead(char *buf, unsigned int *size, void *param); 13 | void __cdecl PkwareBufferWrite(char *buf, unsigned int *size, void *param); 14 | void PkwareDecompress(void *param, int recv_size, int dwMaxBytes); 15 | 16 | #endif /* __ENCRYPT_H__ */ 17 | -------------------------------------------------------------------------------- /Source/setmaps.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __SETMAPS_H__ 3 | #define __SETMAPS_H__ 4 | 5 | int ObjIndex(int x, int y); 6 | void AddSKingObjs(); 7 | void AddSChamObjs(); 8 | void AddVileObjs(); 9 | void DRLG_SetMapTrans(char *sFileName); 10 | void LoadSetMap(); 11 | 12 | /* rdata */ 13 | extern BYTE SkelKingTrans1[8]; 14 | extern BYTE SkelKingTrans2[8]; 15 | extern BYTE SkelKingTrans3[20]; 16 | extern BYTE SkelKingTrans4[28]; 17 | extern BYTE SkelChamTrans1[20]; 18 | extern BYTE SkelChamTrans2[8]; 19 | extern BYTE SkelChamTrans3[36]; 20 | extern char *quest_level_names[]; 21 | 22 | #endif /* __SETMAPS_H__ */ 23 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ts/io_context.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/io_context.hpp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_IO_CONTEXT_HPP 12 | #define ASIO_TS_IO_CONTEXT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/io_context.hpp" 19 | 20 | #endif // ASIO_TS_IO_CONTEXT_HPP 21 | -------------------------------------------------------------------------------- /SourceS/miniwin/com.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace dvl { 4 | 5 | struct IDirectSoundBuffer { 6 | virtual void Release() = 0; 7 | virtual void GetStatus(LPDWORD pdwStatus) = 0; 8 | virtual void Play(int lVolume, int lPan) = 0; 9 | virtual void Stop() = 0; 10 | virtual int SetChunk(BYTE *fileData, DWORD dwBytes) = 0; 11 | }; 12 | 13 | typedef IDirectSoundBuffer *LPDIRECTSOUNDBUFFER; 14 | 15 | const auto DVL_DS_OK = 0; 16 | const auto DVL_ERROR_SUCCESS = 0L; 17 | const auto DVL_DSBSTATUS_PLAYING = 0x00000001; 18 | 19 | constexpr auto DVL_SW_HIDE = 0; 20 | constexpr auto DVL_SW_SHOWNORMAL = 1; 21 | 22 | } // namespace dvl 23 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/text_draw.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "devilution.h" 4 | 5 | namespace dvl { 6 | 7 | struct TtfSurfaceCache { 8 | ~TtfSurfaceCache() 9 | { 10 | mem_free_dbg(text); 11 | mem_free_dbg(shadow); 12 | } 13 | 14 | SDL_Surface *text = nullptr; 15 | SDL_Surface *shadow = nullptr; 16 | }; 17 | 18 | void DrawTTF(const char *text, const SDL_Rect &rect, int flags, 19 | const SDL_Color &text_color, const SDL_Color &shadow_color, 20 | TtfSurfaceCache **surface_cache); 21 | 22 | void DrawArtStr(const char *text, const SDL_Rect &rect, int flags, bool drawTextCursor = false); 23 | 24 | } // namespace dvl 25 | -------------------------------------------------------------------------------- /SourceX/miniwin/dsound.h: -------------------------------------------------------------------------------- 1 | #include "devilution.h" 2 | 3 | #ifdef VITA 4 | #ifdef USE_SDL1 5 | #include 6 | #else 7 | #include 8 | #endif 9 | #else 10 | #include 11 | #endif 12 | 13 | namespace dvl { 14 | 15 | struct DirectSoundBuffer final : public IDirectSoundBuffer { 16 | public: 17 | void Release() override; 18 | void GetStatus(LPDWORD pdwStatus) override; 19 | void Play(int lVolume, int lPan) override; 20 | void Stop() override; 21 | int SetChunk(BYTE *fileData, DWORD dwBytes) override; 22 | 23 | private: 24 | Mix_Chunk *chunk; 25 | }; 26 | 27 | } // namespace dvl 28 | -------------------------------------------------------------------------------- /Packaging/debian/devilutionx.install: -------------------------------------------------------------------------------- 1 | Packaging/fedora/devilutionx.desktop usr/share/applications/ 2 | obj-x86_64-linux-gnu/devilutionx usr/share/games/diablo/ 3 | Packaging/resources/Diablo_48.png usr/share/icons/hicolor/48x48/apps 4 | Packaging/resources/Diablo_32.png usr/share/icons/hicolor/32x32/apps 5 | Packaging/resources/16.png usr/share/icons/hicolor/16x16/apps 6 | Packaging/resources/CharisSILB.ttf usr/share/fonts/truetype 7 | Packaging/resources/16.png usr/share/icons/hicolor/16x16/apps/ 8 | Packaging/resources/Diablo_32.png usr/share/icons/hicolor/32x32/apps/ 9 | Packaging/resources/Diablo_48.png usr/share/icons/hicolor/48x48/apps/ 10 | 11 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | 3 | pull_requests: 4 | do_not_increment_build_number: true 5 | clone_depth: 1 6 | image: Visual Studio 2017 7 | cache: c:\tools\vcpkg\installed\ 8 | 9 | install: 10 | - vcpkg install sdl2:x86-windows sdl2-mixer:x86-windows sdl2-ttf:x86-windows libsodium:x86-windows 11 | 12 | before_build: 13 | - cmake -G "Visual Studio 15 2017" -DNIGHTLY_BUILD=ON -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake . 14 | 15 | build: 16 | project: $(APPVEYOR_BUILD_FOLDER)\$(APPVEYOR_PROJECT_NAME).sln 17 | verbosity: minimal 18 | artifacts: 19 | - path: Debug\devilutionx.exe 20 | name: devilutionx.exe 21 | -------------------------------------------------------------------------------- /CMake/git.cmake: -------------------------------------------------------------------------------- 1 | function(get_git_tag output_var) 2 | execute_process( 3 | COMMAND git describe --abbrev=0 --tags 4 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 5 | OUTPUT_VARIABLE GIT_TAG 6 | OUTPUT_STRIP_TRAILING_WHITESPACE) 7 | set(${output_var} ${GIT_TAG} PARENT_SCOPE) 8 | endfunction(get_git_tag) 9 | 10 | function(get_git_commit_hash output_var) 11 | execute_process( 12 | COMMAND git log -1 --format=-%h 13 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 14 | OUTPUT_VARIABLE GIT_COMMIT_HASH 15 | OUTPUT_STRIP_TRAILING_WHITESPACE) 16 | set(${output_var} ${GIT_COMMIT_HASH} PARENT_SCOPE) 17 | endfunction(get_git_commit_hash) 18 | -------------------------------------------------------------------------------- /Source/dx.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __DX_H__ 3 | #define __DX_H__ 4 | 5 | extern BYTE *gpBuffer; 6 | extern char gbBackBuf; 7 | extern char gbEmulate; 8 | extern HMODULE ghDiabMod; 9 | 10 | void dx_init(HWND hWnd); 11 | void lock_buf(BYTE idx); 12 | void unlock_buf(BYTE idx); 13 | void dx_cleanup(); 14 | void dx_reinit(); 15 | 16 | void CreatePalette(); 17 | void BltFast(DWORD dwX, DWORD dwY, LPRECT lpSrcRect); 18 | void RenderPresent(); 19 | void PaletteGetEntries(DWORD dwNumEntries, LPPALETTEENTRY lpEntries); 20 | void PaletteSetEntries(DWORD dwCount, LPPALETTEENTRY lpEntries); 21 | 22 | /* data */ 23 | 24 | #endif /* __DX_H__ */ 25 | -------------------------------------------------------------------------------- /CMake/mingwcc.cmake: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | SET(CROSS_PREFIX "/usr" CACHE STRING "crosstool-NG prefix") 4 | 5 | SET(CMAKE_SYSTEM_NAME Windows) 6 | 7 | # workaround 8 | list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${CROSS_PREFIX}/i686-w64-mingw32/include") 9 | 10 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") 11 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") 12 | 13 | SET(CMAKE_FIND_ROOT_PATH "${CROSS_PREFIX}/i686-w64-mingw32" "${CROSS_PREFIX}/i686-w64-mingw32/i686-w64-mingw32") 14 | 15 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 16 | 17 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 18 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 19 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/io_service_strand.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // io_service_strand.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IO_SERVICE_STRAND_HPP 12 | #define ASIO_IO_SERVICE_STRAND_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/io_context_strand.hpp" 19 | 20 | #endif // ASIO_IO_SERVICE_STRAND_HPP 21 | -------------------------------------------------------------------------------- /3rdParty/Radon/Radon/include/Key.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Dmitro bjornus Szewczuk 2017 under zlib license 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | #include "Named.hpp" 8 | 9 | namespace radon 10 | { 11 | class Key 12 | : public Named 13 | { 14 | public: 15 | 16 | Key(); 17 | 18 | Key(const std::string & name, const std::string & value); 19 | 20 | Key(const std::string & name, const float & value); 21 | 22 | std::string getStringValue(); 23 | 24 | float getFloatValue(); 25 | 26 | void setValue(float & value); 27 | 28 | void setValue(std::string & value); 29 | 30 | private: 31 | std::string value; 32 | 33 | friend class File; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /Source/sync.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __SYNC_H__ 3 | #define __SYNC_H__ 4 | 5 | extern WORD sync_word_6AA708[MAXMONSTERS]; 6 | extern int sgnMonsters; 7 | extern WORD sgwLRU[MAXMONSTERS]; 8 | extern int sgnSyncItem; 9 | 10 | DWORD sync_all_monsters(const BYTE *pbBuf, DWORD dwMaxLen); 11 | void sync_one_monster(); 12 | BOOL sync_monster_active(TSyncMonster *p); 13 | void sync_monster_pos(TSyncMonster *p, int ndx); 14 | BOOL sync_monster_active2(TSyncMonster *p); 15 | void SyncPlrInv(TSyncHeader *pHdr); 16 | DWORD sync_update(int pnum, const BYTE *pbBuf); 17 | void sync_monster(int pnum, const TSyncMonster *p); 18 | void sync_init(); 19 | 20 | #endif /* __SYNC_H__ */ 21 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/buildroot_rg350_defconfig: -------------------------------------------------------------------------------- 1 | BR2_mipsel=y 2 | BR2_mips_32r2=y 3 | # BR2_MIPS_SOFT_FLOAT is not set 4 | BR2_OPTIMIZE_2=y 5 | BR2_KERNEL_HEADERS_3_12=y 6 | BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y 7 | BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=y 8 | BR2_TOOLCHAIN_BUILDROOT_WCHAR=y 9 | BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-lto" 10 | BR2_GCC_VERSION_4_9_X=y 11 | BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-lto" 12 | BR2_TOOLCHAIN_BUILDROOT_CXX=y 13 | BR2_PACKAGE_SDL2=y 14 | BR2_PACKAGE_SDL2_IMAGE=y 15 | BR2_PACKAGE_SDL2_IMAGE_PNG=y 16 | BR2_PACKAGE_SDL2_MIXER=y 17 | BR2_PACKAGE_SDL2_TTF=y 18 | BR2_PACKAGE_ETNA_VIV=y 19 | BR2_PACKAGE_ETNA_VIV_ABIV4=y 20 | BR2_PACKAGE_MESA3D_ETNA_VIV=y 21 | BR2_PACKAGE_LIBZIP=y 22 | -------------------------------------------------------------------------------- /SourceX/miniwin/ddraw.h: -------------------------------------------------------------------------------- 1 | #include "devilution.h" 2 | #ifdef VITA 3 | #ifdef USE_SDL1 4 | #include 5 | #else 6 | #include 7 | #endif 8 | #else 9 | #include 10 | #endif 11 | namespace dvl { 12 | 13 | extern SDL_Window *window; 14 | extern SDL_Renderer *renderer; 15 | extern SDL_Texture *texture; 16 | 17 | extern SDL_Palette *palette; 18 | extern SDL_Surface *pal_surface; 19 | extern unsigned int pal_surface_palette_version; 20 | extern bool bufferUpdated; 21 | 22 | // Returns: 23 | // SDL1: Video surface. 24 | // SDL2, no upscale: Window surface. 25 | // SDL2, upscale: Renderer texture surface. 26 | SDL_Surface *GetOutputSurface(); 27 | 28 | } // namespace dvl 29 | -------------------------------------------------------------------------------- /Source/minitext.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __MINITEXT_H__ 3 | #define __MINITEXT_H__ 4 | 5 | extern int qtexty; 6 | extern char *qtextptr; 7 | extern int qtextSpd; 8 | extern BOOLEAN qtextflag; 9 | extern int scrolltexty; 10 | extern BYTE *pMedTextCels; 11 | extern BYTE *pTextBoxCels; 12 | 13 | void FreeQuestText(); 14 | void InitQuestText(); 15 | void InitQTextMsg(int m); 16 | void DrawQTextBack(); 17 | void PrintQTextChr(int sx, int sy, BYTE *pCelBuff, int nCel); 18 | void DrawQText(); 19 | 20 | /* rdata */ 21 | 22 | extern const BYTE mfontframe[127]; 23 | extern const BYTE mfontkern[56]; 24 | 25 | /* data */ 26 | 27 | extern int qscroll_spd_tbl[9]; 28 | 29 | #endif /* __MINITEXT_H__ */ 30 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/experimental.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // experimental.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_EXPERIMENTAL_HPP 12 | #define ASIO_EXPERIMENTAL_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/experimental/co_spawn.hpp" 19 | #include "asio/experimental/detached.hpp" 20 | #include "asio/experimental/redirect_error.hpp" 21 | 22 | #endif // ASIO_EXPERIMENTAL_HPP 23 | -------------------------------------------------------------------------------- /Source/debug.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __DEBUG_H__ 3 | #define __DEBUG_H__ 4 | 5 | extern BYTE *pSquareCel; 6 | extern char dMonsDbg[NUMLEVELS][MAXDUNX][MAXDUNY]; 7 | extern char dFlagDbg[NUMLEVELS][MAXDUNX][MAXDUNY]; 8 | 9 | void LoadDebugGFX(); 10 | void FreeDebugGFX(); 11 | void CheckDungeonClear(); 12 | #ifdef _DEBUG 13 | void GiveGoldCheat(); 14 | void StoresCheat(); 15 | void TakeGoldCheat(); 16 | void MaxSpellsCheat(); 17 | void SetSpellLevelCheat(char spl, int spllvl); 18 | void SetAllSpellsCheat(); 19 | void PrintDebugPlayer(BOOL bNextPlayer); 20 | void PrintDebugQuest(); 21 | void PrintDebugMonster(int m); 22 | void GetDebugMonster(); 23 | void NextDebugMonster(); 24 | #endif 25 | 26 | #endif /* __DEBUG_H__ */ 27 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/buffered_stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // buffered_stream_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BUFFERED_STREAM_FWD_HPP 12 | #define ASIO_BUFFERED_STREAM_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | namespace asio { 19 | 20 | template 21 | class buffered_stream; 22 | 23 | } // namespace asio 24 | 25 | #endif // ASIO_BUFFERED_STREAM_FWD_HPP 26 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ts/buffer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/buffer.hpp 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_BUFFER_HPP 12 | #define ASIO_TS_BUFFER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/buffer.hpp" 19 | #include "asio/completion_condition.hpp" 20 | #include "asio/read.hpp" 21 | #include "asio/write.hpp" 22 | #include "asio/read_until.hpp" 23 | 24 | #endif // ASIO_TS_BUFFER_HPP 25 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/version.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // version.hpp 3 | // ~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_VERSION_HPP 12 | #define ASIO_VERSION_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | // ASIO_VERSION % 100 is the sub-minor version 19 | // ASIO_VERSION / 100 % 1000 is the minor version 20 | // ASIO_VERSION / 100000 is the major version 21 | #define ASIO_VERSION 101202 // 1.12.2 22 | 23 | #endif // ASIO_VERSION_HPP 24 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/buffered_read_stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // buffered_read_stream_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BUFFERED_READ_STREAM_FWD_HPP 12 | #define ASIO_BUFFERED_READ_STREAM_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | namespace asio { 19 | 20 | template 21 | class buffered_read_stream; 22 | 23 | } // namespace asio 24 | 25 | #endif // ASIO_BUFFERED_READ_STREAM_FWD_HPP 26 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/ttf_render_wrapped.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "devilution.h" 4 | #ifdef VITA 5 | #ifdef USE_SDL1 6 | #include 7 | #else 8 | #include 9 | #endif 10 | #else 11 | #include 12 | #endif 13 | 14 | namespace dvl { 15 | 16 | enum class TextAlignment { 17 | BEGIN = 0, 18 | CENTER, 19 | END, 20 | }; 21 | 22 | /** 23 | * Renders UTF-8, wrapping lines to avoid exceeding wrapLength, and aligning 24 | * according to the `x_align` argument. 25 | * 26 | * This method is slow. Caching the result is recommended. 27 | */ 28 | SDL_Surface *RenderUTF8_Solid_Wrapped( 29 | TTF_Font *font, const char *text, SDL_Color fg, Uint32 wrapLength, TextAlignment x_align = TextAlignment::BEGIN); 30 | 31 | } // namespace dvl 32 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/buffered_write_stream_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // buffered_write_stream_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BUFFERED_WRITE_STREAM_FWD_HPP 12 | #define ASIO_BUFFERED_WRITE_STREAM_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | namespace asio { 19 | 20 | template 21 | class buffered_write_stream; 22 | 23 | } // namespace asio 24 | 25 | #endif // ASIO_BUFFERED_WRITE_STREAM_FWD_HPP 26 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ts/net.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/net.hpp 3 | // ~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_NET_HPP 12 | #define ASIO_TS_NET_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/ts/netfwd.hpp" 19 | #include "asio/ts/executor.hpp" 20 | #include "asio/ts/io_context.hpp" 21 | #include "asio/ts/timer.hpp" 22 | #include "asio/ts/buffer.hpp" 23 | #include "asio/ts/socket.hpp" 24 | #include "asio/ts/internet.hpp" 25 | 26 | #endif // ASIO_TS_NET_HPP 27 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/art.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "devilution.h" 4 | 5 | namespace dvl { 6 | 7 | struct Art { 8 | SDL_Surface *surface = NULL; 9 | int frames = 1; 10 | int frame_height = 0; 11 | unsigned int palette_version = 0; 12 | 13 | int w() const 14 | { 15 | return surface ? surface->w : 0; 16 | } 17 | 18 | int h() const 19 | { 20 | return frame_height; 21 | } 22 | 23 | void Unload() 24 | { 25 | SDL_FreeSurface(surface); 26 | surface = NULL; 27 | } 28 | }; 29 | 30 | void LoadArt(const char *pszFile, Art *art, int frames = 1, PALETTEENTRY *pPalette = NULL); 31 | void LoadMaskedArt(const char *pszFile, Art *art, int frames = 1, int mask = 250); 32 | void LoadArt(Art *art, const BYTE *artData, int w, int h, int frames = 1); 33 | 34 | } // namespace dvl 35 | -------------------------------------------------------------------------------- /SourceX/dvlnet/frame_queue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "dvlnet/abstract_net.h" 6 | 7 | namespace dvl { 8 | namespace net { 9 | 10 | class frame_queue_exception : public dvlnet_exception { 11 | }; 12 | 13 | typedef uint32_t framesize_t; 14 | 15 | class frame_queue { 16 | public: 17 | constexpr static framesize_t max_frame_size = 0xFFFF; 18 | 19 | private: 20 | framesize_t current_size = 0; 21 | std::deque buffer_deque; 22 | framesize_t nextsize = 0; 23 | 24 | framesize_t size(); 25 | buffer_t read(framesize_t s); 26 | 27 | public: 28 | bool packet_ready(); 29 | buffer_t read_packet(); 30 | void write(buffer_t buf); 31 | 32 | static buffer_t make_frame(buffer_t packetbuf); 33 | }; 34 | 35 | } // namespace net 36 | } // namespace dvl 37 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ts/timer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/timer.hpp 3 | // ~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_TIMER_HPP 12 | #define ASIO_TS_TIMER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/chrono.hpp" 19 | 20 | #include "asio/wait_traits.hpp" 21 | #include "asio/basic_waitable_timer.hpp" 22 | #include "asio/system_timer.hpp" 23 | #include "asio/steady_timer.hpp" 24 | #include "asio/high_resolution_timer.hpp" 25 | 26 | #endif // ASIO_TS_TIMER_HPP 27 | -------------------------------------------------------------------------------- /SourceX/miniwin/misc_dx.cpp: -------------------------------------------------------------------------------- 1 | #include "devilution.h" 2 | #include "miniwin/ddraw.h" 3 | #include "stubs.h" 4 | #ifdef VITA 5 | #ifdef USE_SDL1 6 | #include 7 | #else 8 | #include 9 | #endif 10 | #else 11 | #include 12 | #endif 13 | 14 | namespace dvl { 15 | 16 | WINBOOL SetCursorPos(int X, int Y) 17 | { 18 | 19 | #ifndef VITA 20 | assert(window); 21 | 22 | #ifndef USE_SDL1 23 | if (renderer) { 24 | SDL_Rect view; 25 | SDL_RenderGetViewport(renderer, &view); 26 | X += view.x; 27 | Y += view.y; 28 | 29 | float scaleX; 30 | SDL_RenderGetScale(renderer, &scaleX, NULL); 31 | X *= scaleX; 32 | Y *= scaleX; 33 | } 34 | #endif 35 | 36 | SDL_WarpMouseInWindow(window, X, Y); 37 | #endif 38 | return true; 39 | } 40 | 41 | } // namespace dvl 42 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/impl/src.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // impl/src.cpp 3 | // ~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #if defined(_MSC_VER) \ 12 | || defined(__BORLANDC__) \ 13 | || defined(__DMC__) 14 | # pragma message ( \ 15 | "This file is deprecated. " \ 16 | "Please #include instead.") 17 | #elif defined(__GNUC__) \ 18 | || defined(__HP_aCC) \ 19 | || defined(__SUNPRO_CC) \ 20 | || defined(__IBMCPP__) 21 | # warning "This file is deprecated." 22 | # warning "Please #include instead." 23 | #endif 24 | 25 | #include "asio/impl/src.hpp" 26 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/limits.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/limits.hpp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_LIMITS_HPP 12 | #define ASIO_DETAIL_LIMITS_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_BOOST_LIMITS) 21 | # include 22 | #else // defined(ASIO_HAS_BOOST_LIMITS) 23 | # include 24 | #endif // defined(ASIO_HAS_BOOST_LIMITS) 25 | 26 | #endif // ASIO_DETAIL_LIMITS_HPP 27 | -------------------------------------------------------------------------------- /Source/portal.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __PORTAL_H__ 3 | #define __PORTAL_H__ 4 | 5 | extern PortalStruct portal[MAXPORTAL]; 6 | extern int portalindex; 7 | 8 | void InitPortals(); 9 | void SetPortalStats(int i, BOOL o, int x, int y, int lvl, int lvltype); 10 | void AddWarpMissile(int i, int x, int y); 11 | void SyncPortals(); 12 | void AddInTownPortal(int i); 13 | void ActivatePortal(int i, int x, int y, int lvl, int lvltype, BOOL sp); 14 | void DeactivatePortal(int i); 15 | BOOL PortalOnLevel(int i); 16 | void RemovePortalMissile(int id); 17 | void SetCurrentPortal(int p); 18 | void GetPortalLevel(); 19 | void GetPortalLvlPos(); 20 | BOOL PosOkPortal(int lvl, int x, int y); 21 | 22 | /* rdata */ 23 | extern int WarpDropX[MAXPORTAL]; 24 | extern int WarpDropY[MAXPORTAL]; 25 | 26 | #endif /* __PORTAL_H__ */ 27 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/fonts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "devilution.h" 4 | 5 | #ifdef VITA 6 | #ifdef USE_SDL1 7 | #include 8 | #else 9 | #include 10 | #endif 11 | #else 12 | #include 13 | #endif 14 | 15 | #include "DiabloUI/art.h" 16 | 17 | #ifndef TTF_FONT_PATH 18 | #define TTF_FONT_PATH "CharisSILB.ttf" 19 | #endif 20 | 21 | namespace dvl { 22 | 23 | enum _artFontTables { 24 | AFT_SMALL, 25 | AFT_MED, 26 | AFT_BIG, 27 | AFT_HUGE, 28 | }; 29 | 30 | enum _artFontColors { 31 | AFC_SILVER, 32 | AFC_GOLD, 33 | }; 34 | 35 | extern TTF_Font *font; 36 | extern BYTE *FontTables[4]; 37 | extern Art ArtFonts[4][2]; 38 | 39 | void LoadArtFonts(); 40 | void UnloadArtFonts(); 41 | 42 | void LoadTtfFont(); 43 | void UnloadTtfFont(); 44 | 45 | } // namespace dvl 46 | -------------------------------------------------------------------------------- /3rdParty/Radon/Radon/source/Key.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Dmitro bjornus Szewczuk 2017 2 | 3 | #include "../include/Radon.hpp" 4 | 5 | namespace radon 6 | { 7 | Key::Key() 8 | : Named() 9 | { 10 | } 11 | 12 | 13 | Key::Key(const std::string & name, const std::string & value) 14 | : Named(name), value(value) 15 | { 16 | } 17 | 18 | 19 | Key::Key(const std::string & name, const float & value) 20 | : Named(name), value(std::to_string(value)) 21 | { 22 | } 23 | 24 | 25 | std::string Key::getStringValue() 26 | { 27 | return value; 28 | } 29 | 30 | 31 | float Key::getFloatValue() 32 | { 33 | return (float)(atof(value.data())); 34 | } 35 | 36 | 37 | void Key::setValue(float & value) 38 | { 39 | this->value = std::to_string(value); 40 | } 41 | 42 | 43 | void Key::setValue(std::string & value) 44 | { 45 | this->value = value; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ssl.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ssl.hpp 3 | // ~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SSL_HPP 12 | #define ASIO_SSL_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/ssl/context.hpp" 19 | #include "asio/ssl/context_base.hpp" 20 | #include "asio/ssl/error.hpp" 21 | #include "asio/ssl/rfc2818_verification.hpp" 22 | #include "asio/ssl/stream.hpp" 23 | #include "asio/ssl/stream_base.hpp" 24 | #include "asio/ssl/verify_context.hpp" 25 | #include "asio/ssl/verify_mode.hpp" 26 | 27 | #endif // ASIO_SSL_HPP 28 | -------------------------------------------------------------------------------- /Packaging/OpenDingux/package-opk.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd "$(dirname "${BASH_SOURCE[0]}")" 4 | 5 | readonly OUT="${1:-../../build/devilutionx.opk}" 6 | readonly IN="${2:-../../build/devilutionx.dge}" 7 | 8 | readonly TMP="tmp/opk" 9 | 10 | echo 1>&2 Packaging ${OUT}... 11 | 12 | set -x 13 | rm -rf "${TMP}" 14 | mkdir -p "${TMP}" 15 | cat > "${TMP}/default.gcw0.desktop" <= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include 20 | 21 | namespace asio { 22 | 23 | #if defined(ASIO_HAS_NULLPTR) 24 | using std::nullptr_t; 25 | #else // defined(ASIO_HAS_NULLPTR) 26 | struct nullptr_t {}; 27 | #endif // defined(ASIO_HAS_NULLPTR) 28 | 29 | } // namespace asio 30 | 31 | #endif // ASIO_DETAIL_CSTDDEF_HPP 32 | -------------------------------------------------------------------------------- /Source/cursor.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __CURSOR_H__ 3 | #define __CURSOR_H__ 4 | 5 | extern int cursH; 6 | extern int icursH28; 7 | extern int cursW; 8 | extern int pcursmonst; 9 | extern int icursW28; 10 | extern BYTE *pCursCels; 11 | extern int icursH; 12 | extern char pcursinvitem; 13 | extern int icursW; 14 | extern char pcursitem; 15 | extern char pcursobj; 16 | extern char pcursplr; 17 | extern int cursmx; 18 | extern int cursmy; 19 | extern int pcurstemp; 20 | extern int pcurs; 21 | 22 | void InitCursor(); 23 | void FreeCursor(); 24 | void SetICursor(int i); 25 | void SetCursor_(int i); 26 | void NewCursor(int i); 27 | void InitLevelCursor(); 28 | void CheckTown(); 29 | void CheckRportal(); 30 | void CheckCursMove(); 31 | 32 | /* rdata */ 33 | extern const int InvItemWidth[180]; 34 | extern const int InvItemHeight[180]; 35 | 36 | #endif /* __CURSOR_H__ */ 37 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ssl/impl/src.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // impl/ssl/src.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SSL_IMPL_SRC_HPP 12 | #define ASIO_SSL_IMPL_SRC_HPP 13 | 14 | #define ASIO_SOURCE 15 | 16 | #include "asio/detail/config.hpp" 17 | 18 | #if defined(ASIO_HEADER_ONLY) 19 | # error Do not compile Asio library source with ASIO_HEADER_ONLY defined 20 | #endif 21 | 22 | #include "asio/ssl/impl/context.ipp" 23 | #include "asio/ssl/impl/error.ipp" 24 | #include "asio/ssl/detail/impl/engine.ipp" 25 | #include "asio/ssl/detail/impl/openssl_init.ipp" 26 | #include "asio/ssl/impl/rfc2818_verification.ipp" 27 | 28 | #endif // ASIO_SSL_IMPL_SRC_HPP 29 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/streambuf.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // streambuf.hpp 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_STREAMBUF_HPP 12 | #define ASIO_STREAMBUF_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_NO_IOSTREAM) 21 | 22 | #include "asio/basic_streambuf.hpp" 23 | 24 | namespace asio { 25 | 26 | /// Typedef for the typical usage of basic_streambuf. 27 | typedef basic_streambuf<> streambuf; 28 | 29 | } // namespace asio 30 | 31 | #endif // !defined(ASIO_NO_IOSTREAM) 32 | 33 | #endif // ASIO_STREAMBUF_HPP 34 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ts/socket.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/socket.hpp 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_SOCKET_HPP 12 | #define ASIO_TS_SOCKET_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/socket_base.hpp" 19 | #include "asio/basic_socket.hpp" 20 | #include "asio/basic_datagram_socket.hpp" 21 | #include "asio/basic_stream_socket.hpp" 22 | #include "asio/basic_socket_acceptor.hpp" 23 | #include "asio/basic_socket_streambuf.hpp" 24 | #include "asio/basic_socket_iostream.hpp" 25 | #include "asio/connect.hpp" 26 | 27 | #endif // ASIO_TS_SOCKET_HPP 28 | -------------------------------------------------------------------------------- /vita/common/debugScreen_custom.h: -------------------------------------------------------------------------------- 1 | #ifndef DEBUG_SCREEN_CUSTOM_H 2 | #define DEBUG_SCREEN_CUSTOM_H 3 | 4 | //#define SCREEN_TAB_SIZE (8) 5 | 6 | // backward compatibility for sources based on older Vita SDK versions 7 | //#define DEBUG_SCREEN_CODE_INCLUDE // not recommended for your own projects, but for sake of backward compatibility 8 | #define psvDebugScreenSetFgColor(rgb) psvDebugScreenPrintf("\e[38;2;%lu;%lu;%lum", ((uint32_t)(rgb)>>16)&0xFF, ((uint32_t)(rgb)>>8)&0xFF, (uint32_t)(rgb)&0xFF) 9 | #define psvDebugScreenSetBgColor(rgb) psvDebugScreenPrintf("\e[48;2;%lu;%lu;%lum", ((uint32_t)(rgb)>>16)&0xFF, ((uint32_t)(rgb)>>8)&0xFF, (uint32_t)(rgb)&0xFF) 10 | #define psvDebugScreenClear(rgb) psvDebugScreenSetBgColor(rgb); psvDebugScreenPuts("\e[H\e[2J") 11 | 12 | // custom changes for non-Vita builds 13 | #ifndef __vita__ 14 | #define psvDebugScreenInitReplacement(...) setvbuf(stdout,NULL,_IONBF,0) 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /SourceX/dvlnet/abstract_net.cpp: -------------------------------------------------------------------------------- 1 | #include "dvlnet/abstract_net.h" 2 | 3 | #include "stubs.h" 4 | #ifndef NONET 5 | #include "dvlnet/tcp_client.h" 6 | #include "dvlnet/udp_p2p.h" 7 | #endif 8 | #include "dvlnet/loopback.h" 9 | 10 | namespace dvl { 11 | namespace net { 12 | 13 | abstract_net::~abstract_net() 14 | { 15 | } 16 | 17 | std::unique_ptr abstract_net::make_net(provider_t provider) 18 | { 19 | #ifdef NONET 20 | return std::unique_ptr(new loopback); 21 | #else 22 | switch (provider) { 23 | case SELCONN_TCP: 24 | return std::unique_ptr(new tcp_client); 25 | #ifdef BUGGY 26 | case SELCONN_UDP: 27 | return std::unique_ptr(new udp_p2p); 28 | #endif 29 | case SELCONN_LOOPBACK: 30 | return std::unique_ptr(new loopback); 31 | default: 32 | ABORT(); 33 | } 34 | #endif 35 | } 36 | 37 | } // namespace net 38 | } // namespace dvl 39 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/io_service.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // io_service.hpp 3 | // ~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IO_SERVICE_HPP 12 | #define ASIO_IO_SERVICE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/io_context.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | 24 | #if !defined(ASIO_NO_DEPRECATED) 25 | /// Typedef for backwards compatibility. 26 | typedef io_context io_service; 27 | #endif // !defined(ASIO_NO_DEPRECATED) 28 | 29 | } // namespace asio 30 | 31 | #include "asio/detail/pop_options.hpp" 32 | 33 | #endif // ASIO_IO_SERVICE_HPP 34 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/button.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "DiabloUI/art.h" 4 | #include "DiabloUI/ui_item.h" 5 | 6 | namespace dvl { 7 | 8 | extern Art SmlButton; 9 | void LoadSmlButtonArt(); 10 | inline void UnloadSmlButtonArt() 11 | { 12 | SmlButton.Unload(); 13 | } 14 | constexpr decltype(SDL_Rect().w) SML_BUTTON_WIDTH = 110; 15 | constexpr decltype(SDL_Rect().h) SML_BUTTON_HEIGHT = 28; 16 | 17 | constexpr UiButton MakeSmlButton( 18 | const char *text, void (*action)(), decltype(SDL_Rect().x) x, decltype(SDL_Rect().y) y, int flags = 0) 19 | { 20 | return UiButton( 21 | &SmlButton, 22 | text, 23 | action, 24 | SDL_Rect{ x, y, SML_BUTTON_WIDTH, SML_BUTTON_HEIGHT }, 25 | flags); 26 | } 27 | 28 | void RenderButton(UiButton *button); 29 | bool HandleMouseEventButton(const SDL_Event &event, UiButton *button); 30 | void HandleGlobalMouseUpButton(UiButton *button); 31 | 32 | } // namespace dvl 33 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/date_time_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/date_time_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_DATE_TIME_FWD_HPP 12 | #define ASIO_DETAIL_DATE_TIME_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | namespace boost { 21 | namespace date_time { 22 | 23 | template 24 | class base_time; 25 | 26 | } // namespace date_time 27 | namespace posix_time { 28 | 29 | class ptime; 30 | 31 | } // namespace posix_time 32 | } // namespace boost 33 | 34 | #endif // ASIO_DETAIL_DATE_TIME_FWD_HPP 35 | -------------------------------------------------------------------------------- /SourceS/miniwin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | // work around https://reviews.llvm.org/D51265 6 | #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) 7 | #include "macos_stdarg.h" 8 | #else 9 | #include 10 | #endif 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #ifndef _WIN32 18 | #define __int8 char 19 | #define __int16 short 20 | #define __int32 int 21 | #define __int64 long long __attribute__((aligned(8))) 22 | #endif 23 | 24 | #include "miniwin/misc.h" 25 | #include "miniwin/com.h" 26 | #include "miniwin/ui.h" 27 | #include "miniwin/thread.h" 28 | #include "miniwin/rand.h" 29 | #include "storm_full.h" 30 | 31 | #ifndef MAX_PATH 32 | #define MAX_PATH DVL_MAX_PATH 33 | #endif 34 | #ifdef DEVILUTION_ENGINE 35 | #include "miniwin/misc_macro.h" 36 | #include "miniwin/com_macro.h" 37 | #endif 38 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/impl/system_context.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // impl/system_context.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IMPL_SYSTEM_CONTEXT_HPP 12 | #define ASIO_IMPL_SYSTEM_CONTEXT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/system_executor.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | 24 | inline system_context::executor_type 25 | system_context::get_executor() ASIO_NOEXCEPT 26 | { 27 | return system_executor(); 28 | } 29 | 30 | } // namespace asio 31 | 32 | #include "asio/detail/pop_options.hpp" 33 | 34 | #endif // ASIO_IMPL_SYSTEM_CONTEXT_HPP 35 | -------------------------------------------------------------------------------- /Source/wave.cpp: -------------------------------------------------------------------------------- 1 | #include "diablo.h" 2 | #include "../3rdParty/Storm/Source/storm.h" 3 | 4 | DEVILUTION_BEGIN_NAMESPACE 5 | 6 | BOOL WCloseFile(HANDLE file) 7 | { 8 | return SFileCloseFile(file); 9 | } 10 | 11 | LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh, const char *FileName) 12 | { 13 | LONG ret; 14 | 15 | if ((ret = SFileGetFileSize(hsFile, lpFileSizeHigh)) == 0) 16 | FileErrDlg(FileName); 17 | 18 | return ret; 19 | } 20 | 21 | BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist) 22 | { 23 | if (!SFileOpenFile(FileName, phsFile)) 24 | FileErrDlg(FileName); 25 | 26 | return TRUE; 27 | } 28 | 29 | void WReadFile(HANDLE hsFile, LPVOID buf, DWORD to_read, const char *FileName) 30 | { 31 | if (SFileSetFilePointer(hsFile, 0, NULL, FILE_CURRENT) == -1) 32 | FileErrDlg(FileName); 33 | 34 | if (!SFileReadFile(hsFile, buf, to_read, NULL, NULL)) 35 | FileErrDlg(FileName); 36 | } 37 | 38 | DEVILUTION_END_NAMESPACE 39 | -------------------------------------------------------------------------------- /CMake/32bit.cmake: -------------------------------------------------------------------------------- 1 | message(STATUS "Using 32-bit toolchain") 2 | 3 | set(CMAKE_CXX_FLAGS -m32 CACHE STRING "") 4 | set(CMAKE_C_FLAGS -m32 CACHE STRING "") 5 | 6 | # Affects pkg-config 7 | set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE) 8 | # Used by pkg-config on Debian 9 | set(CMAKE_LIBRARY_ARCHITECTURE i386-linux-gnu) 10 | # Silly hack required to get the pkg-config path code to activate 11 | list(APPEND CMAKE_PREFIX_PATH /usr) 12 | 13 | # Find where 32-bit CMake modules are stored 14 | find_path(DIR NAMES cmake PATHS /usr/lib32 /usr/lib/i386-linux-gnu NO_DEFAULT_PATH) 15 | 16 | if(DIR) 17 | message(STATUS "Using 32-bit libraries from ${DIR}") 18 | # Read CMake modules from 32-bit packages 19 | # set(CMAKE_FIND_ROOT_PATH ${DIR}) 20 | # set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 21 | # set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 22 | # set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) 23 | endif() 24 | 25 | # 32-bit NASM 26 | set(CMAKE_ASM_NASM_OBJECT_FORMAT elf) 27 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/regex_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/regex_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_REGEX_FWD_HPP 12 | #define ASIO_DETAIL_REGEX_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #if defined(ASIO_HAS_BOOST_REGEX) 19 | 20 | #include 21 | #include 22 | 23 | namespace boost { 24 | 25 | template 26 | struct sub_match; 27 | 28 | template 29 | class match_results; 30 | 31 | } // namespace boost 32 | 33 | #endif // defined(ASIO_HAS_BOOST_REGEX) 34 | 35 | #endif // ASIO_DETAIL_REGEX_FWD_HPP 36 | -------------------------------------------------------------------------------- /Source/scrollrt.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __SCROLLRT_H__ 3 | #define __SCROLLRT_H__ 4 | 5 | extern int light_table_index; 6 | extern BYTE *gpBufStart; 7 | extern BYTE *gpBufEnd; 8 | extern DWORD level_cel_block; 9 | extern char arch_draw_type; 10 | extern int cel_transparency_active; 11 | extern int level_piece_id; 12 | extern void (*DrawPlrProc)(int, int, int, int, int, BYTE *, int, int, int, int); 13 | 14 | void ClearCursor(); 15 | void DrawMissile(int x, int y, int sx, int sy, BOOL pre); 16 | void DrawDeadPlayer(int x, int y, int sx, int sy); 17 | void DrawView(int StartX, int StartY); 18 | void ClearScreenBuffer(); 19 | #ifdef _DEBUG 20 | void ScrollView(); 21 | #endif 22 | void EnableFrameCount(); 23 | void scrollrt_draw_game_screen(BOOL draw_cursor); 24 | void DrawAndBlit(); 25 | 26 | /* rdata */ 27 | 28 | /* data */ 29 | 30 | /* used in 1.00 debug */ 31 | extern char *szMonModeAssert[18]; 32 | extern char *szPlrModeAssert[12]; 33 | 34 | #endif /* __SCROLLRT_H__ */ 35 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/dependent_type.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/dependent_type.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_DEPENDENT_TYPE_HPP 12 | #define ASIO_DETAIL_DEPENDENT_TYPE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | namespace detail { 24 | 25 | template 26 | struct dependent_type 27 | { 28 | typedef T type; 29 | }; 30 | 31 | } // namespace detail 32 | } // namespace asio 33 | 34 | #include "asio/detail/pop_options.hpp" 35 | 36 | #endif // ASIO_DETAIL_DEPENDENT_TYPE_HPP 37 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/impl/executor.ipp: -------------------------------------------------------------------------------- 1 | // 2 | // impl/executor.ipp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IMPL_EXECUTOR_IPP 12 | #define ASIO_IMPL_EXECUTOR_IPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/executor.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | 25 | bad_executor::bad_executor() ASIO_NOEXCEPT 26 | { 27 | } 28 | 29 | const char* bad_executor::what() const ASIO_NOEXCEPT_OR_NOTHROW 30 | { 31 | return "bad executor"; 32 | } 33 | 34 | } // namespace asio 35 | 36 | #include "asio/detail/pop_options.hpp" 37 | 38 | #endif // ASIO_IMPL_EXECUTOR_IPP 39 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/win_iocp_thread_info.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/win_iocp_thread_info.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP 12 | #define ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/thread_info_base.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | namespace detail { 24 | 25 | struct win_iocp_thread_info : public thread_info_base 26 | { 27 | }; 28 | 29 | } // namespace detail 30 | } // namespace asio 31 | 32 | #include "asio/detail/pop_options.hpp" 33 | 34 | #endif // ASIO_DETAIL_WIN_IOCP_THREAD_INFO_HPP 35 | -------------------------------------------------------------------------------- /Source/automap.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __AUTOMAP_H__ 3 | #define __AUTOMAP_H__ 4 | 5 | extern WORD automaptype[512]; 6 | extern BOOL automapflag; 7 | extern char AmShiftTab[32]; 8 | extern BOOLEAN automapview[DMAXX][DMAXY]; 9 | extern int AutoMapScale; 10 | extern int AutoMapXOfs; 11 | extern int AutoMapYOfs; 12 | extern int AutoMapPosBits; 13 | extern int AutoMapXPos; 14 | extern int AutoMapYPos; 15 | extern int AMPlayerX; 16 | extern int AMPlayerY; 17 | 18 | void InitAutomapOnce(); 19 | void InitAutomap(); 20 | void StartAutomap(); 21 | void AutomapUp(); 22 | void AutomapDown(); 23 | void AutomapLeft(); 24 | void AutomapRight(); 25 | void AutomapZoomIn(); 26 | void AutomapZoomOut(); 27 | void DrawAutomap(); 28 | void DrawAutomapType(int screen_x, int screen_y, WORD automap_type); 29 | void DrawAutomapPlr(); 30 | WORD GetAutomapType(int x, int y, BOOL view); 31 | void DrawAutomapGame(); 32 | void SetAutomapView(int x, int y); 33 | void AutomapZoomReset(); 34 | 35 | #endif /* __AUTOMAP_H__ */ 36 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/basic_streambuf_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // basic_streambuf_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_BASIC_STREAMBUF_FWD_HPP 12 | #define ASIO_BASIC_STREAMBUF_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_NO_IOSTREAM) 21 | 22 | #include 23 | 24 | namespace asio { 25 | 26 | template > 27 | class basic_streambuf; 28 | 29 | template > 30 | class basic_streambuf_ref; 31 | 32 | } // namespace asio 33 | 34 | #endif // !defined(ASIO_NO_IOSTREAM) 35 | 36 | #endif // ASIO_BASIC_STREAMBUF_FWD_HPP 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Before creating a bug report, please note that this bug tracker is only intended for the original devilution project, which is binary exact function-wise. Please report bugs in ports of devilution in their respective repositories: [Browser port](https://github.com/d07RiV/diabloweb/issues), [Crossplatform port](https://github.com/diasurgical/devilutionX/issues) 11 | 12 | **Describe the bug** 13 | A clear and concise description of what the bug is. 14 | 15 | **To Reproduce** 16 | Steps to reproduce the behavior: 17 | 1. Go to '...' 18 | 2. Click on '....' 19 | 3. Scroll down to '....' 20 | 4. See error 21 | 22 | **Expected behavior** 23 | A clear and concise description of what you expected to happen. 24 | 25 | **Screenshots** 26 | If applicable, add screenshots to help explain your problem. 27 | 28 | **Additional context** 29 | Add any other context about the problem here. 30 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ssl/detail/openssl_types.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ssl/detail/openssl_types.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SSL_DETAIL_OPENSSL_TYPES_HPP 12 | #define ASIO_SSL_DETAIL_OPENSSL_TYPES_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/socket_types.hpp" 20 | #include 21 | #include 22 | #if !defined(OPENSSL_NO_ENGINE) 23 | # include 24 | #endif // !defined(OPENSSL_NO_ENGINE) 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #endif // ASIO_SSL_DETAIL_OPENSSL_TYPES_HPP 31 | -------------------------------------------------------------------------------- /Source/nthread.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __NTHREAD_H__ 3 | #define __NTHREAD_H__ 4 | 5 | extern BYTE sgbNetUpdateRate; 6 | extern DWORD gdwMsgLenTbl[MAX_PLRS]; 7 | extern DWORD gdwDeltaBytesSec; 8 | extern BOOLEAN nthread_should_run; 9 | extern DWORD gdwTurnsInTransit; 10 | extern uintptr_t glpMsgTbl[MAX_PLRS]; 11 | extern unsigned int glpNThreadId; 12 | extern int turn_upper_bit; 13 | extern BOOLEAN sgbThreadIsRunning; 14 | extern DWORD gdwLargestMsgSize; 15 | extern DWORD gdwNormalMsgSize; 16 | extern int last_tick; 17 | 18 | void nthread_terminate_game(const char *pszFcn); 19 | DWORD nthread_send_and_recv_turn(DWORD cur_turn, int turn_delta); 20 | BOOL nthread_recv_turns(BOOL *pfSendAsync); 21 | void nthread_set_turn_upper_bit(); 22 | void nthread_start(BOOL set_turn_upper_bit); 23 | unsigned int __stdcall nthread_handler(void *); 24 | void nthread_cleanup(); 25 | void nthread_ignore_mutex(BOOL bStart); 26 | BOOL nthread_has_500ms_passed(BOOL unused); 27 | 28 | /* rdata */ 29 | 30 | #endif /* __NTHREAD_H__ */ 31 | -------------------------------------------------------------------------------- /Packaging/debian/control: -------------------------------------------------------------------------------- 1 | Source: devilutionx 2 | Section: contrib/games 3 | Priority: optional 4 | Maintainer: Debian Games Team 5 | Build-Depends: 6 | debhelper (>= 9), 7 | cmake, g++, libsdl2-mixer-dev, libsdl2-ttf-dev, libsodium-dev 8 | Standards-Version: 4.3.0 9 | Homepage: https://github.com/diasurgical/devilutionX 10 | Vcs-Git: git://git@github.com:diasurgical/devilutionX.git 11 | Vcs-Browser: https://github.com/diasurgical/devilutionX.git 12 | 13 | Package: devilutionx 14 | Architecture: any 15 | Depends: 16 | ${shlibs:Depends}, 17 | ${misc:Depends}, 18 | devilutionx-data | diablo-data | game-data-packager (>= 40), 19 | Description: Diablo build for modern operating systems 20 | Diablo by Blizzard Entertainment is undoubtedly one of 21 | the best games of the 1990s 22 | 23 | Package: diablo-data 24 | Architecture: all 25 | Depends: 26 | ${shlibs:Depends}, 27 | ${misc:Depends}, 28 | devilutionx | diablo, 29 | Description: Diablo game data 30 | Copy diabdat.mpq from your CD, or GoG install folder 31 | 32 | -------------------------------------------------------------------------------- /SourceX/storm/storm_dx.cpp: -------------------------------------------------------------------------------- 1 | #ifdef VITA 2 | #ifdef USE_SDL1 3 | #include 4 | #else 5 | #include 6 | #endif 7 | #else 8 | #include 9 | #endif 10 | 11 | #include "devilution.h" 12 | #include "miniwin/ddraw.h" 13 | #include "stubs.h" 14 | 15 | namespace dvl { 16 | 17 | void SDrawUpdatePalette(unsigned int firstentry, unsigned int numentries, PALETTEENTRY *pPalEntries, int a4) 18 | { 19 | assert(firstentry == 0); 20 | assert(numentries == 256); 21 | 22 | SDL_Color colors[256]; 23 | for (unsigned int i = firstentry; i < numentries; i++) { 24 | SDL_Color *c = &colors[i]; 25 | PALETTEENTRY *p = &pPalEntries[i]; 26 | c->r = p->peRed; 27 | c->g = p->peGreen; 28 | c->b = p->peBlue; 29 | #ifndef USE_SDL1 30 | c->a = SDL_ALPHA_OPAQUE; 31 | #endif 32 | } 33 | 34 | assert(palette); 35 | if (SDLC_SetSurfaceAndPaletteColors(pal_surface, palette, colors, firstentry, numentries) <= -1) { 36 | ErrSdl(); 37 | } 38 | pal_surface_palette_version++; 39 | } 40 | 41 | } // namespace dvl 42 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/assert.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/assert.hpp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_ASSERT_HPP 12 | #define ASIO_DETAIL_ASSERT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_BOOST_ASSERT) 21 | # include 22 | #else // defined(ASIO_HAS_BOOST_ASSERT) 23 | # include 24 | #endif // defined(ASIO_HAS_BOOST_ASSERT) 25 | 26 | #if defined(ASIO_HAS_BOOST_ASSERT) 27 | # define ASIO_ASSERT(expr) BOOST_ASSERT(expr) 28 | #else // defined(ASIO_HAS_BOOST_ASSERT) 29 | # define ASIO_ASSERT(expr) assert(expr) 30 | #endif // defined(ASIO_HAS_BOOST_ASSERT) 31 | 32 | #endif // ASIO_DETAIL_ASSERT_HPP 33 | -------------------------------------------------------------------------------- /Source/drlg_l1.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __DRLG_L1_H__ 3 | #define __DRLG_L1_H__ 4 | 5 | extern BYTE L5dungeon[80][80]; 6 | extern BYTE L5dflags[DMAXX][DMAXY]; 7 | extern BOOL setloadflag; 8 | extern int HR1; 9 | extern int HR2; 10 | extern int HR3; 11 | extern int VR1; 12 | extern int VR2; 13 | extern int VR3; 14 | extern BYTE *pSetPiece; 15 | 16 | void DRLG_Init_Globals(); 17 | void LoadL1Dungeon(char *sFileName, int vx, int vy); 18 | void LoadPreL1Dungeon(char *sFileName, int vx, int vy); 19 | void CreateL5Dungeon(DWORD rseed, int entry); 20 | 21 | /* rdata */ 22 | extern const ShadowStruct SPATS[37]; 23 | 24 | // BUGFIX: These arrays should contain an additional 0 (207 elements). 25 | extern const BYTE BSTYPES[207]; 26 | extern const BYTE L5BTYPES[207]; 27 | 28 | extern const BYTE STAIRSUP[]; 29 | extern const BYTE L5STAIRSUP[]; 30 | extern const BYTE STAIRSDOWN[]; 31 | extern const BYTE LAMPS[]; 32 | extern const BYTE PWATERIN[]; 33 | 34 | /* data */ 35 | extern BYTE L5ConvTbl[16]; 36 | 37 | #endif /* __DRLG_L1_H__ */ 38 | -------------------------------------------------------------------------------- /types.h: -------------------------------------------------------------------------------- 1 | // temporary file 2 | 3 | #ifndef _TYPES_H 4 | #define _TYPES_H 5 | 6 | #include "resource.h" 7 | 8 | #define DEVILUTION_BEGIN_NAMESPACE namespace dvl { 9 | #define DEVILUTION_END_NAMESPACE } 10 | 11 | #include "miniwin/pushdecl.inc" 12 | #include "miniwin.h" 13 | 14 | DEVILUTION_BEGIN_NAMESPACE 15 | 16 | #include 17 | #include "defs.h" 18 | #include "enums.h" 19 | #include "structs.h" 20 | 21 | // If defined, use copy protection [Default -> Defined] 22 | #if !defined(_DEBUG) && !defined(SPAWN) 23 | //#define COPYPROT 24 | #endif 25 | 26 | // If defined, don't reload for debuggers [Default -> Undefined] 27 | // Note that with patch 1.03 the command line was hosed, this is required to pass arguments to the game 28 | #ifdef _DEBUG 29 | #define DEBUGGER 30 | #endif 31 | 32 | // If defined, don't fry the CPU [Default -> Undefined] 33 | //#ifdef _DEBUG 34 | #define SLEEPFIX 35 | //#endif 36 | 37 | // If defined, fix palette glitch in Windows Vista+ [Default -> Undefined] 38 | //#define COLORFIX 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/operation.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/operation.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_OPERATION_HPP 12 | #define ASIO_DETAIL_OPERATION_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_IOCP) 21 | # include "asio/detail/win_iocp_operation.hpp" 22 | #else 23 | # include "asio/detail/scheduler_operation.hpp" 24 | #endif 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | #if defined(ASIO_HAS_IOCP) 30 | typedef win_iocp_operation operation; 31 | #else 32 | typedef scheduler_operation operation; 33 | #endif 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #endif // ASIO_DETAIL_OPERATION_HPP 39 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/reactor.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/reactor.hpp 3 | // ~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_REACTOR_HPP 12 | #define ASIO_DETAIL_REACTOR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/reactor_fwd.hpp" 19 | 20 | #if defined(ASIO_HAS_EPOLL) 21 | # include "asio/detail/epoll_reactor.hpp" 22 | #elif defined(ASIO_HAS_KQUEUE) 23 | # include "asio/detail/kqueue_reactor.hpp" 24 | #elif defined(ASIO_HAS_DEV_POLL) 25 | # include "asio/detail/dev_poll_reactor.hpp" 26 | #elif defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) 27 | # include "asio/detail/null_reactor.hpp" 28 | #else 29 | # include "asio/detail/select_reactor.hpp" 30 | #endif 31 | 32 | #endif // ASIO_DETAIL_REACTOR_HPP 33 | -------------------------------------------------------------------------------- /Source/effects.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __EFFECTS_H__ 3 | #define __EFFECTS_H__ 4 | 5 | extern int sfxdelay; 6 | extern int sfxdnum; 7 | extern HANDLE sfx_stream; 8 | extern TSFX *sfx_data_cur; 9 | 10 | BOOL effect_is_playing(int nSFX); 11 | void sfx_stop(); 12 | void InitMonsterSND(int monst); 13 | void FreeEffects(); 14 | void PlayEffect(int i, int mode); 15 | BOOL calc_snd_position(int x, int y, int *plVolume, int *plPan); 16 | void PlaySFX(int psfx); 17 | void PlaySFX_priv(TSFX *pSFX, BOOL loc, int x, int y); 18 | void stream_play(TSFX *pSFX, int lVolume, int lPan); 19 | int RndSFX(int psfx); 20 | void PlaySfxLoc(int psfx, int x, int y); 21 | void FreeMonsterSnd(); 22 | void sound_stop(); 23 | void sound_update(); 24 | void effects_update(); 25 | void effects_cleanup_sfx(); 26 | void stream_update(); 27 | void priv_sound_init(BYTE bLoadMask); 28 | void sound_init(); 29 | void __stdcall effects_play_sound(char *snd_file); 30 | 31 | /* rdata */ 32 | 33 | extern const char MonstSndChar[]; 34 | 35 | /* data */ 36 | 37 | #endif /* __EFFECTS_H__ */ 38 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/array_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/array_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_ARRAY_FWD_HPP 12 | #define ASIO_DETAIL_ARRAY_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | namespace boost { 21 | 22 | template 23 | class array; 24 | 25 | } // namespace boost 26 | 27 | // Standard library components can't be forward declared, so we'll have to 28 | // include the array header. Fortunately, it's fairly lightweight and doesn't 29 | // add significantly to the compile time. 30 | #if defined(ASIO_HAS_STD_ARRAY) 31 | # include 32 | #endif // defined(ASIO_HAS_STD_ARRAY) 33 | 34 | #endif // ASIO_DETAIL_ARRAY_FWD_HPP 35 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/array.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/array.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_ARRAY_HPP 12 | #define ASIO_DETAIL_ARRAY_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_STD_ARRAY) 21 | # include 22 | #else // defined(ASIO_HAS_STD_ARRAY) 23 | # include 24 | #endif // defined(ASIO_HAS_STD_ARRAY) 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | #if defined(ASIO_HAS_STD_ARRAY) 30 | using std::array; 31 | #else // defined(ASIO_HAS_STD_ARRAY) 32 | using boost::array; 33 | #endif // defined(ASIO_HAS_STD_ARRAY) 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #endif // ASIO_DETAIL_ARRAY_HPP 39 | -------------------------------------------------------------------------------- /Source/init.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __INIT_H__ 3 | #define __INIT_H__ 4 | 5 | extern _SNETVERSIONDATA fileinfo; 6 | extern int gbActive; 7 | extern char diablo_exe_path[MAX_PATH]; 8 | extern HANDLE hellfire_mpq; 9 | extern char patch_rt_mpq_path[MAX_PATH]; 10 | extern WNDPROC CurrentProc; 11 | extern HANDLE diabdat_mpq; 12 | extern char diabdat_mpq_path[MAX_PATH]; 13 | extern HANDLE patch_rt_mpq; 14 | extern BOOLEAN screensaver_enabled_prev; 15 | 16 | void init_cleanup(); 17 | void init_disable_screensaver(BOOLEAN disable); 18 | void init_create_window(); 19 | void init_archives(); 20 | HANDLE init_test_access(char *mpq_path, char *mpq_name, char *reg_loc, int flags, int fs); 21 | void init_get_file_info(); 22 | LRESULT __stdcall MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); 23 | void init_activate_window(HWND hWnd, BOOL bActive); 24 | WNDPROC SetWindowProc(WNDPROC NewProc); 25 | 26 | /* rdata */ 27 | 28 | /* data */ 29 | 30 | extern char gszVersionNumber[MAX_PATH]; 31 | extern char gszProductName[MAX_PATH]; 32 | 33 | #endif /* __INIT_H__ */ 34 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/functional.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/functional.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_FUNCTIONAL_HPP 12 | #define ASIO_DETAIL_FUNCTIONAL_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include 21 | 22 | #if !defined(ASIO_HAS_STD_FUNCTION) 23 | # include 24 | #endif // !defined(ASIO_HAS_STD_FUNCTION) 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | #if defined(ASIO_HAS_STD_FUNCTION) 30 | using std::function; 31 | #else // defined(ASIO_HAS_STD_FUNCTION) 32 | using boost::function; 33 | #endif // defined(ASIO_HAS_STD_FUNCTION) 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #endif // ASIO_DETAIL_FUNCTIONAL_HPP 39 | -------------------------------------------------------------------------------- /Source/palette.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __PALETTE_H__ 3 | #define __PALETTE_H__ 4 | 5 | extern PALETTEENTRY logical_palette[256]; 6 | extern PALETTEENTRY system_palette[256]; 7 | extern PALETTEENTRY orig_palette[256]; 8 | extern int gdwPalEntries; 9 | 10 | void SaveGamma(); 11 | void palette_init(); 12 | void LoadGamma(); 13 | void LoadSysPal(); 14 | void LoadPalette(char *pszFileName); 15 | void LoadRndLvlPal(int l); 16 | void ResetPal(); 17 | void IncreaseGamma(); 18 | void palette_update(); 19 | void ApplyGamma(PALETTEENTRY *dst, const PALETTEENTRY *src, int n); 20 | void DecreaseGamma(); 21 | int UpdateGamma(int gamma); 22 | void BlackPalette(); 23 | void SetFadeLevel(DWORD fadeval); 24 | void PaletteFadeIn(int fr); 25 | void PaletteFadeOut(int fr); 26 | void palette_update_caves(); 27 | void palette_update_quest_palette(int n); 28 | BOOL palette_get_colour_cycling(); 29 | BOOL palette_set_color_cycling(BOOL enabled); 30 | 31 | /* rdata */ 32 | 33 | /* data */ 34 | 35 | extern int gamma_correction; 36 | extern BOOL color_cycling_enabled; 37 | 38 | #endif /* __PALETTE_H__ */ 39 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/noncopyable.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/noncopyable.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_NONCOPYABLE_HPP 12 | #define ASIO_DETAIL_NONCOPYABLE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | namespace detail { 24 | 25 | class noncopyable 26 | { 27 | protected: 28 | noncopyable() {} 29 | ~noncopyable() {} 30 | private: 31 | noncopyable(const noncopyable&); 32 | const noncopyable& operator=(const noncopyable&); 33 | }; 34 | 35 | } // namespace detail 36 | 37 | using asio::detail::noncopyable; 38 | 39 | } // namespace asio 40 | 41 | #include "asio/detail/pop_options.hpp" 42 | 43 | #endif // ASIO_DETAIL_NONCOPYABLE_HPP 44 | -------------------------------------------------------------------------------- /3rdParty/Radon/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Dmitro Szewczuk 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/wait_op.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/wait_op.hpp 3 | // ~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_WAIT_OP_HPP 12 | #define ASIO_DETAIL_WAIT_OP_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/operation.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | namespace detail { 25 | 26 | class wait_op 27 | : public operation 28 | { 29 | public: 30 | // The error code to be passed to the completion handler. 31 | asio::error_code ec_; 32 | 33 | protected: 34 | wait_op(func_type func) 35 | : operation(func) 36 | { 37 | } 38 | }; 39 | 40 | } // namespace detail 41 | } // namespace asio 42 | 43 | #include "asio/detail/pop_options.hpp" 44 | 45 | #endif // ASIO_DETAIL_WAIT_OP_HPP 46 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/fd_set_adapter.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/fd_set_adapter.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_FD_SET_ADAPTER_HPP 12 | #define ASIO_DETAIL_FD_SET_ADAPTER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_WINDOWS_RUNTIME) 21 | 22 | #include "asio/detail/posix_fd_set_adapter.hpp" 23 | #include "asio/detail/win_fd_set_adapter.hpp" 24 | 25 | namespace asio { 26 | namespace detail { 27 | 28 | #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) 29 | typedef win_fd_set_adapter fd_set_adapter; 30 | #else 31 | typedef posix_fd_set_adapter fd_set_adapter; 32 | #endif 33 | 34 | } // namespace detail 35 | } // namespace asio 36 | 37 | #endif // !defined(ASIO_WINDOWS_RUNTIME) 38 | 39 | #endif // ASIO_DETAIL_FD_SET_ADAPTER_HPP 40 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ts/executor.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/executor.hpp 3 | // ~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_EXECUTOR_HPP 12 | #define ASIO_TS_EXECUTOR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/handler_type.hpp" 19 | #include "asio/async_result.hpp" 20 | #include "asio/associated_allocator.hpp" 21 | #include "asio/execution_context.hpp" 22 | #include "asio/is_executor.hpp" 23 | #include "asio/associated_executor.hpp" 24 | #include "asio/bind_executor.hpp" 25 | #include "asio/executor_work_guard.hpp" 26 | #include "asio/system_executor.hpp" 27 | #include "asio/executor.hpp" 28 | #include "asio/dispatch.hpp" 29 | #include "asio/post.hpp" 30 | #include "asio/defer.hpp" 31 | #include "asio/strand.hpp" 32 | #include "asio/packaged_task.hpp" 33 | #include "asio/use_future.hpp" 34 | 35 | #endif // ASIO_TS_EXECUTOR_HPP 36 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ip/host_name.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ip/host_name.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IP_HOST_NAME_HPP 12 | #define ASIO_IP_HOST_NAME_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include 20 | #include "asio/error_code.hpp" 21 | 22 | #include "asio/detail/push_options.hpp" 23 | 24 | namespace asio { 25 | namespace ip { 26 | 27 | /// Get the current host name. 28 | ASIO_DECL std::string host_name(); 29 | 30 | /// Get the current host name. 31 | ASIO_DECL std::string host_name(asio::error_code& ec); 32 | 33 | } // namespace ip 34 | } // namespace asio 35 | 36 | #include "asio/detail/pop_options.hpp" 37 | 38 | #if defined(ASIO_HEADER_ONLY) 39 | # include "asio/ip/impl/host_name.ipp" 40 | #endif // defined(ASIO_HEADER_ONLY) 41 | 42 | #endif // ASIO_IP_HOST_NAME_HPP 43 | -------------------------------------------------------------------------------- /3rdParty/StormLib/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 1999-2013 Ladislav Zezula 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/scheduler_thread_info.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/scheduler_thread_info.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_SCHEDULER_THREAD_INFO_HPP 12 | #define ASIO_DETAIL_SCHEDULER_THREAD_INFO_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/op_queue.hpp" 19 | #include "asio/detail/thread_info_base.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | namespace detail { 25 | 26 | class scheduler; 27 | class scheduler_operation; 28 | 29 | struct scheduler_thread_info : public thread_info_base 30 | { 31 | op_queue private_op_queue; 32 | long private_outstanding_work; 33 | }; 34 | 35 | } // namespace detail 36 | } // namespace asio 37 | 38 | #include "asio/detail/pop_options.hpp" 39 | 40 | #endif // ASIO_DETAIL_SCHEDULER_THREAD_INFO_HPP 41 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/null_fenced_block.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/null_fenced_block.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_NULL_FENCED_BLOCK_HPP 12 | #define ASIO_DETAIL_NULL_FENCED_BLOCK_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/noncopyable.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | namespace detail { 24 | 25 | class null_fenced_block 26 | : private noncopyable 27 | { 28 | public: 29 | enum half_or_full_t { half, full }; 30 | 31 | // Constructor. 32 | explicit null_fenced_block(half_or_full_t) 33 | { 34 | } 35 | 36 | // Destructor. 37 | ~null_fenced_block() 38 | { 39 | } 40 | }; 41 | 42 | } // namespace detail 43 | } // namespace asio 44 | 45 | #include "asio/detail/pop_options.hpp" 46 | 47 | #endif // ASIO_DETAIL_NULL_FENCED_BLOCK_HPP 48 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/resolve_op.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/resolve_op.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_RESOLVE_OP_HPP 12 | #define ASIO_DETAIL_RESOLVE_OP_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/error.hpp" 20 | #include "asio/detail/operation.hpp" 21 | 22 | #include "asio/detail/push_options.hpp" 23 | 24 | namespace asio { 25 | namespace detail { 26 | 27 | class resolve_op : public operation 28 | { 29 | public: 30 | // The error code to be passed to the completion handler. 31 | asio::error_code ec_; 32 | 33 | protected: 34 | resolve_op(func_type complete_func) 35 | : operation(complete_func) 36 | { 37 | } 38 | }; 39 | 40 | } // namespace detail 41 | } // namespace asio 42 | 43 | #include "asio/detail/pop_options.hpp" 44 | 45 | #endif // ASIO_DETAIL_RESOLVE_OP_HPP 46 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/signal_init.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/signal_init.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_SIGNAL_INIT_HPP 12 | #define ASIO_DETAIL_SIGNAL_INIT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) 21 | 22 | #include 23 | 24 | #include "asio/detail/push_options.hpp" 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | template 30 | class signal_init 31 | { 32 | public: 33 | // Constructor. 34 | signal_init() 35 | { 36 | std::signal(Signal, SIG_IGN); 37 | } 38 | }; 39 | 40 | } // namespace detail 41 | } // namespace asio 42 | 43 | #include "asio/detail/pop_options.hpp" 44 | 45 | #endif // !defined(ASIO_WINDOWS) && !defined(__CYGWIN__) 46 | 47 | #endif // ASIO_DETAIL_SIGNAL_INIT_HPP 48 | -------------------------------------------------------------------------------- /Source/loadsave.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __LOADSAVE_H__ 3 | #define __LOADSAVE_H__ 4 | 5 | extern BYTE *tbuff; 6 | 7 | void LoadGame(BOOL firstflag); 8 | char BLoad(); 9 | int WLoad(); 10 | int ILoad(); 11 | BOOL OLoad(); 12 | void LoadItems(const int n, ItemStruct *pItem); 13 | void LoadItemData(ItemStruct *pItem); 14 | void SaveItem(ItemStruct *pItem); 15 | void SaveItems(ItemStruct *pItem, const int n); 16 | 17 | void LoadPlayer(int i); 18 | void LoadMonster(int i); 19 | void LoadMissile(int i); 20 | void LoadObject(int i); 21 | void LoadItem(int i); 22 | void LoadPremium(int i); 23 | void LoadQuest(int i); 24 | void LoadLighting(int i); 25 | void LoadVision(int i); 26 | void LoadPortal(int i); 27 | void SaveGame(); 28 | void BSave(char v); 29 | void WSave(int v); 30 | void ISave(int v); 31 | void OSave(BOOL v); 32 | void SavePlayer(int i); 33 | void SaveMonster(int i); 34 | void SaveMissile(int i); 35 | void SaveObject(int i); 36 | void SaveItem(int i); 37 | void SavePremium(int i); 38 | void SaveQuest(int i); 39 | void SaveLighting(int i); 40 | void SaveVision(int i); 41 | void SavePortal(int i); 42 | void SaveLevel(); 43 | void LoadLevel(); 44 | 45 | #endif /* __LOADSAVE_H__ */ 46 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/deadline_timer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // deadline_timer.hpp 3 | // ~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DEADLINE_TIMER_HPP 12 | #define ASIO_DEADLINE_TIMER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_BOOST_DATE_TIME) \ 21 | || defined(GENERATING_DOCUMENTATION) 22 | 23 | #include "asio/detail/socket_types.hpp" // Must come before posix_time. 24 | #include "asio/basic_deadline_timer.hpp" 25 | 26 | #include 27 | 28 | namespace asio { 29 | 30 | /// Typedef for the typical usage of timer. Uses a UTC clock. 31 | typedef basic_deadline_timer deadline_timer; 32 | 33 | } // namespace asio 34 | 35 | #endif // defined(ASIO_HAS_BOOST_DATE_TIME) 36 | // || defined(GENERATING_DOCUMENTATION) 37 | 38 | #endif // ASIO_DEADLINE_TIMER_HPP 39 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/timer_scheduler.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/timer_scheduler.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_TIMER_SCHEDULER_HPP 12 | #define ASIO_DETAIL_TIMER_SCHEDULER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/timer_scheduler_fwd.hpp" 20 | 21 | #if defined(ASIO_WINDOWS_RUNTIME) 22 | # include "asio/detail/winrt_timer_scheduler.hpp" 23 | #elif defined(ASIO_HAS_IOCP) 24 | # include "asio/detail/win_iocp_io_context.hpp" 25 | #elif defined(ASIO_HAS_EPOLL) 26 | # include "asio/detail/epoll_reactor.hpp" 27 | #elif defined(ASIO_HAS_KQUEUE) 28 | # include "asio/detail/kqueue_reactor.hpp" 29 | #elif defined(ASIO_HAS_DEV_POLL) 30 | # include "asio/detail/dev_poll_reactor.hpp" 31 | #else 32 | # include "asio/detail/select_reactor.hpp" 33 | #endif 34 | 35 | #endif // ASIO_DETAIL_TIMER_SCHEDULER_HPP 36 | -------------------------------------------------------------------------------- /Source/track.cpp: -------------------------------------------------------------------------------- 1 | #include "diablo.h" 2 | 3 | DEVILUTION_BEGIN_NAMESPACE 4 | 5 | static BYTE sgbIsScrolling; 6 | static DWORD sgdwLastWalk; 7 | static BOOL sgbIsWalking; 8 | 9 | void track_process() 10 | { 11 | if (!sgbIsWalking) 12 | return; 13 | 14 | if (cursmx < 0 || cursmx >= MAXDUNX - 1 || cursmy < 0 || cursmy >= MAXDUNY - 1) 15 | return; 16 | 17 | if (plr[myplr]._pVar8 <= 6 && plr[myplr]._pmode != PM_STAND) 18 | return; 19 | 20 | if (cursmx != plr[myplr]._ptargx || cursmy != plr[myplr]._ptargy) { 21 | DWORD tick = GetTickCount(); 22 | if ((int)(tick - sgdwLastWalk) >= 300) { 23 | sgdwLastWalk = tick; 24 | NetSendCmdLoc(TRUE, CMD_WALKXY, cursmx, cursmy); 25 | if (!sgbIsScrolling) 26 | sgbIsScrolling = 1; 27 | } 28 | } 29 | } 30 | 31 | void track_repeat_walk(BOOL rep) 32 | { 33 | if (sgbIsWalking == rep) 34 | return; 35 | 36 | sgbIsWalking = rep; 37 | if (rep) { 38 | sgbIsScrolling = 0; 39 | sgdwLastWalk = GetTickCount() - 50; 40 | NetSendCmdLoc(TRUE, CMD_WALKXY, cursmx, cursmy); 41 | } else if (sgbIsScrolling) { 42 | sgbIsScrolling = 0; 43 | } 44 | } 45 | 46 | BOOL track_isscrolling() 47 | { 48 | return sgbIsScrolling; 49 | } 50 | 51 | DEVILUTION_END_NAMESPACE 52 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/reactor_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/reactor_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_REACTOR_FWD_HPP 12 | #define ASIO_DETAIL_REACTOR_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | namespace asio { 21 | namespace detail { 22 | 23 | #if defined(ASIO_HAS_IOCP) || defined(ASIO_WINDOWS_RUNTIME) 24 | typedef class null_reactor reactor; 25 | #elif defined(ASIO_HAS_IOCP) 26 | typedef class select_reactor reactor; 27 | #elif defined(ASIO_HAS_EPOLL) 28 | typedef class epoll_reactor reactor; 29 | #elif defined(ASIO_HAS_KQUEUE) 30 | typedef class kqueue_reactor reactor; 31 | #elif defined(ASIO_HAS_DEV_POLL) 32 | typedef class dev_poll_reactor reactor; 33 | #else 34 | typedef class select_reactor reactor; 35 | #endif 36 | 37 | } // namespace detail 38 | } // namespace asio 39 | 40 | #endif // ASIO_DETAIL_REACTOR_FWD_HPP 41 | -------------------------------------------------------------------------------- /Source/appfat.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __APPFAT_H__ 3 | #define __APPFAT_H__ 4 | 5 | extern char sz_error_buf[256]; 6 | extern BOOL terminating; 7 | extern int cleanup_thread_id; 8 | 9 | void TriggerBreak(); 10 | #ifdef _DEBUG 11 | LONG __stdcall BreakFilter(PEXCEPTION_POINTERS pExc); 12 | #endif 13 | char *GetErrorStr(DWORD error_code); 14 | #define TraceLastError SDL_GetError 15 | void __cdecl app_fatal(const char *pszFmt, ...); 16 | void MsgBox(const char *pszFmt, va_list va); 17 | void FreeDlg(); 18 | void __cdecl DrawDlg(char *pszFmt, ...); 19 | #ifdef _DEBUG 20 | void assert_fail(int nLineNo, const char *pszFile, const char *pszFail); 21 | #endif 22 | void DDErrMsg(DWORD error_code, int log_line_nr, char *log_file_path); 23 | void DSErrMsg(DWORD error_code, int log_line_nr, char *log_file_path); 24 | void center_window(HWND hDlg); 25 | void ErrDlg(const char *title, const char *error, char *log_file_path, int log_line_nr); 26 | BOOL __stdcall FuncDlg(HWND hDlg, UINT uMsg, WPARAM wParam, char *text); 27 | void TextDlg(HWND hDlg, char *text); 28 | void FileErrDlg(const char *error); 29 | void DiskFreeDlg(char *error); 30 | void InsertCDDlg(const char *fileName); 31 | void DirErrorDlg(char *error); 32 | 33 | #endif /* __APPFAT_H__ */ 34 | -------------------------------------------------------------------------------- /Source/towners.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __TOWNERS_H__ 3 | #define __TOWNERS_H__ 4 | 5 | extern TownerStruct towner[16]; 6 | 7 | int GetActiveTowner(int t); 8 | void SetTownerGPtrs(BYTE *pData, BYTE **pAnim); 9 | void NewTownerAnim(int tnum, BYTE *pAnim, int numFrames, int Delay); 10 | void InitTownerInfo(int i, int w, int sel, int t, int x, int y, int ao, int tp); 11 | void InitQstSnds(int i); 12 | void InitSmith(); 13 | void InitBarOwner(); 14 | void InitTownDead(); 15 | void InitWitch(); 16 | void InitBarmaid(); 17 | void InitBoy(); 18 | void InitHealer(); 19 | void InitTeller(); 20 | void InitDrunk(); 21 | void InitCows(); 22 | void InitTowners(); 23 | void FreeTownerGFX(); 24 | void TownCtrlMsg(int i); 25 | void TownBlackSmith(); 26 | void TownBarOwner(); 27 | void TownDead(); 28 | void TownHealer(); 29 | void TownStory(); 30 | void TownDrunk(); 31 | void TownBoy(); 32 | void TownWitch(); 33 | void TownBarMaid(); 34 | void TownCow(); 35 | void ProcessTowners(); 36 | ItemStruct *PlrHasItem(int pnum, int item, int &i); 37 | void TownerTalk(int first, int t); 38 | void TalkToTowner(int p, int t); 39 | void CowSFX(int pnum); 40 | 41 | /* data */ 42 | 43 | extern QuestTalkData Qtalklist[11]; 44 | 45 | #endif /* __TOWNERS_H__ */ 46 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/thread_context.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/thread_context.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_THREAD_CONTEXT_HPP 12 | #define ASIO_DETAIL_THREAD_CONTEXT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include 19 | #include 20 | #include "asio/detail/call_stack.hpp" 21 | 22 | #include "asio/detail/push_options.hpp" 23 | 24 | namespace asio { 25 | namespace detail { 26 | 27 | class thread_info_base; 28 | 29 | // Base class for things that manage threads (scheduler, win_iocp_io_context). 30 | class thread_context 31 | { 32 | public: 33 | // Per-thread call stack to track the state of each thread in the context. 34 | typedef call_stack thread_call_stack; 35 | }; 36 | 37 | } // namespace detail 38 | } // namespace asio 39 | 40 | #include "asio/detail/pop_options.hpp" 41 | 42 | #endif // ASIO_DETAIL_THREAD_CONTEXT_HPP 43 | -------------------------------------------------------------------------------- /3rdParty/PKWare/PKWare.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /Source/sound.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __SOUND_H__ 3 | #define __SOUND_H__ 4 | 5 | extern IDirectSoundBuffer *DSBs[8]; 6 | extern BOOLEAN gbSndInited; 7 | extern HMODULE hDsound_dll; 8 | 9 | void snd_update(BOOL bStopAll); 10 | void snd_stop_snd(TSnd *pSnd); 11 | BOOL snd_playing(TSnd *pSnd); 12 | void snd_play_snd(TSnd *pSnd, int lVolume, int lPan); 13 | IDirectSoundBuffer *sound_dup_channel(IDirectSoundBuffer *DSB); 14 | BOOL sound_file_reload(TSnd *sound_file, IDirectSoundBuffer *DSB); 15 | TSnd *sound_file_load(char *path); 16 | void sound_CreateSoundBuffer(TSnd *sound_file); 17 | void sound_file_cleanup(TSnd *sound_file); 18 | void snd_init(HWND hWnd); 19 | void sound_load_volume(char *value_name, int *value); 20 | void sound_create_primary_buffer(HANDLE music_track); 21 | void sound_cleanup(); 22 | void sound_store_volume(char *key, int value); 23 | void music_stop(); 24 | void music_start(int nTrack); 25 | void sound_disable_music(BOOL disable); 26 | int sound_get_or_set_music_volume(int volume); 27 | int sound_get_or_set_sound_volume(int volume); 28 | 29 | /* rdata */ 30 | 31 | /* data */ 32 | 33 | extern BOOLEAN gbMusicOn; 34 | extern BOOLEAN gbSoundOn; 35 | extern BOOLEAN gbDupSounds; 36 | extern char unk_volume[4][2]; 37 | 38 | #endif /* __SOUND_H__ */ 39 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/signal_op.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/signal_op.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_SIGNAL_OP_HPP 12 | #define ASIO_DETAIL_SIGNAL_OP_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/operation.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | namespace detail { 25 | 26 | class signal_op 27 | : public operation 28 | { 29 | public: 30 | // The error code to be passed to the completion handler. 31 | asio::error_code ec_; 32 | 33 | // The signal number to be passed to the completion handler. 34 | int signal_number_; 35 | 36 | protected: 37 | signal_op(func_type func) 38 | : operation(func), 39 | signal_number_(0) 40 | { 41 | } 42 | }; 43 | 44 | } // namespace detail 45 | } // namespace asio 46 | 47 | #include "asio/detail/pop_options.hpp" 48 | 49 | #endif // ASIO_DETAIL_SIGNAL_OP_HPP 50 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ip/resolver_query_base.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ip/resolver_query_base.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IP_RESOLVER_QUERY_BASE_HPP 12 | #define ASIO_IP_RESOLVER_QUERY_BASE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/ip/resolver_base.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | namespace ip { 25 | 26 | /// The resolver_query_base class is used as a base for the 27 | /// basic_resolver_query class templates to provide a common place to define 28 | /// the flag constants. 29 | class resolver_query_base : public resolver_base 30 | { 31 | protected: 32 | /// Protected destructor to prevent deletion through this type. 33 | ~resolver_query_base() 34 | { 35 | } 36 | }; 37 | 38 | } // namespace ip 39 | } // namespace asio 40 | 41 | #include "asio/detail/pop_options.hpp" 42 | 43 | #endif // ASIO_IP_RESOLVER_QUERY_BASE_HPP 44 | -------------------------------------------------------------------------------- /Source/drlg_l4.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __DRLG_L4_H__ 3 | #define __DRLG_L4_H__ 4 | 5 | extern int diabquad1x; 6 | extern int diabquad1y; 7 | extern int diabquad3x; 8 | extern int diabquad3y; 9 | extern int diabquad2x; 10 | extern int diabquad2y; 11 | extern int diabquad4x; 12 | extern int diabquad4y; 13 | extern BOOL hallok[20]; 14 | extern int l4holdx; 15 | extern int l4holdy; 16 | extern int SP4x1; 17 | extern int SP4x2; 18 | extern int SP4y1; 19 | extern int SP4y2; 20 | extern BYTE L4dungeon[80][80]; 21 | extern BYTE dung[20][20]; 22 | //int dword_52A4DC; 23 | 24 | void DRLG_LoadL4SP(); 25 | void DRLG_FreeL4SP(); 26 | void DRLG_L4SetSPRoom(int rx1, int ry1); 27 | void L4SaveQuads(); 28 | void DRLG_L4SetRoom(BYTE *pSetPiece, int rx1, int ry1); 29 | void DRLG_LoadDiabQuads(BOOL preflag); 30 | BOOL IsDURWall(char d); 31 | BOOL IsDLLWall(char dd); 32 | void L4FixRim(); 33 | void DRLG_L4GeneralFix(); 34 | void CreateL4Dungeon(DWORD rseed, int entry); 35 | 36 | /* rdata */ 37 | extern const BYTE L4ConvTbl[16]; 38 | extern const BYTE L4USTAIRS[42]; 39 | extern const BYTE L4TWARP[42]; 40 | extern const BYTE L4DSTAIRS[52]; 41 | extern const BYTE L4PENTA[52]; 42 | extern const BYTE L4PENTA2[52]; 43 | extern const BYTE L4BTYPES[140]; 44 | 45 | #endif /* __DRLG_L4_H__ */ 46 | -------------------------------------------------------------------------------- /SourceX/dvlnet/tcp_client.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "dvlnet/packet.h" 11 | #include "dvlnet/frame_queue.h" 12 | #include "dvlnet/base.h" 13 | #include "dvlnet/tcp_server.h" 14 | 15 | namespace dvl { 16 | namespace net { 17 | 18 | class tcp_client : public base { 19 | public: 20 | int create(std::string addrstr, std::string passwd); 21 | int join(std::string addrstr, std::string passwd); 22 | virtual bool SNetLeaveGame(int type); 23 | 24 | constexpr static unsigned short default_port = 6112; 25 | 26 | virtual void poll(); 27 | virtual void send(packet &pkt); 28 | 29 | private: 30 | frame_queue recv_queue; 31 | buffer_t recv_buffer = buffer_t(frame_queue::max_frame_size); 32 | 33 | asio::io_context ioc; 34 | asio::ip::tcp::socket sock = asio::ip::tcp::socket(ioc); 35 | std::unique_ptr local_server; // must be declared *after* ioc 36 | 37 | void handle_recv(const asio::error_code &error, size_t bytes_read); 38 | void start_recv(); 39 | void handle_send(const asio::error_code &error, size_t bytes_sent); 40 | }; 41 | 42 | } // namespace net 43 | } // namespace dvl 44 | -------------------------------------------------------------------------------- /Source/gamemenu.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __GAMEMENU_H__ 3 | #define __GAMEMENU_H__ 4 | 5 | void gamemenu_previous(); 6 | void gamemenu_enable_single(TMenuItem *pMenuItems); 7 | void gamemenu_enable_multi(TMenuItem *pMenuItems); 8 | void gamemenu_off(); 9 | void gamemenu_handle_previous(); 10 | void j_gamemenu_previous(BOOL bActivate); 11 | void gamemenu_new_game(BOOL bActivate); 12 | void gamemenu_quit_game(BOOL bActivate); 13 | void gamemenu_load_game(BOOL bActivate); 14 | void gamemenu_save_game(BOOL bActivate); 15 | void gamemenu_restart_town(BOOL bActivate); 16 | void gamemenu_options(BOOL bActivate); 17 | void gamemenu_get_music(); 18 | void gamemenu_sound_music_toggle(char **names, TMenuItem *menu_item, int gamma); 19 | void gamemenu_get_sound(); 20 | void gamemenu_get_color_cycling(); 21 | void gamemenu_get_gamma(); 22 | void gamemenu_music_volume(BOOL bActivate); 23 | int gamemenu_slider_music_sound(TMenuItem *menu_item); 24 | void gamemenu_sound_volume(BOOL bActivate); 25 | void gamemenu_gamma(BOOL bActivate); 26 | int gamemenu_slider_gamma(); 27 | void gamemenu_color_cycling(BOOL bActivate); 28 | 29 | /* rdata */ 30 | extern char *music_toggle_names[]; 31 | extern char *sound_toggle_names[]; 32 | extern char *color_cycling_toggle_names[]; 33 | 34 | #endif /* __GAMEMENU_H__ */ 35 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/future.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/future.hpp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_FUTURE_HPP 12 | #define ASIO_DETAIL_FUTURE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #if defined(ASIO_HAS_STD_FUTURE) 20 | # include 21 | // Even though the future header is available, libstdc++ may not implement the 22 | // std::future class itself. However, we need to have already included the 23 | // future header to reliably test for _GLIBCXX_HAS_GTHREADS. 24 | # if defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX) 25 | # if defined(_GLIBCXX_HAS_GTHREADS) 26 | # define ASIO_HAS_STD_FUTURE_CLASS 1 27 | # endif // defined(_GLIBCXX_HAS_GTHREADS) 28 | # else // defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX) 29 | # define ASIO_HAS_STD_FUTURE_CLASS 1 30 | # endif // defined(__GNUC__) && !defined(ASIO_HAS_CLANG_LIBCXX) 31 | #endif // defined(ASIO_HAS_STD_FUTURE) 32 | 33 | #endif // ASIO_DETAIL_FUTURE_HPP 34 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/impl/posix_mutex.ipp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/impl/posix_mutex.ipp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP 12 | #define ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_PTHREADS) 21 | 22 | #include "asio/detail/posix_mutex.hpp" 23 | #include "asio/detail/throw_error.hpp" 24 | #include "asio/error.hpp" 25 | 26 | #include "asio/detail/push_options.hpp" 27 | 28 | namespace asio { 29 | namespace detail { 30 | 31 | posix_mutex::posix_mutex() 32 | { 33 | int error = ::pthread_mutex_init(&mutex_, 0); 34 | asio::error_code ec(error, 35 | asio::error::get_system_category()); 36 | asio::detail::throw_error(ec, "mutex"); 37 | } 38 | 39 | } // namespace detail 40 | } // namespace asio 41 | 42 | #include "asio/detail/pop_options.hpp" 43 | 44 | #endif // defined(ASIO_HAS_PTHREADS) 45 | 46 | #endif // ASIO_DETAIL_IMPL_POSIX_MUTEX_IPP 47 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/timer_scheduler_fwd.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/timer_scheduler_fwd.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP 12 | #define ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | namespace asio { 21 | namespace detail { 22 | 23 | #if defined(ASIO_WINDOWS_RUNTIME) 24 | typedef class winrt_timer_scheduler timer_scheduler; 25 | #elif defined(ASIO_HAS_IOCP) 26 | typedef class win_iocp_io_context timer_scheduler; 27 | #elif defined(ASIO_HAS_EPOLL) 28 | typedef class epoll_reactor timer_scheduler; 29 | #elif defined(ASIO_HAS_KQUEUE) 30 | typedef class kqueue_reactor timer_scheduler; 31 | #elif defined(ASIO_HAS_DEV_POLL) 32 | typedef class dev_poll_reactor timer_scheduler; 33 | #else 34 | typedef class select_reactor timer_scheduler; 35 | #endif 36 | 37 | } // namespace detail 38 | } // namespace asio 39 | 40 | #endif // ASIO_DETAIL_TIMER_SCHEDULER_FWD_HPP 41 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ip/impl/basic_endpoint.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ip/impl/basic_endpoint.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IP_IMPL_BASIC_ENDPOINT_HPP 12 | #define ASIO_IP_IMPL_BASIC_ENDPOINT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #if !defined(ASIO_NO_IOSTREAM) 19 | 20 | #include "asio/detail/throw_error.hpp" 21 | 22 | #include "asio/detail/push_options.hpp" 23 | 24 | namespace asio { 25 | namespace ip { 26 | 27 | template 28 | std::basic_ostream& operator<<( 29 | std::basic_ostream& os, 30 | const basic_endpoint& endpoint) 31 | { 32 | asio::ip::detail::endpoint tmp_ep(endpoint.address(), endpoint.port()); 33 | return os << tmp_ep.to_string().c_str(); 34 | } 35 | 36 | } // namespace ip 37 | } // namespace asio 38 | 39 | #include "asio/detail/pop_options.hpp" 40 | 41 | #endif // !defined(ASIO_NO_IOSTREAM) 42 | 43 | #endif // ASIO_IP_IMPL_BASIC_ENDPOINT_HPP 44 | -------------------------------------------------------------------------------- /Source/mainmenu.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __MAINMENU_H__ 3 | #define __MAINMENU_H__ 4 | 5 | extern char gszHero[16]; 6 | 7 | void mainmenu_refresh_music(); 8 | void __stdcall mainmenu_change_name(int arg1, int arg2, int arg3, int arg4, char *name_1, char *name_2); 9 | int __stdcall mainmenu_select_hero_dialog( 10 | const _SNETPROGRAMDATA *client_info, 11 | const _SNETPLAYERDATA *user_info, 12 | const _SNETUIDATA *ui_info, 13 | const _SNETVERSIONDATA *fileinfo, 14 | DWORD mode, // 4 chars, e.g. 'IPXN', 'BNET' etc. */ 15 | char *cname, DWORD clen, // character name will be copied here 16 | char *cdesc, DWORD cdlen, // character "description" will be copied here (used to advertise games) 17 | BOOL *multi); // new character? - unsure about this 18 | void mainmenu_loop(); 19 | BOOL mainmenu_single_player(); 20 | BOOL mainmenu_init_menu(int type); 21 | BOOL mainmenu_multi_player(); 22 | #ifdef VITA 23 | BOOL mainmenu_set_vita_video_mode(); 24 | extern void DvlVitaIntSetting(const char *valuename, int *value, bool save); 25 | extern SDL_Renderer *renderer; 26 | extern SDL_Surface *GetOutputSurface(); 27 | #endif 28 | void mainmenu_play_intro(); 29 | 30 | /* rdata */ 31 | 32 | /* data */ 33 | 34 | extern int menu_music_track_id; 35 | 36 | #endif /* __MAINMENU_H__ */ 37 | -------------------------------------------------------------------------------- /Source/trigs.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __TRIGS_H__ 3 | #define __TRIGS_H__ 4 | 5 | extern BOOL townwarps[3]; 6 | extern BOOL trigflag; 7 | extern int numtrigs; 8 | extern TriggerStruct trigs[MAXTRIGGERS]; 9 | extern int TWarpFrom; 10 | 11 | void InitNoTriggers(); 12 | void InitTownTriggers(); 13 | void InitL1Triggers(); 14 | void InitL2Triggers(); 15 | void InitL3Triggers(); 16 | void InitL4Triggers(); 17 | void InitSKingTriggers(); 18 | void InitSChambTriggers(); 19 | void InitPWaterTriggers(); 20 | void InitVPTriggers(); 21 | BOOL ForceTownTrig(); 22 | BOOL ForceL1Trig(); 23 | BOOL ForceL2Trig(); 24 | BOOL ForceL3Trig(); 25 | BOOL ForceL4Trig(); 26 | void Freeupstairs(); 27 | BOOL ForceSKingTrig(); 28 | BOOL ForceSChambTrig(); 29 | BOOL ForcePWaterTrig(); 30 | void CheckTrigForce(); 31 | void CheckTriggers(); 32 | 33 | /* rdata */ 34 | 35 | extern int TownDownList[11]; 36 | extern int TownWarp1List[13]; 37 | extern int L1UpList[12]; 38 | extern int L1DownList[10]; 39 | extern int L2UpList[3]; 40 | extern int L2DownList[5]; 41 | extern int L2TWarpUpList[3]; 42 | extern int L3UpList[15]; 43 | extern int L3DownList[9]; 44 | extern int L3TWarpUpList[14]; 45 | extern int L4UpList[4]; 46 | extern int L4DownList[6]; 47 | extern int L4TWarpUpList[4]; 48 | extern int L4PentaList[33]; 49 | 50 | #endif /* __TRIGS_H__ */ 51 | -------------------------------------------------------------------------------- /Source/tmsg.cpp: -------------------------------------------------------------------------------- 1 | #include "diablo.h" 2 | 3 | DEVILUTION_BEGIN_NAMESPACE 4 | 5 | static TMsg *sgpTimedMsgHead; 6 | 7 | int tmsg_get(BYTE *pbMsg, DWORD dwMaxLen) 8 | { 9 | int len; 10 | TMsg *head; 11 | 12 | if (!sgpTimedMsgHead) 13 | return 0; 14 | 15 | if ((int)(sgpTimedMsgHead->hdr.dwTime - GetTickCount()) >= 0) 16 | return 0; 17 | head = sgpTimedMsgHead; 18 | sgpTimedMsgHead = head->hdr.pNext; 19 | len = head->hdr.bLen; 20 | // BUGFIX: ignores dwMaxLen 21 | memcpy(pbMsg, head->body, len); 22 | mem_free_dbg(head); 23 | return len; 24 | } 25 | 26 | void tmsg_add(BYTE *pbMsg, BYTE bLen) 27 | { 28 | TMsg **tail; 29 | 30 | TMsg *msg = (TMsg *)DiabloAllocPtr(bLen + sizeof(*msg)); 31 | msg->hdr.pNext = NULL; 32 | msg->hdr.dwTime = GetTickCount() + 500; 33 | msg->hdr.bLen = bLen; 34 | memcpy(msg->body, pbMsg, bLen); 35 | for (tail = &sgpTimedMsgHead; *tail; tail = &(*tail)->hdr.pNext) { 36 | ; 37 | } 38 | *tail = msg; 39 | } 40 | 41 | void tmsg_start() 42 | { 43 | /// ASSERT: assert(! sgpTimedMsgHead); 44 | } 45 | 46 | void *tmsg_cleanup() 47 | { 48 | TMsg *next; 49 | 50 | while (sgpTimedMsgHead) { 51 | next = sgpTimedMsgHead->hdr.pNext; 52 | MemFreeDbg(sgpTimedMsgHead); 53 | sgpTimedMsgHead = next; 54 | } 55 | return sgpTimedMsgHead; 56 | } 57 | 58 | DEVILUTION_END_NAMESPACE 59 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/impl/posix_tss_ptr.ipp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/impl/posix_tss_ptr.ipp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP 12 | #define ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_PTHREADS) 21 | 22 | #include "asio/detail/posix_tss_ptr.hpp" 23 | #include "asio/detail/throw_error.hpp" 24 | #include "asio/error.hpp" 25 | 26 | #include "asio/detail/push_options.hpp" 27 | 28 | namespace asio { 29 | namespace detail { 30 | 31 | void posix_tss_ptr_create(pthread_key_t& key) 32 | { 33 | int error = ::pthread_key_create(&key, 0); 34 | asio::error_code ec(error, 35 | asio::error::get_system_category()); 36 | asio::detail::throw_error(ec, "tss"); 37 | } 38 | 39 | } // namespace detail 40 | } // namespace asio 41 | 42 | #include "asio/detail/pop_options.hpp" 43 | 44 | #endif // defined(ASIO_HAS_PTHREADS) 45 | 46 | #endif // ASIO_DETAIL_IMPL_POSIX_TSS_PTR_IPP 47 | -------------------------------------------------------------------------------- /Source/path.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __PATH_H__ 3 | #define __PATH_H__ 4 | 5 | extern PATHNODE path_nodes[MAXPATHNODES]; 6 | extern int gdwCurPathStep; 7 | extern int gdwCurNodes; 8 | extern int pnode_vals[25]; 9 | extern PATHNODE *pnode_ptr; 10 | extern PATHNODE *pnode_tblptr[MAXPATHNODES]; 11 | extern PATHNODE *path_2_nodes; 12 | extern PATHNODE path_unusednodes[MAXPATHNODES]; 13 | 14 | int FindPath(BOOL (*PosOk)(int, int, int), int PosOkArg, int sx, int sy, int dx, int dy, char *path); 15 | int path_get_h_cost(int sx, int sy, int dx, int dy); 16 | int path_check_equal(PATHNODE *pPath, int dx, int dy); 17 | PATHNODE *GetNextPath(); 18 | BOOL path_solid_pieces(PATHNODE *pPath, int dx, int dy); 19 | BOOL path_get_path(BOOL (*PosOk)(int, int, int), int PosOkArg, PATHNODE *pPath, int x, int y); 20 | BOOL path_parent_path(PATHNODE *pPath, int dx, int dy, int sx, int sy); 21 | PATHNODE *path_get_node1(int dx, int dy); 22 | PATHNODE *path_get_node2(int dx, int dy); 23 | void path_next_node(PATHNODE *pPath); 24 | void path_set_coords(PATHNODE *pPath); 25 | void path_push_active_step(PATHNODE *pPath); 26 | PATHNODE *path_pop_active_step(); 27 | PATHNODE *path_new_step(); 28 | 29 | /* rdata */ 30 | 31 | extern const char pathxdir[8]; 32 | extern const char pathydir[8]; 33 | 34 | /* data */ 35 | extern char path_directions[9]; 36 | 37 | #endif /* __PATH_H__ */ 38 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ssl/stream_base.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ssl/stream_base.hpp 3 | // ~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SSL_STREAM_BASE_HPP 12 | #define ASIO_SSL_STREAM_BASE_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | namespace ssl { 24 | 25 | /// The stream_base class is used as a base for the asio::ssl::stream 26 | /// class template so that we have a common place to define various enums. 27 | class stream_base 28 | { 29 | public: 30 | /// Different handshake types. 31 | enum handshake_type 32 | { 33 | /// Perform handshaking as a client. 34 | client, 35 | 36 | /// Perform handshaking as a server. 37 | server 38 | }; 39 | 40 | protected: 41 | /// Protected destructor to prevent deletion through this type. 42 | ~stream_base() 43 | { 44 | } 45 | }; 46 | 47 | } // namespace ssl 48 | } // namespace asio 49 | 50 | #include "asio/detail/pop_options.hpp" 51 | 52 | #endif // ASIO_SSL_STREAM_BASE_HPP 53 | -------------------------------------------------------------------------------- /SourceX/dvlnet/loopback.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "devilution.h" 7 | #include "dvlnet/abstract_net.h" 8 | 9 | namespace dvl { 10 | namespace net { 11 | 12 | class loopback : public abstract_net { 13 | private: 14 | std::queue message_queue; 15 | buffer_t message_last; 16 | const int plr_single = 0; 17 | 18 | public: 19 | virtual int create(std::string addrstr, std::string passwd); 20 | virtual int join(std::string addrstr, std::string passwd); 21 | virtual bool SNetReceiveMessage(int *sender, char **data, int *size); 22 | virtual bool SNetSendMessage(int dest, void *data, unsigned int size); 23 | virtual bool SNetReceiveTurns(char **data, unsigned int *size, 24 | DWORD *status); 25 | virtual bool SNetSendTurn(char *data, unsigned int size); 26 | virtual int SNetGetProviderCaps(struct _SNETCAPS *caps); 27 | virtual bool SNetRegisterEventHandler(event_type evtype, 28 | SEVTHANDLER func); 29 | virtual bool SNetUnregisterEventHandler(event_type evtype, 30 | SEVTHANDLER func); 31 | virtual bool SNetLeaveGame(int type); 32 | virtual bool SNetDropPlayer(int playerid, DWORD flags); 33 | virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns); 34 | virtual bool SNetGetTurnsInTransit(int *turns); 35 | virtual void setup_gameinfo(buffer_t info); 36 | }; 37 | 38 | } // namespace net 39 | } // namespace dvl 40 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/steady_timer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // steady_timer.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_STEADY_TIMER_HPP 12 | #define ASIO_STEADY_TIMER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) 21 | 22 | #include "asio/basic_waitable_timer.hpp" 23 | #include "asio/detail/chrono.hpp" 24 | 25 | namespace asio { 26 | 27 | /// Typedef for a timer based on the steady clock. 28 | /** 29 | * This typedef uses the C++11 @c <chrono> standard library facility, if 30 | * available. Otherwise, it may use the Boost.Chrono library. To explicitly 31 | * utilise Boost.Chrono, use the basic_waitable_timer template directly: 32 | * @code 33 | * typedef basic_waitable_timer timer; 34 | * @endcode 35 | */ 36 | typedef basic_waitable_timer steady_timer; 37 | 38 | } // namespace asio 39 | 40 | #endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) 41 | 42 | #endif // ASIO_STEADY_TIMER_HPP 43 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/system_timer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // system_timer.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SYSTEM_TIMER_HPP 12 | #define ASIO_SYSTEM_TIMER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) 21 | 22 | #include "asio/basic_waitable_timer.hpp" 23 | #include "asio/detail/chrono.hpp" 24 | 25 | namespace asio { 26 | 27 | /// Typedef for a timer based on the system clock. 28 | /** 29 | * This typedef uses the C++11 @c <chrono> standard library facility, if 30 | * available. Otherwise, it may use the Boost.Chrono library. To explicitly 31 | * utilise Boost.Chrono, use the basic_waitable_timer template directly: 32 | * @code 33 | * typedef basic_waitable_timer timer; 34 | * @endcode 35 | */ 36 | typedef basic_waitable_timer system_timer; 37 | 38 | } // namespace asio 39 | 40 | #endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) 41 | 42 | #endif // ASIO_SYSTEM_TIMER_HPP 43 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/button.cpp: -------------------------------------------------------------------------------- 1 | #include "DiabloUI/button.h" 2 | #include "DiabloUI/art_draw.h" 3 | #include "DiabloUI/text_draw.h" 4 | #include "DiabloUI/errorart.h" 5 | 6 | namespace dvl { 7 | 8 | Art SmlButton; 9 | 10 | void LoadSmlButtonArt() 11 | { 12 | LoadArt(&SmlButton, btnData, SML_BUTTON_WIDTH, SML_BUTTON_HEIGHT * 2, 2); 13 | } 14 | 15 | void RenderButton(UiButton *button) 16 | { 17 | int frame; 18 | if (button->pressed) { 19 | frame = UiButton::PRESSED; 20 | } else { 21 | frame = UiButton::DEFAULT; 22 | } 23 | DrawArt(button->rect.x, button->rect.y, button->art, frame, button->rect.w, button->rect.h); 24 | 25 | SDL_Rect text_rect = button->rect; 26 | if (!button->pressed) 27 | --text_rect.y; 28 | DrawTTF(button->text, text_rect, UIS_CENTER, 29 | SDL_Color{ 243, 243, 243, 0 }, SDL_Color{ 0, 0, 0, 0 }, &button->render_cache); 30 | } 31 | 32 | bool HandleMouseEventButton(const SDL_Event &event, UiButton *button) 33 | { 34 | if (event.button.button != SDL_BUTTON_LEFT) 35 | return false; 36 | switch (event.type) { 37 | case SDL_MOUSEBUTTONUP: 38 | button->action(); 39 | return true; 40 | case SDL_MOUSEBUTTONDOWN: 41 | button->pressed = true; 42 | return true; 43 | default: 44 | return false; 45 | } 46 | } 47 | 48 | void HandleGlobalMouseUpButton(UiButton *button) 49 | { 50 | button->pressed = false; 51 | } 52 | 53 | } // namespace dvl 54 | -------------------------------------------------------------------------------- /SourceX/DiabloUI/text.cpp: -------------------------------------------------------------------------------- 1 | #include "DiabloUI/text.h" 2 | 3 | namespace dvl { 4 | 5 | std::size_t GetArtStrWidth(const char *str, std::size_t size) 6 | { 7 | int strWidth = 0; 8 | 9 | for (size_t i = 0, n = strlen(str); i < n; i++) { 10 | BYTE w = FontTables[size][*(BYTE *)&str[i] + 2]; 11 | if (w) 12 | strWidth += w; 13 | else 14 | strWidth += FontTables[size][0]; 15 | } 16 | 17 | return strWidth; 18 | } 19 | 20 | void WordWrapArtStr(char *text, std::size_t width) 21 | { 22 | const std::size_t len = strlen(text); 23 | std::size_t lineStart = 0; 24 | for (std::size_t i = 0; i <= len; i++) { 25 | if (text[i] == '\n') { 26 | lineStart = i + 1; 27 | continue; 28 | } else if (text[i] != ' ' && i != len) { 29 | continue; 30 | } 31 | 32 | if (i != len) 33 | text[i] = '\0'; 34 | if (GetArtStrWidth(&text[lineStart], AFT_SMALL) <= width) { 35 | if (i != len) 36 | text[i] = ' '; 37 | continue; 38 | } 39 | 40 | std::size_t j; 41 | for (j = i; j >= lineStart; j--) { 42 | if (text[j] == ' ') { 43 | break; // Scan for previous space 44 | } 45 | } 46 | 47 | if (j == lineStart) { // Single word longer then width 48 | if (i == len) 49 | break; 50 | j = i; 51 | } 52 | 53 | if (i != len) 54 | text[i] = ' '; 55 | text[j] = '\n'; 56 | lineStart = j + 1; 57 | } 58 | } 59 | 60 | } // namespace dvl 61 | -------------------------------------------------------------------------------- /vita/sce_sys/livearea/contents/template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |   5 | 6 |     bg.png 7 | 8 | 9 | 10 | startup.png 11 | 12 | 13 | 14 | 15 | logo0.png 16 | 17 | 18 | 19 | 20 | 21 | 22 | devilutionX for PSVita 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | by Gokuhs 31 | 32 | https://github.com/gokuhs 33 | 34 | 35 | 36 | 37 | 38 | 39 | v0.5.0 - Vita - Beta2 40 | 41 | https://github.com/gokuhs/devilutionX/releases/latest 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /3rdParty/asio/LICENSE_1_0.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /Packaging/debian/diablo-data.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for diablo-data 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see http://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | # Source debconf library. 21 | . /usr/share/debconf/confmodule 22 | 23 | 24 | case "$1" in 25 | configure) 26 | 27 | test -f "/usr/share/games/diablo/diabdat.mpq" && chgrp games /usr/share/games/diablo/diabdat.mpq || true 28 | test -f "/usr/share/games/diablo/diabdat.mpq" && chmod g+wr /usr/share/games/diablo/diabdat.mpq || true 29 | 30 | ;; 31 | 32 | abort-upgrade|abort-remove|abort-deconfigure) 33 | ;; 34 | 35 | *) 36 | echo "postinst called with unknown argument \`$1'" >&2 37 | exit 1 38 | ;; 39 | esac 40 | 41 | # dh_installdeb will replace this with shell code automatically 42 | # generated by other debhelper scripts. 43 | 44 | exit 0 45 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/is_executor.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // is_executor.hpp 3 | // ~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IS_EXECUTOR_HPP 12 | #define ASIO_IS_EXECUTOR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/is_executor.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | 25 | /// The is_executor trait detects whether a type T meets the Executor type 26 | /// requirements. 27 | /** 28 | * Class template @c is_executor is a UnaryTypeTrait that is derived from @c 29 | * true_type if the type @c T meets the syntactic requirements for Executor, 30 | * otherwise @c false_type. 31 | */ 32 | template 33 | struct is_executor 34 | #if defined(GENERATING_DOCUMENTATION) 35 | : integral_constant 36 | #else // defined(GENERATING_DOCUMENTATION) 37 | : asio::detail::is_executor 38 | #endif // defined(GENERATING_DOCUMENTATION) 39 | { 40 | }; 41 | 42 | } // namespace asio 43 | 44 | #include "asio/detail/pop_options.hpp" 45 | 46 | #endif // ASIO_IS_EXECUTOR_HPP 47 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ts/internet.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ts/internet.hpp 3 | // ~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_TS_INTERNET_HPP 12 | #define ASIO_TS_INTERNET_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/ip/address.hpp" 19 | #include "asio/ip/address_v4.hpp" 20 | #include "asio/ip/address_v4_iterator.hpp" 21 | #include "asio/ip/address_v4_range.hpp" 22 | #include "asio/ip/address_v6.hpp" 23 | #include "asio/ip/address_v6_iterator.hpp" 24 | #include "asio/ip/address_v6_range.hpp" 25 | #include "asio/ip/bad_address_cast.hpp" 26 | #include "asio/ip/basic_endpoint.hpp" 27 | #include "asio/ip/basic_resolver_query.hpp" 28 | #include "asio/ip/basic_resolver_entry.hpp" 29 | #include "asio/ip/basic_resolver_iterator.hpp" 30 | #include "asio/ip/basic_resolver.hpp" 31 | #include "asio/ip/host_name.hpp" 32 | #include "asio/ip/network_v4.hpp" 33 | #include "asio/ip/network_v6.hpp" 34 | #include "asio/ip/tcp.hpp" 35 | #include "asio/ip/udp.hpp" 36 | #include "asio/ip/v6_only.hpp" 37 | #include "asio/ip/unicast.hpp" 38 | #include "asio/ip/multicast.hpp" 39 | 40 | #endif // ASIO_TS_INTERNET_HPP 41 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ssl/detail/shutdown_op.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ssl/detail/shutdown_op.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_SSL_DETAIL_SHUTDOWN_OP_HPP 12 | #define ASIO_SSL_DETAIL_SHUTDOWN_OP_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include "asio/ssl/detail/engine.hpp" 21 | 22 | #include "asio/detail/push_options.hpp" 23 | 24 | namespace asio { 25 | namespace ssl { 26 | namespace detail { 27 | 28 | class shutdown_op 29 | { 30 | public: 31 | engine::want operator()(engine& eng, 32 | asio::error_code& ec, 33 | std::size_t& bytes_transferred) const 34 | { 35 | bytes_transferred = 0; 36 | return eng.shutdown(ec); 37 | } 38 | 39 | template 40 | void call_handler(Handler& handler, 41 | const asio::error_code& ec, 42 | const std::size_t&) const 43 | { 44 | handler(ec); 45 | } 46 | }; 47 | 48 | } // namespace detail 49 | } // namespace ssl 50 | } // namespace asio 51 | 52 | #include "asio/detail/pop_options.hpp" 53 | 54 | #endif // ASIO_SSL_DETAIL_SHUTDOWN_OP_HPP 55 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/mutex.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/mutex.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_MUTEX_HPP 12 | #define ASIO_DETAIL_MUTEX_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | # include "asio/detail/null_mutex.hpp" 22 | #elif defined(ASIO_WINDOWS) 23 | # include "asio/detail/win_mutex.hpp" 24 | #elif defined(ASIO_HAS_PTHREADS) 25 | # include "asio/detail/posix_mutex.hpp" 26 | #elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 27 | # include "asio/detail/std_mutex.hpp" 28 | #else 29 | # error Only Windows, POSIX and std::mutex are supported! 30 | #endif 31 | 32 | namespace asio { 33 | namespace detail { 34 | 35 | #if !defined(ASIO_HAS_THREADS) 36 | typedef null_mutex mutex; 37 | #elif defined(ASIO_WINDOWS) 38 | typedef win_mutex mutex; 39 | #elif defined(ASIO_HAS_PTHREADS) 40 | typedef posix_mutex mutex; 41 | #elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 42 | typedef std_mutex mutex; 43 | #endif 44 | 45 | } // namespace detail 46 | } // namespace asio 47 | 48 | #endif // ASIO_DETAIL_MUTEX_HPP 49 | -------------------------------------------------------------------------------- /SourceX/dvlnet/udp_p2p.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "dvlnet/packet.h" 11 | #include "dvlnet/base.h" 12 | 13 | namespace dvl { 14 | namespace net { 15 | 16 | class udp_p2p : public base { 17 | public: 18 | virtual int create(std::string addrstr, std::string passwd); 19 | virtual int join(std::string addrstr, std::string passwd); 20 | virtual void poll(); 21 | virtual void send(packet &pkt); 22 | 23 | private: 24 | typedef asio::ip::udp::endpoint endpoint; 25 | static const endpoint none; 26 | 27 | static constexpr unsigned short default_port = 6112; 28 | static constexpr unsigned short try_ports = 512; 29 | static constexpr int ACTIVE = 60; 30 | 31 | asio::io_context io_context; 32 | endpoint master; 33 | 34 | std::set connection_requests_pending; 35 | std::array nexthop_table; 36 | 37 | asio::ip::udp::socket sock = asio::ip::udp::socket(io_context); 38 | 39 | void recv(); 40 | void handle_join_request(packet &pkt, endpoint sender); 41 | void send_internal(packet &pkt, endpoint sender = none); 42 | std::set dests_for_addr(plr_t dest, endpoint sender); 43 | void recv_decrypted(packet &pkt, endpoint sender); 44 | }; 45 | 46 | } // namespace net 47 | } // namespace dvl 48 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/event.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/event.hpp 3 | // ~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_EVENT_HPP 12 | #define ASIO_DETAIL_EVENT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | # include "asio/detail/null_event.hpp" 22 | #elif defined(ASIO_WINDOWS) 23 | # include "asio/detail/win_event.hpp" 24 | #elif defined(ASIO_HAS_PTHREADS) 25 | # include "asio/detail/posix_event.hpp" 26 | #elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 27 | # include "asio/detail/std_event.hpp" 28 | #else 29 | # error Only Windows, POSIX and std::condition_variable are supported! 30 | #endif 31 | 32 | namespace asio { 33 | namespace detail { 34 | 35 | #if !defined(ASIO_HAS_THREADS) 36 | typedef null_event event; 37 | #elif defined(ASIO_WINDOWS) 38 | typedef win_event event; 39 | #elif defined(ASIO_HAS_PTHREADS) 40 | typedef posix_event event; 41 | #elif defined(ASIO_HAS_STD_MUTEX_AND_CONDVAR) 42 | typedef std_event event; 43 | #endif 44 | 45 | } // namespace detail 46 | } // namespace asio 47 | 48 | #endif // ASIO_DETAIL_EVENT_HPP 49 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/null_static_mutex.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/null_static_mutex.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_NULL_STATIC_MUTEX_HPP 12 | #define ASIO_DETAIL_NULL_STATIC_MUTEX_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | 22 | #include "asio/detail/scoped_lock.hpp" 23 | 24 | #include "asio/detail/push_options.hpp" 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | struct null_static_mutex 30 | { 31 | typedef asio::detail::scoped_lock scoped_lock; 32 | 33 | // Initialise the mutex. 34 | void init() 35 | { 36 | } 37 | 38 | // Lock the mutex. 39 | void lock() 40 | { 41 | } 42 | 43 | // Unlock the mutex. 44 | void unlock() 45 | { 46 | } 47 | 48 | int unused_; 49 | }; 50 | 51 | #define ASIO_NULL_STATIC_MUTEX_INIT { 0 } 52 | 53 | } // namespace detail 54 | } // namespace asio 55 | 56 | #include "asio/detail/pop_options.hpp" 57 | 58 | #endif // !defined(ASIO_HAS_THREADS) 59 | 60 | #endif // ASIO_DETAIL_NULL_STATIC_MUTEX_HPP 61 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/null_mutex.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/null_mutex.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_NULL_MUTEX_HPP 12 | #define ASIO_DETAIL_NULL_MUTEX_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | 22 | #include "asio/detail/noncopyable.hpp" 23 | #include "asio/detail/scoped_lock.hpp" 24 | 25 | #include "asio/detail/push_options.hpp" 26 | 27 | namespace asio { 28 | namespace detail { 29 | 30 | class null_mutex 31 | : private noncopyable 32 | { 33 | public: 34 | typedef asio::detail::scoped_lock scoped_lock; 35 | 36 | // Constructor. 37 | null_mutex() 38 | { 39 | } 40 | 41 | // Destructor. 42 | ~null_mutex() 43 | { 44 | } 45 | 46 | // Lock the mutex. 47 | void lock() 48 | { 49 | } 50 | 51 | // Unlock the mutex. 52 | void unlock() 53 | { 54 | } 55 | }; 56 | 57 | } // namespace detail 58 | } // namespace asio 59 | 60 | #include "asio/detail/pop_options.hpp" 61 | 62 | #endif // !defined(ASIO_HAS_THREADS) 63 | 64 | #endif // ASIO_DETAIL_NULL_MUTEX_HPP 65 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/signal_blocker.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/signal_blocker.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_SIGNAL_BLOCKER_HPP 12 | #define ASIO_DETAIL_SIGNAL_BLOCKER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) || defined(ASIO_WINDOWS) \ 21 | || defined(ASIO_WINDOWS_RUNTIME) \ 22 | || defined(__CYGWIN__) || defined(__SYMBIAN32__) 23 | # include "asio/detail/null_signal_blocker.hpp" 24 | #elif defined(ASIO_HAS_PTHREADS) 25 | # include "asio/detail/posix_signal_blocker.hpp" 26 | #else 27 | # error Only Windows and POSIX are supported! 28 | #endif 29 | 30 | namespace asio { 31 | namespace detail { 32 | 33 | #if !defined(ASIO_HAS_THREADS) || defined(ASIO_WINDOWS) \ 34 | || defined(ASIO_WINDOWS_RUNTIME) \ 35 | || defined(__CYGWIN__) || defined(__SYMBIAN32__) 36 | typedef null_signal_blocker signal_blocker; 37 | #elif defined(ASIO_HAS_PTHREADS) 38 | typedef posix_signal_blocker signal_blocker; 39 | #endif 40 | 41 | } // namespace detail 42 | } // namespace asio 43 | 44 | #endif // ASIO_DETAIL_SIGNAL_BLOCKER_HPP 45 | -------------------------------------------------------------------------------- /SourceS/sdl2_backports.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // Backports for older versions of SDL 2. 3 | 4 | #ifdef USE_SDL1 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #if !SDL_VERSION_ATLEAST(2, 0, 4) 11 | inline SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) 12 | { 13 | return ((p->x >= r->x) && (p->x < (r->x + r->w)) && (p->y >= r->y) && (p->y < (r->y + r->h))) ? SDL_TRUE : SDL_FALSE; 14 | } 15 | #endif 16 | 17 | #if !SDL_VERSION_ATLEAST(2, 0, 5) 18 | inline SDL_Surface * 19 | SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, 20 | Uint32 format) 21 | { 22 | int bpp; 23 | Uint32 rmask, gmask, bmask, amask; 24 | if (!SDL_PixelFormatEnumToMasks(format, &bpp, &rmask, &gmask, &bmask, &amask)) 25 | return nullptr; 26 | return SDL_CreateRGBSurface(flags, width, height, bpp, rmask, gmask, bmask, amask); 27 | } 28 | 29 | // From SDL 2.0.9. 30 | inline SDL_Surface * 31 | SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, 32 | int width, int height, int depth, int pitch, 33 | Uint32 format) 34 | { 35 | SDL_Surface *surface; 36 | 37 | surface = SDL_CreateRGBSurfaceWithFormat(0, 0, 0, depth, format); 38 | if (surface != NULL) { 39 | surface->flags |= SDL_PREALLOC; 40 | surface->pixels = pixels; 41 | surface->w = width; 42 | surface->h = height; 43 | surface->pitch = pitch; 44 | SDL_SetClipRect(surface, NULL); 45 | } 46 | return surface; 47 | } 48 | #endif 49 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/throw_error.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/throw_error.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_THROW_ERROR_HPP 12 | #define ASIO_DETAIL_THROW_ERROR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/error_code.hpp" 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | namespace detail { 25 | 26 | ASIO_DECL void do_throw_error(const asio::error_code& err); 27 | 28 | ASIO_DECL void do_throw_error(const asio::error_code& err, 29 | const char* location); 30 | 31 | inline void throw_error(const asio::error_code& err) 32 | { 33 | if (err) 34 | do_throw_error(err); 35 | } 36 | 37 | inline void throw_error(const asio::error_code& err, 38 | const char* location) 39 | { 40 | if (err) 41 | do_throw_error(err, location); 42 | } 43 | 44 | } // namespace detail 45 | } // namespace asio 46 | 47 | #include "asio/detail/pop_options.hpp" 48 | 49 | #if defined(ASIO_HEADER_ONLY) 50 | # include "asio/detail/impl/throw_error.ipp" 51 | #endif // defined(ASIO_HEADER_ONLY) 52 | 53 | #endif // ASIO_DETAIL_THROW_ERROR_HPP 54 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ip/bad_address_cast.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // ip/bad_address_cast.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IP_BAD_ADDRESS_CAST_HPP 12 | #define ASIO_IP_BAD_ADDRESS_CAST_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include 20 | 21 | #include "asio/detail/push_options.hpp" 22 | 23 | namespace asio { 24 | namespace ip { 25 | 26 | /// Thrown to indicate a failed address conversion. 27 | class bad_address_cast : 28 | #if defined(ASIO_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS 29 | public std::exception 30 | #else 31 | public std::bad_cast 32 | #endif 33 | { 34 | public: 35 | /// Default constructor. 36 | bad_address_cast() {} 37 | 38 | /// Destructor. 39 | virtual ~bad_address_cast() ASIO_NOEXCEPT_OR_NOTHROW {} 40 | 41 | /// Get the message associated with the exception. 42 | virtual const char* what() const ASIO_NOEXCEPT_OR_NOTHROW 43 | { 44 | return "bad address cast"; 45 | } 46 | }; 47 | 48 | } // namespace ip 49 | } // namespace asio 50 | 51 | #include "asio/detail/pop_options.hpp" 52 | 53 | #endif // ASIO_IP_ADDRESS_HPP 54 | -------------------------------------------------------------------------------- /Packaging/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | # Uncomment this to turn on verbose mode. 5 | export DH_VERBOSE=1 6 | export COMPILE_FLAGS="-O0" 7 | 8 | export DH_VERBOSE = 1 9 | export DEB_BUILD_MAINT_OPTIONS = hardening=-all 10 | export DEB_CFLAGS_MAINT_APPEND = -Wno-error 11 | export DEB_LDFLAGS_MAINT_APPEND = -Wno-error 12 | export CXXFLAGS="-DTTF_FONT_PATH=\"/usr/share/fonts/truetype/CharisSILB.ttf\"" 13 | 14 | %: 15 | dh $@ --buildsystem=cmake 16 | 17 | #override_dh_auto_clean: 18 | # dh_auto_clean 19 | #override_dh_auto_configure: 20 | # dh_auto_configure -O--buildsystem=cmake -- -DDESTDIR=/usr/games -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var 21 | 22 | override_dh_auto_install: 23 | mkdir -p debian/diablo-data/usr/share/games/diablo/ 24 | test -f "../diabdat.mpq" && cp ../diabdat.mpq debian/diablo-data/usr/share/games/diablo/ || true 25 | dh_auto_install 26 | mkdir -p debian/devilutionx/usr/share/icons/hicolor/16x16/apps/ 27 | mkdir -p debian/devilutionx/usr/share/icons/hicolor/32x32/apps/ 28 | mkdir -p debian/devilutionx/usr/share/icons/hicolor/48x48/apps/ 29 | cp Packaging/resources/16.png debian/devilutionx/usr/share/icons/hicolor/16x16/apps/diablo.png 30 | cp Packaging/resources/Diablo_32.png debian/devilutionx/usr/share/icons/hicolor/32x32/apps/diablo.png 31 | cp Packaging/resources/Diablo_48.png debian/devilutionx/usr/share/icons/hicolor/48x48/apps/diablo.png 32 | -------------------------------------------------------------------------------- /Source/gmenu.h: -------------------------------------------------------------------------------- 1 | //HEADER_GOES_HERE 2 | #ifndef __GMENU_H__ 3 | #define __GMENU_H__ 4 | 5 | extern BYTE *optbar_cel; 6 | extern BOOLEAN mouseNavigation; 7 | extern BYTE *PentSpin_cel; 8 | extern BYTE *BigTGold_cel; 9 | extern int dword_634474; 10 | extern char byte_634478; 11 | extern void (*dword_63447C)(TMenuItem *); 12 | extern TMenuItem *sgpCurrentMenu; 13 | extern BYTE *option_cel; 14 | extern int sgCurrentMenuIdx; 15 | 16 | void gmenu_draw_pause(); 17 | void gmenu_print_text(int x, int y, char *pszStr); 18 | void FreeGMenu(); 19 | void gmenu_init_menu(); 20 | BOOL gmenu_exception(); 21 | void gmenu_call_proc(TMenuItem *pItem, void (*gmFunc)(TMenuItem *)); 22 | void gmenu_up_down(BOOL isDown); 23 | void gmenu_draw(); 24 | void gmenu_draw_menu_item(TMenuItem *pItem, int y); 25 | void gmenu_clear_buffer(int x, int y, int width, int height); 26 | int gmenu_get_lfont(TMenuItem *pItem); 27 | BOOL gmenu_presskeys(int vkey); 28 | void gmenu_left_right(BOOL isRight); 29 | BOOL gmenu_on_mouse_move(); 30 | BOOLEAN gmenu_valid_mouse_pos(int *plOffset); 31 | BOOL gmenu_left_mouse(BOOL isDown); 32 | void gmenu_enable(TMenuItem *pMenuItem, BOOL enable); 33 | void gmenu_slider_set(TMenuItem *pItem, int min, int max, int gamma); 34 | int gmenu_slider_get(TMenuItem *pItem, int min, int max); 35 | void gmenu_slider_steps(TMenuItem *pItem, int dwTicks); 36 | 37 | /* rdata */ 38 | 39 | extern const BYTE lfontframe[127]; 40 | extern const BYTE lfontkern[56]; 41 | 42 | #endif /* __GMENU_H__ */ 43 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/global.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/global.hpp 3 | // ~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_GLOBAL_HPP 12 | #define ASIO_DETAIL_GLOBAL_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | # include "asio/detail/null_global.hpp" 22 | #elif defined(ASIO_WINDOWS) 23 | # include "asio/detail/win_global.hpp" 24 | #elif defined(ASIO_HAS_PTHREADS) 25 | # include "asio/detail/posix_global.hpp" 26 | #elif defined(ASIO_HAS_STD_CALL_ONCE) 27 | # include "asio/detail/std_global.hpp" 28 | #else 29 | # error Only Windows, POSIX and std::call_once are supported! 30 | #endif 31 | 32 | namespace asio { 33 | namespace detail { 34 | 35 | template 36 | inline T& global() 37 | { 38 | #if !defined(ASIO_HAS_THREADS) 39 | return null_global(); 40 | #elif defined(ASIO_WINDOWS) 41 | return win_global(); 42 | #elif defined(ASIO_HAS_PTHREADS) 43 | return posix_global(); 44 | #elif defined(ASIO_HAS_STD_CALL_ONCE) 45 | return std_global(); 46 | #endif 47 | } 48 | 49 | } // namespace detail 50 | } // namespace asio 51 | 52 | #endif // ASIO_DETAIL_GLOBAL_HPP 53 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/handler_cont_helpers.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/handler_cont_helpers.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP 12 | #define ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/memory.hpp" 20 | #include "asio/handler_continuation_hook.hpp" 21 | 22 | #include "asio/detail/push_options.hpp" 23 | 24 | // Calls to asio_handler_is_continuation must be made from a namespace that 25 | // does not contain overloads of this function. This namespace is defined here 26 | // for that purpose. 27 | namespace asio_handler_cont_helpers { 28 | 29 | template 30 | inline bool is_continuation(Context& context) 31 | { 32 | #if !defined(ASIO_HAS_HANDLER_HOOKS) 33 | return false; 34 | #else 35 | using asio::asio_handler_is_continuation; 36 | return asio_handler_is_continuation( 37 | asio::detail::addressof(context)); 38 | #endif 39 | } 40 | 41 | } // namespace asio_handler_cont_helpers 42 | 43 | #include "asio/detail/pop_options.hpp" 44 | 45 | #endif // ASIO_DETAIL_HANDLER_CONT_HELPERS_HPP 46 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/null_global.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/null_global.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_NULL_GLOBAL_HPP 12 | #define ASIO_DETAIL_NULL_GLOBAL_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #include "asio/detail/push_options.hpp" 21 | 22 | namespace asio { 23 | namespace detail { 24 | 25 | template 26 | struct null_global_impl 27 | { 28 | null_global_impl() 29 | : ptr_(0) 30 | { 31 | } 32 | 33 | // Destructor automatically cleans up the global. 34 | ~null_global_impl() 35 | { 36 | delete ptr_; 37 | } 38 | 39 | static null_global_impl instance_; 40 | T* ptr_; 41 | }; 42 | 43 | template 44 | null_global_impl null_global_impl::instance_; 45 | 46 | template 47 | T& null_global() 48 | { 49 | if (null_global_impl::instance_.ptr_ == 0) 50 | null_global_impl::instance_.ptr_ = new T; 51 | return *null_global_impl::instance_.ptr_; 52 | } 53 | 54 | } // namespace detail 55 | } // namespace asio 56 | 57 | #include "asio/detail/pop_options.hpp" 58 | 59 | #endif // ASIO_DETAIL_NULL_GLOBAL_HPP 60 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/null_tss_ptr.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/null_tss_ptr.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_NULL_TSS_PTR_HPP 12 | #define ASIO_DETAIL_NULL_TSS_PTR_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | 22 | #include "asio/detail/noncopyable.hpp" 23 | 24 | #include "asio/detail/push_options.hpp" 25 | 26 | namespace asio { 27 | namespace detail { 28 | 29 | template 30 | class null_tss_ptr 31 | : private noncopyable 32 | { 33 | public: 34 | // Constructor. 35 | null_tss_ptr() 36 | : value_(0) 37 | { 38 | } 39 | 40 | // Destructor. 41 | ~null_tss_ptr() 42 | { 43 | } 44 | 45 | // Get the value. 46 | operator T*() const 47 | { 48 | return value_; 49 | } 50 | 51 | // Set the value. 52 | void operator=(T* value) 53 | { 54 | value_ = value; 55 | } 56 | 57 | private: 58 | T* value_; 59 | }; 60 | 61 | } // namespace detail 62 | } // namespace asio 63 | 64 | #include "asio/detail/pop_options.hpp" 65 | 66 | #endif // !defined(ASIO_HAS_THREADS) 67 | 68 | #endif // ASIO_DETAIL_NULL_TSS_PTR_HPP 69 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/high_resolution_timer.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // high_resolution_timer.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_HIGH_RESOLUTION_TIMER_HPP 12 | #define ASIO_HIGH_RESOLUTION_TIMER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) 21 | 22 | #include "asio/basic_waitable_timer.hpp" 23 | #include "asio/detail/chrono.hpp" 24 | 25 | namespace asio { 26 | 27 | /// Typedef for a timer based on the high resolution clock. 28 | /** 29 | * This typedef uses the C++11 @c <chrono> standard library facility, if 30 | * available. Otherwise, it may use the Boost.Chrono library. To explicitly 31 | * utilise Boost.Chrono, use the basic_waitable_timer template directly: 32 | * @code 33 | * typedef basic_waitable_timer timer; 34 | * @endcode 35 | */ 36 | typedef basic_waitable_timer< 37 | chrono::high_resolution_clock> 38 | high_resolution_timer; 39 | 40 | } // namespace asio 41 | 42 | #endif // defined(ASIO_HAS_CHRONO) || defined(GENERATING_DOCUMENTATION) 43 | 44 | #endif // ASIO_HIGH_RESOLUTION_TIMER_HPP 45 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/atomic_count.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/atomic_count.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_ATOMIC_COUNT_HPP 12 | #define ASIO_DETAIL_ATOMIC_COUNT_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_HAS_THREADS) 21 | // Nothing to include. 22 | #elif defined(ASIO_HAS_STD_ATOMIC) 23 | # include 24 | #else // defined(ASIO_HAS_STD_ATOMIC) 25 | # include 26 | #endif // defined(ASIO_HAS_STD_ATOMIC) 27 | 28 | namespace asio { 29 | namespace detail { 30 | 31 | #if !defined(ASIO_HAS_THREADS) 32 | typedef long atomic_count; 33 | inline void increment(atomic_count& a, long b) { a += b; } 34 | #elif defined(ASIO_HAS_STD_ATOMIC) 35 | typedef std::atomic atomic_count; 36 | inline void increment(atomic_count& a, long b) { a += b; } 37 | #else // defined(ASIO_HAS_STD_ATOMIC) 38 | typedef boost::detail::atomic_count atomic_count; 39 | inline void increment(atomic_count& a, long b) { while (b > 0) ++a, --b; } 40 | #endif // defined(ASIO_HAS_STD_ATOMIC) 41 | 42 | } // namespace detail 43 | } // namespace asio 44 | 45 | #endif // ASIO_DETAIL_ATOMIC_COUNT_HPP 46 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/detail/select_interrupter.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // detail/select_interrupter.hpp 3 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_DETAIL_SELECT_INTERRUPTER_HPP 12 | #define ASIO_DETAIL_SELECT_INTERRUPTER_HPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | 20 | #if !defined(ASIO_WINDOWS_RUNTIME) 21 | 22 | #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__) 23 | # include "asio/detail/socket_select_interrupter.hpp" 24 | #elif defined(ASIO_HAS_EVENTFD) 25 | # include "asio/detail/eventfd_select_interrupter.hpp" 26 | #else 27 | # include "asio/detail/pipe_select_interrupter.hpp" 28 | #endif 29 | 30 | namespace asio { 31 | namespace detail { 32 | 33 | #if defined(ASIO_WINDOWS) || defined(__CYGWIN__) || defined(__SYMBIAN32__) 34 | typedef socket_select_interrupter select_interrupter; 35 | #elif defined(ASIO_HAS_EVENTFD) 36 | typedef eventfd_select_interrupter select_interrupter; 37 | #else 38 | typedef pipe_select_interrupter select_interrupter; 39 | #endif 40 | 41 | } // namespace detail 42 | } // namespace asio 43 | 44 | #endif // !defined(ASIO_WINDOWS_RUNTIME) 45 | 46 | #endif // ASIO_DETAIL_SELECT_INTERRUPTER_HPP 47 | -------------------------------------------------------------------------------- /3rdParty/asio/include/asio/ip/impl/host_name.ipp: -------------------------------------------------------------------------------- 1 | // 2 | // ip/impl/host_name.ipp 3 | // ~~~~~~~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 | // 10 | 11 | #ifndef ASIO_IP_IMPL_HOST_NAME_IPP 12 | #define ASIO_IP_IMPL_HOST_NAME_IPP 13 | 14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 15 | # pragma once 16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 17 | 18 | #include "asio/detail/config.hpp" 19 | #include "asio/detail/socket_ops.hpp" 20 | #include "asio/detail/throw_error.hpp" 21 | #include "asio/detail/winsock_init.hpp" 22 | #include "asio/ip/host_name.hpp" 23 | 24 | #include "asio/detail/push_options.hpp" 25 | 26 | namespace asio { 27 | namespace ip { 28 | 29 | std::string host_name() 30 | { 31 | char name[1024]; 32 | asio::error_code ec; 33 | if (asio::detail::socket_ops::gethostname(name, sizeof(name), ec) != 0) 34 | { 35 | asio::detail::throw_error(ec); 36 | return std::string(); 37 | } 38 | return std::string(name); 39 | } 40 | 41 | std::string host_name(asio::error_code& ec) 42 | { 43 | char name[1024]; 44 | if (asio::detail::socket_ops::gethostname(name, sizeof(name), ec) != 0) 45 | return std::string(); 46 | return std::string(name); 47 | } 48 | 49 | } // namespace ip 50 | } // namespace asio 51 | 52 | #include "asio/detail/pop_options.hpp" 53 | 54 | #endif // ASIO_IP_IMPL_HOST_NAME_IPP 55 | -------------------------------------------------------------------------------- /Packaging/debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: devilutionx 3 | Source: https://github.com/diasurgical/devilutionX 4 | 5 | Files: * 6 | Copyright: 2019 Devilutionx Authors 7 | License: Unlicense 8 | This is free and unencumbered software released into the public domain. 9 | . 10 | Anyone is free to copy, modify, publish, use, compile, sell, or 11 | distribute this software, either in source code form or as a compiled 12 | binary, for any purpose, commercial or non-commercial, and by any 13 | means. 14 | . 15 | In jurisdictions that recognize copyright laws, the author or authors 16 | of this software dedicate any and all copyright interest in the 17 | software to the public domain. We make this dedication for the benefit 18 | of the public at large and to the detriment of our heirs and 19 | successors. We intend this dedication to be an overt act of 20 | relinquishment in perpetuity of all present and future rights to this 21 | software under copyright law. 22 | . 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 26 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 27 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 28 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 29 | OTHER DEALINGS IN THE SOFTWARE. 30 | . 31 | For more information, please refer to 32 | --------------------------------------------------------------------------------