Browse Source

Merge branch 'master' of github.com:diasurgical/devilutionX into macos

pull/44/head
Anders Jenbo 7 years ago
parent
commit
282a089ce3
  1. 2
      3rdParty/Storm/Source/storm.cpp
  2. 4190
      CMake/cotire.cmake
  3. 2
      CMake/mingwcc.cmake
  4. 58
      CMakeLists.txt
  5. 6
      Diablo.dsp
  6. 2
      DiabloUI/_temp_funcs.h
  7. 2
      DiabloUI/connect.cpp
  8. 2
      DiabloUI/diabloui.h
  9. 2
      MakefileVC
  10. 2
      Source/asm_trans_rect.inc
  11. 2
      Source/automap.cpp
  12. 2
      Source/capture.cpp
  13. 21
      Source/control.cpp
  14. 152
      Source/drlg_l1.cpp
  15. 10
      Source/dx.cpp
  16. 2
      Source/dx.h
  17. 1
      Source/effects.cpp
  18. 1693
      Source/engine.cpp
  19. 18
      Source/engine.h
  20. 2
      Source/gendung.cpp
  21. 2
      Source/gendung.h
  22. 42
      Source/inv.cpp
  23. 21
      Source/items.cpp
  24. 2
      Source/items.h
  25. 160
      Source/minitext.cpp
  26. 2
      Source/minitext.h
  27. 391
      Source/missiles.cpp
  28. 66
      Source/objects.cpp
  29. 50
      Source/scrollrt.cpp
  30. 2
      Source/sound.cpp
  31. 2
      Source/sound.h
  32. 51
      Source/stores.cpp
  33. 399
      Source/town.cpp
  34. 4
      Source/town.h
  35. 1
      SourceS/devilution.h
  36. 1
      SourceS/miniwin.h
  37. 6
      SourceS/miniwin/misc.h
  38. 11
      SourceS/storm_full.h
  39. 7
      SourceX/DiabloUI/credits.cpp
  40. 14
      SourceX/DiabloUI/diabloui.cpp
  41. 2
      SourceX/DiabloUI/diabloui.h
  42. 3
      SourceX/DiabloUI/dialogs.cpp
  43. 3
      SourceX/DiabloUI/mainmenu.cpp
  44. 4
      SourceX/DiabloUI/progress.cpp
  45. 4
      SourceX/DiabloUI/selconn.cpp
  46. 4
      SourceX/DiabloUI/selgame.cpp
  47. 4
      SourceX/DiabloUI/selhero.cpp
  48. 5
      SourceX/DiabloUI/title.cpp
  49. 3
      SourceX/devilution.h
  50. 6
      SourceX/dvlnet/abstract_net.cpp
  51. 61
      SourceX/dvlnet/abstract_net.h
  52. 10
      SourceX/dvlnet/base.cpp
  53. 116
      SourceX/dvlnet/base.h
  54. 10
      SourceX/dvlnet/frame_queue.cpp
  55. 48
      SourceX/dvlnet/frame_queue.h
  56. 7
      SourceX/dvlnet/loopback.cpp
  57. 56
      SourceX/dvlnet/loopback.h
  58. 6
      SourceX/dvlnet/packet.cpp
  59. 506
      SourceX/dvlnet/packet.h
  60. 6
      SourceX/dvlnet/tcp_client.cpp
  61. 50
      SourceX/dvlnet/tcp_client.h
  62. 6
      SourceX/dvlnet/tcp_server.cpp
  63. 92
      SourceX/dvlnet/tcp_server.h
  64. 10
      SourceX/dvlnet/udp_p2p.cpp
  65. 70
      SourceX/dvlnet/udp_p2p.h
  66. 87
      SourceX/dx.cpp
  67. 2
      SourceX/dx.h
  68. 5
      SourceX/main.cpp
  69. 7
      SourceX/miniwin/dsound.cpp
  70. 26
      SourceX/miniwin/dsound.h
  71. 35
      SourceX/miniwin/misc.cpp
  72. 45
      SourceX/miniwin/misc_dx.cpp
  73. 174
      SourceX/miniwin/misc_io.cpp
  74. 7
      SourceX/miniwin/misc_msg.cpp
  75. 2
      SourceX/miniwin/rand.cpp
  76. 6
      SourceX/miniwin/thread.cpp
  77. 44
      SourceX/pch.h
  78. 9
      SourceX/sound.cpp
  79. 44
      SourceX/storm/storm.cpp
  80. 38
      SourceX/storm/storm_dx.cpp
  81. 5
      SourceX/storm/storm_net.cpp
  82. 6
      SourceX/stubs.h
  83. 14
      SourceX/utf8.h
  84. 784
      Xcode/devilutionX.xcodeproj/project.pbxproj
  85. 2
      defs.h
  86. 18
      structs.h

2
3rdParty/Storm/Source/storm.cpp vendored

@ -96,7 +96,7 @@ BOOL STORMAPI SBltROP3Tiled(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt,
BOOL STORMAPI SBmpDecodeImage(DWORD dwImgType, void *pSrcBuffer, DWORD dwSrcBuffersize, PALETTEENTRY *pPalette, void *pDstBuffer, DWORD dwDstBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp) rBool;
BOOL STORMAPI SBmpLoadImage(const char *pszFileName, PALETTEENTRY *pPalette, void *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *dwHeight, DWORD *pdwBpp) rBool;
BOOL STORMAPI SBmpLoadImage(const char *pszFileName, PALETTEENTRY *pPalette, BYTE *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp) rBool;
BOOL STORMAPI SBmpSaveImage(const char*, PALETTEENTRY*, void*, DWORD, DWORD, DWORD) rBool;
HANDLE STORMAPI SBmpAllocLoadImage(const char *fileName, PALETTEENTRY *palette, void **buffer, int *width, int *height, int unused6, int unused7, void *(STORMAPI *allocFunction)(DWORD)) rPVoid;

4190
CMake/cotire.cmake

File diff suppressed because it is too large Load Diff

2
CMake/mingwcc.cmake

@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.13)
SET(CROSS_PREFIX "/usr" CACHE STRING "crosstool-NG prefix")
SET(CMAKE_SYSTEM_NAME Windows)

58
CMakeLists.txt

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.7)
cmake_minimum_required(VERSION 3.12)
include(CMake/out_of_tree.cmake)
@ -6,32 +6,39 @@ project(devilutionX
VERSION 0.0.1
LANGUAGES C CXX)
list(APPEND CMAKE_MODULE_PATH "${devilutionX_SOURCE_DIR}/CMake")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
option(ASAN "Enable address sanitizer" ON)
option(DEBUG "Enable debug mode in engine" ON)
option(COTIRE "Enable cotire" OFF)
option(DIST "Dynamically link only glibc and SDL2" OFF)
option(FASTER "Enable FASTER in engine" ON)
option(BINARY_RELEASE "Enable options for binary release" OFF)
option(NIGHTLY_BUILD "Enable options for nightly build" OFF)
if(BINARY_RELEASE)
set(CMAKE_BUILD_TYPE "Release")
set(ASAN OFF)
set(DEBUG OFF)
set(COTIRE OFF)
set(DIST ON)
set(FASTER OFF)
endif()
if(NIGHTLY_BUILD)
set(CMAKE_BUILD_TYPE "Debug")
set(ASAN OFF)
set(DEBUG ON)
set(DIST ON)
set(FASTER ON)
endif()
if(DIST)
set(sodium_USE_STATIC_LIBS ON)
endif()
list(APPEND CMAKE_MODULE_PATH "${devilutionX_SOURCE_DIR}/CMake")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
@ -43,10 +50,6 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 4)
message(WARNING [[Not 32-bit, highly experimental!]])
endif()
if(COTIRE)
include(CMake/cotire.cmake)
endif()
find_package(Threads REQUIRED)
find_package(SDL2 REQUIRED)
find_package(SDL2_ttf REQUIRED)
@ -150,19 +153,20 @@ add_library(devilution OBJECT
Source/track.cpp
Source/trigs.cpp
Source/wave.cpp)
target_include_directories(devilution PRIVATE SourceS)
add_executable(devilutionx
SourceX/dx.cpp
SourceX/miniwin/misc.cpp
SourceX/miniwin/misc_io.cpp
SourceX/miniwin/misc_msg.cpp
SourceX/miniwin/misc_dx.cpp
SourceX/miniwin/rand.cpp
SourceX/miniwin/thread.cpp
SourceX/miniwin_dsound.cpp
SourceX/miniwin/dsound.cpp
SourceX/sound.cpp
SourceX/storm.cpp
SourceX/storm_net.cpp
SourceX/storm/storm.cpp
SourceX/storm/storm_net.cpp
SourceX/storm/storm_dx.cpp
SourceX/dvlnet/abstract_net.cpp
SourceX/dvlnet/loopback.cpp
SourceX/dvlnet/packet.cpp
@ -182,16 +186,20 @@ add_executable(devilutionx
SourceX/DiabloUI/title.cpp
SourceX/main.cpp)
target_include_directories(devilutionx PRIVATE SourceS SourceX 3rdParty/asio/include .)
target_include_directories(devilution PUBLIC Source SourceS)
target_include_directories(devilutionx PRIVATE
SourceX
3rdParty/asio/include
3rdParty/Radon/Radon/include
3rdParty/libsmacker)
target_link_libraries(devilution PRIVATE Threads::Threads)
target_link_libraries(devilution PUBLIC Threads::Threads)
target_link_libraries(devilutionx PRIVATE
devilution
PKWare
StormLib
smacker
Radon
Threads::Threads
SDL2::SDL2main
SDL2::SDL2_ttf
SDL2::SDL2_mixer
@ -203,10 +211,8 @@ target_compile_definitions(devilution PUBLIC
"$<$<BOOL:${DEBUG}>:_DEBUG>"
# Skip fades and other fluff
"$<$<BOOL:${FASTER}>:FASTER>")
target_compile_definitions(devilutionx PRIVATE ASIO_STANDALONE)
target_compile_definitions(devilutionx PUBLIC ASIO_STANDALONE)
# Enable ASAN in Debug mode
if(ASAN)
target_compile_options(devilution PUBLIC -fsanitize=address -fsanitize-recover=address)
target_link_libraries(devilution PUBLIC -fsanitize=address -fsanitize-recover=address)
@ -217,15 +223,14 @@ if(DIST)
endif()
if(WIN32)
cmake_minimum_required(VERSION 3.13)
target_link_libraries(devilutionx PRIVATE wsock32 ws2_32 wininet)
target_compile_options(devilution PUBLIC $<$<CONFIG:Debug>:-gstabs>)
endif()
target_compile_options(devilution PUBLIC -Wno-unknown-pragmas)
# Note: In Debug mode, GCC generates spurious memory references that upset Valgrind,
# these options fix that.
target_compile_options(devilution PUBLIC $<$<CONFIG:Debug>:-fno-omit-frame-pointer>)
# Ignore serious warnings due to "quality" of decompiled code
# Currently, disable ignore all warnings (-w), to be removed later
target_compile_options(devilution PRIVATE -fpermissive -Wno-write-strings -Wno-multichar -w)
@ -235,8 +240,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(devilution PRIVATE -fno-aggressive-loop-optimizations)
endif()
# Warnings for devilutionX
target_compile_options(devilution PUBLIC -Wno-unknown-pragmas)
target_compile_options(devilutionx PRIVATE -Wall -Wextra -Wno-multichar -Wno-unused-parameter)
target_compile_options(devilutionx PRIVATE -Wall -Wextra -Wno-write-strings -Wno-multichar -Wno-unused-parameter)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Style issues
@ -248,11 +252,3 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(devilutionx PROPERTIES LINK_FLAGS "-liconv")
endif()
if(COTIRE)
set_target_properties(devilutionx PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
set_target_properties(devilutionx PROPERTIES
COTIRE_PREFIX_HEADER_INCLUDE_PATH "${devilutionX_SOURCE_DIR}"
COTIRE_PREFIX_HEADER_IGNORE_PATH "${devilutionX_SOURCE_DIR}/SourceX")
cotire(devilutionx)
endif()

6
Diablo.dsp

@ -44,7 +44,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /TC /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /O1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /O1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /TC /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
@ -97,7 +97,7 @@ LINK32=link.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# SUBTRACT BASE CPP /WX
# ADD CPP /nologo /MT /W3 /GX /Zi /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FAs /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /Zi /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FAs /YX /FD /TC /c
# SUBTRACT CPP /WX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32

2
DiabloUI/_temp_funcs.h

@ -70,7 +70,7 @@ char *__stdcall BNetGW_10002E0B(char *a1, unsigned int a2);
void __cdecl Connect_FreeConnectData();
BOOL __cdecl Connect_LoadGFXAndStuff();
BOOL __stdcall UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, void *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp);
BOOL __stdcall UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, BYTE *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp);
void __cdecl j_Connect_cpp_init();
void __cdecl Connect_cpp_init();
BOOL __stdcall UiGetDataCallback(int game_type, int data_code, void *a3, int a4, int a5);

2
DiabloUI/connect.cpp

@ -72,7 +72,7 @@ BOOL __cdecl Connect_LoadGFXAndStuff()
// 100295C0: using guessed type int heroport_frames;
// ref: 0x10003009
BOOL __stdcall UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, void *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp)
BOOL __stdcall UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, BYTE *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp)
{
BOOL result; // eax
char pszFileName[260]; // [esp+8h] [ebp-104h]

2
DiabloUI/diabloui.h

@ -46,7 +46,7 @@ BOOL __stdcall UiSoundCallback(int a1, int type, int a3);
void __stdcall UiMessageBoxCallback(HWND hWnd, char *lpText, LPCSTR lpCaption, UINT uType);
BOOL __stdcall UiDrawDescCallback(int game_type, COLORREF color, LPCSTR lpString, char *a4, int a5, UINT align, time_t a7, HDC *a8);
BOOL __stdcall UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6);
BOOL __stdcall UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, void *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp);
BOOL __stdcall UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, BYTE *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp);
int __stdcall UiSelectGame(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *a6);
int __stdcall UiSelectProvider(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *type);
BOOL __stdcall UiCreatePlayerDescription(_uiheroinfo *info, DWORD mode, char *desc);

2
MakefileVC

@ -36,7 +36,7 @@ else
VC6_LINK = wine $(VC6_BIN_DIR)/link.exe
endif
CFLAGS=/nologo /c /TC /GX /W3 /O1 /I $(VC6_INC_DIR) /FD /MT /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fp"Diablo.pch" /YX /Gm /Zi /FA
CFLAGS=/nologo /c /TC /GX /W3 /O1 /I $(VC6_INC_DIR) /FD /MT /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fp"Diablo.pch" /YX /Gm /Zi /FAs
LINKFLAGS=/nologo /subsystem:windows /machine:I386 /incremental:no
ifeq ($(MAKE_BUILD),pdb)

2
Source/asm_trans_rect.inc

@ -50,7 +50,7 @@ x2loop:
#else // _MSC_VER && _M_IX86
{
int row, col;
char *pix = &gpBuffer->row[TRANS_RECT_Y + TRANS_RECT_HEIGHT - 1].pixels[TRANS_RECT_X];
BYTE *pix = &gpBuffer[SCREENXY(TRANS_RECT_X, TRANS_RECT_Y + TRANS_RECT_HEIGHT - 1)];
for (row = TRANS_RECT_HEIGHT >> 1; row != 0; row--) {
for (col = TRANS_RECT_WIDTH >> 1; col != 0; col--) {
*pix++ = 0;

2
Source/automap.cpp

@ -177,7 +177,7 @@ void __cdecl DrawAutomap()
return;
}
gpBufEnd = (unsigned char *)&gpBuffer->row[352];
gpBufEnd = (unsigned char *)&gpBuffer[(352 + 160) * 768];
MapX = (ViewX - 16) >> 1;
while (MapX + AutoMapXOfs < 0)

2
Source/capture.cpp

@ -24,7 +24,7 @@ void __cdecl CaptureScreen()
j_lock_buf_priv(2);
success = CaptureHdr(hObject, 640, 480);
if (success) {
success = CapturePix(hObject, 640, 480, 768, (BYTE *)gpBuffer->row[0].pixels);
success = CapturePix(hObject, 640, 480, 768, &gpBuffer[SCREENXY(0, 0)]);
if (success) {
success = CapturePal(hObject, palette);
}

21
Source/control.cpp

@ -187,12 +187,11 @@ int SpellPages[6][7] = {
void __fastcall DrawSpellCel(int xp, int yp, BYTE *Trans, int nCel, int w)
{
BYTE *tmp, *dst, *tbl, *end;
BYTE *dst, *tbl, *end;
/// ASSERT: assert(gpBuffer);
tmp = (BYTE *)gpBuffer; /* remove when fixed */
dst = &tmp[screen_y_times_768[yp] + xp];
dst = &gpBuffer[xp + screen_y_times_768[yp]];
tbl = SplTransTbl;
#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
@ -846,7 +845,7 @@ void __fastcall DrawPanelBox(int x, int y, int w, int h, int sx, int sy)
unsigned int v11; // ecx
v6 = (char *)pBtmBuff + 640 * y + x;
v7 = &gpBuffer->row_unused_1[sy].col_unused_1[sx];
v7 = (char *)&gpBuffer[768 * sy + sx];
v8 = h;
do {
v9 = w >> 1;
@ -872,7 +871,7 @@ void __fastcall SetFlaskHeight(char *buf, int min, int max, int c, int r)
int v7; // edx
v5 = &buf[88 * min];
v6 = &gpBuffer->row_unused_1[r].col_unused_1[c];
v6 = (char *)&gpBuffer[768 * r + c];
v7 = max - min;
do {
qmemcpy(v6, v5, 0x58u);
@ -1023,20 +1022,20 @@ void __cdecl InitControlPan()
pSpellCels = LoadFileInMem("CtrlPan\\SpelIcon.CEL", 0);
SetSpellTrans(RSPLTYPE_SKILL);
pStatusPanel = LoadFileInMem("CtrlPan\\Panel8.CEL", 0);
CelDecodeRect((char *)pBtmBuff, 0, 143, 640, (char *)pStatusPanel, 1, 640);
CelDecodeRect((BYTE *)pBtmBuff, 0, 143, 640, (BYTE *)pStatusPanel, 1, 640);
v1 = pStatusPanel;
pStatusPanel = 0;
mem_free_dbg(v1);
pStatusPanel = LoadFileInMem("CtrlPan\\P8Bulbs.CEL", 0);
CelDecodeRect(pLifeBuff, 0, 87, 88, (char *)pStatusPanel, 1, 88);
CelDecodeRect(pManaBuff, 0, 87, 88, (char *)pStatusPanel, 2, 88);
CelDecodeRect((BYTE *)pLifeBuff, 0, 87, 88, (BYTE *)pStatusPanel, 1, 88);
CelDecodeRect((BYTE *)pManaBuff, 0, 87, 88, (BYTE *)pStatusPanel, 2, 88);
v2 = pStatusPanel;
pStatusPanel = 0;
mem_free_dbg(v2);
talkflag = 0;
if (gbMaxPlayers != 1) {
pTalkPanel = LoadFileInMem("CtrlPan\\TalkPanl.CEL", 0);
CelDecodeRect((char *)pBtmBuff, 0, 287, 640, (char *)pTalkPanel, 1, 640);
CelDecodeRect((BYTE *)pBtmBuff, 0, 287, 640, (BYTE *)pTalkPanel, 1, 640);
v3 = pTalkPanel;
pTalkPanel = 0;
mem_free_dbg(v3);
@ -2270,7 +2269,7 @@ void __cdecl RedBack()
_LOWORD(v0) = v0 & 0xF400;
v12 = v0 + 768 * 6;
if (leveltype == DTYPE_HELL) {
v7 = gpBuffer->row[0].pixels;
v7 = (char *)&gpBuffer[SCREENXY(0, 0)];
_EBX = &pLightTbl[v12];
v9 = 352;
do {
@ -2286,7 +2285,7 @@ void __cdecl RedBack()
--v9;
} while (v9);
} else {
v1 = gpBuffer->row[0].pixels;
v1 = (char *)&gpBuffer[SCREENXY(0, 0)];
_EBX = &pLightTbl[v12];
v3 = 352;
do {

152
Source/drlg_l1.cpp

@ -202,77 +202,87 @@ void __cdecl DRLG_L1Floor()
void __cdecl DRLG_L1Pass3()
{
int v0; // eax
int *v1; // edx
int *v2; // eax
signed int v3; // ecx
signed int v4; // ebx
int *v5; // ecx
unsigned char *v6; // edx
unsigned short *v7; // esi
unsigned short v8; // ax
int v9; // eax
int v10; // ST24_4
int v11; // ST20_4
int v12; // ST1C_4
signed int v13; // [esp+Ch] [ebp-1Ch]
int *v14; // [esp+10h] [ebp-18h]
int v15; // [esp+14h] [ebp-14h]
int v16; // [esp+18h] [ebp-10h]
int v17; // [esp+1Ch] [ebp-Ch]
int v18; // [esp+20h] [ebp-8h]
v0 = *((unsigned short *)pMegaTiles + 84) + 1;
v18 = *((unsigned short *)pMegaTiles + 84) + 1;
_LOWORD(v0) = *((_WORD *)pMegaTiles + 85);
v17 = ++v0;
_LOWORD(v0) = *((_WORD *)pMegaTiles + 86);
v16 = ++v0;
_LOWORD(v0) = *((_WORD *)pMegaTiles + 87);
v15 = v0 + 1;
v1 = dPiece[1];
do {
v2 = v1;
v3 = 56;
do {
*(v2 - 112) = v18;
*v2 = v17;
*(v2 - 111) = v16;
v2[1] = v15;
v2 += 224;
--v3;
} while (v3);
v1 += 2;
} while ((INT_PTR)v1 < (INT_PTR)dPiece[2]);
v4 = 0;
v14 = &dPiece[17][16]; /* check */
do {
v5 = v14;
v6 = (unsigned char *)dungeon + v4;
v13 = 40;
do {
v7 = (unsigned short *)((char *)pMegaTiles + 8 * (*v6 - 1));
v8 = *v7;
++v7;
v9 = v8 + 1;
v10 = v9;
_LOWORD(v9) = *v7;
++v7;
v11 = ++v9;
_LOWORD(v9) = *v7;
v12 = ++v9;
_LOWORD(v9) = v7[1];
v6 += 40;
*(v5 - 112) = v10;
*v5 = v11;
*(v5 - 111) = v12;
v5[1] = v9 + 1;
v5 += 224;
--v13;
} while (v13);
v14 += 2;
++v4;
} while (v4 < 40);
int i, j, xx, yy;
long v1, v2, v3, v4, lv;
lv = 22-1;
#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
__asm {
mov esi, pMegaTiles
mov eax, lv
shl eax, 3
add esi, eax
xor eax, eax
lodsw
inc eax
mov v1, eax
lodsw
inc eax
mov v2, eax
lodsw
inc eax
mov v3, eax
lodsw
inc eax
mov v4, eax
}
#else
v1 = *((WORD *)&pMegaTiles[lv*8])+1;
v2 = *((WORD *)&pMegaTiles[lv*8]+1)+1;
v3 = *((WORD *)&pMegaTiles[lv*8]+2)+1;
v4 = *((WORD *)&pMegaTiles[lv*8]+3)+1;
#endif
for(j = 0; j < MAXDUNY; j += 2) {
for(i = 0; i < MAXDUNX; i += 2) {
dPiece[i][j] = v1;
dPiece[i+1][j] = v2;
dPiece[i][j+1] = v3;
dPiece[i+1][j+1] = v4;
}
}
yy = 16;
for(j = 0; j < DMAXY; j++) {
xx = 16;
for(i = 0; i < DMAXX; i++) {
lv = (unsigned char)dungeon[i][j]-1;
/// ASSERT: assert(lv >= 0);
#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
__asm {
mov esi, pMegaTiles
mov eax, lv
shl eax, 3
add esi, eax
xor eax, eax
lodsw
inc eax
mov v1, eax
lodsw
inc eax
mov v2, eax
lodsw
inc eax
mov v3, eax
lodsw
inc eax
mov v4, eax
}
#else
v1 = *((WORD *)&pMegaTiles[lv*8])+1;
v2 = *((WORD *)&pMegaTiles[lv*8]+1)+1;
v3 = *((WORD *)&pMegaTiles[lv*8]+2)+1;
v4 = *((WORD *)&pMegaTiles[lv*8]+3)+1;
#endif
dPiece[xx][yy] = v1;
dPiece[xx+1][yy] = v2;
dPiece[xx][yy+1] = v3;
dPiece[xx+1][yy+1] = v4;
xx += 2;
}
yy += 2;
}
}
void __cdecl DRLG_InitL1Vals()

10
Source/dx.cpp

@ -4,11 +4,11 @@
DEVILUTION_BEGIN_NAMESPACE
Screen *sgpBackBuf;
BYTE *sgpBackBuf;
LPDIRECTDRAW lpDDInterface;
IDirectDrawPalette *lpDDPalette; // idb
int sgdwLockCount;
Screen *gpBuffer;
BYTE *gpBuffer;
IDirectDrawSurface *lpDDSBackBuf;
IDirectDrawSurface *lpDDSPrimary;
#ifdef _DEBUG
@ -130,7 +130,7 @@ void __cdecl dx_create_back_buffer()
#else
lpDDSPrimary->lpVtbl->Unlock(lpDDSPrimary, NULL);
#endif
sgpBackBuf = (Screen *)DiabloAllocPtr(sizeof(Screen));
sgpBackBuf = (BYTE *)DiabloAllocPtr(656 * 768);
return;
}
if (error_code != DDERR_CANTLOCKSURFACE)
@ -240,7 +240,7 @@ void __cdecl lock_buf_priv()
DDErrMsg(error_code, 235, "C:\\Src\\Diablo\\Source\\dx.cpp");
gpBufEnd += (int)ddsd.lpSurface;
gpBuffer = (Screen *)ddsd.lpSurface;
gpBuffer = (BYTE *)ddsd.lpSurface;
sgdwLockCount++;
}
@ -282,7 +282,7 @@ void __cdecl unlock_buf_priv()
void __cdecl dx_cleanup()
{
Screen *v0; // ecx
BYTE *v0; // ecx
if (ghMainWnd)
ShowWindow(ghMainWnd, SW_HIDE);

2
Source/dx.h

@ -4,7 +4,7 @@
extern IDirectDraw *lpDDInterface;
extern IDirectDrawPalette *lpDDPalette; // idb
extern Screen *gpBuffer;
extern BYTE *gpBuffer;
extern IDirectDrawSurface *lpDDSBackBuf;
extern IDirectDrawSurface *lpDDSPrimary;
extern char gbBackBuf; // weak

1
Source/effects.cpp

@ -1158,6 +1158,7 @@ void __cdecl sound_update()
sfx_stop();
}
}
// 415DBA: could not find valid save-restore pair for ebp
void __cdecl effects_cleanup_sfx()

1693
Source/engine.cpp

File diff suppressed because it is too large Load Diff

18
Source/engine.h

@ -19,20 +19,20 @@ void __fastcall CelDecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWid
void __fastcall CelDecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall CelDecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall CelDecodeLightOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void __fastcall CelDecodeHdrLightOnly(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int always_0, int direction);
void __fastcall CelDecodeHdrLightTrans(char *pBuff, char *pCelBuff, int frame, int frame_width, int always_0, int direction);
void __fastcall CelDrawHdrLightRed(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int always_0, int direction, char always_1);
void __fastcall CelDecodeHdrLightOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall CelDecodeHdrLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall CelDrawHdrLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir, char light);
void __fastcall Cel2DecDatOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall Cel2DrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall Cel2DecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall Cel2DecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall Cel2DecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall Cel2DecodeHdrLight(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int a6, int direction);
void __fastcall Cel2DecodeLightTrans(char *dst_buf, char *pCelBuff, int frame, int frame_width, int a5, int direction);
void __fastcall Cel2DrawHdrLightRed(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int always_0, int direction, char always_1);
void __fastcall CelDecodeRect(char *pBuff, int always_0, int dst_height, int dst_width, char *pCelBuff, int frame, int frame_width);
void __fastcall CelDecodeClr(BYTE colour, int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int a7, int direction);
void __fastcall CelDrawHdrClrHL(char colour, int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int a7, int direction);
void __fastcall Cel2DecodeHdrLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall Cel2DecodeLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall Cel2DrawHdrLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir, char light);
void __fastcall CelDecodeRect(BYTE *pBuff, int always_0, int hgt, int wdt, BYTE *pCelBuff, int nCel, int nWidth);
void __fastcall CelDecodeClr(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall CelDrawHdrClrHL(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall ENG_set_pixel(int screen_x, int screen_y, UCHAR pixel);
void __fastcall engine_draw_pixel(int x, int y);
void __fastcall DrawLine(int x0, int y0, int x1, int y1, UCHAR col);

2
Source/gendung.cpp

@ -24,7 +24,7 @@ int dPiece[MAXDUNX][MAXDUNY];
char dTransVal[MAXDUNX][MAXDUNY];
int setloadflag_2; // weak
int tile_defs[2048];
void *pMegaTiles;
BYTE *pMegaTiles;
void *pLevelPieces;
int gnDifficulty; // idb
char block_lvid[2049];

2
Source/gendung.h

@ -22,7 +22,7 @@ extern int dPiece[MAXDUNX][MAXDUNY];
extern char dTransVal[MAXDUNX][MAXDUNY];
extern int setloadflag_2; // weak
extern int tile_defs[2048];
extern void *pMegaTiles;
extern BYTE *pMegaTiles;
extern void *pLevelPieces;
extern int gnDifficulty; // idb
extern char block_lvid[2049];

42
Source/inv.cpp

@ -168,13 +168,13 @@ void __cdecl DrawInv()
if (!plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 517, 219, (char *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 517, 219, (BYTE *)pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) {
CelDrawHdrOnly(517, 219, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(517, 219, (char *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(517, 219, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -192,13 +192,13 @@ void __cdecl DrawInv()
if (!plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 432, 365, (char *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 432, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) {
CelDrawHdrOnly(432, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(432, 365, (char *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(432, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -216,13 +216,13 @@ void __cdecl DrawInv()
if (!plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 633, 365, (char *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 633, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) {
CelDrawHdrOnly(633, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(633, 365, (char *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(633, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -240,13 +240,13 @@ void __cdecl DrawInv()
if (!plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 589, 220, (char *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 589, 220, (BYTE *)pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) {
CelDrawHdrOnly(589, 220, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(589, 220, (char *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(589, 220, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -267,13 +267,13 @@ void __cdecl DrawInv()
if (!plr[myplr].InvBody[INVLOC_HAND_LEFT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, screen_x, screen_y, (char *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iStatFlag) {
CelDrawHdrOnly(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(screen_x, screen_y, (char *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
}
if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iLoc == ILOC_TWOHAND) {
@ -283,9 +283,9 @@ void __cdecl DrawInv()
CelDecodeHdrLightTrans(
frame_width == INV_SLOT_SIZE_PX
? &gpBuffer->row[160].pixels[581]
: &gpBuffer->row[160].pixels[567],
(char *)pCursCels, frame, frame_width, 0, 8);
? &gpBuffer[SCREENXY(581, 160)]
: &gpBuffer[SCREENXY(567, 160)],
(BYTE *)pCursCels, frame, frame_width, 0, 8);
cel_transparency_active = 0;
}
@ -307,13 +307,13 @@ void __cdecl DrawInv()
if (!plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, screen_x, screen_y, (char *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iStatFlag) {
CelDrawHdrOnly(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(screen_x, screen_y, (char *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -331,13 +331,13 @@ void __cdecl DrawInv()
if (!plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, 517, 320, (char *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, 517, 320, (BYTE *)pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) {
CelDrawHdrOnly(517, 320, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(517, 320, (char *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(517, 320, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -372,7 +372,7 @@ void __cdecl DrawInv()
colour,
InvRect[j + SLOTXY_INV_FIRST].X + 64,
InvRect[j + SLOTXY_INV_FIRST].Y + 159,
(char *)pCursCels, frame, frame_width, 0, 8);
(BYTE *)pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvList[ii]._iStatFlag) {
@ -384,7 +384,7 @@ void __cdecl DrawInv()
CelDrawHdrLightRed(
InvRect[j + SLOTXY_INV_FIRST].X + 64,
InvRect[j + SLOTXY_INV_FIRST].Y + 159,
(char *)pCursCels, frame, frame_width, 0, 8, 1);
(BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
}
}
}
@ -420,13 +420,13 @@ void __cdecl DrawInvBelt()
colour = ICOL_BLUE;
if (!plr[myplr].SpdList[i]._iStatFlag)
colour = ICOL_RED;
CelDecodeClr(colour, InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (char *)pCursCels, frame, frame_width, 0, 8);
CelDecodeClr(colour, InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (BYTE *)pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].SpdList[i]._iStatFlag)
CelDrawHdrOnly(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (BYTE *)pCursCels, frame, frame_width, 0, 8);
else
CelDrawHdrLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (char *)pCursCels, frame, frame_width, 0, 8, 1);
CelDrawHdrLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (BYTE *)pCursCels, frame, frame_width, 0, 8, 1);
if (AllItemsList[plr[myplr].SpdList[i].IDidx].iUsable
&& plr[myplr].SpdList[i]._iStatFlag

21
Source/items.cpp

@ -3767,8 +3767,8 @@ void __fastcall DrawULine(int y)
char *v2; // edi
signed int v3; // edx
v1 = &gpBuffer->row[25].pixels[26];
v2 = &gpBuffer->row_unused_1[0].pixels[screen_y_times_768[SStringY[y] + 198] + 26];
v1 = (char *)&gpBuffer[SCREENXY(26, 25)];
v2 = (char *)&gpBuffer[screen_y_times_768[SStringY[y] + 198] + 26 + 64];
v3 = 3;
do {
qmemcpy(v2, v1, 0x10A); /* find real fix */
@ -4129,15 +4129,18 @@ void __fastcall UseItem(int p, int Mid, int spl)
}
}
BOOLEAN __fastcall StoreStatOk(ItemStruct *h)
BOOL __fastcall StoreStatOk(ItemStruct *h)
{
BOOLEAN sf; // al
BOOL sf;
sf = TRUE;
if (plr[myplr]._pStrength < h->_iMinStr)
sf = FALSE;
if (plr[myplr]._pMagic < h->_iMinMag)
sf = FALSE;
if (plr[myplr]._pDexterity < h->_iMinDex)
sf = FALSE;
sf = 1;
if (plr[myplr]._pStrength < h->_iMinStr
|| plr[myplr]._pMagic < h->_iMinMag
|| plr[myplr]._pDexterity < h->_iMinDex)
sf = 0;
return sf;
}

2
Source/items.h

@ -88,7 +88,7 @@ void __fastcall PrintItemMisc(ItemStruct *x);
void __fastcall PrintItemDetails(ItemStruct *x);
void __fastcall PrintItemDur(ItemStruct *x);
void __fastcall UseItem(int p, int Mid, int spl);
BOOLEAN __fastcall StoreStatOk(ItemStruct *h);
BOOL __fastcall StoreStatOk(ItemStruct *h);
BOOL __fastcall SmithItemOk(int i);
int __fastcall RndSmithItem(int lvl);
void __fastcall BubbleSwapItem(ItemStruct *a, ItemStruct *b);

160
Source/minitext.cpp

@ -96,59 +96,121 @@ void __cdecl DrawQTextBack()
#include "asm_trans_rect.inc"
}
void __fastcall PrintQTextChr(int screen_x, int screen_y, char *cel_buf, int frame)
void __fastcall PrintQTextChr(int sx, int sy, BYTE *pCelBuff, int nCel)
{
char *v4; // ebx
char *v5; // esi
char *v6; // edi
int v7; // ebx
signed int v8; // edx
unsigned int v9; // eax
unsigned int v10; // ecx
char v11; // cf
unsigned int v12; // ecx
char *v13; // [esp+14h] [ebp-8h]
char *v14; // [esp+18h] [ebp-4h]
BYTE *dst, *pStart, *pEnd, *end;
v13 = (char *)gpBuffer + screen_y_times_768[209];
v14 = (char *)gpBuffer + screen_y_times_768[469];
v4 = &cel_buf[4 * frame];
v5 = &cel_buf[*(_DWORD *)v4];
v6 = (char *)gpBuffer + screen_y_times_768[screen_y] + screen_x;
v7 = (int)&v5[*((_DWORD *)v4 + 1) - *(_DWORD *)v4];
do {
v8 = 22;
do {
while (1) {
v9 = (unsigned char)*v5++;
if ((v9 & 0x80u) == 0)
break;
_LOBYTE(v9) = -(char)v9;
v6 += v9;
v8 -= v9;
if (!v8)
goto LABEL_15;
}
v8 -= v9;
if (v6 < v13 || v6 > v14) {
v5 += v9;
v6 += v9;
} else {
v10 = v9 >> 1;
if (!(v9 & 1) || (*v6 = *v5, ++v5, ++v6, v10)) {
v11 = v10 & 1;
v12 = v9 >> 2;
if (!v11 || (*(_WORD *)v6 = *(_WORD *)v5, v5 += 2, v6 += 2, v12)) {
qmemcpy(v6, v5, 4 * v12);
v5 += 4 * v12;
v6 += 4 * v12;
/// ASSERT: assert(gpBuffer);
dst = &gpBuffer[sx + screen_y_times_768[sy]];
pStart = &gpBuffer[screen_y_times_768[209]];
pEnd = &gpBuffer[screen_y_times_768[469]];
#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
__asm {
mov ebx, pCelBuff
mov eax, nCel
shl eax, 2
add ebx, eax
mov eax, [ebx+4]
sub eax, [ebx]
mov end, eax
mov esi, pCelBuff
add esi, [ebx]
mov edi, dst
mov ebx, end
add ebx, esi
label1:
mov edx, 22
label2:
xor eax, eax
lodsb
or al, al
js label7
sub edx, eax
cmp edi, pStart
jb label5
cmp edi, pEnd
ja label5
mov ecx, eax
shr ecx, 1
jnb label3
movsb
jecxz label6
label3:
shr ecx, 1
jnb label4
movsw
jecxz label6
label4:
rep movsd
jmp label6
label5:
add esi, eax
add edi, eax
label6:
or edx, edx
jz label8
jmp label2
label7:
neg al
add edi, eax
sub edx, eax
jnz label2
label8:
sub edi, 768 + 22
cmp ebx, esi
jnz label1
}
#else
int i;
BYTE width;
BYTE *src;
DWORD *pFrameTable;
pFrameTable = (DWORD *)&pCelBuff[4 * nCel];
src = &pCelBuff[pFrameTable[0]];
end = &src[pFrameTable[1] - pFrameTable[0]];
for(; src != end; dst -= 768 + 22) {
for(i = 22; i;) {
width = *src++;
if(!(width & 0x80)) {
i -= width;
if(dst >= pStart && dst <= pEnd) {
if(width & 1) {
dst[0] = src[0];
src++;
dst++;
}
width >>= 1;
if(width & 1) {
dst[0] = src[0];
dst[1] = src[1];
src += 2;
dst += 2;
}
width >>= 1;
for(; width; width--) {
dst[0] = src[0];
dst[1] = src[1];
dst[2] = src[2];
dst[3] = src[3];
src += 4;
dst += 4;
}
} else {
src += width;
dst += width;
}
} else {
width = -(char)width;
dst += width;
i -= width;
}
} while (v8);
LABEL_15:
v6 -= 790;
} while ((char *)v7 != v5);
}
}
#endif
}
void __cdecl DrawQText()
@ -213,7 +275,7 @@ void __cdecl DrawQText()
if (*v0 == 10)
++v0;
if (v10)
PrintQTextChr(screen_x, screen_y, (char *)pMedTextCels, v10);
PrintQTextChr(screen_x, screen_y, (BYTE *)pMedTextCels, v10);
++v9;
screen_x += mfontkern[v10] + 2;
v8 = *v9;

2
Source/minitext.h

@ -14,7 +14,7 @@ void __cdecl FreeQuestText();
void __cdecl InitQuestText();
void __fastcall InitQTextMsg(int m);
void __cdecl DrawQTextBack();
void __fastcall PrintQTextChr(int screen_x, int screen_y, char *cel_buf, int frame);
void __fastcall PrintQTextChr(int sx, int sy, BYTE *pCelBuff, int nCel);
void __cdecl DrawQText();
/* rdata */

391
Source/missiles.cpp

@ -2439,7 +2439,7 @@ void __fastcall miss_null_11(int mi, int sx, int sy, int dx, int dy, int midir,
SetMissDir(mi, dx);
v10 = v9;
missile[v10]._midam = 0;
missile[v10]._miLightFlag = 1;
missile[v10]._miLightFlag = TRUE;
missile[v10]._mirange = 250;
}
@ -2456,7 +2456,7 @@ void __fastcall miss_null_12(int mi, int sx, int sy, int dx, int dy, int midir,
SetMissDir(mi, v9);
v11 = v10;
missile[v11]._midam = 0;
missile[v11]._miLightFlag = 1;
missile[v11]._miLightFlag = TRUE;
missile[v11]._mirange = 250;
}
@ -2475,56 +2475,43 @@ void __fastcall miss_null_13(int mi, int sx, int sy, int dx, int dy, int midir,
v11 = v10;
v12 = missile[v10]._miAnimLen;
missile[v11]._midam = 0;
missile[v11]._miLightFlag = 1;
missile[v11]._miLightFlag = TRUE;
missile[v11]._mirange = v12;
}
void __fastcall AddRhino(int mi, int sx, int sy, int dx, int dy, int midir, int mienemy, int id, int dam)
{
int v9; // esi
CMonster *v10; // eax
char v11; // cl
AnimStruct *v12; // edi
int v13; // eax
CMonster *v14; // ecx
char v15; // cl
BOOLEAN v16; // zf
int i; // [esp+8h] [ebp-4h]
AnimStruct *anim;
v9 = id;
i = mi;
v10 = monster[id].MType;
v11 = v10->mtype;
if (v10->mtype < MT_HORNED || v11 > MT_OBLORD) {
if (v11 < MT_NSNAKE || (v12 = &v10->Anims[MA_ATTACK], v11 > MT_GSNAKE))
v12 = &v10->Anims[MA_WALK];
if (monster[id].MType->mtype < MT_HORNED || monster[id].MType->mtype > MT_OBLORD) {
if (monster[id].MType->mtype < MT_NSNAKE || monster[id].MType->mtype > MT_GSNAKE) {
anim = &monster[id].MType->Anims[MA_WALK];
} else {
anim = &monster[id].MType->Anims[MA_ATTACK];
}
} else {
v12 = &v10->Anims[MA_SPECIAL];
}
GetMissileVel(i, sx, sy, dx, dy, 18);
v13 = i;
missile[v13]._miAnimFlags = 0;
missile[v13]._mimfnum = midir;
missile[v13]._miAnimData = v12->Data[midir];
missile[v13]._miAnimDelay = v12->Rate;
missile[v13]._miAnimLen = v12->Frames;
v14 = monster[v9].MType;
missile[v13]._miAnimWidth = v14->width;
missile[v13]._miAnimWidth2 = v14->width2;
missile[v13]._miAnimAdd = 1;
v15 = v14->mtype;
if (v15 >= MT_NSNAKE && v15 <= MT_GSNAKE)
missile[v13]._miAnimFrame = 7;
missile[v13]._miVar1 = 0;
missile[v13]._miVar2 = 0;
v16 = monster[v9]._uniqtype == 0;
missile[v13]._miLightFlag = 1;
if (!v16) {
missile[v13]._miUniqTrans = (unsigned char)monster[v9]._uniqtrans + 1;
missile[v13]._mlid = (unsigned char)monster[v9].mlid;
}
missile[v13]._mirange = 256;
PutMissile(i);
anim = &monster[id].MType->Anims[MA_SPECIAL];
}
GetMissileVel(mi, sx, sy, dx, dy, 18);
missile[mi]._miAnimFlags = 0;
missile[mi]._mimfnum = midir;
missile[mi]._miAnimData = anim->Data[midir];
missile[mi]._miAnimDelay = anim->Rate;
missile[mi]._miAnimLen = anim->Frames;
missile[mi]._miAnimWidth = monster[id].MType->width;
missile[mi]._miAnimWidth2 = monster[id].MType->width2;
missile[mi]._miAnimAdd = 1;
if (monster[id].MType->mtype >= MT_NSNAKE && monster[id].MType->mtype <= MT_GSNAKE)
missile[mi]._miAnimFrame = 7;
missile[mi]._miVar1 = 0;
missile[mi]._miVar2 = 0;
missile[mi]._miLightFlag = TRUE;
if (monster[id]._uniqtype != 0) {
missile[mi]._miUniqTrans = monster[id]._uniqtrans + 1;
missile[mi]._mlid = monster[id].mlid;
}
missile[mi]._mirange = 256;
PutMissile(mi);
}
void __fastcall miss_null_32(int mi, int sx, int sy, int dx, int dy, int midir, int mienemy, int id, int dam)
@ -2543,7 +2530,7 @@ void __fastcall miss_null_32(int mi, int sx, int sy, int dx, int dy, int midir,
missile[mi]._miAnimAdd = 1;
missile[mi]._miVar1 = 0;
missile[mi]._miVar2 = 0;
missile[mi]._miLightFlag = 1;
missile[mi]._miLightFlag = TRUE;
if (monster[id]._uniqtype != 0)
missile[mi]._miUniqTrans = monster[id]._uniqtrans + 1;
dMonster[monster[id]._mx][monster[id]._my] = 0;
@ -2621,7 +2608,7 @@ void __fastcall AddAcidpud(int mi, int sx, int sy, int dx, int dy, int midir, in
missile[v9]._miyvel = 0;
missile[v9]._mixoff = 0;
missile[v9]._miyoff = 0;
missile[v9]._miLightFlag = 1;
missile[v9]._miLightFlag = TRUE;
v11 = random(50, 15);
missile[v9]._miPreFlag = TRUE;
missile[v9]._mirange = v11 + 40 * ((unsigned char)monster[v10]._mint + 1);
@ -2767,7 +2754,7 @@ void __fastcall miss_null_23(int mi, int sx, int sy, int dx, int dy, int midir,
SetMissDir(mi, 0);
else
SetMissDir(mi, 1);
missile[mi]._miLightFlag = 1;
missile[mi]._miLightFlag = TRUE;
missile[mi]._mirange = missile[mi]._miAnimLen;
}
@ -3290,7 +3277,7 @@ int __fastcall AddMissile(int sx, int sy, int dx, int dy, int midir, int mitype,
missile[mi]._mityoff = 0;
missile[mi]._miDelFlag = FALSE;
missile[mi]._miAnimAdd = 1;
missile[mi]._miLightFlag = 0;
missile[mi]._miLightFlag = FALSE;
missile[mi]._miPreFlag = FALSE;
missile[mi]._miUniqTrans = 0;
missile[mi]._midam = midam;
@ -4280,75 +4267,44 @@ void __fastcall MI_Etherealize(int i)
void __fastcall MI_Firemove(int i)
{
int v1; // esi
int *v2; // eax
int v4; // ecx
int v5; // ebx
int v6; // ecx
int v7; // edx
int v8; // ecx
int v9; // ST10_4
int v10; // ecx
int ExpLight[14]; // [esp+Ch] [ebp-3Ch]
int ia; // [esp+44h] [ebp-4h]
int j;
int ExpLight[14] = { 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 12 };
v1 = i;
ExpLight[3] = 5;
ExpLight[4] = 5;
missile[v1]._miyoff += 32;
ExpLight[11] = 12;
ExpLight[12] = 12;
--missile[v1]._mix;
--missile[v1]._miy;
ExpLight[0] = 2;
ExpLight[1] = 3;
ExpLight[2] = 4;
ExpLight[5] = 6;
ExpLight[6] = 7;
ExpLight[7] = 8;
ExpLight[8] = 9;
ExpLight[9] = 10;
ExpLight[10] = 11;
ia = i;
ExpLight[13] = 0;
v2 = &missile[i]._miVar1;
if (++*v2 == missile[i]._miAnimLen) {
missile[i]._mix--;
missile[i]._miy--;
missile[i]._miyoff += 32;
missile[i]._miVar1++;
if (missile[i]._miVar1 == missile[i]._miAnimLen) {
SetMissDir(i, 1);
missile[v1]._miAnimFrame = random(82, 11) + 1;
missile[i]._miAnimFrame = random(82, 11) + 1;
}
v4 = ia;
missile[v1]._mitxoff += missile[v1]._mixvel;
missile[v1]._mityoff += missile[v1]._miyvel;
GetMissilePos(v4);
v5 = missile[v1]._mirange;
CheckMissileCol(ia, missile[v1]._midam, missile[v1]._midam, 0, missile[v1]._mix, missile[v1]._miy, 0);
if (missile[v1]._miHitFlag)
missile[v1]._mirange = v5;
if (!missile[v1]._mirange) {
v6 = missile[v1]._mlid;
missile[v1]._miDelFlag = TRUE;
AddUnLight(v6);
missile[i]._mitxoff += missile[i]._mixvel;
missile[i]._mityoff += missile[i]._miyvel;
GetMissilePos(i);
j = missile[i]._mirange;
CheckMissileCol(i, missile[i]._midam, missile[i]._midam, 0, missile[i]._mix, missile[i]._miy, 0);
if (missile[i]._miHitFlag == TRUE)
missile[i]._mirange = j;
if (!missile[i]._mirange) {
missile[i]._miDelFlag = TRUE;
AddUnLight(missile[i]._mlid);
}
if (missile[v1]._mimfnum || !missile[v1]._mirange) {
v7 = missile[v1]._mix;
if (v7 != missile[v1]._miVar3 || missile[v1]._miy != missile[v1]._miVar4) {
v8 = missile[v1]._mlid;
missile[v1]._miVar3 = v7;
v9 = missile[v1]._miy;
missile[v1]._miVar4 = v9;
ChangeLight(v8, v7, v9, 8);
if (missile[i]._mimfnum || !missile[i]._mirange) {
if (missile[i]._mix != missile[i]._miVar3 || missile[i]._miy != missile[i]._miVar4) {
missile[i]._miVar3 = missile[i]._mix;
missile[i]._miVar4 = missile[i]._miy;
ChangeLight(missile[i]._mlid, missile[i]._mix, missile[i]._miy, 8);
}
} else {
if (!missile[v1]._miVar2)
missile[v1]._mlid = AddLight(missile[v1]._mix, missile[v1]._miy, ExpLight[0]);
ChangeLight(missile[v1]._mlid, missile[v1]._mix, missile[v1]._miy, ExpLight[missile[v1]._miVar2]);
++missile[v1]._miVar2;
if (!missile[i]._miVar2)
missile[i]._mlid = AddLight(missile[i]._mix, missile[i]._miy, ExpLight[0]);
ChangeLight(missile[i]._mlid, missile[i]._mix, missile[i]._miy, ExpLight[missile[i]._miVar2]);
missile[i]._miVar2++;
}
++missile[v1]._mix;
v10 = ia;
++missile[v1]._miy;
missile[v1]._miyoff -= 32;
PutMissile(v10);
missile[i]._mix++;
missile[i]._miy++;
missile[i]._miyoff -= 32;
PutMissile(i);
}
void __fastcall MI_Guardian(int i)
@ -4746,78 +4702,44 @@ void __fastcall MI_Rhino(int i)
void __fastcall mi_null_32(int i)
{
int v1; // edi
int v2; // esi
int v3; // ebx
int v4; // edi
int v5; // eax
int v6; // eax
int v7; // ecx
int v8; // eax
int v9; // eax
int v10; // ebx
int v11; // eax
//int v12; // eax
int v13; // ecx
int v14; // ecx
unsigned char *v15; // eax
int v16; // [esp+Ch] [ebp-14h]
int arglist; // [esp+10h] [ebp-10h]
int x; // [esp+14h] [ebp-Ch]
int y; // [esp+18h] [ebp-8h]
int a3; // [esp+1Ch] [ebp-4h]
int src, enemy, ax, ay, bx, by, cx, cy, j;
v1 = i;
arglist = i;
GetMissilePos(i);
v2 = v1;
v3 = missile[v1]._mix;
a3 = missile[v1]._miy;
missile[v2]._mitxoff += missile[v1]._mixvel;
missile[v2]._mityoff += missile[v1]._miyvel;
GetMissilePos(v1);
v4 = missile[v1]._misource;
y = missile[v2]._miy;
v5 = monster[v4]._menemy;
x = missile[v2]._mix;
if (monster[v4]._mFlags & MFLAG_TARGETS_MONSTER) {
v9 = v5;
v7 = monster[v9]._mx;
v8 = monster[v9]._my;
ax = missile[i]._mix;
ay = missile[i]._miy;
missile[i]._mitxoff += missile[i]._mixvel;
missile[i]._mityoff += missile[i]._miyvel;
GetMissilePos(i);
src = missile[i]._misource;
bx = missile[i]._mix;
by = missile[i]._miy;
enemy = monster[src]._menemy;
if (!(monster[src]._mFlags & MFLAG_TARGETS_MONSTER)) {
cx = plr[enemy].WorldX;
cy = plr[enemy].WorldY;
} else {
v6 = v5;
v7 = plr[v6].WorldX;
v8 = plr[v6].WorldY;
}
v16 = v8;
if ((missile[v2]._mix != v3 || y != a3)
&& (missile[v2]._miVar1 & 1 && (abs(v3 - v7) >= 4 || abs(a3 - v16) >= 4) || missile[v2]._miVar2 > 1)
&& PosOkMonst(missile[v2]._misource, v3, a3)) {
MissToMonst(arglist, v3, a3);
v10 = v16;
missile[v2]._miDelFlag = TRUE;
cx = monster[enemy]._mx;
cy = monster[enemy]._my;
}
if ((bx != ax || by != ay) && (missile[i]._miVar1 & 1 && (abs(ax - cx) >= 4 || abs(ay - cy) >= 4) || missile[i]._miVar2 > 1) && PosOkMonst(missile[i]._misource, ax, ay)) {
MissToMonst(i, ax, ay);
missile[i]._miDelFlag = TRUE;
} else if (!(monster[src]._mFlags & MFLAG_TARGETS_MONSTER)) {
j = dPlayer[bx][by];
} else {
v11 = x;
if (monster[v4]._mFlags & MFLAG_TARGETS_MONSTER)
v10 = dMonster[v11][y];
else
v10 = dPlayer[v11][y];
}
//_LOBYTE(v12) = PosOkMissile(x, y);
if (!PosOkMissile(x, y) || v10 > 0 && !(missile[v2]._miVar1 & 1)) {
missile[v2]._mixvel = -missile[v2]._mixvel;
v13 = missile[v2]._mimfnum;
missile[v2]._miyvel = -missile[v2]._miyvel;
v14 = opposite[v13];
missile[v2]._mimfnum = v14;
v15 = monster[v4].MType->Anims[MA_WALK].Data[v14];
++missile[v2]._miVar2;
missile[v2]._miAnimData = v15;
if (v10 > 0)
missile[v2]._miVar1 |= 1u;
j = dMonster[bx][by];
}
MoveMissilePos(arglist);
PutMissile(arglist);
if (!PosOkMissile(bx, by) || j > 0 && !(missile[i]._miVar1 & 1)) {
missile[i]._mixvel *= -1;
missile[i]._miyvel *= -1;
missile[i]._mimfnum = opposite[missile[i]._mimfnum];
missile[i]._miAnimData = monster[src].MType->Anims[MA_WALK].Data[missile[i]._mimfnum];
missile[i]._miVar2++;
if (j > 0)
missile[i]._miVar1 |= 1;
}
MoveMissilePos(i);
PutMissile(i);
}
void __fastcall MI_FirewallC(int i)
@ -5497,66 +5419,32 @@ void __fastcall MI_Bonespirit(int i)
void __fastcall MI_ResurrectBeam(int i)
{
int v1; // eax
BOOLEAN v2; // zf
v1 = i;
v2 = missile[i]._mirange == 1;
--missile[v1]._mirange;
if (v2)
missile[v1]._miDelFlag = TRUE;
missile[i]._mirange--;
if (missile[i]._mirange == 0)
missile[i]._miDelFlag = TRUE;
PutMissile(i);
}
void __fastcall MI_Rportal(int i)
{
int v1; // esi
int v2; // eax
int v3; // ecx
int ExpLight[17]; // [esp+8h] [ebp-48h]
int ia; // [esp+4Ch] [ebp-4h]
int ExpLight[17] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15 };
v1 = i;
ExpLight[14] = 15;
ExpLight[15] = 15;
ExpLight[16] = 15;
v2 = missile[i]._mirange;
ia = i;
ExpLight[0] = 1;
ExpLight[1] = 2;
ExpLight[2] = 3;
ExpLight[3] = 4;
ExpLight[4] = 5;
ExpLight[5] = 6;
ExpLight[6] = 7;
ExpLight[7] = 8;
ExpLight[8] = 9;
ExpLight[9] = 10;
ExpLight[10] = 11;
ExpLight[11] = 12;
ExpLight[12] = 13;
ExpLight[13] = 14;
if (v2 > 1)
missile[v1]._mirange = v2 - 1;
if (missile[v1]._mirange == missile[v1]._miVar1)
if (missile[i]._mirange > 1)
missile[i]._mirange--;
if (missile[i]._mirange == missile[i]._miVar1)
SetMissDir(i, 1);
if (currlevel && missile[v1]._mimfnum != 1) {
if (!missile[v1]._mirange) {
LABEL_12:
v3 = missile[v1]._mlid;
missile[v1]._miDelFlag = TRUE;
AddUnLight(v3);
goto LABEL_13;
}
if (!missile[v1]._miVar2)
missile[v1]._mlid = AddLight(missile[v1]._mix, missile[v1]._miy, 1);
ChangeLight(missile[v1]._mlid, missile[v1]._mix, missile[v1]._miy, ExpLight[missile[v1]._miVar2]);
++missile[v1]._miVar2;
if (currlevel && missile[i]._mimfnum != 1 && missile[i]._mirange != 0) {
if (!missile[i]._miVar2)
missile[i]._mlid = AddLight(missile[i]._mix, missile[i]._miy, 1);
ChangeLight(missile[i]._mlid, missile[i]._mix, missile[i]._miy, ExpLight[missile[i]._miVar2]);
missile[i]._miVar2++;
}
if (!missile[v1]._mirange)
goto LABEL_12;
LABEL_13:
PutMissile(ia);
if (!missile[i]._mirange) {
missile[i]._miDelFlag = TRUE;
AddUnLight(missile[i]._mlid);
}
PutMissile(i);
}
void __cdecl ProcessMissiles()
@ -5619,33 +5507,26 @@ void __cdecl ProcessMissiles()
void __cdecl missiles_process_charge()
{
int v0; // ebx
int i; // edi
int v2; // ecx
int v3; // esi
BOOLEAN v4; // zf
CMonster *v5; // eax
char v6; // dl
AnimStruct *v7; // eax
v0 = nummissiles;
for (i = 0; i < v0; ++i) {
v2 = missileactive[i];
v3 = missile[v2]._mimfnum;
v4 = missile[v2]._mitype == MIS_RHINO;
missile[v2]._miAnimData = misfiledata[0].mAnimData[v3 + 59 * _LOBYTE(missile[v2]._miAnimType)];
if (v4) {
v5 = monster[missile[v2]._misource].MType;
v6 = v5->mtype;
if (v5->mtype < MT_HORNED || v6 > MT_OBLORD) {
if (v6 < MT_NSNAKE || v6 > MT_GSNAKE)
v7 = &v5->Anims[MA_WALK];
else
v7 = &v5->Anims[MA_ATTACK];
CMonster *mon;
AnimStruct *anim;
MissileStruct *mis;
int i, mi;
for (i = 0; i < nummissiles; i++) {
mi = missileactive[i];
mis = &missile[mi];
mis->_miAnimData = misfiledata[mis->_miAnimType].mAnimData[mis->_mimfnum];
if (mis->_mitype == MIS_RHINO) {
mon = monster[mis->_misource].MType;
if (mon->mtype >= MT_HORNED && mon->mtype <= MT_OBLORD) {
anim = &mon->Anims[MA_SPECIAL];
} else {
v7 = &v5->Anims[MA_SPECIAL];
if (mon->mtype >= MT_NSNAKE && mon->mtype <= MT_GSNAKE)
anim = &mon->Anims[MA_ATTACK];
else
anim = &mon->Anims[MA_WALK];
}
missile[v2]._miAnimData = v7->Data[v3];
missile[mi]._miAnimData = anim->Data[mis->_mimfnum];
}
}
}

66
Source/objects.cpp

@ -2631,34 +2631,44 @@ void __fastcall objects_set_door_piece(int x, int y)
void __fastcall ObjSetMini(int x, int y, int v)
{
unsigned short *v3; // esi
unsigned short v4; // ax
int v5; // eax
int pn; // ST1C_4
int v7; // ST18_4
int v8; // ST14_4
int v9; // ST10_4
int v10; // esi
int v11; // edi
v3 = (unsigned short *)((char *)pMegaTiles + 8 * ((unsigned short)v - 1));
v4 = *v3;
++v3;
v5 = v4 + 1;
pn = v5;
_LOWORD(v5) = *v3;
++v3;
v7 = ++v5;
_LOWORD(v5) = *v3;
v8 = ++v5;
_LOWORD(v5) = v3[1];
v9 = v5 + 1;
v10 = 2 * x + 16;
v11 = 2 * y + 16;
ObjSetMicro(v10, v11, pn);
ObjSetMicro(v10 + 1, v11++, v7);
ObjSetMicro(v10, v11, v8);
ObjSetMicro(v10 + 1, v11, v9);
int xx, yy;
long v1, v2, v3, v4;
#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
__asm {
mov esi, pMegaTiles
xor eax, eax
mov ax, word ptr v
dec eax
shl eax, 3
add esi, eax
xor eax, eax
lodsw
inc eax
mov v1, eax
lodsw
inc eax
mov v2, eax
lodsw
inc eax
mov v3, eax
lodsw
inc eax
mov v4, eax
}
#else
v1 = *((WORD *)&pMegaTiles[((WORD)v-1)*8])+1;
v2 = *((WORD *)&pMegaTiles[((WORD)v-1)*8]+1)+1;
v3 = *((WORD *)&pMegaTiles[((WORD)v-1)*8]+2)+1;
v4 = *((WORD *)&pMegaTiles[((WORD)v-1)*8]+3)+1;
#endif
xx = 2 * x + 16;
yy = 2 * y + 16;
ObjSetMicro(xx, yy, v1);
ObjSetMicro(xx + 1, yy, v2);
ObjSetMicro(xx, yy + 1, v3);
ObjSetMicro(xx + 1, yy + 1, v4);
}
void __fastcall ObjL1Special(int x1, int y1, int x2, int y2)

50
Source/scrollrt.cpp

@ -873,8 +873,8 @@ void __fastcall scrollrt_draw_clipped_dungeon(char *a1, int sx, int sy, int a4,
if (v18 >= 1 && *(_DWORD *)v17 <= 0x32u && v18 <= *(_DWORD *)v17) {
v19 = a4 - v16->_iAnimWidth2;
if (v49 - 1 == pcursitem)
CelDrawHdrClrHL(ICOL_BLUE, v19, a5, v17, v16->_iAnimFrame, v16->_iAnimWidth, 0, 8);
Cel2DecodeHdrLight(v19, a5, (char *)v16->_iAnimData, v16->_iAnimFrame, v16->_iAnimWidth, 0, 8);
CelDrawHdrClrHL(ICOL_BLUE, v19, a5, (BYTE *)v17, v16->_iAnimFrame, v16->_iAnimWidth, 0, 8);
Cel2DecodeHdrLight(v19, a5, v16->_iAnimData, v16->_iAnimFrame, v16->_iAnimWidth, 0, 8);
}
}
}
@ -987,11 +987,11 @@ void __fastcall scrollrt_draw_clipped_dungeon(char *a1, int sx, int sy, int a4,
if (v38 >= 1 && *(_DWORD *)v37 <= 0x32u && v38 <= *(_DWORD *)v37) {
v39 = a4 - v36->_iAnimWidth2;
if (v49 - 1 == pcursitem)
CelDrawHdrClrHL(ICOL_BLUE, v39, a5, v37, v36->_iAnimFrame, v36->_iAnimWidth, 0, 8);
CelDrawHdrClrHL(ICOL_BLUE, v39, a5, (BYTE *)v37, v36->_iAnimFrame, v36->_iAnimWidth, 0, 8);
Cel2DecodeHdrLight(
v39,
a5,
(char *)v36->_iAnimData,
v36->_iAnimData,
v36->_iAnimFrame,
v36->_iAnimWidth,
0,
@ -1003,7 +1003,7 @@ void __fastcall scrollrt_draw_clipped_dungeon(char *a1, int sx, int sy, int a4,
}
if (v46) {
cel_transparency_active = (unsigned char)TransList[v44];
Cel2DecodeLightTrans(dst_buf, (char *)level_special_cel, v46, 64, 0, 8);
Cel2DecodeLightTrans((BYTE *)dst_buf, (BYTE *)level_special_cel, v46, 64, 0, 8);
}
}
// 4B8CC0: using guessed type char pcursitem;
@ -1111,9 +1111,9 @@ void __fastcall DrawClippedObject(int x, int y, int ox, int oy, BOOL pre, int a6
}
if(bv == pcursobj)
CelDrawHdrClrHL(194, sx, sy, (char *)object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
CelDrawHdrClrHL(194, sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
if(object[bv]._oLight)
Cel2DecodeHdrLight(sx, sy, (char *)object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
Cel2DecodeHdrLight(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
else
Cel2DrawHdrOnly(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
}
@ -1473,8 +1473,8 @@ void __fastcall scrollrt_draw_clipped_dungeon_2(char *buffer, int x, int y, int
if (v21 >= 1 && *(_DWORD *)v20 <= 0x32u && v21 <= *(_DWORD *)v20) {
v22 = v13 - v19->_iAnimWidth2;
if (v52 - 1 == pcursitem)
CelDrawHdrClrHL(ICOL_BLUE, v22, sy, v20, v19->_iAnimFrame, v19->_iAnimWidth, a5, 8);
Cel2DecodeHdrLight(v22, sy, (char *)v19->_iAnimData, v19->_iAnimFrame, v19->_iAnimWidth, a5, 8);
CelDrawHdrClrHL(ICOL_BLUE, v22, sy, (BYTE *)v20, v19->_iAnimFrame, v19->_iAnimWidth, a5, 8);
Cel2DecodeHdrLight(v22, sy, v19->_iAnimData, v19->_iAnimFrame, v19->_iAnimWidth, a5, 8);
}
}
}
@ -1589,11 +1589,11 @@ void __fastcall scrollrt_draw_clipped_dungeon_2(char *buffer, int x, int y, int
if (v41 >= 1 && *(_DWORD *)v40 <= 0x32u && v41 <= *(_DWORD *)v40) {
v42 = v13 - v39->_iAnimWidth2;
if (v52 - 1 == pcursitem)
CelDrawHdrClrHL(ICOL_BLUE, v42, sy, v40, v41, v39->_iAnimWidth, a5, 8);
CelDrawHdrClrHL(ICOL_BLUE, v42, sy, (BYTE *)v40, v41, v39->_iAnimWidth, a5, 8);
Cel2DecodeHdrLight(
v42,
sy,
(char *)v39->_iAnimData,
v39->_iAnimData,
v39->_iAnimFrame,
v39->_iAnimWidth,
a5,
@ -1605,7 +1605,7 @@ void __fastcall scrollrt_draw_clipped_dungeon_2(char *buffer, int x, int y, int
}
if (v49) {
cel_transparency_active = (unsigned char)TransList[v47];
Cel2DecodeLightTrans(dst_buf, (char *)level_special_cel, v49, 64, a5, 8);
Cel2DecodeLightTrans((BYTE *)dst_buf, (BYTE *)level_special_cel, v49, 64, a5, 8);
}
}
// 4B8CC0: using guessed type char pcursitem;
@ -2013,8 +2013,8 @@ void __fastcall scrollrt_draw_dungeon(char *buffer, int x, int y, int a4, int a5
if (v20 >= 1 && *(_DWORD *)v19 <= 0x32u && v20 <= *(_DWORD *)v19) {
v21 = sx - v18->_iAnimWidth2;
if (v51 - 1 == pcursitem)
CelDecodeClr(ICOL_BLUE, v21, sy, v19, v18->_iAnimFrame, v18->_iAnimWidth, 0, a5);
CelDecodeHdrLightOnly(v21, sy, (char *)v18->_iAnimData, v18->_iAnimFrame, v18->_iAnimWidth, 0, a5);
CelDecodeClr(ICOL_BLUE, v21, sy, (BYTE *)v19, v18->_iAnimFrame, v18->_iAnimWidth, 0, a5);
CelDecodeHdrLightOnly(v21, sy, v18->_iAnimData, v18->_iAnimFrame, v18->_iAnimWidth, 0, a5);
}
}
}
@ -2127,11 +2127,11 @@ void __fastcall scrollrt_draw_dungeon(char *buffer, int x, int y, int a4, int a5
if (v40 >= 1 && *(_DWORD *)v39 <= 0x32u && v40 <= *(_DWORD *)v39) {
v41 = sx - v38->_iAnimWidth2;
if (v51 - 1 == pcursitem)
CelDecodeClr(ICOL_BLUE, v41, sy, v39, v38->_iAnimFrame, v38->_iAnimWidth, 0, a5);
CelDecodeClr(ICOL_BLUE, v41, sy, (BYTE *)v39, v38->_iAnimFrame, v38->_iAnimWidth, 0, a5);
CelDecodeHdrLightOnly(
v41,
sy,
(char *)v38->_iAnimData,
v38->_iAnimData,
v38->_iAnimFrame,
v38->_iAnimWidth,
0,
@ -2143,7 +2143,7 @@ void __fastcall scrollrt_draw_dungeon(char *buffer, int x, int y, int a4, int a5
}
if (v48) {
cel_transparency_active = (unsigned char)TransList[v46];
CelDecodeHdrLightTrans(dst_buf, (char *)level_special_cel, v48, 64, 0, a5);
CelDecodeHdrLightTrans((BYTE *)dst_buf, (BYTE *)level_special_cel, v48, 64, 0, a5);
}
}
// 4B8CC0: using guessed type char pcursitem;
@ -2251,9 +2251,9 @@ void __fastcall DrawObject(int x, int y, int ox, int oy, BOOL pre, int a6, int d
}
if(bv == pcursobj)
CelDecodeClr(194, sx, sy, (char *)object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
CelDecodeClr(194, sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
if(object[bv]._oLight) {
CelDecodeHdrLightOnly(sx, sy, (char *)object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
CelDecodeHdrLightOnly(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
} else {
/// ASSERT: assert(object[bv]._oAnimData);
if(object[bv]._oAnimData) // BUGFIX: _oAnimData was already checked, this is redundant
@ -2465,7 +2465,7 @@ void __fastcall DrawZoom(int x, int y)
LABEL_24:
v11 = (_WORD *)((char *)gpBuffer + a6b);
v12 = (char *)gpBuffer + a5a;
v13 = &gpBuffer->row_unused_1[1].col_unused_1[a6b];
v13 = (char *)&gpBuffer[a6b + 768];
v14 = 176;
do {
v15 = v19;
@ -2501,7 +2501,7 @@ void __cdecl ClearScreenBuffer()
j_lock_buf_priv(3);
for (i = 0; i < 480; i++)
memset(gpBuffer->row[i].pixels, 0, 640);
memset(&gpBuffer[SCREENXY(0, i)], 0, 640);
j_unlock_buf_priv(3);
}
@ -2629,7 +2629,7 @@ void __cdecl scrollrt_draw_cursor_back_buffer()
if (sgdwCursWdt) {
v1 = sgdwCursY;
v2 = sgSaveBack;
v3 = &gpBuffer->row[sgdwCursY].pixels[sgdwCursX];
v3 = (char *)&gpBuffer[SCREENXY(sgdwCursX, sgdwCursY)];
v4 = sgdwCursHgt;
if (sgdwCursHgt) {
v5 = sgdwCursHgt;
@ -2701,7 +2701,7 @@ void __cdecl scrollrt_draw_cursor_item()
v14 = sgSaveBack;
v6 = 1 - v3 + v5;
sgdwCursHgt = v6;
v7 = &gpBuffer->row[v3].pixels[v2 & 0xFFFFFFFC];
v7 = (char *)&gpBuffer[SCREENXY(v2 & 0xFFFFFFFC, v3)];
if (v6) {
v8 = v6;
do {
@ -2725,10 +2725,10 @@ void __cdecl scrollrt_draw_cursor_item()
if (!plr[myplr].HoldItem._iStatFlag)
colour = ICOL_RED;
v12 = v9 + 64;
CelDrawHdrClrHL(colour, v12, v1 + v10 + 159, (char *)pCursCels, pcurs, v0, 0, 8);
CelDrawHdrClrHL(colour, v12, v1 + v10 + 159, (BYTE *)pCursCels, pcurs, v0, 0, 8);
v13 = cursH + v10 + 159;
if (colour == ICOL_RED)
Cel2DrawHdrLightRed(v12, v13, (char *)pCursCels, pcurs, cursW, 0, 8, 1);
Cel2DrawHdrLightRed(v12, v13, (BYTE *)pCursCels, pcurs, cursW, 0, 8, 1);
else
Cel2DrawHdrOnly(v12, v13, (BYTE *)pCursCels, pcurs, cursW, 0, 8);
}

2
Source/sound.cpp

@ -6,7 +6,7 @@ DEVILUTION_BEGIN_NAMESPACE
LPDIRECTSOUNDBUFFER DSBs[8];
LPDIRECTSOUND sglpDS;
char gbSndInited;
BOOLEAN gbSndInited;
int sglMusicVolume;
int sglSoundVolume;
HMODULE hDsound_dll;

2
Source/sound.h

@ -3,7 +3,7 @@
#define __SOUND_H__
extern IDirectSoundBuffer *DSBs[8];
extern char gbSndInited;
extern BOOLEAN gbSndInited;
extern HMODULE hDsound_dll;
void __fastcall snd_update(BOOL bStopAll);

51
Source/stores.cpp

@ -579,35 +579,36 @@ void __cdecl S_StartSmith()
void __fastcall S_ScrollSBuy(int idx)
{
int v1; // esi
int v2; // edi
char *v3; // esi
char *v4; // eax
int iclr; // [esp+Ch] [ebp-4h]
int y;
char clr;
v1 = idx;
v2 = 5;
ClearSText(5, 21);
v3 = &smithitem[v1]._iMagical;
stextup = 5;
do {
if (*((_DWORD *)v3 - 13) != -1) {
_LOBYTE(iclr) = COL_WHITE;
if (*v3)
_LOBYTE(iclr) = COL_BLUE;
if (!*((_DWORD *)v3 + 74))
_LOBYTE(iclr) = COL_RED;
v4 = v3 + 65;
if (!*v3)
v4 = v3 + 1;
AddSText(20, v2, 0, v4, iclr, 1);
AddSTextVal(v2, *((_DWORD *)v3 + 35));
PrintStoreItem((ItemStruct *)(v3 - 60), v2 + 1, iclr);
stextdown = v2;
v3 += 368;
for (y = 5; y < 20; y += 4) {
if (smithitem[idx]._itype != -1) {
clr = COL_WHITE;
if (smithitem[idx]._iMagical) {
clr = COL_BLUE;
}
if (!smithitem[idx]._iStatFlag) {
clr = COL_RED;
}
if (smithitem[idx]._iMagical) {
AddSText(20, y, 0, smithitem[idx]._iIName, clr, 1);
} else {
AddSText(20, y, 0, smithitem[idx]._iName, clr, 1);
}
AddSTextVal(y, smithitem[idx]._iIvalue);
PrintStoreItem(&smithitem[idx], y + 1, clr);
stextdown = y;
idx++;
}
v2 += 4;
} while (v2 < 20);
}
if (!stext[stextsel]._ssel && stextsel != 22)
stextsel = stextdown;
}

399
Source/town.cpp

@ -4,83 +4,143 @@
DEVILUTION_BEGIN_NAMESPACE
void __fastcall town_clear_upper_buf(unsigned char *a1)
void __fastcall town_clear_upper_buf(BYTE *pBuff)
{
unsigned char *v1; // edi
signed int v2; // edx
signed int v3; // ebx
unsigned char *v4; // edi
signed int v5; // edx
signed int v6; // ebx
unsigned char *v7; // edi
/// ASSERT: assert(gpBuffer);
v1 = a1;
v2 = 30;
v3 = 1;
while (v1 >= gpBufEnd) {
v4 = &v1[v2];
memset(v4, 0, 4 * v3);
v1 = &v4[4 * v3 - 832 + v2];
if (!v2) {
v5 = 2;
v6 = 15;
do {
if (v1 < gpBufEnd)
break;
v7 = &v1[v5];
memset(v7, 0, 4 * v6);
v1 = &v7[4 * v6-- - 832 + v5];
v5 += 2;
} while (v5 != 32);
return;
}
v2 -= 2;
++v3;
#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
__asm {
mov edi, pBuff
mov edx, 30
mov ebx, 1
xor eax, eax
label1:
cmp edi, gpBufEnd
jb label4
add edi, edx
mov ecx, ebx
rep stosd
add edi, edx
sub edi, 768 + 64
or edx, edx
jz label2
sub edx, 2
inc ebx
jmp label1
label2:
mov edx, 2
mov ebx, 15
label3:
cmp edi, gpBufEnd
jb label4
add edi, edx
mov ecx, ebx
rep stosd
add edi, edx
sub edi, 768 + 64
dec ebx
add edx, 2
cmp edx, 32
jnz label3
label4:
nop
}
#else
int i, j, k;
BYTE *dst;
dst = pBuff;
for(i = 30, j = 1; i >= 0 && dst >= gpBufEnd; i -= 2, j++, dst -= 768 + 64) {
dst += i;
for(k = 0; k < 4 * j; k++)
*dst++ = 0;
dst += i;
}
for(i = 2, j = 15; i != 32 && dst >= gpBufEnd; i += 2, j--, dst -= 768 + 64) {
dst += i;
for(k = 0; k < 4 * j; k++)
*dst++ = 0;
dst += i;
}
#endif
}
// 69CF0C: using guessed type int gpBufEnd;
void __fastcall town_clear_low_buf(unsigned char *y_related)
void __fastcall town_clear_low_buf(BYTE *pBuff)
{
unsigned char *v1; // edi
signed int v2; // edx
signed int i; // ebx
unsigned char *v4; // edi
unsigned char *v5; // edi
signed int v6; // edx
signed int v7; // ebx
unsigned char *v8; // edi
unsigned char *v9; // edi
/// ASSERT: assert(gpBuffer);
#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
__asm {
mov edi, pBuff
mov edx, 30
mov ebx, 1
xor eax, eax
label1:
cmp edi, gpBufEnd
jb label2
add edi, 64
jmp label3
label2:
add edi, edx
mov ecx, ebx
rep stosd
add edi, edx
label3:
sub edi, 768 + 64
or edx, edx
jz label4
sub edx, 2
inc ebx
jmp label1
label4:
mov edx, 2
mov ebx, 15
label5:
cmp edi, gpBufEnd
jb label6
add edi, 64
jmp label7
label6:
add edi, edx
mov ecx, ebx
rep stosd
add edi, edx
label7:
sub edi, 768 + 64
dec ebx
add edx, 2
cmp edx, 32
jnz label5
}
#else
int i, j, k;
BYTE *dst;
v1 = y_related;
v2 = 30;
for (i = 1;; ++i) {
if (v1 < gpBufEnd) {
v5 = &v1[v2];
memset(v5, 0, 4 * i);
v4 = &v5[4 * i + v2];
dst = pBuff;
for(i = 30, j = 1; i >= 0; i -= 2, j++, dst -= 768 + 64) {
if(dst < gpBufEnd) {
dst += i;
for(k = 0; k < 4 * j; k++)
*dst++ = 0;
dst += i;
} else {
v4 = v1 + 64;
dst += 64;
}
v1 = v4 - 832;
if (!v2)
break;
v2 -= 2;
}
v6 = 2;
v7 = 15;
do {
if (v1 < gpBufEnd) {
v9 = &v1[v6];
memset(v9, 0, 4 * v7);
v8 = &v9[4 * v7 + v6];
for(i = 2, j = 15; i != 32; i += 2, j--, dst -= 768 + 64) {
if(dst < gpBufEnd) {
dst += i;
for(k = 0; k < 4 * j; k++)
*dst++ = 0;
dst += i;
} else {
v8 = v1 + 64;
dst += 64;
}
v1 = v8 - 832;
--v7;
v6 += 2;
} while (v6 != 32);
}
#endif
}
// 69CF0C: using guessed type int gpBufEnd;
@ -148,7 +208,7 @@ void __fastcall town_draw_clipped_town(BYTE *buffer, int x, int y, int sx, int s
ICOL_BLUE,
v11,
sy,
(char *)item[v10]._iAnimData,
item[v10]._iAnimData,
item[v10]._iAnimFrame,
item[v10]._iAnimWidth,
0,
@ -163,7 +223,7 @@ void __fastcall town_draw_clipped_town(BYTE *buffer, int x, int y, int sx, int s
166,
v13,
sy,
(char *)towner[v12]._tAnimData,
towner[v12]._tAnimData,
towner[v12]._tAnimFrame,
towner[v12]._tAnimWidth,
0,
@ -180,7 +240,7 @@ void __fastcall town_draw_clipped_town(BYTE *buffer, int x, int y, int sx, int s
166,
v17,
sy,
(char *)towner[v16]._tAnimData,
towner[v16]._tAnimData,
towner[v16]._tAnimFrame,
towner[v16]._tAnimWidth,
0,
@ -253,7 +313,7 @@ void __fastcall town_draw_lower(int x, int y, int sx, int sy, int a5, int some_f
if (y >= 0 && y < MAXDUNY && x >= 0 && x < MAXDUNX && (level_cel_block = dPiece[x][y]) != 0) {
v6 = sy;
v7 = &screen_y_times_768[sy];
a1 = (unsigned char *)&gpBuffer->row_unused_1[0].col_unused_1[*v7 + 32 + sx];
a1 = (unsigned char *)&gpBuffer[*v7 + 32 + sx];
v25 = 1;
v8 = (char *)dpiece_defs_map_1 + 32 * gendung_get_dpiece_num_from_coord(x, y);
do {
@ -408,7 +468,7 @@ void __fastcall town_draw_clipped_town_2(int x, int y, int a3, int a4, int a5, i
ICOL_BLUE,
v13,
sy,
(char *)item[v12]._iAnimData,
item[v12]._iAnimData,
item[v12]._iAnimFrame,
item[v12]._iAnimWidth,
a5,
@ -423,7 +483,7 @@ void __fastcall town_draw_clipped_town_2(int x, int y, int a3, int a4, int a5, i
166,
v15,
sy,
(char *)towner[v14]._tAnimData,
towner[v14]._tAnimData,
towner[v14]._tAnimFrame,
towner[v14]._tAnimWidth,
a5,
@ -440,7 +500,7 @@ void __fastcall town_draw_clipped_town_2(int x, int y, int a3, int a4, int a5, i
166,
v19,
sy,
(char *)towner[v18]._tAnimData,
towner[v18]._tAnimData,
towner[v18]._tAnimFrame,
towner[v18]._tAnimWidth,
a5,
@ -655,21 +715,21 @@ void __fastcall town_draw_town_all(BYTE *buffer, int x, int y, int a4, int dir,
ii = dItem[x][y] - 1;
xx = sx - item[ii]._iAnimWidth2;
if (ii == pcursitem)
CelDecodeClr(ICOL_BLUE, xx, sy, (char *)item[ii]._iAnimData, item[ii]._iAnimFrame, item[ii]._iAnimWidth, 0, dir);
CelDecodeClr(ICOL_BLUE, xx, sy, item[ii]._iAnimData, item[ii]._iAnimFrame, item[ii]._iAnimWidth, 0, dir);
CelDrawHdrOnly(xx, sy, item[ii]._iAnimData, item[ii]._iAnimFrame, item[ii]._iAnimWidth, 0, dir);
}
if (dFlags[x][y] & DFLAG_MONSTER) {
mi = -1 - dMonster[x][y - 1];
xx = sx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst)
CelDecodeClr(PAL16_BEIGE + 6, xx, sy, (char *)towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
CelDecodeClr(PAL16_BEIGE + 6, xx, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
CelDrawHdrOnly(xx, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
}
if (dMonster[x][y] > 0) {
mi = dMonster[x][y] - 1;
xx = sx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst)
CelDecodeClr(PAL16_BEIGE + 6, xx, sy, (char *)towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
CelDecodeClr(PAL16_BEIGE + 6, xx, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
CelDrawHdrOnly(xx, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
}
if (dFlags[x][y] & DFLAG_PLAYER) {
@ -712,7 +772,7 @@ void __fastcall town_draw_upper(int x, int y, int sx, int sy, INT_PTR a5, int a6
int v14; // esi
int v15; // edi
int v16; // eax
Screen *v17; // eax
BYTE *v17; // eax
unsigned char *v18; // ebx
char *v19; // edi
int v20; // eax
@ -749,7 +809,7 @@ void __fastcall town_draw_upper(int x, int y, int sx, int sy, INT_PTR a5, int a6
v10 = v9 == 0;
v11 = sy;
if (!v10) {
a1 = (int *)&gpBuffer->row_unused_1[0].col_unused_1[sx + 32 + screen_y_times_768[sy]];
a1 = (int *)&gpBuffer[sx + 32 + screen_y_times_768[sy]];
sxa = 0;
v12 = &dpiece_defs_map_1[0][16 * gendung_get_dpiece_num_from_coord(x, y) + 1];
do {
@ -1106,7 +1166,7 @@ void __fastcall T_DrawZoom(int x, int y)
LABEL_24:
v11 = (_WORD *)((char *)gpBuffer + a5a);
v12 = (char *)gpBuffer + a6b;
v13 = &gpBuffer->row_unused_1[1].col_unused_1[a5a];
v13 = (char *)&gpBuffer[a5a + 768];
v14 = 176;
do {
v15 = v19;
@ -1245,94 +1305,121 @@ void __cdecl town_init_dpiece_defs_map()
// 5C3000: using guessed type int scr_pix_width;
// 5C3004: using guessed type int scr_pix_height;
void __fastcall T_FillSector(unsigned char *P3Tiles, unsigned char *pSector, int xi, int yi, int w, int h) /* check 7 params: int AddSec */
void __fastcall T_FillSector(unsigned char *P3Tiles, unsigned char *pSector, int xi, int yi, int w, int h)
{
int v7; // ebx
int v8; // edx
int v9; // edi
int *v10; // ecx
int v11; // eax
unsigned char *v12; // esi
unsigned short v13; // ax
int v14; // eax
int v15; // [esp+4h] [ebp-14h]
int v16; // [esp+8h] [ebp-10h]
unsigned char *v17; // [esp+Ch] [ebp-Ch]
unsigned char *v18; // [esp+10h] [ebp-8h]
signed int v19; // [esp+14h] [ebp-4h]
int a4; // [esp+24h] [ebp+Ch]
int a6; // [esp+2Ch] [ebp+14h]
int i, j, xx, yy;
long v1, v2, v3, v4, ii;
v7 = h;
v17 = pSector;
v8 = yi;
v18 = P3Tiles;
v19 = 4;
if (h > 0) {
do {
v9 = w;
if (w > 0) {
v10 = &dPiece[1][v8 + 112 * xi];
do {
v11 = *(unsigned short *)&v17[v19];
if ((_WORD)v11) {
v12 = &v18[8 * (v11 - 1)];
v13 = *(_WORD *)v12;
v12 += 2;
v14 = v13 + 1;
a4 = v14;
_LOWORD(v14) = *(_WORD *)v12;
v12 += 2;
a6 = ++v14;
_LOWORD(v14) = *(_WORD *)v12;
v16 = ++v14;
_LOWORD(v14) = *((_WORD *)v12 + 1);
v15 = v14 + 1;
} else {
a4 = 0;
a6 = 0;
v16 = 0;
v15 = 0;
}
v19 += 2;
*(v10 - 112) = a4;
*v10 = a6;
*(v10 - 111) = v16;
v10[1] = v15;
v10 += 224;
--v9;
} while (v9);
ii = 4;
yy = yi;
for(j = 0; j < h; j++) {
xx = xi;
for(i = 0; i < w; i++) {
#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
__asm {
mov esi, pSector
mov eax, ii
add esi, eax
xor eax, eax
lodsw
or eax, eax
jz label1
dec eax
mov esi, P3Tiles
shl eax, 3
add esi, eax
xor eax, eax
lodsw
inc eax
mov v1, eax
lodsw
inc eax
mov v2, eax
lodsw
inc eax
mov v3, eax
lodsw
inc eax
mov v4, eax
jmp label2
label1:
mov v1, eax
mov v2, eax
mov v3, eax
mov v4, eax
label2:
nop
}
v8 += 2;
--v7;
} while (v7);
#else
WORD *Map;
Map = (WORD *)&pSector[ii];
if(*Map) {
v1 = *((WORD *)&P3Tiles[(*Map-1)*8])+1;
v2 = *((WORD *)&P3Tiles[(*Map-1)*8]+1)+1;
v3 = *((WORD *)&P3Tiles[(*Map-1)*8]+2)+1;
v4 = *((WORD *)&P3Tiles[(*Map-1)*8]+3)+1;
} else {
v1 = 0;
v2 = 0;
v3 = 0;
v4 = 0;
}
#endif
dPiece[xx][yy] = v1;
dPiece[xx + 1][yy] = v2;
dPiece[xx][yy + 1] = v3;
dPiece[xx + 1][yy + 1] = v4;
xx += 2;
ii += 2;
}
yy += 2;
}
}
void __fastcall T_FillTile(unsigned char *P3Tiles, int xx, int yy, int t)
{
unsigned char *v4; // esi
unsigned short v5; // ax
int v6; // eax
int v7; // ST10_4
int v8; // ST0C_4
int v9; // ST08_4
long v1, v2, v3, v4;
#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
__asm {
mov eax, t
dec eax
mov esi, P3Tiles
shl eax, 3
add esi, eax
xor eax, eax
lodsw
inc eax
mov v1, eax
lodsw
inc eax
mov v2, eax
lodsw
inc eax
mov v3, eax
lodsw
inc eax
mov v4, eax
jmp label1
mov v1, eax
mov v2, eax
mov v3, eax
mov v4, eax
label1:
nop
}
#else
v1 = *((WORD *)&P3Tiles[(t-1)*8])+1;
v2 = *((WORD *)&P3Tiles[(t-1)*8]+1)+1;
v3 = *((WORD *)&P3Tiles[(t-1)*8]+2)+1;
v4 = *((WORD *)&P3Tiles[(t-1)*8]+3)+1;
#endif
v4 = &P3Tiles[8 * (t - 1)];
v5 = *(_WORD *)v4;
v4 += 2;
v6 = v5 + 1;
v7 = v6;
_LOWORD(v6) = *(_WORD *)v4;
v4 += 2;
v8 = ++v6;
_LOWORD(v6) = *(_WORD *)v4;
v9 = ++v6;
_LOWORD(v6) = *((_WORD *)v4 + 1);
dPiece[xx][yy] = v7;
dPiece[xx + 1][yy] = v8;
dPiece[xx][yy + 1] = v9;
dPiece[xx + 1][yy + 1] = v6 + 1;
dPiece[xx][yy] = v1;
dPiece[xx + 1][yy] = v2;
dPiece[xx][yy + 1] = v3;
dPiece[xx + 1][yy + 1] = v4;
}
void __cdecl T_Pass3()

4
Source/town.h

@ -2,8 +2,8 @@
#ifndef __TOWN_H__
#define __TOWN_H__
void __fastcall town_clear_upper_buf(unsigned char *a1);
void __fastcall town_clear_low_buf(unsigned char *y_related);
void __fastcall town_clear_upper_buf(BYTE *pBuff);
void __fastcall town_clear_low_buf(BYTE *pBuff);
void __fastcall town_draw_clipped_e_flag(BYTE *buffer, int x, int y, int sx, int sy);
void __fastcall town_draw_clipped_town(BYTE *buffer, int x, int y, int sx, int sy, int some_flag);
void __fastcall town_draw_lower(int x, int y, int sx, int sy, int a5, int some_flag);

1
SourceS/devilution.h

@ -0,0 +1 @@
#include "../types.h"

1
SourceS/miniwin.h

@ -30,6 +30,7 @@
#include "miniwin/ui.h"
#include "miniwin/thread.h"
#include "miniwin/rand.h"
#include "storm_full.h"
#ifdef DEVILUTION_ENGINE
#include "miniwin/misc_macro.h"

6
SourceS/miniwin/misc.h

@ -45,10 +45,6 @@ typedef int INT;
typedef unsigned int UINT;
typedef unsigned int *PUINT;
// GCC qword alignment is 4, MSVC is 8, work around by introducing a more aligned type
typedef long long INT64;
typedef unsigned long long UINT64;
typedef intptr_t INT_PTR, *PINT_PTR;
typedef uintptr_t UINT_PTR, *PUINT_PTR;
@ -203,7 +199,7 @@ struct DVL_finddata_t {
time_t time_access; /* -1 for FAT file systems */
time_t time_write;
_fsize_t size;
char name[260];
char name[DVL_MAX_PATH];
};
typedef WORD ATOM;

11
SourceS/storm_full.h

@ -0,0 +1,11 @@
#pragma once
namespace dvl {
extern "C" {
extern DWORD nLastError;
void TranslateFileName(char *dst, int dstLen, const char *src);
}
} // namespace dvl

7
SourceX/DiabloUI/credits.cpp

@ -1,4 +1,6 @@
#include "pch.h"
#include "devilution.h"
#include "DiabloUI/diabloui.h"
#include "dx.h"
#define CREDIT_LINES 13
@ -517,7 +519,8 @@ void credts_Render()
x += 40;
}
if (text_surface = TTF_RenderUTF8_Solid(font, the_long_credits[creditLine + i] + offset, color)) {
text_surface = TTF_RenderUTF8_Solid(font, the_long_credits[creditLine + i] + offset, color);
if (text_surface) {
SDL_Rect src_rect = { 0, -y, SCREEN_WIDTH, 251 };
SDL_Rect dsc_rect = { 64 + x, 160 + 114, SCREEN_WIDTH, SCREEN_HEIGHT };
SDL_BlitSurface(text_surface, &src_rect, pal_surface, &dsc_rect);

14
SourceX/DiabloUI/diabloui.cpp

@ -1,6 +1,10 @@
#include "pch.h"
#include <string>
#include "devilution.h"
#include "DiabloUI/diabloui.h"
#include "dx.h"
#include "utf8.h"
#include "stubs.h"
namespace dvl {
@ -483,7 +487,7 @@ BOOL UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6)
UNIMPLEMENTED();
}
BOOL UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, void *pBuffer,
BOOL UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, BYTE *pBuffer,
DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp)
{
UNIMPLEMENTED();
@ -515,7 +519,7 @@ BOOL UiCreatePlayerDescription(_uiheroinfo *info, DWORD mode, char *desc)
void DrawArt(int screenX, int screenY, Art *art, int nFrame, int drawW)
{
BYTE *src = (BYTE *)art->data + (art->width * art->height * nFrame);
BYTE *dst = (BYTE *)&gpBuffer->row[screenY].pixels[screenX];
BYTE *dst = &gpBuffer[screenX + 64 + (screenY + 160) * 768];
drawW = drawW ?: art->width;
for (int i = 0; i < art->height && i + screenY < SCREEN_HEIGHT; i++, src += art->width, dst += ROW_PITCH) {
@ -539,7 +543,7 @@ int GetStrWidth(char *str, int size)
{
int strWidth = 0;
for (int i = 0; i < strlen((char *)str); i++) {
for (size_t i = 0; i < strlen((char *)str); i++) {
BYTE w = FontTables[size][*(BYTE *)&str[i] + 2];
if (w)
strWidth += w;
@ -629,7 +633,7 @@ void DrawArtStr(UI_Item *item)
if (item->flags & UIS_VCENTER)
sy += (item->rect.h - ArtFonts[size][color].height) / 2;
for (int i = 0; i < strlen((char *)item->caption); i++) {
for (size_t i = 0; i < strlen((char *)item->caption); i++) {
if (item->caption[i] == '\n') {
sx = x;
sy += ArtFonts[size][color].height;

2
SourceX/DiabloUI/diabloui.h

@ -68,7 +68,7 @@ typedef struct UI_Item {
int flags;
int value;
char *caption;
void *context;
const void *context;
} UI_Item;
extern TTF_Font *font;

3
SourceX/DiabloUI/dialogs.cpp

@ -1,4 +1,5 @@
#include "pch.h"
#include "devilution.h"
#include "DiabloUI/diabloui.h"
namespace dvl {

3
SourceX/DiabloUI/mainmenu.cpp

@ -1,4 +1,5 @@
#include "pch.h"
#include "devilution.h"
#include "DiabloUI/diabloui.h"
namespace dvl {

4
SourceX/DiabloUI/progress.cpp

@ -1,4 +1,6 @@
#include "pch.h"
#include "devilution.h"
#include "DiabloUI/diabloui.h"
#include "dx.h"
namespace dvl {

4
SourceX/DiabloUI/selconn.cpp

@ -1,6 +1,8 @@
#include "pch.h"
#include "selconn.h"
#include "devilution.h"
#include "DiabloUI/diabloui.h"
namespace dvl {
char selconn_MaxPlayers[21];

4
SourceX/DiabloUI/selgame.cpp

@ -1,6 +1,8 @@
#include "pch.h"
#include "selgame.h"
#include "devilution.h"
#include "DiabloUI/diabloui.h"
namespace dvl {
char selgame_Lable[32];

4
SourceX/DiabloUI/selhero.cpp

@ -1,6 +1,8 @@
#include "pch.h"
#include "selhero.h"
#include "devilution.h"
#include "DiabloUI/diabloui.h"
namespace dvl {
int selhero_SaveCount = 0;

5
SourceX/DiabloUI/title.cpp

@ -1,4 +1,5 @@
#include "pch.h"
#include "devilution.h"
#include "DiabloUI/diabloui.h"
namespace dvl {
@ -26,7 +27,7 @@ BOOL UiTitleDialog(int a1)
title_Load();
bool endMenu = false;
int timeOut = SDL_GetTicks() + 7000;
Uint32 timeOut = SDL_GetTicks() + 7000;
SDL_Event event;
while (!endMenu && SDL_GetTicks() < timeOut) {

3
SourceX/devilution.h

@ -1,3 +0,0 @@
#include <types.h>
#include "stubs.h"
#include "miniwin_sdl.h"

6
SourceX/dvlnet/abstract_net.cpp

@ -5,7 +5,8 @@
#include "dvlnet/udp_p2p.h"
#include "dvlnet/loopback.h"
namespace dvl { namespace net {
namespace dvl {
namespace net {
abstract_net::~abstract_net()
{
@ -24,4 +25,5 @@ std::unique_ptr<abstract_net> abstract_net::make_net(provider_t provider)
}
}
}}
} // namespace net
} // namespace dvl

61
SourceX/dvlnet/abstract_net.h

@ -7,36 +7,39 @@
#include "devilution.h"
namespace dvl { namespace net {
typedef std::vector<unsigned char> buffer_t;
typedef void(*snet_event_func)(struct _SNETEVENT*);
typedef unsigned long provider_t;
class dvlnet_exception : public std::exception {};
namespace dvl {
namespace net {
class abstract_net {
public:
virtual int create(std::string addrstr, std::string passwd) = 0;
virtual int join(std::string addrstr, std::string passwd) = 0;
virtual bool SNetReceiveMessage(int* sender, char** data,
int* size) = 0;
virtual bool SNetSendMessage(int dest, void* data,
unsigned int size) = 0;
virtual bool SNetReceiveTurns(char** data, unsigned int* size,
DWORD* status) = 0;
virtual bool SNetSendTurn(char* data, unsigned int size) = 0;
virtual int SNetGetProviderCaps(struct _SNETCAPS* caps) = 0;
virtual void* SNetRegisterEventHandler(event_type evtype,
snet_event_func func) = 0;
virtual void* SNetUnregisterEventHandler(event_type evtype,
snet_event_func func) = 0;
virtual bool SNetLeaveGame(int type) = 0;
virtual bool SNetDropPlayer(int playerid, DWORD flags) = 0;
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns) = 0;
virtual bool SNetGetTurnsInTransit(int *turns) = 0;
virtual void setup_gameinfo(buffer_t info) = 0;
virtual ~abstract_net();
typedef std::vector<unsigned char> buffer_t;
typedef void(*snet_event_func)(struct _SNETEVENT*);
typedef unsigned long provider_t;
class dvlnet_exception : public std::exception {};
static std::unique_ptr<abstract_net> make_net(provider_t provider);
class abstract_net {
public:
virtual int create(std::string addrstr, std::string passwd) = 0;
virtual int join(std::string addrstr, std::string passwd) = 0;
virtual bool SNetReceiveMessage(int* sender, char** data,
int* size) = 0;
virtual bool SNetSendMessage(int dest, void* data,
unsigned int size) = 0;
virtual bool SNetReceiveTurns(char** data, unsigned int* size,
DWORD* status) = 0;
virtual bool SNetSendTurn(char* data, unsigned int size) = 0;
virtual int SNetGetProviderCaps(struct _SNETCAPS* caps) = 0;
virtual void* SNetRegisterEventHandler(event_type evtype,
snet_event_func func) = 0;
virtual void* SNetUnregisterEventHandler(event_type evtype,
snet_event_func func) = 0;
virtual bool SNetLeaveGame(int type) = 0;
virtual bool SNetDropPlayer(int playerid, DWORD flags) = 0;
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns) = 0;
virtual bool SNetGetTurnsInTransit(int *turns) = 0;
virtual void setup_gameinfo(buffer_t info) = 0;
virtual ~abstract_net();
static std::unique_ptr<abstract_net> make_net(provider_t provider);
};
}}
} // namespace net
} // namespace dvl

10
SourceX/dvlnet/base.cpp

@ -1,8 +1,10 @@
#include "dvlnet/base.h"
#include <algorithm>
#include <cstring>
namespace dvl { namespace net {
namespace dvl {
namespace net {
void base::setup_gameinfo(buffer_t info)
{
@ -170,7 +172,8 @@ bool base::SNetSendTurn(char* data, unsigned int size)
{
if (size != sizeof(turn_t))
ABORT();
turn_t turn = *reinterpret_cast<turn_t*>(data);
turn_t turn;
std::memcpy(&turn, data, sizeof(turn));
auto pkt = pktfty->make_packet<PT_TURN>(plr_self, PLR_BROADCAST, turn);
send(*pkt);
turn_queue[plr_self].push_back(pkt->turn());
@ -253,4 +256,5 @@ bool base::SNetGetTurnsInTransit(int *turns)
return true;
}
}}
} // namespace net
} // namespace dvl

116
SourceX/dvlnet/base.h

@ -18,60 +18,64 @@
#define LEAVE_ENDING 0x40000004
#define LEAVE_DROP 0x40000006
namespace dvl { namespace net {
class base : public abstract_net {
public:
virtual int create(std::string addrstr, std::string passwd) = 0;
virtual int join(std::string addrstr, std::string passwd) = 0;
virtual bool SNetReceiveMessage(int* sender, char** data, int* size);
virtual bool SNetSendMessage(int dest, void* data, unsigned int size);
virtual bool SNetReceiveTurns(char** data, unsigned int* size,
DWORD* status);
virtual bool SNetSendTurn(char* data, unsigned int size);
virtual int SNetGetProviderCaps(struct _SNETCAPS* caps);
virtual void* SNetRegisterEventHandler(event_type evtype,
snet_event_func func);
virtual void* SNetUnregisterEventHandler(event_type evtype,
snet_event_func func);
virtual bool SNetLeaveGame(int type);
virtual bool SNetDropPlayer(int playerid, DWORD flags);
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns);
virtual bool SNetGetTurnsInTransit(int *turns);
virtual void poll() = 0;
virtual void send(packet& pkt) = 0;
void setup_gameinfo(buffer_t info);
protected:
std::map<event_type, snet_event_func> registered_handlers;
buffer_t game_init_info;
struct message_t {
int sender; // change int to something else in devilution code later
buffer_t payload;
message_t() : sender(-1), payload({}) {}
message_t(int s, buffer_t p) : sender(s), payload(p) {}
};
message_t message_last;
std::deque<message_t> message_queue;
std::array<turn_t, MAX_PLRS> turn_last = {};
std::array<std::deque<turn_t>, MAX_PLRS> turn_queue;
std::array<bool, MAX_PLRS> connected_table = {};
plr_t plr_self = PLR_BROADCAST;
cookie_t cookie_self = 0;
std::unique_ptr<packet_factory> pktfty;
void setup_password(std::string pw);
void handle_accept(packet& pkt);
void recv_local(packet& pkt);
void run_event_handler(_SNETEVENT& ev);
private:
plr_t get_owner();
void clear_msg(plr_t plr);
namespace dvl {
namespace net {
class base : public abstract_net {
public:
virtual int create(std::string addrstr, std::string passwd) = 0;
virtual int join(std::string addrstr, std::string passwd) = 0;
virtual bool SNetReceiveMessage(int* sender, char** data, int* size);
virtual bool SNetSendMessage(int dest, void* data, unsigned int size);
virtual bool SNetReceiveTurns(char** data, unsigned int* size,
DWORD* status);
virtual bool SNetSendTurn(char* data, unsigned int size);
virtual int SNetGetProviderCaps(struct _SNETCAPS* caps);
virtual void* SNetRegisterEventHandler(event_type evtype,
snet_event_func func);
virtual void* SNetUnregisterEventHandler(event_type evtype,
snet_event_func func);
virtual bool SNetLeaveGame(int type);
virtual bool SNetDropPlayer(int playerid, DWORD flags);
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns);
virtual bool SNetGetTurnsInTransit(int *turns);
virtual void poll() = 0;
virtual void send(packet& pkt) = 0;
void setup_gameinfo(buffer_t info);
protected:
std::map<event_type, snet_event_func> registered_handlers;
buffer_t game_init_info;
struct message_t {
int sender; // change int to something else in devilution code later
buffer_t payload;
message_t() : sender(-1), payload({}) {}
message_t(int s, buffer_t p) : sender(s), payload(p) {}
};
}}
message_t message_last;
std::deque<message_t> message_queue;
std::array<turn_t, MAX_PLRS> turn_last = {};
std::array<std::deque<turn_t>, MAX_PLRS> turn_queue;
std::array<bool, MAX_PLRS> connected_table = {};
plr_t plr_self = PLR_BROADCAST;
cookie_t cookie_self = 0;
std::unique_ptr<packet_factory> pktfty;
void setup_password(std::string pw);
void handle_accept(packet& pkt);
void recv_local(packet& pkt);
void run_event_handler(_SNETEVENT& ev);
private:
plr_t get_owner();
void clear_msg(plr_t plr);
};
} // namespace net
} // namespace dvl

10
SourceX/dvlnet/frame_queue.cpp

@ -1,8 +1,11 @@
#include "dvlnet/frame_queue.h"
#include <cstring>
#include "dvlnet/packet.h"
namespace dvl { namespace net {
namespace dvl {
namespace net {
size_t frame_queue::size()
{
@ -45,7 +48,7 @@ bool frame_queue::packet_ready()
if(size() < sizeof(framesize_t))
return false;
auto szbuf = read(sizeof(framesize_t));
nextsize = *(reinterpret_cast<framesize_t*>(&szbuf[0]));
std::memcpy(&nextsize, &szbuf[0], sizeof(nextsize));
if(!nextsize)
throw frame_queue_exception();
}
@ -75,4 +78,5 @@ buffer_t frame_queue::make_frame(buffer_t packetbuf)
return std::move(ret);
}
}}
} // namespace net
} // namespace dvl

48
SourceX/dvlnet/frame_queue.h

@ -4,25 +4,29 @@
#include "dvlnet/abstract_net.h"
namespace dvl { namespace net {
class frame_queue_exception : public dvlnet_exception {};
class frame_queue {
public:
typedef uint32_t framesize_t;
constexpr static framesize_t max_frame_size = 0xFFFF;
private:
size_t current_size = 0;
std::deque<buffer_t> buffer_deque;
size_t nextsize = 0;
size_t size();
buffer_t read(size_t s);
public:
bool packet_ready();
buffer_t read_packet();
void write(buffer_t buf);
static buffer_t make_frame(buffer_t packetbuf);
};
}}
namespace dvl {
namespace net {
class frame_queue_exception : public dvlnet_exception {};
class frame_queue {
public:
typedef uint32_t framesize_t;
constexpr static framesize_t max_frame_size = 0xFFFF;
private:
size_t current_size = 0;
std::deque<buffer_t> buffer_deque;
size_t nextsize = 0;
size_t size();
buffer_t read(size_t s);
public:
bool packet_ready();
buffer_t read_packet();
void write(buffer_t buf);
static buffer_t make_frame(buffer_t packetbuf);
};
} // namespace net
} // namespace dvl

7
SourceX/dvlnet/loopback.cpp

@ -1,6 +1,8 @@
#include "dvlnet/loopback.h"
#include "stubs.h"
namespace dvl { namespace net {
namespace dvl {
namespace net {
int loopback::create(std::string addrstr, std::string passwd)
{
@ -103,4 +105,5 @@ bool loopback::SNetGetTurnsInTransit(int *turns)
return true;
}
}}
} // namespace net
} // namespace dvl

56
SourceX/dvlnet/loopback.h

@ -6,30 +6,34 @@
#include "devilution.h"
#include "dvlnet/abstract_net.h"
namespace dvl { namespace net {
class loopback : public abstract_net {
private:
std::queue<buffer_t> message_queue;
buffer_t message_last;
const int plr_single = 0;
namespace dvl {
namespace net {
public:
virtual int create(std::string addrstr, std::string passwd);
virtual int join(std::string addrstr, std::string passwd);
virtual bool SNetReceiveMessage(int* sender, char** data, int* size);
virtual bool SNetSendMessage(int dest, void* data, unsigned int size);
virtual bool SNetReceiveTurns(char** data, unsigned int* size,
DWORD* status);
virtual bool SNetSendTurn(char* data, unsigned int size);
virtual int SNetGetProviderCaps(struct _SNETCAPS* caps);
virtual void *SNetRegisterEventHandler(event_type evtype,
snet_event_func func);
virtual void *SNetUnregisterEventHandler(event_type evtype,
snet_event_func func);
virtual bool SNetLeaveGame(int type);
virtual bool SNetDropPlayer(int playerid, DWORD flags);
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns);
virtual bool SNetGetTurnsInTransit(int *turns);
virtual void setup_gameinfo(buffer_t info);
};
}}
class loopback : public abstract_net {
private:
std::queue<buffer_t> message_queue;
buffer_t message_last;
const int plr_single = 0;
public:
virtual int create(std::string addrstr, std::string passwd);
virtual int join(std::string addrstr, std::string passwd);
virtual bool SNetReceiveMessage(int* sender, char** data, int* size);
virtual bool SNetSendMessage(int dest, void* data, unsigned int size);
virtual bool SNetReceiveTurns(char** data, unsigned int* size,
DWORD* status);
virtual bool SNetSendTurn(char* data, unsigned int size);
virtual int SNetGetProviderCaps(struct _SNETCAPS* caps);
virtual void *SNetRegisterEventHandler(event_type evtype,
snet_event_func func);
virtual void *SNetUnregisterEventHandler(event_type evtype,
snet_event_func func);
virtual bool SNetLeaveGame(int type);
virtual bool SNetDropPlayer(int playerid, DWORD flags);
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns);
virtual bool SNetGetTurnsInTransit(int *turns);
virtual void setup_gameinfo(buffer_t info);
};
} // namespace net
} // namespace dvl

6
SourceX/dvlnet/packet.cpp

@ -1,6 +1,7 @@
#include "dvlnet/packet.h"
namespace dvl { namespace net {
namespace dvl {
namespace net {
static constexpr bool disable_encryption = false;
@ -174,4 +175,5 @@ packet_factory::packet_factory(std::string pw)
ABORT();
}
}}
} // namespace net
} // namespace dvl

506
SourceX/dvlnet/packet.h

@ -3,266 +3,272 @@
#include <string>
#include <memory>
#include <array>
#include <cstring>
#include <sodium.h>
#include "dvlnet/abstract_net.h"
#include "stubs.h"
namespace dvl { namespace net {
enum packet_type : uint8_t {
namespace dvl {
namespace net {
enum packet_type : uint8_t {
PT_MESSAGE = 0x01,
PT_TURN = 0x02,
PT_JOIN_REQUEST = 0x11,
PT_JOIN_ACCEPT = 0x12,
PT_CONNECT = 0x13,
PT_DISCONNECT = 0x14,
};
typedef uint8_t plr_t;
typedef uint32_t cookie_t;
typedef int turn_t; // change int to something else in devilution code later
typedef int leaveinfo_t; // also change later
typedef std::array<unsigned char, crypto_secretbox_KEYBYTES> key_t;
static constexpr plr_t PLR_MASTER = 0xFE;
static constexpr plr_t PLR_BROADCAST = 0xFF;
class packet_exception : public dvlnet_exception {};
class packet {
protected:
packet_type m_type;
plr_t m_src;
plr_t m_dest;
buffer_t m_message;
turn_t m_turn;
cookie_t m_cookie;
plr_t m_newplr;
buffer_t m_info;
leaveinfo_t m_leaveinfo;
const key_t& key;
bool have_encrypted = false;
bool have_decrypted = false;
buffer_t encrypted_buffer;
buffer_t decrypted_buffer;
public:
packet(const key_t& k) : key(k) {};
const buffer_t& data();
packet_type type();
plr_t src();
plr_t dest();
const buffer_t& message();
turn_t turn();
cookie_t cookie();
plr_t newplr();
const buffer_t& info();
leaveinfo_t leaveinfo();
};
template<class P> class packet_proc : public packet {
public:
using packet::packet;
void process_data();
};
class packet_in : public packet_proc<packet_in> {
public:
using packet_proc<packet_in>::packet_proc;
void create(buffer_t buf);
void process_element(buffer_t& x);
template <class T> void process_element(T& x);
void decrypt();
};
class packet_out : public packet_proc<packet_out> {
public:
using packet_proc<packet_out>::packet_proc;
template<packet_type t, typename... Args>
void create(Args... args);
void process_element(buffer_t& x);
template<class T> void process_element(T& x);
template<class T> static const unsigned char* begin(const T& x);
template<class T> static const unsigned char* end(const T& x);
void encrypt();
};
template<class P> void packet_proc<P>::process_data()
{
P& self = static_cast<P&>(*this);
self.process_element(m_type);
self.process_element(m_src);
self.process_element(m_dest);
switch (m_type) {
case PT_MESSAGE:
self.process_element(m_message);
break;
case PT_TURN:
self.process_element(m_turn);
break;
case PT_JOIN_REQUEST:
self.process_element(m_cookie);
self.process_element(m_info);
break;
case PT_JOIN_ACCEPT:
self.process_element(m_cookie);
self.process_element(m_newplr);
self.process_element(m_info);
break;
case PT_CONNECT:
self.process_element(m_newplr);
break;
case PT_DISCONNECT:
self.process_element(m_newplr);
self.process_element(m_leaveinfo);
break;
}
}
inline void packet_in::process_element(buffer_t& x)
{
x.insert(x.begin(), decrypted_buffer.begin(), decrypted_buffer.end());
decrypted_buffer.resize(0);
}
template <class T> void packet_in::process_element(T& x)
{
if (decrypted_buffer.size() < sizeof(T))
throw packet_exception();
x = *reinterpret_cast<T *>(decrypted_buffer.data());
decrypted_buffer.erase(decrypted_buffer.begin(),
decrypted_buffer.begin() + sizeof(T));
}
template<>
inline void packet_out::create<PT_MESSAGE>(plr_t s, plr_t d, buffer_t m)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_MESSAGE;
m_src = s;
m_dest = d;
m_message = std::move(m);
}
template<>
inline void packet_out::create<PT_TURN>(plr_t s, plr_t d, turn_t u)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_TURN;
m_src = s;
m_dest = d;
m_turn = u;
}
template<>
inline void packet_out::create<PT_JOIN_REQUEST>(plr_t s, plr_t d,
cookie_t c, buffer_t i)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_JOIN_REQUEST;
m_src = s;
m_dest = d;
m_cookie = c;
m_info = i;
}
template<>
inline void packet_out::create<PT_JOIN_ACCEPT>(plr_t s, plr_t d, cookie_t c,
plr_t n, buffer_t i)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_JOIN_ACCEPT;
m_src = s;
m_dest = d;
m_cookie = c;
m_newplr = n;
m_info = i;
}
template<>
inline void packet_out::create<PT_CONNECT>(plr_t s, plr_t d, plr_t n)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_CONNECT;
m_src = s;
m_dest = d;
m_newplr = n;
}
template<>
inline void packet_out::create<PT_DISCONNECT>(plr_t s, plr_t d, plr_t n,
leaveinfo_t l)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_DISCONNECT;
m_src = s;
m_dest = d;
m_newplr = n;
m_leaveinfo = l;
}
inline void packet_out::process_element(buffer_t& x)
{
encrypted_buffer.insert(encrypted_buffer.end(), x.begin(), x.end());
}
template <class T> void packet_out::process_element(T& x)
{
encrypted_buffer.insert(encrypted_buffer.end(), begin(x), end(x));
}
template <class T> const unsigned char* packet_out::begin(const T& x)
{
return reinterpret_cast<const unsigned char *>(&x);
}
template <class T> const unsigned char* packet_out::end(const T& x)
{
return reinterpret_cast<const unsigned char *>(&x) + sizeof(T);
}
class packet_factory {
key_t key = {};
public:
static constexpr unsigned short max_packet_size = 0xFFFF;
packet_factory(std::string pw = "");
std::unique_ptr<packet> make_packet(buffer_t buf);
template<packet_type t, typename... Args>
std::unique_ptr<packet> make_packet(Args... args);
};
inline std::unique_ptr<packet> packet_factory::make_packet(buffer_t buf)
{
auto ret = std::make_unique<packet_in>(key);
ret->create(std::move(buf));
ret->decrypt();
return ret;
}
};
typedef uint8_t plr_t;
typedef uint32_t cookie_t;
typedef int turn_t; // change int to something else in devilution code later
typedef int leaveinfo_t; // also change later
typedef std::array<unsigned char, crypto_secretbox_KEYBYTES> key_t;
static constexpr plr_t PLR_MASTER = 0xFE;
static constexpr plr_t PLR_BROADCAST = 0xFF;
class packet_exception : public dvlnet_exception {};
class packet {
protected:
packet_type m_type;
plr_t m_src;
plr_t m_dest;
buffer_t m_message;
turn_t m_turn;
cookie_t m_cookie;
plr_t m_newplr;
buffer_t m_info;
leaveinfo_t m_leaveinfo;
const key_t& key;
bool have_encrypted = false;
bool have_decrypted = false;
buffer_t encrypted_buffer;
buffer_t decrypted_buffer;
public:
packet(const key_t& k) : key(k) {};
const buffer_t& data();
packet_type type();
plr_t src();
plr_t dest();
const buffer_t& message();
turn_t turn();
cookie_t cookie();
plr_t newplr();
const buffer_t& info();
leaveinfo_t leaveinfo();
};
template<class P> class packet_proc : public packet {
public:
using packet::packet;
void process_data();
};
class packet_in : public packet_proc<packet_in> {
public:
using packet_proc<packet_in>::packet_proc;
void create(buffer_t buf);
void process_element(buffer_t& x);
template <class T> void process_element(T& x);
void decrypt();
};
class packet_out : public packet_proc<packet_out> {
public:
using packet_proc<packet_out>::packet_proc;
template<packet_type t, typename... Args>
std::unique_ptr<packet> packet_factory::make_packet(Args... args)
{
auto ret = std::make_unique<packet_out>(key);
ret->create<t>(args...);
ret->encrypt();
return ret;
void create(Args... args);
void process_element(buffer_t& x);
template<class T> void process_element(T& x);
template<class T> static const unsigned char* begin(const T& x);
template<class T> static const unsigned char* end(const T& x);
void encrypt();
};
template<class P> void packet_proc<P>::process_data()
{
P& self = static_cast<P&>(*this);
self.process_element(m_type);
self.process_element(m_src);
self.process_element(m_dest);
switch (m_type) {
case PT_MESSAGE:
self.process_element(m_message);
break;
case PT_TURN:
self.process_element(m_turn);
break;
case PT_JOIN_REQUEST:
self.process_element(m_cookie);
self.process_element(m_info);
break;
case PT_JOIN_ACCEPT:
self.process_element(m_cookie);
self.process_element(m_newplr);
self.process_element(m_info);
break;
case PT_CONNECT:
self.process_element(m_newplr);
break;
case PT_DISCONNECT:
self.process_element(m_newplr);
self.process_element(m_leaveinfo);
break;
}
}}
}
inline void packet_in::process_element(buffer_t& x)
{
x.insert(x.begin(), decrypted_buffer.begin(), decrypted_buffer.end());
decrypted_buffer.resize(0);
}
template <class T> void packet_in::process_element(T& x)
{
if (decrypted_buffer.size() < sizeof(T))
throw packet_exception();
std::memcpy(&x, decrypted_buffer.data(), sizeof(T));
decrypted_buffer.erase(decrypted_buffer.begin(),
decrypted_buffer.begin() + sizeof(T));
}
template<>
inline void packet_out::create<PT_MESSAGE>(plr_t s, plr_t d, buffer_t m)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_MESSAGE;
m_src = s;
m_dest = d;
m_message = std::move(m);
}
template<>
inline void packet_out::create<PT_TURN>(plr_t s, plr_t d, turn_t u)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_TURN;
m_src = s;
m_dest = d;
m_turn = u;
}
template<>
inline void packet_out::create<PT_JOIN_REQUEST>(plr_t s, plr_t d,
cookie_t c, buffer_t i)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_JOIN_REQUEST;
m_src = s;
m_dest = d;
m_cookie = c;
m_info = i;
}
template<>
inline void packet_out::create<PT_JOIN_ACCEPT>(plr_t s, plr_t d, cookie_t c,
plr_t n, buffer_t i)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_JOIN_ACCEPT;
m_src = s;
m_dest = d;
m_cookie = c;
m_newplr = n;
m_info = i;
}
template<>
inline void packet_out::create<PT_CONNECT>(plr_t s, plr_t d, plr_t n)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_CONNECT;
m_src = s;
m_dest = d;
m_newplr = n;
}
template<>
inline void packet_out::create<PT_DISCONNECT>(plr_t s, plr_t d, plr_t n,
leaveinfo_t l)
{
if (have_encrypted || have_decrypted)
ABORT();
have_decrypted = true;
m_type = PT_DISCONNECT;
m_src = s;
m_dest = d;
m_newplr = n;
m_leaveinfo = l;
}
inline void packet_out::process_element(buffer_t& x)
{
encrypted_buffer.insert(encrypted_buffer.end(), x.begin(), x.end());
}
template <class T> void packet_out::process_element(T& x)
{
encrypted_buffer.insert(encrypted_buffer.end(), begin(x), end(x));
}
template <class T> const unsigned char* packet_out::begin(const T& x)
{
return reinterpret_cast<const unsigned char *>(&x);
}
template <class T> const unsigned char* packet_out::end(const T& x)
{
return reinterpret_cast<const unsigned char *>(&x) + sizeof(T);
}
class packet_factory {
key_t key = {};
public:
static constexpr unsigned short max_packet_size = 0xFFFF;
packet_factory(std::string pw = "");
std::unique_ptr<packet> make_packet(buffer_t buf);
template<packet_type t, typename... Args>
std::unique_ptr<packet> make_packet(Args... args);
};
inline std::unique_ptr<packet> packet_factory::make_packet(buffer_t buf)
{
auto ret = std::make_unique<packet_in>(key);
ret->create(std::move(buf));
ret->decrypt();
return ret;
}
template<packet_type t, typename... Args>
std::unique_ptr<packet> packet_factory::make_packet(Args... args)
{
auto ret = std::make_unique<packet_out>(key);
ret->create<t>(args...);
ret->encrypt();
return ret;
}
} // namespace net
} // namespace dvl

6
SourceX/dvlnet/tcp_client.cpp

@ -7,7 +7,8 @@
#include <sodium.h>
#include <SDL.h>
namespace dvl { namespace net {
namespace dvl {
namespace net {
int tcp_client::create(std::string addrstr, std::string passwd)
{
@ -102,4 +103,5 @@ void tcp_client::send(packet& pkt)
std::placeholders::_1, std::placeholders::_2));
}
}}
} // namespace net
} // namespace dvl

50
SourceX/dvlnet/tcp_client.h

@ -12,26 +12,30 @@
#include "dvlnet/base.h"
#include "dvlnet/tcp_server.h"
namespace dvl { namespace net {
class tcp_client : public base {
public:
int create(std::string addrstr, std::string passwd);
int join(std::string addrstr, std::string passwd);
constexpr static unsigned short default_port = 6112;
virtual void poll();
virtual void send(packet& pkt);
private:
frame_queue recv_queue;
buffer_t recv_buffer = buffer_t(frame_queue::max_frame_size);
asio::io_context ioc;
asio::ip::tcp::socket sock = asio::ip::tcp::socket(ioc);
std::unique_ptr<tcp_server> local_server; // must be declared *after* ioc
void handle_recv(const asio::error_code& error, size_t bytes_read);
void start_recv();
void handle_send(const asio::error_code& error, size_t bytes_sent);
};
}}
namespace dvl {
namespace net {
class tcp_client : public base {
public:
int create(std::string addrstr, std::string passwd);
int join(std::string addrstr, std::string passwd);
constexpr static unsigned short default_port = 6112;
virtual void poll();
virtual void send(packet& pkt);
private:
frame_queue recv_queue;
buffer_t recv_buffer = buffer_t(frame_queue::max_frame_size);
asio::io_context ioc;
asio::ip::tcp::socket sock = asio::ip::tcp::socket(ioc);
std::unique_ptr<tcp_server> local_server; // must be declared *after* ioc
void handle_recv(const asio::error_code& error, size_t bytes_read);
void start_recv();
void handle_send(const asio::error_code& error, size_t bytes_sent);
};
} // namespace net
} // namespace dvl

6
SourceX/dvlnet/tcp_server.cpp

@ -5,7 +5,8 @@
#include "dvlnet/base.h"
namespace dvl { namespace net {
namespace dvl {
namespace net {
tcp_server::tcp_server(asio::io_context& ioc, std::string bindaddr,
unsigned short port, std::string pw) :
@ -208,4 +209,5 @@ void tcp_server::drop_connection(scc con)
con->socket.close();
}
}}
} // namespace net
} // namespace dvl

92
SourceX/dvlnet/tcp_server.h

@ -12,53 +12,57 @@
#include "dvlnet/abstract_net.h"
#include "dvlnet/frame_queue.h"
namespace dvl { namespace net {
class server_exception : public dvlnet_exception {};
namespace dvl {
namespace net {
class tcp_server {
public:
tcp_server(asio::io_context& ioc, std::string bindaddr,
unsigned short port, std::string pw);
std::string localhost_self();
class server_exception : public dvlnet_exception {};
private:
static constexpr int timeout_connect = 30;
static constexpr int timeout_active = 60;
class tcp_server {
public:
tcp_server(asio::io_context& ioc, std::string bindaddr,
unsigned short port, std::string pw);
std::string localhost_self();
struct client_connection {
frame_queue recv_queue;
buffer_t recv_buffer = buffer_t(frame_queue::max_frame_size);
plr_t plr = PLR_BROADCAST;
asio::ip::tcp::socket socket;
asio::steady_timer timer;
int timeout;
client_connection(asio::io_context& ioc) :
socket(ioc), timer(ioc) {}
};
private:
static constexpr int timeout_connect = 30;
static constexpr int timeout_active = 60;
typedef std::shared_ptr<client_connection> scc;
struct client_connection {
frame_queue recv_queue;
buffer_t recv_buffer = buffer_t(frame_queue::max_frame_size);
plr_t plr = PLR_BROADCAST;
asio::ip::tcp::socket socket;
asio::steady_timer timer;
int timeout;
client_connection(asio::io_context& ioc) :
socket(ioc), timer(ioc) {}
};
asio::io_context& ioc;
packet_factory pktfty;
std::unique_ptr<asio::ip::tcp::acceptor> acceptor;
std::array<scc, MAX_PLRS> connections;
buffer_t game_init_info;
typedef std::shared_ptr<client_connection> scc;
scc make_connection();
plr_t next_free();
bool empty();
void start_accept();
void handle_accept(scc con, const asio::error_code& ec);
void start_recv(scc con);
void handle_recv(scc con, const asio::error_code& ec, size_t bytes_read);
void handle_recv_newplr(scc con, packet& pkt);
void handle_recv_packet(packet& pkt);
void send_connect(scc con);
void send_packet(packet& pkt);
void start_send(scc con, packet& pkt);
void handle_send(scc con, const asio::error_code& ec, size_t bytes_sent);
void start_timeout(scc con);
void handle_timeout(scc con, const asio::error_code& ec);
void drop_connection(scc con);
};
}}
asio::io_context& ioc;
packet_factory pktfty;
std::unique_ptr<asio::ip::tcp::acceptor> acceptor;
std::array<scc, MAX_PLRS> connections;
buffer_t game_init_info;
scc make_connection();
plr_t next_free();
bool empty();
void start_accept();
void handle_accept(scc con, const asio::error_code& ec);
void start_recv(scc con);
void handle_recv(scc con, const asio::error_code& ec, size_t bytes_read);
void handle_recv_newplr(scc con, packet& pkt);
void handle_recv_packet(packet& pkt);
void send_connect(scc con);
void send_packet(packet& pkt);
void start_send(scc con, packet& pkt);
void handle_send(scc con, const asio::error_code& ec, size_t bytes_sent);
void start_timeout(scc con);
void handle_timeout(scc con, const asio::error_code& ec);
void drop_connection(scc con);
};
} //namespace net
} //namespace dvl

10
SourceX/dvlnet/udp_p2p.cpp

@ -1,6 +1,9 @@
#include "dvlnet/udp_p2p.h"
namespace dvl { namespace net {
#include <SDL.h>
namespace dvl {
namespace net {
const udp_p2p::endpoint udp_p2p::none;
@ -49,7 +52,7 @@ int udp_p2p::join(std::string addrstr, std::string passwd)
sock.connect(themaster);
master = themaster;
{ // hack: try to join for 5 seconds
randombytes_buf(reinterpret_cast<unsigned char *>(&cookie_self),
randombytes_buf(reinterpret_cast<unsigned char*>(&cookie_self),
sizeof(cookie_t));
auto pkt = pktfty->make_packet<PT_JOIN_REQUEST>(PLR_BROADCAST,
PLR_MASTER, cookie_self,
@ -167,4 +170,5 @@ void udp_p2p::recv_decrypted(packet& pkt, endpoint sender)
recv_local(pkt);
}
}}
} // namespace net
} // namespace dvl

70
SourceX/dvlnet/udp_p2p.h

@ -10,36 +10,40 @@
#include "dvlnet/packet.h"
#include "dvlnet/base.h"
namespace dvl { namespace net {
class udp_p2p : public base {
public:
virtual int create(std::string addrstr, std::string passwd);
virtual int join(std::string addrstr, std::string passwd);
virtual void poll();
virtual void send(packet& pkt);
private:
typedef asio::ip::udp::endpoint endpoint;
static const endpoint none;
unsigned short udpport_self = 0;
static constexpr unsigned short default_port = 6112;
static constexpr unsigned short try_ports = 512;
static constexpr int ACTIVE = 60;
asio::io_context io_context;
endpoint master;
std::set<endpoint> connection_requests_pending;
std::array<endpoint, MAX_PLRS> nexthop_table;
asio::ip::udp::socket sock = asio::ip::udp::socket(io_context);
void recv();
void handle_join_request(packet& pkt, endpoint sender);
void send_internal(packet& pkt, endpoint sender = none);
std::set<endpoint> dests_for_addr(plr_t dest, endpoint sender);
void recv_decrypted(packet& pkt, endpoint sender);
};
}}
namespace dvl {
namespace net {
class udp_p2p : public base {
public:
virtual int create(std::string addrstr, std::string passwd);
virtual int join(std::string addrstr, std::string passwd);
virtual void poll();
virtual void send(packet& pkt);
private:
typedef asio::ip::udp::endpoint endpoint;
static const endpoint none;
unsigned short udpport_self = 0;
static constexpr unsigned short default_port = 6112;
static constexpr unsigned short try_ports = 512;
static constexpr int ACTIVE = 60;
asio::io_context io_context;
endpoint master;
std::set<endpoint> connection_requests_pending;
std::array<endpoint, MAX_PLRS> nexthop_table;
asio::ip::udp::socket sock = asio::ip::udp::socket(io_context);
void recv();
void handle_join_request(packet& pkt, endpoint sender);
void send_internal(packet& pkt, endpoint sender = none);
std::set<endpoint> dests_for_addr(plr_t dest, endpoint sender);
void recv_decrypted(packet& pkt, endpoint sender);
};
} // namespace net
} // namespace dvl

87
SourceX/dx.cpp

@ -1,8 +1,12 @@
#include "pch.h"
#include "dx.h"
#include "devilution.h"
#include "stubs.h"
#include "DiabloUI/diabloui.h"
namespace dvl {
Screen *gpBuffer;
BYTE *gpBuffer;
IDirectDraw *lpDDInterface;
IDirectDrawSurface *lpDDSPrimary;
@ -366,7 +370,7 @@ void dx_init(HWND hWnd)
}
const int pitch = 64 + SCREEN_WIDTH + 64;
gpBuffer = (Screen *)malloc(sizeof(Screen));
gpBuffer = (BYTE *)malloc(656 * 768);
gpBufEnd += (uintptr_t)gpBuffer;
pal_surface = SDL_CreateRGBSurfaceFrom(gpBuffer, pitch, 160 + SCREEN_HEIGHT + 16, 8, pitch, 0, 0, 0, 0);
@ -380,7 +384,7 @@ void dx_init(HWND hWnd)
return;
}
MainWndProc(NULL, DVL_WM_ACTIVATEAPP, true, NULL);
MainWndProc(NULL, DVL_WM_ACTIVATEAPP, true, 0);
lpDDInterface = &stub_draw;
lpDDSPrimary = &stub_surface;
@ -444,77 +448,4 @@ void dx_reinit()
UNIMPLEMENTED();
}
//
// Storm functions
//
BOOL SDrawUpdatePalette(unsigned int firstentry, unsigned int numentries, PALETTEENTRY *pPalEntries, int a4)
{
assert(firstentry == 0);
assert(numentries == 256);
SDL_Color colors[256];
for (unsigned int i = firstentry; i < numentries; i++) {
SDL_Color *c = &colors[i];
PALETTEENTRY *p = &pPalEntries[i];
c->r = p->peRed;
c->g = p->peGreen;
c->b = p->peBlue;
c->a = SDL_ALPHA_OPAQUE;
}
assert(palette);
if (SDL_SetPaletteColors(palette, colors, firstentry, numentries) != 0) {
SDL_Log("SDL_SetPaletteColors: %s\n", SDL_GetError());
return false;
}
if (pal_surface) {
sdl_update_entire_surface();
sdl_present_surface();
}
return true;
}
//
// Windows API functions
//
WINBOOL SetCursorPos(int X, int Y)
{
assert(renderer);
assert(window);
SDL_Rect view;
SDL_RenderGetViewport(renderer, &view);
X += view.x;
Y += view.y;
float scaleX;
SDL_RenderGetScale(renderer, &scaleX, NULL);
X *= scaleX;
Y *= scaleX;
SDL_WarpMouseInWindow(window, X, Y);
return true;
}
int ShowCursor(WINBOOL bShow)
{
SDL_ShowCursor(bShow ? SDL_ENABLE : SDL_DISABLE);
return bShow;
}
WINBOOL TextOutA(HDC hdc, int x, int y, LPCSTR lpString, int c)
{
DUMMY_ONCE();
assert(window);
SDL_SetWindowTitle(window, lpString);
return true;
}
}
} // namespace dvl

2
SourceX/miniwin_sdl.h → SourceX/dx.h

@ -15,4 +15,4 @@ void sdl_present_surface();
void sdl_update_entire_surface();
}
} // namespace dvl

5
SourceX/main.cpp

@ -1,4 +1,7 @@
#include "pch.h"
#include <string>
#include <SDL.h>
#include "devilution.h"
extern "C" const char *__asan_default_options()
{

7
SourceX/miniwin_dsound.cpp → SourceX/miniwin/dsound.cpp

@ -1,4 +1,9 @@
#include "pch.h"
#include "miniwin/dsound.h"
#include <SDL.h>
#include "devilution.h"
#include "stubs.h"
namespace dvl {

26
SourceX/miniwin/dsound.h

@ -0,0 +1,26 @@
#include "devilution.h"
#include <SDL_mixer.h>
namespace dvl {
struct DirectSoundBuffer : public IDirectSoundBuffer {
public:
virtual ULONG Release();
BOOL GetStatus(LPDWORD pdwStatus);
HRESULT Lock(DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags);
HRESULT Play(DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags);
HRESULT SetFormat(LPCWAVEFORMATEX pcfxFormat);
HRESULT SetVolume(LONG lVolume);
HRESULT SetPan(LONG lPan);
HRESULT Stop();
HRESULT Unlock(LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2);
HRESULT Restore();
private:
int volume = 0;
int pan = 0;
Mix_Chunk *chunk;
};
} // namespace dvl

35
SourceX/miniwin/misc.cpp

@ -1,10 +1,10 @@
#include "pch.h"
#ifndef _WIN32
#include <sys/statvfs.h>
#endif
#include <SDL.h>
#include "devilution.h"
#include "stubs.h"
#include "dx.h"
#include "DiabloUI/diabloui.h"
namespace dvl {
DWORD last_error;
@ -104,25 +104,11 @@ UINT GetWindowsDirectoryA(LPSTR lpBuffer, UINT uSize)
WINBOOL GetDiskFreeSpaceA(LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector,
LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters)
{
#ifndef _WIN32
struct statvfs fiData;
int success = statvfs("/", &fiData);
*lpBytesPerSector = fiData.f_frsize;
*lpSectorsPerCluster = 1;
*lpNumberOfFreeClusters = fiData.f_bavail;
*lpTotalNumberOfClusters = fiData.f_blocks;
return success >= 0;
#else
// Todo give windows the real GetDiskFreeSpace
DUMMY();
*lpBytesPerSector = 1;
*lpSectorsPerCluster = 1;
*lpNumberOfFreeClusters = 10 << 20;
*lpTotalNumberOfClusters = 10 << 20;
return true;
#endif
}
/**
@ -188,6 +174,7 @@ DWORD GetCurrentDirectory(DWORD nBufferLength, LPTSTR lpBuffer)
if (!base_path) {
base_path = SDL_strdup("./");
}
eprintf("BasePath: %s\n", base_path);
strncpy(lpBuffer, base_path, nBufferLength);
SDL_free(base_path);
@ -201,10 +188,7 @@ DWORD GetCurrentDirectory(DWORD nBufferLength, LPTSTR lpBuffer)
DWORD GetLogicalDriveStringsA(DWORD nBufferLength, LPSTR lpBuffer)
{
DUMMY();
sprintf(lpBuffer, "/");
return 3;
return 0;
}
UINT GetDriveTypeA(LPCSTR lpRootPathName)
@ -274,7 +258,7 @@ HWND FindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName)
void FakeWMDestroy()
{
MainWndProc(NULL, DVL_WM_DESTROY, 0, NULL);
MainWndProc(NULL, DVL_WM_DESTROY, 0, 0);
}
HWND CreateWindowExA(
@ -639,6 +623,7 @@ DWORD GetPrivateProfileStringA(LPCSTR lpAppName, LPCSTR lpKeyName, LPCSTR lpDefa
strncpy(lpReturnedString, lpDefault, nSize);
SRegSaveString(lpAppName, lpKeyName, 0, lpReturnedString);
}
return 0; // dummy return value
}
int MessageBoxA(HWND hWnd, const char *Text, const char *Title, UINT Flags)
@ -704,7 +689,7 @@ LRESULT DefWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
if (Msg == DVL_WM_QUERYENDSESSION)
exit(0);
return NULL;
return 0;
}
LONG GetWindowLongA(HWND hWnd, int nIndex)

45
SourceX/miniwin/misc_dx.cpp

@ -0,0 +1,45 @@
#include <SDL.h>
#include "devilution.h"
#include "dx.h"
#include "stubs.h"
namespace dvl {
WINBOOL SetCursorPos(int X, int Y)
{
assert(renderer);
assert(window);
SDL_Rect view;
SDL_RenderGetViewport(renderer, &view);
X += view.x;
Y += view.y;
float scaleX;
SDL_RenderGetScale(renderer, &scaleX, NULL);
X *= scaleX;
Y *= scaleX;
SDL_WarpMouseInWindow(window, X, Y);
return true;
}
int ShowCursor(WINBOOL bShow)
{
SDL_ShowCursor(bShow ? SDL_ENABLE : SDL_DISABLE);
return bShow;
}
WINBOOL TextOutA(HDC hdc, int x, int y, LPCSTR lpString, int c)
{
DUMMY_ONCE();
assert(window);
SDL_SetWindowTitle(window, lpString);
return true;
}
} // namespace dvl

174
SourceX/miniwin/misc_io.cpp

@ -1,153 +1,147 @@
#include "pch.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cstdio>
#include <set>
#include <string>
#include <iterator>
#include <vector>
#include <algorithm>
#include <fstream>
#include <memory>
#include "devilution.h"
#include "stubs.h"
namespace dvl {
extern "C" void TranslateFileName(char *dst, int dstLen, const char *src)
{
for (int i = 0; i < dstLen; i++) {
char c = *src++;
dst[i] = c == '\\' ? '/' : c;
if (!c) {
break;
}
}
}
struct memfile {
std::string path;
std::vector<char> buf;
std::size_t pos = 0;
};
static std::set<HANDLE> files;
static std::set<memfile*> files;
HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
{
char name[260];
char name[DVL_MAX_PATH];
TranslateFileName(name, sizeof(name), lpFileName);
DUMMY_PRINT("file: %s (%s)", lpFileName, name);
assert(dwDesiredAccess == DVL_GENERIC_READ | DVL_GENERIC_WRITE);
int flags = O_RDWR;
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
UNIMPLEMENTED_UNLESS(dwDesiredAccess == (DVL_GENERIC_READ | DVL_GENERIC_WRITE));
memfile* file = new memfile;
file->path = name;
if (dwCreationDisposition == DVL_OPEN_EXISTING) {
// Nothing
// read contents of existing file into buffer
std::ifstream filestream(file->path, std::ios::binary);
if(!filestream.fail()) {
file->buf.insert(file->buf.begin(),
std::istreambuf_iterator<char>(filestream),
std::istreambuf_iterator<char>());
}
} else if (dwCreationDisposition == DVL_CREATE_ALWAYS) {
flags |= O_CREAT | O_TRUNC;
// start with empty file
} else {
UNIMPLEMENTED();
}
#ifdef _WIN32
//replace this later by something portable
HANDLE fd = (HANDLE)open(name, flags | _O_BINARY, mode);
#else
HANDLE fd = (HANDLE)open(name, flags, mode);
#endif
files.insert(fd);
return fd;
files.insert(file);
return file;
}
WINBOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped)
LPOVERLAPPED lpOverlapped)
{
DUMMY_ONCE();
assert(!lpOverlapped);
int len = read((intptr_t)hFile, lpBuffer, nNumberOfBytesToRead);
assert(len != -1);
memfile* file = static_cast<memfile*>(hFile);
UNIMPLEMENTED_UNLESS(!lpOverlapped);
size_t len = std::min<size_t>(file->buf.size() - file->pos, nNumberOfBytesToRead);
std::copy(file->buf.begin() + file->pos, file->buf.begin() + file->pos + len, static_cast<char*>(lpBuffer));
file->pos += len;
*lpNumberOfBytesRead = len;
return true;
}
DWORD GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
{
DUMMY_ONCE();
assert(!lpFileSizeHigh);
struct stat s;
int ret = fstat((intptr_t)hFile, &s);
assert(ret == 0);
return s.st_size;
memfile* file = static_cast<memfile*>(hFile);
return file->buf.size();
}
WINBOOL WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten,
LPOVERLAPPED lpOverlapped)
WINBOOL WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
{
DUMMY_ONCE();
assert(!lpOverlapped);
ssize_t len = write((intptr_t)hFile, lpBuffer, nNumberOfBytesToWrite);
if (len == -1) {
*lpNumberOfBytesWritten = 0;
return false;
}
*lpNumberOfBytesWritten = (DWORD)len;
memfile* file = static_cast<memfile*>(hFile);
UNIMPLEMENTED_UNLESS(!lpOverlapped);
if(!nNumberOfBytesToWrite)
return true;
if(file->buf.size() < file->pos + nNumberOfBytesToWrite)
file->buf.resize(file->pos + nNumberOfBytesToWrite);
std::copy(static_cast<const char*>(lpBuffer),
static_cast<const char*>(lpBuffer) + nNumberOfBytesToWrite,
file->buf.begin() + file->pos);
file->pos += nNumberOfBytesToWrite;
*lpNumberOfBytesWritten = nNumberOfBytesToWrite;
return true;
}
DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
{
DUMMY_ONCE();
assert(!lpDistanceToMoveHigh);
int whence;
memfile* file = static_cast<memfile*>(hFile);
UNIMPLEMENTED_UNLESS(!lpDistanceToMoveHigh);
if (dwMoveMethod == DVL_FILE_BEGIN) {
whence = SEEK_SET;
file->pos = lDistanceToMove;
} else if (dwMoveMethod == DVL_FILE_CURRENT) {
whence = SEEK_CUR;
file->pos += lDistanceToMove;
} else {
UNIMPLEMENTED();
}
off_t ret = lseek((intptr_t)hFile, lDistanceToMove, whence);
return (DWORD)ret;
if(file->buf.size() < file->pos + 1)
file->buf.resize(file->pos + 1);
return file->pos;
}
WINBOOL SetEndOfFile(HANDLE hFile)
{
DUMMY_ONCE();
off_t cur = lseek((intptr_t)hFile, 0, SEEK_CUR);
assert(cur != -1);
int res = ftruncate((intptr_t)hFile, cur);
assert(res == 0);
memfile* file = static_cast<memfile*>(hFile);
file->buf.erase(file->buf.begin() + file->pos, file->buf.end());
return true;
}
DWORD GetFileAttributesA(LPCSTR lpFileName)
{
char name[260];
char name[DVL_MAX_PATH];
TranslateFileName(name, sizeof(name), lpFileName);
DUMMY_PRINT("file: %s (%s)", lpFileName, name);
struct stat s;
int res = stat(name, &s);
if (res == -1) {
std::ifstream filestream(name, std::ios::binary);
if (filestream.fail()) {
SetLastError(DVL_ERROR_FILE_NOT_FOUND);
return (DWORD)-1;
}
return 0x80;
}
WINBOOL SetFileAttributesA(LPCSTR lpFileName, DWORD dwFileAttributes)
{
DUMMY_PRINT("file: %s", lpFileName);
return true;
}
WINBOOL CloseHandle(HANDLE hObject)
{
if (files.find(hObject) != files.end()) {
int ret = close((intptr_t)hObject);
assert(ret == 0);
files.erase(hObject);
memfile* file = static_cast<memfile*>(hObject);
if (files.find(file) == files.end())
return true;
std::unique_ptr<memfile> ufile(file); // ensure that delete file is
// called on returning
bool ret = true;
std::ofstream filestream(file->path + ".tmp", std::ios::binary);
if (filestream.fail())
ret = false;
filestream.write(file->buf.data(), file->buf.size());
if (filestream.fail())
ret = false;
if (std::rename((file->path + ".tmp").c_str(), file->path.c_str()))
ret = false;
if(!ret) {
DialogBoxParam(ghInst, DVL_MAKEINTRESOURCE(IDD_DIALOG7), ghMainWnd, (DLGPROC)FuncDlg, (LPARAM)file->path.c_str());
}
return true;
return ret;
}
}
} // namespace dvl

7
SourceX/miniwin/misc_msg.cpp

@ -1,4 +1,9 @@
#include "pch.h"
#include <deque>
#include <SDL.h>
#include "devilution.h"
#include "stubs.h"
/** @file
* *
* Windows message handling and keyboard event conversion for SDL.

2
SourceX/miniwin/rand.cpp

@ -1,4 +1,4 @@
#include <stdint.h>
#include <cstdint>
#include "devilution.h"

6
SourceX/miniwin/thread.cpp

@ -1,4 +1,8 @@
#include "pch.h"
#include <set>
#include <SDL.h>
#include "devilution.h"
#include "stubs.h"
namespace dvl {

44
SourceX/pch.h

@ -1,44 +0,0 @@
#include <assert.h>
#include <deque>
#include <dirent.h>
#include <functional>
#include <iostream>
#include <memory>
#include <queue>
#include <set>
#include <map>
#include <stdarg.h>
#include <string>
#include <utility>
#include <vector>
#include <SDL.h>
#include <SDL_mixer.h>
#include <SDL_thread.h>
#include <SDL_ttf.h>
#include "devilution.h"
#include "DiabloUI/diabloui.h"
namespace dvl {
struct DirectSoundBuffer : public IDirectSoundBuffer {
public:
virtual ULONG Release();
BOOL GetStatus(LPDWORD pdwStatus);
HRESULT Lock(DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags);
HRESULT Play(DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags);
HRESULT SetFormat(LPCWAVEFORMATEX pcfxFormat);
HRESULT SetVolume(LONG lVolume);
HRESULT SetPan(LONG lPan);
HRESULT Stop();
HRESULT Unlock(LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2);
HRESULT Restore();
private:
int volume = 0;
int pan = 0;
Mix_Chunk *chunk;
};
} // namespace dvl

9
SourceX/sound.cpp

@ -1,13 +1,14 @@
//HEADER_GOES_HERE
#include "devilution.h"
#include "../types.h"
#include "pch.h"
#include <SDL_mixer.h>
#include "stubs.h"
namespace dvl {
LPDIRECTSOUNDBUFFER DSBs[8];
LPDIRECTSOUND sglpDS;
char gbSndInited;
BOOLEAN gbSndInited;
int sglMusicVolume;
int sglSoundVolume;
HMODULE hDsound_dll;

44
SourceX/storm.cpp → SourceX/storm/storm.cpp

@ -1,24 +1,40 @@
#include "../3rdParty/Radon/Radon/include/Radon.hpp"
#include "../3rdParty/libsmacker/smacker.h"
#include "pch.h"
#include <SDL.h>
#include <SDL_mixer.h>
#include <Radon.hpp>
#include <smacker.h>
#include <unistd.h>
#include "devilution.h"
#include "stubs.h"
#include "DiabloUI/diabloui.h"
#include "dx.h"
namespace dvl {
extern "C" DWORD nLastError = 0;
DWORD nLastError = 0;
std::string getIniPath()
static std::string getIniPath()
{
char path[280];
int len = GetModuleFileNameA(ghInst, path, 260);
char path[DVL_MAX_PATH];
int len = GetModuleFileNameA(ghInst, path, DVL_MAX_PATH);
path[len - 1] = '/';
strcat(path, "diablo.ini");
return path;
}
radon::File ini(getIniPath());
static radon::File ini(getIniPath());
static Mix_Chunk *SFileChunk;
void TranslateFileName(char *dst, int dstLen, const char *src)
{
for (int i = 0; i < dstLen; i++) {
char c = *src++;
dst[i] = c == '\\' ? '/' : c;
if (!c) {
break;
}
}
}
// BOOL SFileCloseArchive(HANDLE hArchive)
// {
@ -30,7 +46,6 @@ radon::File ini(getIniPath());
// UNIMPLEMENTED();
// }
Mix_Chunk *SFileChunk;
BOOL SFileDdaBeginEx(HANDLE hFile, DWORD flags, DWORD mask, unsigned __int32 lDistanceToMove,
signed __int32 volume, signed int pan, int a7)
{
@ -42,6 +57,9 @@ BOOL SFileDdaBeginEx(HANDLE hFile, DWORD flags, DWORD mask, unsigned __int32 lDi
SFileChunk = Mix_LoadWAV_RW(rw, 1);
free(SFXbuffer);
Mix_Volume(0, MIX_MAX_VOLUME - MIX_MAX_VOLUME * volume / VOLUME_MIN);
int panned = 255 - 255 * abs(pan) / 10000;
Mix_SetPanning(0, pan <= 0 ? 255 : panned, pan >= 0 ? 255 : panned);
Mix_PlayChannel(0, SFileChunk, 0);
return true;
@ -206,7 +224,7 @@ BOOL SBmpLoadImage(const char *pszFileName, PALETTEENTRY *pPalette, BYTE *pBuffe
byte = *dataPtr;
if (byte < 0xC0) {
*pBuffer = byte;
*pBuffer++;
pBuffer++;
x++;
continue;
}
@ -214,7 +232,7 @@ BOOL SBmpLoadImage(const char *pszFileName, PALETTEENTRY *pPalette, BYTE *pBuffe
for (int i = 0; i < (byte & 0x3F); i++) {
*pBuffer = *dataPtr;
*pBuffer++;
pBuffer++;
x++;
}
}
@ -526,7 +544,7 @@ BOOL SVidPlayContinue(void)
double now = SDL_GetTicks() * 1000;
if (now < SVidFrameEnd) {
usleep(SVidFrameEnd - now); // wait with next frame if the system is to fast
SDL_Delay((SVidFrameEnd - now)/1000); // wait with next frame if the system is to fast
}
return SVidLoadNextFrame();

38
SourceX/storm/storm_dx.cpp

@ -0,0 +1,38 @@
#include <SDL.h>
#include "devilution.h"
#include "dx.h"
#include "stubs.h"
namespace dvl {
BOOL SDrawUpdatePalette(unsigned int firstentry, unsigned int numentries, PALETTEENTRY *pPalEntries, int a4)
{
assert(firstentry == 0);
assert(numentries == 256);
SDL_Color colors[256];
for (unsigned int i = firstentry; i < numentries; i++) {
SDL_Color *c = &colors[i];
PALETTEENTRY *p = &pPalEntries[i];
c->r = p->peRed;
c->g = p->peGreen;
c->b = p->peBlue;
c->a = SDL_ALPHA_OPAQUE;
}
assert(palette);
if (SDL_SetPaletteColors(palette, colors, firstentry, numentries) != 0) {
SDL_Log("SDL_SetPaletteColors: %s\n", SDL_GetError());
return false;
}
if (pal_surface) {
sdl_update_entire_surface();
sdl_present_surface();
}
return true;
}
} // namespace dvl

5
SourceX/storm_net.cpp → SourceX/storm/storm_net.cpp

@ -1,5 +1,8 @@
#include <memory>
#include "devilution.h"
#include "stubs.h"
#include "dvlnet/abstract_net.h"
#include "pch.h"
namespace dvl {

6
SourceX/stubs.h

@ -12,6 +12,12 @@
abort(); \
} while (0)
#define UNIMPLEMENTED_UNLESS(x) \
do { \
if(!(x)) \
UNIMPLEMENTED(); \
} while (0)
#define ABORT() \
do { \
eprintf("ABORT: %s @ %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \

14
SourceX/utf8.h

@ -1,13 +1,13 @@
#pragma once
#include <cstdint>
#include <string>
#include <utility>
/* Branchless UTF-8 decoder
*
* This is free and unencumbered software released into the public domain.
*/
#ifndef UTF8_H
#define UTF8_H
#include <stdint.h>
#include <string>
#include <utility>
/* Decode the next character, C, from BUF, reporting errors in E.
*
@ -84,5 +84,3 @@ inline std::string utf8_to_latin1(const char* in)
}
return std::move(ret);
}
#endif

784
Xcode/devilutionX.xcodeproj/project.pbxproj

@ -7,19 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
00DABA918E5348F382AF3E16 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4D49F7AAB1448BB3796750 /* debug.cpp */; };
0E40D3E2ABA5486884AD1271 /* textdat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC0017809BF45FD9BCC06CA /* textdat.cpp */; };
10A37F34E807485A8081A8A6 /* missiles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DDD7341C6712447191FD2C4B /* missiles.cpp */; };
17C52FFA55984C5A93007652 /* objects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C713AED00778486B94CD282B /* objects.cpp */; };
1EDB503A982F46D4920BFF3D /* gmenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC4A34B55AA4827B345A6A0 /* gmenu.cpp */; };
2363B2BA33664F008CF2266E /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8E47C81C5BD940C2A5A1704D /* engine.cpp */; };
283E47DA990148F18302218F /* towners.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 47D57E7305264ED7951AF3B1 /* towners.cpp */; };
2962434943834AF8839658B8 /* pack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31E66A5457E64947AA68C7F7 /* pack.cpp */; };
2A743A2DEE444E6295400155 /* player.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1B3EB5883E0C42D3A0F3D4D5 /* player.cpp */; };
2B0FDA186B5D4A348E82BE69 /* drlg_l3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1B1230CFD4B8587F7EC80 /* drlg_l3.cpp */; };
2E51C3FD096247BDB522FA63 /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 413186B26DE644E197D49314 /* error.cpp */; };
3AA9769F36DA404CB3DB029B /* portal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2017B5200DF14FD7B6959133 /* portal.cpp */; };
3D80977966AE4264938D37A3 /* town.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DAAD0527F1EA496A8B669415 /* town.cpp */; };
433449A42240500B003AB4F2 /* libpng16.16.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 433449A222404FFA003AB4F2 /* libpng16.16.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
43398749223E5D3A001F8420 /* SDL2_mixer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43398741223E5CB0001F8420 /* SDL2_mixer.framework */; };
4339874A223E5D3A001F8420 /* SDL2_mixer.framework in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 43398741223E5CB0001F8420 /* SDL2_mixer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@ -27,34 +14,6 @@
4339874C223E5D3A001F8420 /* SDL2_ttf.framework in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 4339873F223E5CAB001F8420 /* SDL2_ttf.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4339874E223E5D3A001F8420 /* SDL2.framework in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 4339873D223E5C1A001F8420 /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
43398752223E5E0E001F8420 /* SDL2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4339873D223E5C1A001F8420 /* SDL2.framework */; };
43398770223E60F8001F8420 /* miniwin_dsound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398754223E60F3001F8420 /* miniwin_dsound.cpp */; };
43398771223E60F8001F8420 /* udp_p2p.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398755223E60F3001F8420 /* udp_p2p.cpp */; };
43398772223E60F8001F8420 /* base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398756223E60F4001F8420 /* base.cpp */; };
43398773223E60F8001F8420 /* storm_net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398757223E60F4001F8420 /* storm_net.cpp */; };
43398774223E60F8001F8420 /* diabloui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398758223E60F4001F8420 /* diabloui.cpp */; };
43398775223E60F8001F8420 /* mainmenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398759223E60F4001F8420 /* mainmenu.cpp */; };
43398776223E60F8001F8420 /* progress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339875A223E60F4001F8420 /* progress.cpp */; };
43398777223E60F9001F8420 /* selconn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339875B223E60F4001F8420 /* selconn.cpp */; };
43398778223E60F9001F8420 /* packet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339875C223E60F4001F8420 /* packet.cpp */; };
43398779223E60F9001F8420 /* sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339875D223E60F5001F8420 /* sound.cpp */; };
4339877A223E60F9001F8420 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339875E223E60F5001F8420 /* main.cpp */; };
4339877B223E60F9001F8420 /* storm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339875F223E60F5001F8420 /* storm.cpp */; };
4339877C223E60F9001F8420 /* abstract_net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398760223E60F5001F8420 /* abstract_net.cpp */; };
4339877D223E60F9001F8420 /* frame_queue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398761223E60F5001F8420 /* frame_queue.cpp */; };
4339877E223E60F9001F8420 /* misc_msg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398762223E60F6001F8420 /* misc_msg.cpp */; };
4339877F223E60F9001F8420 /* misc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398763223E60F6001F8420 /* misc.cpp */; };
43398780223E60F9001F8420 /* thread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398764223E60F6001F8420 /* thread.cpp */; };
43398781223E60F9001F8420 /* title.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398765223E60F6001F8420 /* title.cpp */; };
43398782223E60F9001F8420 /* dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398766223E60F6001F8420 /* dx.cpp */; };
43398783223E60F9001F8420 /* tcp_client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398767223E60F7001F8420 /* tcp_client.cpp */; };
43398784223E60F9001F8420 /* rand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398768223E60F7001F8420 /* rand.cpp */; };
43398785223E60F9001F8420 /* misc_io.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43398769223E60F7001F8420 /* misc_io.cpp */; };
43398786223E60F9001F8420 /* selgame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339876A223E60F7001F8420 /* selgame.cpp */; };
43398787223E60F9001F8420 /* tcp_server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339876B223E60F7001F8420 /* tcp_server.cpp */; };
43398788223E60F9001F8420 /* loopback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339876C223E60F8001F8420 /* loopback.cpp */; };
43398789223E60F9001F8420 /* selhero.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339876D223E60F8001F8420 /* selhero.cpp */; };
4339878A223E60F9001F8420 /* credits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339876E223E60F8001F8420 /* credits.cpp */; };
4339878B223E60F9001F8420 /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4339876F223E60F8001F8420 /* dialogs.cpp */; };
436280812236241F00C911AD /* libdevilution.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3ECD637555514971BCD3E90E /* libdevilution.a */; };
436280822236241F00C911AD /* libPKWare.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 646292CBB776434AA4CA1C94 /* libPKWare.a */; };
436280832236241F00C911AD /* libRadon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E1DAF5C7BA48E5A1E39C04 /* libRadon.a */; };
@ -75,70 +34,113 @@
4362B526223E2B8600633F20 /* SBaseCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4362B51B223E2B8600633F20 /* SBaseCommon.cpp */; };
4362B527223E2B8600633F20 /* SFileExtractFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4362B51C223E2B8600633F20 /* SFileExtractFile.cpp */; };
4362B528223E2B8600633F20 /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4362B51D223E2B8600633F20 /* FileStream.cpp */; };
43B6C7CA224068AB007313EA /* abstract_net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7992240688A007313EA /* abstract_net.cpp */; };
43B6C7CB224068AB007313EA /* base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79022406888007313EA /* base.cpp */; };
43B6C7CC224068AB007313EA /* credits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A92240688C007313EA /* credits.cpp */; };
43B6C7CD224068AB007313EA /* diabloui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79122406889007313EA /* diabloui.cpp */; };
43B6C7CE224068AB007313EA /* dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7AA2240688D007313EA /* dialogs.cpp */; };
43B6C7CF224068AB007313EA /* dsound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7982240688A007313EA /* dsound.cpp */; };
43B6C7D0224068AB007313EA /* dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A02240688B007313EA /* dx.cpp */; };
43B6C7D1224068AB007313EA /* frame_queue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79A2240688A007313EA /* frame_queue.cpp */; };
43B6C7D2224068AB007313EA /* loopback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A62240688C007313EA /* loopback.cpp */; };
43B6C7D3224068AB007313EA /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79722406889007313EA /* main.cpp */; };
43B6C7D4224068AB007313EA /* mainmenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79222406889007313EA /* mainmenu.cpp */; };
43B6C7D5224068AB007313EA /* misc_dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C78F22406888007313EA /* misc_dx.cpp */; };
43B6C7D6224068AB007313EA /* misc_io.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A32240688B007313EA /* misc_io.cpp */; };
43B6C7D7224068AB007313EA /* misc_msg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79B2240688A007313EA /* misc_msg.cpp */; };
43B6C7D8224068AB007313EA /* misc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79C2240688A007313EA /* misc.cpp */; };
43B6C7D9224068AB007313EA /* packet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79522406889007313EA /* packet.cpp */; };
43B6C7DA224068AB007313EA /* progress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79322406889007313EA /* progress.cpp */; };
43B6C7DB224068AB007313EA /* rand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A22240688B007313EA /* rand.cpp */; };
43B6C7DC224068AB007313EA /* selconn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79422406889007313EA /* selconn.cpp */; };
43B6C7DD224068AB007313EA /* selgame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A42240688B007313EA /* selgame.cpp */; };
43B6C7DE224068AB007313EA /* selhero.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A72240688C007313EA /* selhero.cpp */; };
43B6C7DF224068AB007313EA /* sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79D2240688A007313EA /* sound.cpp */; };
43B6C7E0224068AB007313EA /* storm_dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A82240688C007313EA /* storm_dx.cpp */; };
43B6C7E1224068AB007313EA /* storm_net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79622406889007313EA /* storm_net.cpp */; };
43B6C7E2224068AB007313EA /* storm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7AB2240688D007313EA /* storm.cpp */; };
43B6C7E3224068AB007313EA /* tcp_client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A12240688B007313EA /* tcp_client.cpp */; };
43B6C7E4224068AB007313EA /* tcp_server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7A52240688C007313EA /* tcp_server.cpp */; };
43B6C7E5224068AB007313EA /* thread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79E2240688A007313EA /* thread.cpp */; };
43B6C7E6224068AB007313EA /* title.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C79F2240688B007313EA /* title.cpp */; };
43B6C7E7224068AB007313EA /* udp_p2p.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C78E22406888007313EA /* udp_p2p.cpp */; };
43B6C82A224068CF007313EA /* appfat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C72B2240686D007313EA /* appfat.cpp */; };
43B6C82B224068CF007313EA /* automap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7212240686A007313EA /* automap.cpp */; };
43B6C82C224068CF007313EA /* capture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7312240686F007313EA /* capture.cpp */; };
43B6C82D224068CF007313EA /* codec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74622406874007313EA /* codec.cpp */; };
43B6C82E224068CF007313EA /* control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71F2240686A007313EA /* control.cpp */; };
43B6C82F224068CF007313EA /* cursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C70E22406867007313EA /* cursor.cpp */; };
43B6C830224068CF007313EA /* dead.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71522406868007313EA /* dead.cpp */; };
43B6C831224068CF007313EA /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71D22406869007313EA /* debug.cpp */; };
43B6C832224068CF007313EA /* diablo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73F22406873007313EA /* diablo.cpp */; };
43B6C833224068CF007313EA /* doom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7252240686B007313EA /* doom.cpp */; };
43B6C834224068CF007313EA /* drlg_l1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71222406867007313EA /* drlg_l1.cpp */; };
43B6C835224068CF007313EA /* drlg_l2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73722406871007313EA /* drlg_l2.cpp */; };
43B6C836224068CF007313EA /* drlg_l3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71322406868007313EA /* drlg_l3.cpp */; };
43B6C837224068CF007313EA /* drlg_l4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73822406871007313EA /* drlg_l4.cpp */; };
43B6C838224068CF007313EA /* dthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73E22406872007313EA /* dthread.cpp */; };
43B6C839224068CF007313EA /* effects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73B22406872007313EA /* effects.cpp */; };
43B6C83A224068CF007313EA /* encrypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74022406873007313EA /* encrypt.cpp */; };
43B6C83B224068CF007313EA /* engine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73522406870007313EA /* engine.cpp */; };
43B6C83C224068CF007313EA /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C70A22406866007313EA /* error.cpp */; };
43B6C83D224068CF007313EA /* fault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7202240686A007313EA /* fault.cpp */; };
43B6C83E224068CF007313EA /* gamemenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C72E2240686E007313EA /* gamemenu.cpp */; };
43B6C83F224068CF007313EA /* gendung.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71C22406869007313EA /* gendung.cpp */; };
43B6C840224068CF007313EA /* gmenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C70B22406866007313EA /* gmenu.cpp */; };
43B6C841224068CF007313EA /* help.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C70D22406867007313EA /* help.cpp */; };
43B6C842224068CF007313EA /* init.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C70C22406866007313EA /* init.cpp */; };
43B6C843224068CF007313EA /* interfac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71422406868007313EA /* interfac.cpp */; };
43B6C844224068CF007313EA /* inv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73C22406872007313EA /* inv.cpp */; };
43B6C845224068CF007313EA /* items.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71022406867007313EA /* items.cpp */; };
43B6C846224068CF007313EA /* lighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74722406875007313EA /* lighting.cpp */; };
43B6C847224068CF007313EA /* loadsave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C72F2240686F007313EA /* loadsave.cpp */; };
43B6C848224068CF007313EA /* logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7222240686A007313EA /* logging.cpp */; };
43B6C849224068CF007313EA /* mainmenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7302240686F007313EA /* mainmenu.cpp */; };
43B6C84A224068CF007313EA /* minitext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7242240686B007313EA /* minitext.cpp */; };
43B6C84B224068CF007313EA /* missiles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71622406868007313EA /* missiles.cpp */; };
43B6C84C224068CF007313EA /* monster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74822406875007313EA /* monster.cpp */; };
43B6C84D224068CF007313EA /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C72A2240686D007313EA /* movie.cpp */; };
43B6C84E224068CF007313EA /* mpqapi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C72D2240686E007313EA /* mpqapi.cpp */; };
43B6C84F224068CF007313EA /* msg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71722406868007313EA /* msg.cpp */; };
43B6C850224068CF007313EA /* msgcmd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74922406875007313EA /* msgcmd.cpp */; };
43B6C851224068CF007313EA /* multi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71E22406869007313EA /* multi.cpp */; };
43B6C852224068CF007313EA /* nthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73422406870007313EA /* nthread.cpp */; };
43B6C853224068CF007313EA /* objects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C72C2240686E007313EA /* objects.cpp */; };
43B6C854224068CF007313EA /* pack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74122406873007313EA /* pack.cpp */; };
43B6C855224068CF007313EA /* palette.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73322406870007313EA /* palette.cpp */; };
43B6C856224068CF007313EA /* path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7322240686F007313EA /* path.cpp */; };
43B6C857224068CF007313EA /* pfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73922406871007313EA /* pfile.cpp */; };
43B6C858224068CF007313EA /* player.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C70F22406867007313EA /* player.cpp */; };
43B6C859224068CF007313EA /* plrmsg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7232240686A007313EA /* plrmsg.cpp */; };
43B6C85A224068CF007313EA /* portal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71922406869007313EA /* portal.cpp */; };
43B6C85B224068CF007313EA /* quests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74222406873007313EA /* quests.cpp */; };
43B6C85C224068CF007313EA /* render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73622406870007313EA /* render.cpp */; };
43B6C85D224068CF007313EA /* restrict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73D22406872007313EA /* restrict.cpp */; };
43B6C85E224068CF007313EA /* scrollrt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74B22406875007313EA /* scrollrt.cpp */; };
43B6C85F224068CF007313EA /* setmaps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74322406874007313EA /* setmaps.cpp */; };
43B6C860224068CF007313EA /* sha.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7272240686C007313EA /* sha.cpp */; };
43B6C861224068CF007313EA /* spells.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71822406868007313EA /* spells.cpp */; };
43B6C862224068CF007313EA /* stores.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71122406867007313EA /* stores.cpp */; };
43B6C863224068CF007313EA /* sync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7282240686C007313EA /* sync.cpp */; };
43B6C864224068CF007313EA /* textdat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7262240686C007313EA /* textdat.cpp */; };
43B6C865224068CF007313EA /* themes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C7292240686D007313EA /* themes.cpp */; };
43B6C866224068CF007313EA /* tmsg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71B22406869007313EA /* tmsg.cpp */; };
43B6C867224068CF007313EA /* town.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74422406874007313EA /* town.cpp */; };
43B6C868224068CF007313EA /* towners.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74A22406875007313EA /* towners.cpp */; };
43B6C869224068CF007313EA /* track.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C71A22406869007313EA /* track.cpp */; };
43B6C86A224068CF007313EA /* trigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C74522406874007313EA /* trigs.cpp */; };
43B6C86B224068CF007313EA /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B6C73A22406872007313EA /* wave.cpp */; };
43BA39B122375D8A009041FF /* AppIcon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 43BA39AF22375925009041FF /* AppIcon.xcassets */; };
4F27D72CD6A448B196008C10 /* encrypt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F6D083DFE8F4912AD21323E /* encrypt.cpp */; };
503716BF6B434A48ACA1BD86 /* drlg_l1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6687A60F94C648A2B5E20FB7 /* drlg_l1.cpp */; };
50630CDFA3D444DCA5946A1C /* lighting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D58130817DEA419984D28AB3 /* lighting.cpp */; };
545DD73999244831A23D777A /* scrollrt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7385F58EEFA44AF88C4D8798 /* scrollrt.cpp */; };
547166BC671248509081109E /* restrict.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5876CCE0133A4D6EADDF0AAE /* restrict.cpp */; };
5CE3C7E27B6E4BD9AAA5619D /* gamemenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FBCC5BCDC3842F58CF572AB /* gamemenu.cpp */; };
5E67153371F94500B95B41A7 /* track.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2C87FF47C667465E868B191E /* track.cpp */; };
5FA14820FB17477383DA0700 /* path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A711EC4A01C74302BF18E4C3 /* path.cpp */; };
6186FBD4D4644CA78FEAAA53 /* appfat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EDDB82E7195E4EF69A42C0D5 /* appfat.cpp */; };
623ACC26BBBB42978A6386EF /* automap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D86188B68E494666A2972128 /* automap.cpp */; };
6240F97CE4014B1DB267D471 /* dthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D961B8EC59154E98955AE2E7 /* dthread.cpp */; };
6261395CEAB2412186C5666C /* interfac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8445BFAA306D42FE886F0ACC /* interfac.cpp */; };
64CE5D2CE32946A08990EE92 /* setmaps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C78DC63816DF4F1C867578C7 /* setmaps.cpp */; };
652BBCD55FBE46CC941FD64C /* smk_bitstream.c in Sources */ = {isa = PBXBuildFile; fileRef = 670494A24D7F4CFFACCD3BFB /* smk_bitstream.c */; };
6651D75C83744F8BB9A4EE09 /* drlg_l2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 219EFD2B33014357A3B26650 /* drlg_l2.cpp */; };
6669BEC0507C4957BAD30989 /* effects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A28321B6858D4AB5A53D7408 /* effects.cpp */; };
73E86BC9E2714148AD560C46 /* smacker.c in Sources */ = {isa = PBXBuildFile; fileRef = 622A8C6A02D94FFC996C2CAE /* smacker.c */; };
75294609B2944CC9BC4A487B /* drlg_l4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 183703645CB04A19AD9E5025 /* drlg_l4.cpp */; };
75CE86C992F940A4B4D78E5C /* diablo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0EF63E8BD67C4954A26480D5 /* diablo.cpp */; };
7652232427CA44C1BBBAAFE3 /* capture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3B7366F811604AE1B00C8C9A /* capture.cpp */; };
76C236244D2B4D5FB67381DB /* spells.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84BAB44B72164700A0A8B4D6 /* spells.cpp */; };
773B22BC5C3E41799F769001 /* msg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4040598A1C254715A8C8673C /* msg.cpp */; };
7AF599B5937C48CFA2FFDAA4 /* render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5A898CD619824F19ABC9E484 /* render.cpp */; };
7DACE4548EF94D77874E0F31 /* palette.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32E0A65ED0904E12BE84988B /* palette.cpp */; };
7E67ADF45FD840B69098C6D0 /* sync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D09D9AFCBB94D86BD283257 /* sync.cpp */; };
81595166A06F4A09A80AEFB5 /* help.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBB67C79EEBA48D1B5D8D70B /* help.cpp */; };
81797D16B64A49F79D53FE9B /* loadsave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F0FEC1BE8E6049D593406F4D /* loadsave.cpp */; };
82418547480144C0A65FC9CE /* themes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 98AB581710214A55AD84E8D0 /* themes.cpp */; };
8305C713732C4CECA36F37E9 /* explode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D7FE30F050049FB933D2788 /* explode.cpp */; };
8774C8F414CF47248652D15A /* nthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 203ED4AA4231415BA1B02BAE /* nthread.cpp */; };
89C8F76E788A4369AE9CA283 /* logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 68977FC478CB4E6CA54A3E38 /* logging.cpp */; };
8AC07A27B0D3408884802D80 /* tmsg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3216A3E0351743AE8FFCF891 /* tmsg.cpp */; };
8FA4E9B3FA7D4B6AAB10EF73 /* implode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1B2D29A5A284CD29205745F /* implode.cpp */; };
96A5B8E287BF480CB1733558 /* mainmenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 737FBDFA9A4A4B628BB2235B /* mainmenu.cpp */; };
A4D2FA94492E46D38B094934 /* sha.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4741C7B8659C4E1C826A129C /* sha.cpp */; };
A708041A39EB43BB8F68E7D2 /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7B0ACCABE284B3888DF09D5 /* movie.cpp */; };
AA419C3D7384435299F5FA80 /* trigs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 60A06F7D04B1447FAE6F13C9 /* trigs.cpp */; };
AED121172E094DAAB8B1322D /* msgcmd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAC7C674E0104BA4A4B0FEA3 /* msgcmd.cpp */; };
B000FB7744A2405CB4A39483 /* multi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5F3FB00DF08741CDA799AB93 /* multi.cpp */; };
B1D9EA0B0DA04F15BFA456A9 /* gendung.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E421A97655174F4099852AD2 /* gendung.cpp */; };
B4BBB196D148453BA2BA830E /* init.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6BDC3D1BA3B64866B84CEB3C /* init.cpp */; };
B728E60F029A4234B90A9371 /* dead.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 16C6AB08C75D4A1E993FE50B /* dead.cpp */; };
B748B788987B4A9A91DF84B3 /* items.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF78F60283044A13A4CE1D1B /* items.cpp */; };
BAC5D4D57F364349B3C2F552 /* control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D7327A50AC445CE94B2B4C9 /* control.cpp */; };
BB88EC00498744F7914A1484 /* stores.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D28A84812B34E10AE50E192 /* stores.cpp */; };
BFF16F60B46F4B8984D3007C /* quests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0348AAD50CEF4915900FD581 /* quests.cpp */; };
C43B4AA5223F0DD900CE0DD9 /* libclang_rt.asan_osx_dynamic.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = C43B4AA3223F0DCA00CE0DD9 /* libclang_rt.asan_osx_dynamic.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
C648EEFB6E17468AB8C3943E /* fault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9C2AEA532E6F4FF8B66083C9 /* fault.cpp */; };
C794AF87232B4745B3C48397 /* Key.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0B8A000CA684B9FAF88F313 /* Key.cpp */; };
CCB1A17083824600A7FC6DBF /* doom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7119751C6B7A4F40BB3B87B0 /* doom.cpp */; };
CE3E3D2BD44C407A9BE60A72 /* codec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CA4B6FC7C063411F9460CD20 /* codec.cpp */; };
D1124CA76EC04271B012DDA6 /* pfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4A86F8316B224BF3BA817854 /* pfile.cpp */; };
D9B4737B66AE401189E47E04 /* wave.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 373F9A9104DF4176A291FC8B /* wave.cpp */; };
DA61C597DBC848E39FBE602E /* plrmsg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BA2A3A52015F4859A4C5A6A2 /* plrmsg.cpp */; };
E3A3620899BB426EA66636CF /* monster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E54D4F37A0B24C6B83CE5D22 /* monster.cpp */; };
E3C499D08A284F95BDB46B42 /* smk_hufftree.c in Sources */ = {isa = PBXBuildFile; fileRef = 500C9F6E13FE44BFAEFCB81B /* smk_hufftree.c */; };
E777E9F7F0C54ECBA2DE2A2C /* cursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E812A68DE4194125A3A7A351 /* cursor.cpp */; };
EF709BC9D0B245338D17E9D7 /* Section.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6F074DDFE42C4B46A93CC4A9 /* Section.cpp */; };
F425942E977042C9AAD29647 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 722EB8D86DBF49368AAFEE3C /* File.cpp */; };
F47E4687B48048D9943833C3 /* inv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF6C9F651C014C538ECFCC09 /* inv.cpp */; };
FA750FAB5C734384B3E1D709 /* minitext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DB292068EC0C4CDD8E7A57CF /* minitext.cpp */; };
FB80B52A619D452FA9BDE316 /* Named.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B229DB87369B4D76B0A60580 /* Named.cpp */; };
FD006417F6AA479E9A2764C5 /* mpqapi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 966BF9CEF1B6419CA25FC162 /* mpqapi.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -205,63 +207,11 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
0348AAD50CEF4915900FD581 /* quests.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = quests.cpp; path = Source/quests.cpp; sourceTree = SOURCE_ROOT; };
0EF63E8BD67C4954A26480D5 /* diablo.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = diablo.cpp; path = Source/diablo.cpp; sourceTree = SOURCE_ROOT; };
16C6AB08C75D4A1E993FE50B /* dead.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = dead.cpp; path = Source/dead.cpp; sourceTree = SOURCE_ROOT; };
183703645CB04A19AD9E5025 /* drlg_l4.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = drlg_l4.cpp; path = Source/drlg_l4.cpp; sourceTree = SOURCE_ROOT; };
1A4D49F7AAB1448BB3796750 /* debug.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = debug.cpp; path = Source/debug.cpp; sourceTree = SOURCE_ROOT; };
1B3EB5883E0C42D3A0F3D4D5 /* player.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = player.cpp; path = Source/player.cpp; sourceTree = SOURCE_ROOT; };
1F6D083DFE8F4912AD21323E /* encrypt.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = encrypt.cpp; path = Source/encrypt.cpp; sourceTree = SOURCE_ROOT; };
1FBCC5BCDC3842F58CF572AB /* gamemenu.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = gamemenu.cpp; path = Source/gamemenu.cpp; sourceTree = SOURCE_ROOT; };
2017B5200DF14FD7B6959133 /* portal.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = portal.cpp; path = Source/portal.cpp; sourceTree = SOURCE_ROOT; };
203ED4AA4231415BA1B02BAE /* nthread.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = nthread.cpp; path = Source/nthread.cpp; sourceTree = SOURCE_ROOT; };
219EFD2B33014357A3B26650 /* drlg_l2.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = drlg_l2.cpp; path = Source/drlg_l2.cpp; sourceTree = SOURCE_ROOT; };
2C87FF47C667465E868B191E /* track.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = track.cpp; path = Source/track.cpp; sourceTree = SOURCE_ROOT; };
2D7327A50AC445CE94B2B4C9 /* control.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = control.cpp; path = Source/control.cpp; sourceTree = SOURCE_ROOT; };
31E66A5457E64947AA68C7F7 /* pack.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = pack.cpp; path = Source/pack.cpp; sourceTree = SOURCE_ROOT; };
3216A3E0351743AE8FFCF891 /* tmsg.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = tmsg.cpp; path = Source/tmsg.cpp; sourceTree = SOURCE_ROOT; };
32E0A65ED0904E12BE84988B /* palette.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = palette.cpp; path = Source/palette.cpp; sourceTree = SOURCE_ROOT; };
373F9A9104DF4176A291FC8B /* wave.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = wave.cpp; path = Source/wave.cpp; sourceTree = SOURCE_ROOT; };
3B7366F811604AE1B00C8C9A /* capture.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = capture.cpp; path = Source/capture.cpp; sourceTree = SOURCE_ROOT; };
3CC0017809BF45FD9BCC06CA /* textdat.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = textdat.cpp; path = Source/textdat.cpp; sourceTree = SOURCE_ROOT; };
3CC4A34B55AA4827B345A6A0 /* gmenu.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = gmenu.cpp; path = Source/gmenu.cpp; sourceTree = SOURCE_ROOT; };
3D09D9AFCBB94D86BD283257 /* sync.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = sync.cpp; path = Source/sync.cpp; sourceTree = SOURCE_ROOT; };
3D28A84812B34E10AE50E192 /* stores.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = stores.cpp; path = Source/stores.cpp; sourceTree = SOURCE_ROOT; };
3ECD637555514971BCD3E90E /* libdevilution.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libdevilution.a; sourceTree = BUILT_PRODUCTS_DIR; };
4040598A1C254715A8C8673C /* msg.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = msg.cpp; path = Source/msg.cpp; sourceTree = SOURCE_ROOT; };
413186B26DE644E197D49314 /* error.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = error.cpp; path = Source/error.cpp; sourceTree = SOURCE_ROOT; };
433449A222404FFA003AB4F2 /* libpng16.16.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpng16.16.dylib; path = libs/frameworks/libpng16.16.dylib; sourceTree = "<group>"; };
4339873D223E5C1A001F8420 /* SDL2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = SDL2.framework; path = libs/frameworks/SDL2.framework; sourceTree = SOURCE_ROOT; };
4339873F223E5CAB001F8420 /* SDL2_ttf.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = SDL2_ttf.framework; path = libs/frameworks/SDL2_ttf.framework; sourceTree = "<group>"; };
43398741223E5CB0001F8420 /* SDL2_mixer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = SDL2_mixer.framework; path = libs/frameworks/SDL2_mixer.framework; sourceTree = "<group>"; };
43398754223E60F3001F8420 /* miniwin_dsound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = miniwin_dsound.cpp; path = SourceX/miniwin_dsound.cpp; sourceTree = "<group>"; };
43398755223E60F3001F8420 /* udp_p2p.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = udp_p2p.cpp; path = SourceX/dvlnet/udp_p2p.cpp; sourceTree = "<group>"; };
43398756223E60F4001F8420 /* base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = base.cpp; path = SourceX/dvlnet/base.cpp; sourceTree = "<group>"; };
43398757223E60F4001F8420 /* storm_net.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = storm_net.cpp; path = SourceX/storm_net.cpp; sourceTree = "<group>"; };
43398758223E60F4001F8420 /* diabloui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = diabloui.cpp; path = SourceX/DiabloUI/diabloui.cpp; sourceTree = "<group>"; };
43398759223E60F4001F8420 /* mainmenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mainmenu.cpp; path = SourceX/DiabloUI/mainmenu.cpp; sourceTree = "<group>"; };
4339875A223E60F4001F8420 /* progress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = progress.cpp; path = SourceX/DiabloUI/progress.cpp; sourceTree = "<group>"; };
4339875B223E60F4001F8420 /* selconn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = selconn.cpp; path = SourceX/DiabloUI/selconn.cpp; sourceTree = "<group>"; };
4339875C223E60F4001F8420 /* packet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = packet.cpp; path = SourceX/dvlnet/packet.cpp; sourceTree = "<group>"; };
4339875D223E60F5001F8420 /* sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sound.cpp; path = SourceX/sound.cpp; sourceTree = "<group>"; };
4339875E223E60F5001F8420 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = SourceX/main.cpp; sourceTree = "<group>"; };
4339875F223E60F5001F8420 /* storm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = storm.cpp; path = SourceX/storm.cpp; sourceTree = "<group>"; };
43398760223E60F5001F8420 /* abstract_net.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = abstract_net.cpp; path = SourceX/dvlnet/abstract_net.cpp; sourceTree = "<group>"; };
43398761223E60F5001F8420 /* frame_queue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = frame_queue.cpp; path = SourceX/dvlnet/frame_queue.cpp; sourceTree = "<group>"; };
43398762223E60F6001F8420 /* misc_msg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = misc_msg.cpp; path = SourceX/miniwin/misc_msg.cpp; sourceTree = "<group>"; };
43398763223E60F6001F8420 /* misc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = misc.cpp; path = SourceX/miniwin/misc.cpp; sourceTree = "<group>"; };
43398764223E60F6001F8420 /* thread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = thread.cpp; path = SourceX/miniwin/thread.cpp; sourceTree = "<group>"; };
43398765223E60F6001F8420 /* title.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = title.cpp; path = SourceX/DiabloUI/title.cpp; sourceTree = "<group>"; };
43398766223E60F6001F8420 /* dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dx.cpp; path = SourceX/dx.cpp; sourceTree = "<group>"; };
43398767223E60F7001F8420 /* tcp_client.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tcp_client.cpp; path = SourceX/dvlnet/tcp_client.cpp; sourceTree = "<group>"; };
43398768223E60F7001F8420 /* rand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rand.cpp; path = SourceX/miniwin/rand.cpp; sourceTree = "<group>"; };
43398769223E60F7001F8420 /* misc_io.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = misc_io.cpp; path = SourceX/miniwin/misc_io.cpp; sourceTree = "<group>"; };
4339876A223E60F7001F8420 /* selgame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = selgame.cpp; path = SourceX/DiabloUI/selgame.cpp; sourceTree = "<group>"; };
4339876B223E60F7001F8420 /* tcp_server.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tcp_server.cpp; path = SourceX/dvlnet/tcp_server.cpp; sourceTree = "<group>"; };
4339876C223E60F8001F8420 /* loopback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loopback.cpp; path = SourceX/dvlnet/loopback.cpp; sourceTree = "<group>"; };
4339876D223E60F8001F8420 /* selhero.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = selhero.cpp; path = SourceX/DiabloUI/selhero.cpp; sourceTree = "<group>"; };
4339876E223E60F8001F8420 /* credits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = credits.cpp; path = SourceX/DiabloUI/credits.cpp; sourceTree = "<group>"; };
4339876F223E60F8001F8420 /* dialogs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dialogs.cpp; path = SourceX/DiabloUI/dialogs.cpp; sourceTree = "<group>"; };
436280B22236351000C911AD /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
436280B42236352000C911AD /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; };
436280B62236354100C911AD /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
@ -278,63 +228,117 @@
4362B51B223E2B8600633F20 /* SBaseCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBaseCommon.cpp; path = 3rdParty/StormLib/src/SBaseCommon.cpp; sourceTree = "<group>"; };
4362B51C223E2B8600633F20 /* SFileExtractFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SFileExtractFile.cpp; path = 3rdParty/StormLib/src/SFileExtractFile.cpp; sourceTree = "<group>"; };
4362B51D223E2B8600633F20 /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileStream.cpp; path = 3rdParty/StormLib/src/FileStream.cpp; sourceTree = "<group>"; };
43B6C70A22406866007313EA /* error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = error.cpp; path = Source/error.cpp; sourceTree = "<group>"; };
43B6C70B22406866007313EA /* gmenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gmenu.cpp; path = Source/gmenu.cpp; sourceTree = "<group>"; };
43B6C70C22406866007313EA /* init.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = init.cpp; path = Source/init.cpp; sourceTree = "<group>"; };
43B6C70D22406867007313EA /* help.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = help.cpp; path = Source/help.cpp; sourceTree = "<group>"; };
43B6C70E22406867007313EA /* cursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cursor.cpp; path = Source/cursor.cpp; sourceTree = "<group>"; };
43B6C70F22406867007313EA /* player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = player.cpp; path = Source/player.cpp; sourceTree = "<group>"; };
43B6C71022406867007313EA /* items.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = items.cpp; path = Source/items.cpp; sourceTree = "<group>"; };
43B6C71122406867007313EA /* stores.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stores.cpp; path = Source/stores.cpp; sourceTree = "<group>"; };
43B6C71222406867007313EA /* drlg_l1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = drlg_l1.cpp; path = Source/drlg_l1.cpp; sourceTree = "<group>"; };
43B6C71322406868007313EA /* drlg_l3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = drlg_l3.cpp; path = Source/drlg_l3.cpp; sourceTree = "<group>"; };
43B6C71422406868007313EA /* interfac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = interfac.cpp; path = Source/interfac.cpp; sourceTree = "<group>"; };
43B6C71522406868007313EA /* dead.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dead.cpp; path = Source/dead.cpp; sourceTree = "<group>"; };
43B6C71622406868007313EA /* missiles.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = missiles.cpp; path = Source/missiles.cpp; sourceTree = "<group>"; };
43B6C71722406868007313EA /* msg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msg.cpp; path = Source/msg.cpp; sourceTree = "<group>"; };
43B6C71822406868007313EA /* spells.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = spells.cpp; path = Source/spells.cpp; sourceTree = "<group>"; };
43B6C71922406869007313EA /* portal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = portal.cpp; path = Source/portal.cpp; sourceTree = "<group>"; };
43B6C71A22406869007313EA /* track.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = track.cpp; path = Source/track.cpp; sourceTree = "<group>"; };
43B6C71B22406869007313EA /* tmsg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tmsg.cpp; path = Source/tmsg.cpp; sourceTree = "<group>"; };
43B6C71C22406869007313EA /* gendung.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gendung.cpp; path = Source/gendung.cpp; sourceTree = "<group>"; };
43B6C71D22406869007313EA /* debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = debug.cpp; path = Source/debug.cpp; sourceTree = "<group>"; };
43B6C71E22406869007313EA /* multi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = multi.cpp; path = Source/multi.cpp; sourceTree = "<group>"; };
43B6C71F2240686A007313EA /* control.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = control.cpp; path = Source/control.cpp; sourceTree = "<group>"; };
43B6C7202240686A007313EA /* fault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fault.cpp; path = Source/fault.cpp; sourceTree = "<group>"; };
43B6C7212240686A007313EA /* automap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = automap.cpp; path = Source/automap.cpp; sourceTree = "<group>"; };
43B6C7222240686A007313EA /* logging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = logging.cpp; path = Source/logging.cpp; sourceTree = "<group>"; };
43B6C7232240686A007313EA /* plrmsg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = plrmsg.cpp; path = Source/plrmsg.cpp; sourceTree = "<group>"; };
43B6C7242240686B007313EA /* minitext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minitext.cpp; path = Source/minitext.cpp; sourceTree = "<group>"; };
43B6C7252240686B007313EA /* doom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = doom.cpp; path = Source/doom.cpp; sourceTree = "<group>"; };
43B6C7262240686C007313EA /* textdat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = textdat.cpp; path = Source/textdat.cpp; sourceTree = "<group>"; };
43B6C7272240686C007313EA /* sha.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sha.cpp; path = Source/sha.cpp; sourceTree = "<group>"; };
43B6C7282240686C007313EA /* sync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sync.cpp; path = Source/sync.cpp; sourceTree = "<group>"; };
43B6C7292240686D007313EA /* themes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = themes.cpp; path = Source/themes.cpp; sourceTree = "<group>"; };
43B6C72A2240686D007313EA /* movie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = movie.cpp; path = Source/movie.cpp; sourceTree = "<group>"; };
43B6C72B2240686D007313EA /* appfat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = appfat.cpp; path = Source/appfat.cpp; sourceTree = "<group>"; };
43B6C72C2240686E007313EA /* objects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = objects.cpp; path = Source/objects.cpp; sourceTree = "<group>"; };
43B6C72D2240686E007313EA /* mpqapi.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mpqapi.cpp; path = Source/mpqapi.cpp; sourceTree = "<group>"; };
43B6C72E2240686E007313EA /* gamemenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gamemenu.cpp; path = Source/gamemenu.cpp; sourceTree = "<group>"; };
43B6C72F2240686F007313EA /* loadsave.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loadsave.cpp; path = Source/loadsave.cpp; sourceTree = "<group>"; };
43B6C7302240686F007313EA /* mainmenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mainmenu.cpp; path = Source/mainmenu.cpp; sourceTree = "<group>"; };
43B6C7312240686F007313EA /* capture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = capture.cpp; path = Source/capture.cpp; sourceTree = "<group>"; };
43B6C7322240686F007313EA /* path.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = path.cpp; path = Source/path.cpp; sourceTree = "<group>"; };
43B6C73322406870007313EA /* palette.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = palette.cpp; path = Source/palette.cpp; sourceTree = "<group>"; };
43B6C73422406870007313EA /* nthread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = nthread.cpp; path = Source/nthread.cpp; sourceTree = "<group>"; };
43B6C73522406870007313EA /* engine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = engine.cpp; path = Source/engine.cpp; sourceTree = "<group>"; };
43B6C73622406870007313EA /* render.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = render.cpp; path = Source/render.cpp; sourceTree = "<group>"; };
43B6C73722406871007313EA /* drlg_l2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = drlg_l2.cpp; path = Source/drlg_l2.cpp; sourceTree = "<group>"; };
43B6C73822406871007313EA /* drlg_l4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = drlg_l4.cpp; path = Source/drlg_l4.cpp; sourceTree = "<group>"; };
43B6C73922406871007313EA /* pfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pfile.cpp; path = Source/pfile.cpp; sourceTree = "<group>"; };
43B6C73A22406872007313EA /* wave.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wave.cpp; path = Source/wave.cpp; sourceTree = "<group>"; };
43B6C73B22406872007313EA /* effects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = effects.cpp; path = Source/effects.cpp; sourceTree = "<group>"; };
43B6C73C22406872007313EA /* inv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = inv.cpp; path = Source/inv.cpp; sourceTree = "<group>"; };
43B6C73D22406872007313EA /* restrict.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = restrict.cpp; path = Source/restrict.cpp; sourceTree = "<group>"; };
43B6C73E22406872007313EA /* dthread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dthread.cpp; path = Source/dthread.cpp; sourceTree = "<group>"; };
43B6C73F22406873007313EA /* diablo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = diablo.cpp; path = Source/diablo.cpp; sourceTree = "<group>"; };
43B6C74022406873007313EA /* encrypt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = encrypt.cpp; path = Source/encrypt.cpp; sourceTree = "<group>"; };
43B6C74122406873007313EA /* pack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pack.cpp; path = Source/pack.cpp; sourceTree = "<group>"; };
43B6C74222406873007313EA /* quests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = quests.cpp; path = Source/quests.cpp; sourceTree = "<group>"; };
43B6C74322406874007313EA /* setmaps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = setmaps.cpp; path = Source/setmaps.cpp; sourceTree = "<group>"; };
43B6C74422406874007313EA /* town.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = town.cpp; path = Source/town.cpp; sourceTree = "<group>"; };
43B6C74522406874007313EA /* trigs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = trigs.cpp; path = Source/trigs.cpp; sourceTree = "<group>"; };
43B6C74622406874007313EA /* codec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = codec.cpp; path = Source/codec.cpp; sourceTree = "<group>"; };
43B6C74722406875007313EA /* lighting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lighting.cpp; path = Source/lighting.cpp; sourceTree = "<group>"; };
43B6C74822406875007313EA /* monster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = monster.cpp; path = Source/monster.cpp; sourceTree = "<group>"; };
43B6C74922406875007313EA /* msgcmd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = msgcmd.cpp; path = Source/msgcmd.cpp; sourceTree = "<group>"; };
43B6C74A22406875007313EA /* towners.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = towners.cpp; path = Source/towners.cpp; sourceTree = "<group>"; };
43B6C74B22406875007313EA /* scrollrt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = scrollrt.cpp; path = Source/scrollrt.cpp; sourceTree = "<group>"; };
43B6C78E22406888007313EA /* udp_p2p.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = udp_p2p.cpp; path = SourceX/dvlnet/udp_p2p.cpp; sourceTree = "<group>"; };
43B6C78F22406888007313EA /* misc_dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = misc_dx.cpp; path = SourceX/miniwin/misc_dx.cpp; sourceTree = "<group>"; };
43B6C79022406888007313EA /* base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = base.cpp; path = SourceX/dvlnet/base.cpp; sourceTree = "<group>"; };
43B6C79122406889007313EA /* diabloui.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = diabloui.cpp; path = SourceX/DiabloUI/diabloui.cpp; sourceTree = "<group>"; };
43B6C79222406889007313EA /* mainmenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mainmenu.cpp; path = SourceX/DiabloUI/mainmenu.cpp; sourceTree = "<group>"; };
43B6C79322406889007313EA /* progress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = progress.cpp; path = SourceX/DiabloUI/progress.cpp; sourceTree = "<group>"; };
43B6C79422406889007313EA /* selconn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = selconn.cpp; path = SourceX/DiabloUI/selconn.cpp; sourceTree = "<group>"; };
43B6C79522406889007313EA /* packet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = packet.cpp; path = SourceX/dvlnet/packet.cpp; sourceTree = "<group>"; };
43B6C79622406889007313EA /* storm_net.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = storm_net.cpp; path = SourceX/storm/storm_net.cpp; sourceTree = "<group>"; };
43B6C79722406889007313EA /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = SourceX/main.cpp; sourceTree = "<group>"; };
43B6C7982240688A007313EA /* dsound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dsound.cpp; path = SourceX/miniwin/dsound.cpp; sourceTree = "<group>"; };
43B6C7992240688A007313EA /* abstract_net.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = abstract_net.cpp; path = SourceX/dvlnet/abstract_net.cpp; sourceTree = "<group>"; };
43B6C79A2240688A007313EA /* frame_queue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = frame_queue.cpp; path = SourceX/dvlnet/frame_queue.cpp; sourceTree = "<group>"; };
43B6C79B2240688A007313EA /* misc_msg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = misc_msg.cpp; path = SourceX/miniwin/misc_msg.cpp; sourceTree = "<group>"; };
43B6C79C2240688A007313EA /* misc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = misc.cpp; path = SourceX/miniwin/misc.cpp; sourceTree = "<group>"; };
43B6C79D2240688A007313EA /* sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sound.cpp; path = SourceX/sound.cpp; sourceTree = "<group>"; };
43B6C79E2240688A007313EA /* thread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = thread.cpp; path = SourceX/miniwin/thread.cpp; sourceTree = "<group>"; };
43B6C79F2240688B007313EA /* title.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = title.cpp; path = SourceX/DiabloUI/title.cpp; sourceTree = "<group>"; };
43B6C7A02240688B007313EA /* dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dx.cpp; path = SourceX/dx.cpp; sourceTree = "<group>"; };
43B6C7A12240688B007313EA /* tcp_client.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tcp_client.cpp; path = SourceX/dvlnet/tcp_client.cpp; sourceTree = "<group>"; };
43B6C7A22240688B007313EA /* rand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rand.cpp; path = SourceX/miniwin/rand.cpp; sourceTree = "<group>"; };
43B6C7A32240688B007313EA /* misc_io.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = misc_io.cpp; path = SourceX/miniwin/misc_io.cpp; sourceTree = "<group>"; };
43B6C7A42240688B007313EA /* selgame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = selgame.cpp; path = SourceX/DiabloUI/selgame.cpp; sourceTree = "<group>"; };
43B6C7A52240688C007313EA /* tcp_server.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tcp_server.cpp; path = SourceX/dvlnet/tcp_server.cpp; sourceTree = "<group>"; };
43B6C7A62240688C007313EA /* loopback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loopback.cpp; path = SourceX/dvlnet/loopback.cpp; sourceTree = "<group>"; };
43B6C7A72240688C007313EA /* selhero.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = selhero.cpp; path = SourceX/DiabloUI/selhero.cpp; sourceTree = "<group>"; };
43B6C7A82240688C007313EA /* storm_dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = storm_dx.cpp; path = SourceX/storm/storm_dx.cpp; sourceTree = "<group>"; };
43B6C7A92240688C007313EA /* credits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = credits.cpp; path = SourceX/DiabloUI/credits.cpp; sourceTree = "<group>"; };
43B6C7AA2240688D007313EA /* dialogs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dialogs.cpp; path = SourceX/DiabloUI/dialogs.cpp; sourceTree = "<group>"; };
43B6C7AB2240688D007313EA /* storm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = storm.cpp; path = SourceX/storm/storm.cpp; sourceTree = "<group>"; };
43BA39AF22375925009041FF /* AppIcon.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = AppIcon.xcassets; path = Xcode/AppIcon.xcassets; sourceTree = SOURCE_ROOT; };
43BF58B52235DEB8001F9748 /* devilutionX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = devilutionX.app; sourceTree = BUILT_PRODUCTS_DIR; };
4741C7B8659C4E1C826A129C /* sha.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = sha.cpp; path = Source/sha.cpp; sourceTree = SOURCE_ROOT; };
47D57E7305264ED7951AF3B1 /* towners.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = towners.cpp; path = Source/towners.cpp; sourceTree = SOURCE_ROOT; };
4A86F8316B224BF3BA817854 /* pfile.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = pfile.cpp; path = Source/pfile.cpp; sourceTree = SOURCE_ROOT; };
500C9F6E13FE44BFAEFCB81B /* smk_hufftree.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = smk_hufftree.c; path = 3rdParty/libsmacker/smk_hufftree.c; sourceTree = SOURCE_ROOT; };
5876CCE0133A4D6EADDF0AAE /* restrict.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = restrict.cpp; path = Source/restrict.cpp; sourceTree = SOURCE_ROOT; };
5A898CD619824F19ABC9E484 /* render.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = render.cpp; path = Source/render.cpp; sourceTree = SOURCE_ROOT; };
5F3FB00DF08741CDA799AB93 /* multi.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = multi.cpp; path = Source/multi.cpp; sourceTree = SOURCE_ROOT; };
60A06F7D04B1447FAE6F13C9 /* trigs.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = trigs.cpp; path = Source/trigs.cpp; sourceTree = SOURCE_ROOT; };
622A8C6A02D94FFC996C2CAE /* smacker.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = smacker.c; path = 3rdParty/libsmacker/smacker.c; sourceTree = SOURCE_ROOT; };
646292CBB776434AA4CA1C94 /* libPKWare.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libPKWare.a; sourceTree = BUILT_PRODUCTS_DIR; };
6687A60F94C648A2B5E20FB7 /* drlg_l1.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = drlg_l1.cpp; path = Source/drlg_l1.cpp; sourceTree = SOURCE_ROOT; };
670494A24D7F4CFFACCD3BFB /* smk_bitstream.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 4; name = smk_bitstream.c; path = 3rdParty/libsmacker/smk_bitstream.c; sourceTree = SOURCE_ROOT; };
68977FC478CB4E6CA54A3E38 /* logging.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = logging.cpp; path = Source/logging.cpp; sourceTree = SOURCE_ROOT; };
6BDC3D1BA3B64866B84CEB3C /* init.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = init.cpp; path = Source/init.cpp; sourceTree = SOURCE_ROOT; };
6D7FE30F050049FB933D2788 /* explode.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = explode.cpp; path = 3rdParty/PKWare/explode.cpp; sourceTree = SOURCE_ROOT; };
6F074DDFE42C4B46A93CC4A9 /* Section.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = Section.cpp; path = 3rdParty/Radon/Radon/source/Section.cpp; sourceTree = SOURCE_ROOT; };
7119751C6B7A4F40BB3B87B0 /* doom.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = doom.cpp; path = Source/doom.cpp; sourceTree = SOURCE_ROOT; };
722EB8D86DBF49368AAFEE3C /* File.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = File.cpp; path = 3rdParty/Radon/Radon/source/File.cpp; sourceTree = SOURCE_ROOT; };
737FBDFA9A4A4B628BB2235B /* mainmenu.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = mainmenu.cpp; path = Source/mainmenu.cpp; sourceTree = SOURCE_ROOT; };
7385F58EEFA44AF88C4D8798 /* scrollrt.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = scrollrt.cpp; path = Source/scrollrt.cpp; sourceTree = SOURCE_ROOT; };
8445BFAA306D42FE886F0ACC /* interfac.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = interfac.cpp; path = Source/interfac.cpp; sourceTree = SOURCE_ROOT; };
84BAB44B72164700A0A8B4D6 /* spells.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = spells.cpp; path = Source/spells.cpp; sourceTree = SOURCE_ROOT; };
8E47C81C5BD940C2A5A1704D /* engine.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = engine.cpp; path = Source/engine.cpp; sourceTree = SOURCE_ROOT; };
92E1DAF5C7BA48E5A1E39C04 /* libRadon.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRadon.a; sourceTree = BUILT_PRODUCTS_DIR; };
966BF9CEF1B6419CA25FC162 /* mpqapi.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = mpqapi.cpp; path = Source/mpqapi.cpp; sourceTree = SOURCE_ROOT; };
98AB581710214A55AD84E8D0 /* themes.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = themes.cpp; path = Source/themes.cpp; sourceTree = SOURCE_ROOT; };
9C2AEA532E6F4FF8B66083C9 /* fault.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = fault.cpp; path = Source/fault.cpp; sourceTree = SOURCE_ROOT; };
A1E1B1230CFD4B8587F7EC80 /* drlg_l3.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = drlg_l3.cpp; path = Source/drlg_l3.cpp; sourceTree = SOURCE_ROOT; };
A28321B6858D4AB5A53D7408 /* effects.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = effects.cpp; path = Source/effects.cpp; sourceTree = SOURCE_ROOT; };
A711EC4A01C74302BF18E4C3 /* path.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = path.cpp; path = Source/path.cpp; sourceTree = SOURCE_ROOT; };
B1B2D29A5A284CD29205745F /* implode.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = implode.cpp; path = 3rdParty/PKWare/implode.cpp; sourceTree = SOURCE_ROOT; };
B229DB87369B4D76B0A60580 /* Named.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = Named.cpp; path = 3rdParty/Radon/Radon/source/Named.cpp; sourceTree = SOURCE_ROOT; };
BA2A3A52015F4859A4C5A6A2 /* plrmsg.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = plrmsg.cpp; path = Source/plrmsg.cpp; sourceTree = SOURCE_ROOT; };
BF78F60283044A13A4CE1D1B /* items.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = items.cpp; path = Source/items.cpp; sourceTree = SOURCE_ROOT; };
C0B8A000CA684B9FAF88F313 /* Key.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = Key.cpp; path = 3rdParty/Radon/Radon/source/Key.cpp; sourceTree = SOURCE_ROOT; };
C43B4AA3223F0DCA00CE0DD9 /* libclang_rt.asan_osx_dynamic.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libclang_rt.asan_osx_dynamic.dylib; path = 3rdParty/darwin/libclang_rt.asan_osx_dynamic.dylib; sourceTree = "<group>"; };
C713AED00778486B94CD282B /* objects.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = objects.cpp; path = Source/objects.cpp; sourceTree = SOURCE_ROOT; };
C78DC63816DF4F1C867578C7 /* setmaps.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = setmaps.cpp; path = Source/setmaps.cpp; sourceTree = SOURCE_ROOT; };
CA4B6FC7C063411F9460CD20 /* codec.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = codec.cpp; path = Source/codec.cpp; sourceTree = SOURCE_ROOT; };
CF6C9F651C014C538ECFCC09 /* inv.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = inv.cpp; path = Source/inv.cpp; sourceTree = SOURCE_ROOT; };
D58130817DEA419984D28AB3 /* lighting.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = lighting.cpp; path = Source/lighting.cpp; sourceTree = SOURCE_ROOT; };
D86188B68E494666A2972128 /* automap.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = automap.cpp; path = Source/automap.cpp; sourceTree = SOURCE_ROOT; };
D961B8EC59154E98955AE2E7 /* dthread.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = dthread.cpp; path = Source/dthread.cpp; sourceTree = SOURCE_ROOT; };
DAAD0527F1EA496A8B669415 /* town.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = town.cpp; path = Source/town.cpp; sourceTree = SOURCE_ROOT; };
DB292068EC0C4CDD8E7A57CF /* minitext.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = minitext.cpp; path = Source/minitext.cpp; sourceTree = SOURCE_ROOT; };
DCC453E263C842279A5E02E7 /* libsmacker.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libsmacker.a; sourceTree = BUILT_PRODUCTS_DIR; };
DDD7341C6712447191FD2C4B /* missiles.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = missiles.cpp; path = Source/missiles.cpp; sourceTree = SOURCE_ROOT; };
E421A97655174F4099852AD2 /* gendung.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = gendung.cpp; path = Source/gendung.cpp; sourceTree = SOURCE_ROOT; };
E54D4F37A0B24C6B83CE5D22 /* monster.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = monster.cpp; path = Source/monster.cpp; sourceTree = SOURCE_ROOT; };
E7B0ACCABE284B3888DF09D5 /* movie.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = movie.cpp; path = Source/movie.cpp; sourceTree = SOURCE_ROOT; };
E812A68DE4194125A3A7A351 /* cursor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = cursor.cpp; path = Source/cursor.cpp; sourceTree = SOURCE_ROOT; };
EAC7C674E0104BA4A4B0FEA3 /* msgcmd.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = msgcmd.cpp; path = Source/msgcmd.cpp; sourceTree = SOURCE_ROOT; };
EBB67C79EEBA48D1B5D8D70B /* help.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = help.cpp; path = Source/help.cpp; sourceTree = SOURCE_ROOT; };
EDDB82E7195E4EF69A42C0D5 /* appfat.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = appfat.cpp; path = Source/appfat.cpp; sourceTree = SOURCE_ROOT; };
F0FEC1BE8E6049D593406F4D /* loadsave.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = loadsave.cpp; path = Source/loadsave.cpp; sourceTree = SOURCE_ROOT; };
F249E02C422E4EC2B812E004 /* libStormLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libStormLib.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@ -444,72 +448,72 @@
7F95B2EF6FB44A038C321DA7 /* Source Files */ = {
isa = PBXGroup;
children = (
EDDB82E7195E4EF69A42C0D5 /* appfat.cpp */,
D86188B68E494666A2972128 /* automap.cpp */,
3B7366F811604AE1B00C8C9A /* capture.cpp */,
CA4B6FC7C063411F9460CD20 /* codec.cpp */,
2D7327A50AC445CE94B2B4C9 /* control.cpp */,
E812A68DE4194125A3A7A351 /* cursor.cpp */,
16C6AB08C75D4A1E993FE50B /* dead.cpp */,
1A4D49F7AAB1448BB3796750 /* debug.cpp */,
0EF63E8BD67C4954A26480D5 /* diablo.cpp */,
7119751C6B7A4F40BB3B87B0 /* doom.cpp */,
6687A60F94C648A2B5E20FB7 /* drlg_l1.cpp */,
219EFD2B33014357A3B26650 /* drlg_l2.cpp */,
A1E1B1230CFD4B8587F7EC80 /* drlg_l3.cpp */,
183703645CB04A19AD9E5025 /* drlg_l4.cpp */,
D961B8EC59154E98955AE2E7 /* dthread.cpp */,
A28321B6858D4AB5A53D7408 /* effects.cpp */,
1F6D083DFE8F4912AD21323E /* encrypt.cpp */,
8E47C81C5BD940C2A5A1704D /* engine.cpp */,
413186B26DE644E197D49314 /* error.cpp */,
9C2AEA532E6F4FF8B66083C9 /* fault.cpp */,
1FBCC5BCDC3842F58CF572AB /* gamemenu.cpp */,
E421A97655174F4099852AD2 /* gendung.cpp */,
3CC4A34B55AA4827B345A6A0 /* gmenu.cpp */,
EBB67C79EEBA48D1B5D8D70B /* help.cpp */,
6BDC3D1BA3B64866B84CEB3C /* init.cpp */,
8445BFAA306D42FE886F0ACC /* interfac.cpp */,
CF6C9F651C014C538ECFCC09 /* inv.cpp */,
BF78F60283044A13A4CE1D1B /* items.cpp */,
D58130817DEA419984D28AB3 /* lighting.cpp */,
F0FEC1BE8E6049D593406F4D /* loadsave.cpp */,
68977FC478CB4E6CA54A3E38 /* logging.cpp */,
737FBDFA9A4A4B628BB2235B /* mainmenu.cpp */,
DB292068EC0C4CDD8E7A57CF /* minitext.cpp */,
DDD7341C6712447191FD2C4B /* missiles.cpp */,
E54D4F37A0B24C6B83CE5D22 /* monster.cpp */,
E7B0ACCABE284B3888DF09D5 /* movie.cpp */,
966BF9CEF1B6419CA25FC162 /* mpqapi.cpp */,
4040598A1C254715A8C8673C /* msg.cpp */,
EAC7C674E0104BA4A4B0FEA3 /* msgcmd.cpp */,
5F3FB00DF08741CDA799AB93 /* multi.cpp */,
203ED4AA4231415BA1B02BAE /* nthread.cpp */,
C713AED00778486B94CD282B /* objects.cpp */,
31E66A5457E64947AA68C7F7 /* pack.cpp */,
32E0A65ED0904E12BE84988B /* palette.cpp */,
A711EC4A01C74302BF18E4C3 /* path.cpp */,
4A86F8316B224BF3BA817854 /* pfile.cpp */,
1B3EB5883E0C42D3A0F3D4D5 /* player.cpp */,
BA2A3A52015F4859A4C5A6A2 /* plrmsg.cpp */,
2017B5200DF14FD7B6959133 /* portal.cpp */,
0348AAD50CEF4915900FD581 /* quests.cpp */,
5A898CD619824F19ABC9E484 /* render.cpp */,
5876CCE0133A4D6EADDF0AAE /* restrict.cpp */,
7385F58EEFA44AF88C4D8798 /* scrollrt.cpp */,
C78DC63816DF4F1C867578C7 /* setmaps.cpp */,
4741C7B8659C4E1C826A129C /* sha.cpp */,
84BAB44B72164700A0A8B4D6 /* spells.cpp */,
3D28A84812B34E10AE50E192 /* stores.cpp */,
3D09D9AFCBB94D86BD283257 /* sync.cpp */,
3CC0017809BF45FD9BCC06CA /* textdat.cpp */,
98AB581710214A55AD84E8D0 /* themes.cpp */,
3216A3E0351743AE8FFCF891 /* tmsg.cpp */,
DAAD0527F1EA496A8B669415 /* town.cpp */,
47D57E7305264ED7951AF3B1 /* towners.cpp */,
2C87FF47C667465E868B191E /* track.cpp */,
60A06F7D04B1447FAE6F13C9 /* trigs.cpp */,
373F9A9104DF4176A291FC8B /* wave.cpp */,
43B6C72B2240686D007313EA /* appfat.cpp */,
43B6C7212240686A007313EA /* automap.cpp */,
43B6C7312240686F007313EA /* capture.cpp */,
43B6C74622406874007313EA /* codec.cpp */,
43B6C71F2240686A007313EA /* control.cpp */,
43B6C70E22406867007313EA /* cursor.cpp */,
43B6C71522406868007313EA /* dead.cpp */,
43B6C71D22406869007313EA /* debug.cpp */,
43B6C73F22406873007313EA /* diablo.cpp */,
43B6C7252240686B007313EA /* doom.cpp */,
43B6C71222406867007313EA /* drlg_l1.cpp */,
43B6C73722406871007313EA /* drlg_l2.cpp */,
43B6C71322406868007313EA /* drlg_l3.cpp */,
43B6C73822406871007313EA /* drlg_l4.cpp */,
43B6C73E22406872007313EA /* dthread.cpp */,
43B6C73B22406872007313EA /* effects.cpp */,
43B6C74022406873007313EA /* encrypt.cpp */,
43B6C73522406870007313EA /* engine.cpp */,
43B6C70A22406866007313EA /* error.cpp */,
43B6C7202240686A007313EA /* fault.cpp */,
43B6C72E2240686E007313EA /* gamemenu.cpp */,
43B6C71C22406869007313EA /* gendung.cpp */,
43B6C70B22406866007313EA /* gmenu.cpp */,
43B6C70D22406867007313EA /* help.cpp */,
43B6C70C22406866007313EA /* init.cpp */,
43B6C71422406868007313EA /* interfac.cpp */,
43B6C73C22406872007313EA /* inv.cpp */,
43B6C71022406867007313EA /* items.cpp */,
43B6C74722406875007313EA /* lighting.cpp */,
43B6C72F2240686F007313EA /* loadsave.cpp */,
43B6C7222240686A007313EA /* logging.cpp */,
43B6C7302240686F007313EA /* mainmenu.cpp */,
43B6C7242240686B007313EA /* minitext.cpp */,
43B6C71622406868007313EA /* missiles.cpp */,
43B6C74822406875007313EA /* monster.cpp */,
43B6C72A2240686D007313EA /* movie.cpp */,
43B6C72D2240686E007313EA /* mpqapi.cpp */,
43B6C71722406868007313EA /* msg.cpp */,
43B6C74922406875007313EA /* msgcmd.cpp */,
43B6C71E22406869007313EA /* multi.cpp */,
43B6C73422406870007313EA /* nthread.cpp */,
43B6C72C2240686E007313EA /* objects.cpp */,
43B6C74122406873007313EA /* pack.cpp */,
43B6C73322406870007313EA /* palette.cpp */,
43B6C7322240686F007313EA /* path.cpp */,
43B6C73922406871007313EA /* pfile.cpp */,
43B6C70F22406867007313EA /* player.cpp */,
43B6C7232240686A007313EA /* plrmsg.cpp */,
43B6C71922406869007313EA /* portal.cpp */,
43B6C74222406873007313EA /* quests.cpp */,
43B6C73622406870007313EA /* render.cpp */,
43B6C73D22406872007313EA /* restrict.cpp */,
43B6C74B22406875007313EA /* scrollrt.cpp */,
43B6C74322406874007313EA /* setmaps.cpp */,
43B6C7272240686C007313EA /* sha.cpp */,
43B6C71822406868007313EA /* spells.cpp */,
43B6C71122406867007313EA /* stores.cpp */,
43B6C7282240686C007313EA /* sync.cpp */,
43B6C7262240686C007313EA /* textdat.cpp */,
43B6C7292240686D007313EA /* themes.cpp */,
43B6C71B22406869007313EA /* tmsg.cpp */,
43B6C74422406874007313EA /* town.cpp */,
43B6C74A22406875007313EA /* towners.cpp */,
43B6C71A22406869007313EA /* track.cpp */,
43B6C74522406874007313EA /* trigs.cpp */,
43B6C73A22406872007313EA /* wave.cpp */,
);
name = "Source Files";
sourceTree = "<group>";
@ -558,34 +562,36 @@
E1EABD1AC2D8479DB77DBAE9 /* Source Files */ = {
isa = PBXGroup;
children = (
43398760223E60F5001F8420 /* abstract_net.cpp */,
43398756223E60F4001F8420 /* base.cpp */,
4339876E223E60F8001F8420 /* credits.cpp */,
43398758223E60F4001F8420 /* diabloui.cpp */,
4339876F223E60F8001F8420 /* dialogs.cpp */,
43398766223E60F6001F8420 /* dx.cpp */,
43398761223E60F5001F8420 /* frame_queue.cpp */,
4339876C223E60F8001F8420 /* loopback.cpp */,
4339875E223E60F5001F8420 /* main.cpp */,
43398759223E60F4001F8420 /* mainmenu.cpp */,
43398754223E60F3001F8420 /* miniwin_dsound.cpp */,
43398769223E60F7001F8420 /* misc_io.cpp */,
43398762223E60F6001F8420 /* misc_msg.cpp */,
43398763223E60F6001F8420 /* misc.cpp */,
4339875C223E60F4001F8420 /* packet.cpp */,
4339875A223E60F4001F8420 /* progress.cpp */,
43398768223E60F7001F8420 /* rand.cpp */,
4339875B223E60F4001F8420 /* selconn.cpp */,
4339876A223E60F7001F8420 /* selgame.cpp */,
4339876D223E60F8001F8420 /* selhero.cpp */,
4339875D223E60F5001F8420 /* sound.cpp */,
43398757223E60F4001F8420 /* storm_net.cpp */,
4339875F223E60F5001F8420 /* storm.cpp */,
43398767223E60F7001F8420 /* tcp_client.cpp */,
4339876B223E60F7001F8420 /* tcp_server.cpp */,
43398764223E60F6001F8420 /* thread.cpp */,
43398765223E60F6001F8420 /* title.cpp */,
43398755223E60F3001F8420 /* udp_p2p.cpp */,
43B6C7992240688A007313EA /* abstract_net.cpp */,
43B6C79022406888007313EA /* base.cpp */,
43B6C7A92240688C007313EA /* credits.cpp */,
43B6C79122406889007313EA /* diabloui.cpp */,
43B6C7AA2240688D007313EA /* dialogs.cpp */,
43B6C7982240688A007313EA /* dsound.cpp */,
43B6C7A02240688B007313EA /* dx.cpp */,
43B6C79A2240688A007313EA /* frame_queue.cpp */,
43B6C7A62240688C007313EA /* loopback.cpp */,
43B6C79722406889007313EA /* main.cpp */,
43B6C79222406889007313EA /* mainmenu.cpp */,
43B6C78F22406888007313EA /* misc_dx.cpp */,
43B6C7A32240688B007313EA /* misc_io.cpp */,
43B6C79B2240688A007313EA /* misc_msg.cpp */,
43B6C79C2240688A007313EA /* misc.cpp */,
43B6C79522406889007313EA /* packet.cpp */,
43B6C79322406889007313EA /* progress.cpp */,
43B6C7A22240688B007313EA /* rand.cpp */,
43B6C79422406889007313EA /* selconn.cpp */,
43B6C7A42240688B007313EA /* selgame.cpp */,
43B6C7A72240688C007313EA /* selhero.cpp */,
43B6C79D2240688A007313EA /* sound.cpp */,
43B6C7A82240688C007313EA /* storm_dx.cpp */,
43B6C79622406889007313EA /* storm_net.cpp */,
43B6C7AB2240688D007313EA /* storm.cpp */,
43B6C7A12240688B007313EA /* tcp_client.cpp */,
43B6C7A52240688C007313EA /* tcp_server.cpp */,
43B6C79E2240688A007313EA /* thread.cpp */,
43B6C79F2240688B007313EA /* title.cpp */,
43B6C78E22406888007313EA /* udp_p2p.cpp */,
);
name = "Source Files";
sourceTree = "<group>";
@ -765,72 +771,72 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6186FBD4D4644CA78FEAAA53 /* appfat.cpp in Sources */,
623ACC26BBBB42978A6386EF /* automap.cpp in Sources */,
7652232427CA44C1BBBAAFE3 /* capture.cpp in Sources */,
CE3E3D2BD44C407A9BE60A72 /* codec.cpp in Sources */,
BAC5D4D57F364349B3C2F552 /* control.cpp in Sources */,
E777E9F7F0C54ECBA2DE2A2C /* cursor.cpp in Sources */,
B728E60F029A4234B90A9371 /* dead.cpp in Sources */,
00DABA918E5348F382AF3E16 /* debug.cpp in Sources */,
75CE86C992F940A4B4D78E5C /* diablo.cpp in Sources */,
CCB1A17083824600A7FC6DBF /* doom.cpp in Sources */,
503716BF6B434A48ACA1BD86 /* drlg_l1.cpp in Sources */,
6651D75C83744F8BB9A4EE09 /* drlg_l2.cpp in Sources */,
2B0FDA186B5D4A348E82BE69 /* drlg_l3.cpp in Sources */,
75294609B2944CC9BC4A487B /* drlg_l4.cpp in Sources */,
6240F97CE4014B1DB267D471 /* dthread.cpp in Sources */,
6669BEC0507C4957BAD30989 /* effects.cpp in Sources */,
4F27D72CD6A448B196008C10 /* encrypt.cpp in Sources */,
2363B2BA33664F008CF2266E /* engine.cpp in Sources */,
2E51C3FD096247BDB522FA63 /* error.cpp in Sources */,
C648EEFB6E17468AB8C3943E /* fault.cpp in Sources */,
5CE3C7E27B6E4BD9AAA5619D /* gamemenu.cpp in Sources */,
B1D9EA0B0DA04F15BFA456A9 /* gendung.cpp in Sources */,
1EDB503A982F46D4920BFF3D /* gmenu.cpp in Sources */,
81595166A06F4A09A80AEFB5 /* help.cpp in Sources */,
B4BBB196D148453BA2BA830E /* init.cpp in Sources */,
6261395CEAB2412186C5666C /* interfac.cpp in Sources */,
F47E4687B48048D9943833C3 /* inv.cpp in Sources */,
B748B788987B4A9A91DF84B3 /* items.cpp in Sources */,
50630CDFA3D444DCA5946A1C /* lighting.cpp in Sources */,
81797D16B64A49F79D53FE9B /* loadsave.cpp in Sources */,
89C8F76E788A4369AE9CA283 /* logging.cpp in Sources */,
96A5B8E287BF480CB1733558 /* mainmenu.cpp in Sources */,
FA750FAB5C734384B3E1D709 /* minitext.cpp in Sources */,
10A37F34E807485A8081A8A6 /* missiles.cpp in Sources */,
E3A3620899BB426EA66636CF /* monster.cpp in Sources */,
A708041A39EB43BB8F68E7D2 /* movie.cpp in Sources */,
FD006417F6AA479E9A2764C5 /* mpqapi.cpp in Sources */,
773B22BC5C3E41799F769001 /* msg.cpp in Sources */,
AED121172E094DAAB8B1322D /* msgcmd.cpp in Sources */,
B000FB7744A2405CB4A39483 /* multi.cpp in Sources */,
8774C8F414CF47248652D15A /* nthread.cpp in Sources */,
17C52FFA55984C5A93007652 /* objects.cpp in Sources */,
2962434943834AF8839658B8 /* pack.cpp in Sources */,
7DACE4548EF94D77874E0F31 /* palette.cpp in Sources */,
5FA14820FB17477383DA0700 /* path.cpp in Sources */,
D1124CA76EC04271B012DDA6 /* pfile.cpp in Sources */,
2A743A2DEE444E6295400155 /* player.cpp in Sources */,
DA61C597DBC848E39FBE602E /* plrmsg.cpp in Sources */,
3AA9769F36DA404CB3DB029B /* portal.cpp in Sources */,
BFF16F60B46F4B8984D3007C /* quests.cpp in Sources */,
7AF599B5937C48CFA2FFDAA4 /* render.cpp in Sources */,
547166BC671248509081109E /* restrict.cpp in Sources */,
545DD73999244831A23D777A /* scrollrt.cpp in Sources */,
64CE5D2CE32946A08990EE92 /* setmaps.cpp in Sources */,
A4D2FA94492E46D38B094934 /* sha.cpp in Sources */,
76C236244D2B4D5FB67381DB /* spells.cpp in Sources */,
BB88EC00498744F7914A1484 /* stores.cpp in Sources */,
7E67ADF45FD840B69098C6D0 /* sync.cpp in Sources */,
0E40D3E2ABA5486884AD1271 /* textdat.cpp in Sources */,
82418547480144C0A65FC9CE /* themes.cpp in Sources */,
8AC07A27B0D3408884802D80 /* tmsg.cpp in Sources */,
3D80977966AE4264938D37A3 /* town.cpp in Sources */,
283E47DA990148F18302218F /* towners.cpp in Sources */,
5E67153371F94500B95B41A7 /* track.cpp in Sources */,
AA419C3D7384435299F5FA80 /* trigs.cpp in Sources */,
D9B4737B66AE401189E47E04 /* wave.cpp in Sources */,
43B6C82A224068CF007313EA /* appfat.cpp in Sources */,
43B6C82B224068CF007313EA /* automap.cpp in Sources */,
43B6C82C224068CF007313EA /* capture.cpp in Sources */,
43B6C82D224068CF007313EA /* codec.cpp in Sources */,
43B6C82E224068CF007313EA /* control.cpp in Sources */,
43B6C82F224068CF007313EA /* cursor.cpp in Sources */,
43B6C830224068CF007313EA /* dead.cpp in Sources */,
43B6C831224068CF007313EA /* debug.cpp in Sources */,
43B6C832224068CF007313EA /* diablo.cpp in Sources */,
43B6C833224068CF007313EA /* doom.cpp in Sources */,
43B6C834224068CF007313EA /* drlg_l1.cpp in Sources */,
43B6C835224068CF007313EA /* drlg_l2.cpp in Sources */,
43B6C836224068CF007313EA /* drlg_l3.cpp in Sources */,
43B6C837224068CF007313EA /* drlg_l4.cpp in Sources */,
43B6C838224068CF007313EA /* dthread.cpp in Sources */,
43B6C839224068CF007313EA /* effects.cpp in Sources */,
43B6C83A224068CF007313EA /* encrypt.cpp in Sources */,
43B6C83B224068CF007313EA /* engine.cpp in Sources */,
43B6C83C224068CF007313EA /* error.cpp in Sources */,
43B6C83D224068CF007313EA /* fault.cpp in Sources */,
43B6C83E224068CF007313EA /* gamemenu.cpp in Sources */,
43B6C83F224068CF007313EA /* gendung.cpp in Sources */,
43B6C840224068CF007313EA /* gmenu.cpp in Sources */,
43B6C841224068CF007313EA /* help.cpp in Sources */,
43B6C842224068CF007313EA /* init.cpp in Sources */,
43B6C843224068CF007313EA /* interfac.cpp in Sources */,
43B6C844224068CF007313EA /* inv.cpp in Sources */,
43B6C845224068CF007313EA /* items.cpp in Sources */,
43B6C846224068CF007313EA /* lighting.cpp in Sources */,
43B6C847224068CF007313EA /* loadsave.cpp in Sources */,
43B6C848224068CF007313EA /* logging.cpp in Sources */,
43B6C849224068CF007313EA /* mainmenu.cpp in Sources */,
43B6C84A224068CF007313EA /* minitext.cpp in Sources */,
43B6C84B224068CF007313EA /* missiles.cpp in Sources */,
43B6C84C224068CF007313EA /* monster.cpp in Sources */,
43B6C84D224068CF007313EA /* movie.cpp in Sources */,
43B6C84E224068CF007313EA /* mpqapi.cpp in Sources */,
43B6C84F224068CF007313EA /* msg.cpp in Sources */,
43B6C850224068CF007313EA /* msgcmd.cpp in Sources */,
43B6C851224068CF007313EA /* multi.cpp in Sources */,
43B6C852224068CF007313EA /* nthread.cpp in Sources */,
43B6C853224068CF007313EA /* objects.cpp in Sources */,
43B6C854224068CF007313EA /* pack.cpp in Sources */,
43B6C855224068CF007313EA /* palette.cpp in Sources */,
43B6C856224068CF007313EA /* path.cpp in Sources */,
43B6C857224068CF007313EA /* pfile.cpp in Sources */,
43B6C858224068CF007313EA /* player.cpp in Sources */,
43B6C859224068CF007313EA /* plrmsg.cpp in Sources */,
43B6C85A224068CF007313EA /* portal.cpp in Sources */,
43B6C85B224068CF007313EA /* quests.cpp in Sources */,
43B6C85C224068CF007313EA /* render.cpp in Sources */,
43B6C85D224068CF007313EA /* restrict.cpp in Sources */,
43B6C85E224068CF007313EA /* scrollrt.cpp in Sources */,
43B6C85F224068CF007313EA /* setmaps.cpp in Sources */,
43B6C860224068CF007313EA /* sha.cpp in Sources */,
43B6C861224068CF007313EA /* spells.cpp in Sources */,
43B6C862224068CF007313EA /* stores.cpp in Sources */,
43B6C863224068CF007313EA /* sync.cpp in Sources */,
43B6C864224068CF007313EA /* textdat.cpp in Sources */,
43B6C865224068CF007313EA /* themes.cpp in Sources */,
43B6C866224068CF007313EA /* tmsg.cpp in Sources */,
43B6C867224068CF007313EA /* town.cpp in Sources */,
43B6C868224068CF007313EA /* towners.cpp in Sources */,
43B6C869224068CF007313EA /* track.cpp in Sources */,
43B6C86A224068CF007313EA /* trigs.cpp in Sources */,
43B6C86B224068CF007313EA /* wave.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -838,34 +844,36 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
43398771223E60F8001F8420 /* udp_p2p.cpp in Sources */,
43398782223E60F9001F8420 /* dx.cpp in Sources */,
43398789223E60F9001F8420 /* selhero.cpp in Sources */,
43398784223E60F9001F8420 /* rand.cpp in Sources */,
4339878A223E60F9001F8420 /* credits.cpp in Sources */,
43398773223E60F8001F8420 /* storm_net.cpp in Sources */,
43398787223E60F9001F8420 /* tcp_server.cpp in Sources */,
4339878B223E60F9001F8420 /* dialogs.cpp in Sources */,
43398776223E60F8001F8420 /* progress.cpp in Sources */,
43398783223E60F9001F8420 /* tcp_client.cpp in Sources */,
4339877D223E60F9001F8420 /* frame_queue.cpp in Sources */,
43398788223E60F9001F8420 /* loopback.cpp in Sources */,
43398780223E60F9001F8420 /* thread.cpp in Sources */,
43398778223E60F9001F8420 /* packet.cpp in Sources */,
4339877F223E60F9001F8420 /* misc.cpp in Sources */,
4339877A223E60F9001F8420 /* main.cpp in Sources */,
43398781223E60F9001F8420 /* title.cpp in Sources */,
43398770223E60F8001F8420 /* miniwin_dsound.cpp in Sources */,
43398785223E60F9001F8420 /* misc_io.cpp in Sources */,
43398786223E60F9001F8420 /* selgame.cpp in Sources */,
4339877E223E60F9001F8420 /* misc_msg.cpp in Sources */,
43398775223E60F8001F8420 /* mainmenu.cpp in Sources */,
4339877B223E60F9001F8420 /* storm.cpp in Sources */,
43398774223E60F8001F8420 /* diabloui.cpp in Sources */,
43398779223E60F9001F8420 /* sound.cpp in Sources */,
43398777223E60F9001F8420 /* selconn.cpp in Sources */,
4339877C223E60F9001F8420 /* abstract_net.cpp in Sources */,
43398772223E60F8001F8420 /* base.cpp in Sources */,
43B6C7CA224068AB007313EA /* abstract_net.cpp in Sources */,
43B6C7CB224068AB007313EA /* base.cpp in Sources */,
43B6C7CC224068AB007313EA /* credits.cpp in Sources */,
43B6C7CD224068AB007313EA /* diabloui.cpp in Sources */,
43B6C7CE224068AB007313EA /* dialogs.cpp in Sources */,
43B6C7CF224068AB007313EA /* dsound.cpp in Sources */,
43B6C7D0224068AB007313EA /* dx.cpp in Sources */,
43B6C7D1224068AB007313EA /* frame_queue.cpp in Sources */,
43B6C7D2224068AB007313EA /* loopback.cpp in Sources */,
43B6C7D3224068AB007313EA /* main.cpp in Sources */,
43B6C7D4224068AB007313EA /* mainmenu.cpp in Sources */,
43B6C7D5224068AB007313EA /* misc_dx.cpp in Sources */,
43B6C7D6224068AB007313EA /* misc_io.cpp in Sources */,
43B6C7D7224068AB007313EA /* misc_msg.cpp in Sources */,
43B6C7D8224068AB007313EA /* misc.cpp in Sources */,
43B6C7D9224068AB007313EA /* packet.cpp in Sources */,
43B6C7DA224068AB007313EA /* progress.cpp in Sources */,
43B6C7DB224068AB007313EA /* rand.cpp in Sources */,
43B6C7DC224068AB007313EA /* selconn.cpp in Sources */,
43B6C7DD224068AB007313EA /* selgame.cpp in Sources */,
43B6C7DE224068AB007313EA /* selhero.cpp in Sources */,
43B6C7DF224068AB007313EA /* sound.cpp in Sources */,
43B6C7E0224068AB007313EA /* storm_dx.cpp in Sources */,
43B6C7E1224068AB007313EA /* storm_net.cpp in Sources */,
43B6C7E2224068AB007313EA /* storm.cpp in Sources */,
43B6C7E3224068AB007313EA /* tcp_client.cpp in Sources */,
43B6C7E4224068AB007313EA /* tcp_server.cpp in Sources */,
43B6C7E5224068AB007313EA /* thread.cpp in Sources */,
43B6C7E6224068AB007313EA /* title.cpp in Sources */,
43B6C7E7224068AB007313EA /* udp_p2p.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1095,10 +1103,14 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/SourceS",
"$(PROJECT_DIR)/SourceX",
"$(PROJECT_DIR)/3rdParty/asio/include",
"$(PROJECT_DIR)/3rdParty/Radon/Radon/include",
"$(PROJECT_DIR)/3rdParty/libsmacker",
"$(PROJECT_DIR)/3rdParty/StromLib/src",
"$(PROJECT_DIR)/.",
"$(PROJECT_DIR)/Source",
"$(PROJECT_DIR)/SourceS",
);
INFOPLIST_EXPAND_BUILD_SETTINGS = YES;
INFOPLIST_FILE = "$(SRCROOT)/Xcode/Info.plist";
@ -1217,10 +1229,14 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(PROJECT_DIR)/SourceS",
"$(PROJECT_DIR)/SourceX",
"$(PROJECT_DIR)/3rdParty/asio/include",
"$(PROJECT_DIR)/3rdParty/Radon/Radon/include",
"$(PROJECT_DIR)/3rdParty/libsmacker",
"$(PROJECT_DIR)/3rdParty/StromLib/src",
"$(PROJECT_DIR)/.",
"$(PROJECT_DIR)/Source",
"$(PROJECT_DIR)/SourceS",
);
INFOPLIST_EXPAND_BUILD_SETTINGS = YES;
INFOPLIST_FILE = "$(SRCROOT)/Xcode/Info.plist";
@ -1344,7 +1360,7 @@
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "'CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"'";
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INSTALL_PATH = "";
LIBRARY_STYLE = STATIC;
@ -1394,7 +1410,7 @@
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "'CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"'";
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INSTALL_PATH = "";
LIBRARY_STYLE = STATIC;
@ -1489,7 +1505,7 @@
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "'CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"'";
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INSTALL_PATH = "";
LIBRARY_STYLE = STATIC;
@ -1525,7 +1541,7 @@
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "'CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"'";
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INSTALL_PATH = "";
LIBRARY_STYLE = STATIC;
@ -1564,7 +1580,7 @@
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "'CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"'";
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INSTALL_PATH = "";
LIBRARY_STYLE = STATIC;
@ -1600,7 +1616,7 @@
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "'CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"'";
GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INSTALL_PATH = "";
LIBRARY_STYLE = STATIC;

2
defs.h

@ -83,6 +83,8 @@
#define PAL16_RED 224
#define PAL16_GRAY 240
#define SCREENXY(x, y) ((x) + 64 + (((y) + 160) * 768))
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#endif

18
structs.h

@ -413,7 +413,7 @@ typedef struct MissileStruct {
int _miAnimAdd;
int _miAnimFrame;
BOOL _miDrawFlag;
int _miLightFlag;
BOOL _miLightFlag;
BOOL _miPreFlag;
int _miUniqTrans;
int _mirange;
@ -1187,22 +1187,6 @@ typedef struct DeadStruct {
char _deadtrans;
} DeadStruct;
//////////////////////////////////////////////////
// dx
//////////////////////////////////////////////////
typedef struct ScreenRow {
char col_unused_1[64];
char pixels[640];
char col_unused_2[64];
} ScreenRow;
typedef struct Screen { /* create union for work data vs visible data */
ScreenRow row_unused_1[160];
ScreenRow row[480];
ScreenRow row_unused_2[16];
} Screen;
//////////////////////////////////////////////////
// diabloui
//////////////////////////////////////////////////

Loading…
Cancel
Save