From f511e292786a0cc755dd6a48f590d44e99c875d9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 9 Jan 2011 12:07:19 +0000 Subject: [PATCH] - sync 3D floor branch with trunk. SVN r3094 (3dfloors2) --- src/CMakeLists.txt | 1 + src/asm_ia32/a.asm | 263 +++- src/asm_ia32/tmap.asm | 42 +- src/c_cmds.cpp | 48 +- src/c_cvars.cpp | 18 +- src/c_dispatch.h | 1 + src/compatibility.cpp | 7 - src/d_iwad.cpp | 1 - src/d_net.cpp | 32 +- src/d_player.h | 1 + src/d_protocol.h | 1 + src/g_game.cpp | 26 +- src/g_hexen/a_flechette.cpp | 51 +- src/g_shared/a_artifacts.cpp | 2 - src/g_shared/sbarinfo.cpp | 2 +- src/g_shared/sbarinfo_commands.cpp | 57 +- src/gi.h | 1 - src/intermission/intermission_parse.cpp | 3 +- src/m_fixed.h | 32 + src/memarena.cpp | 376 ++++++ src/memarena.h | 83 ++ src/menu/playermenu.cpp | 2 +- src/namedef.h | 1 + src/p_acs.cpp | 3 + src/p_ceiling.cpp | 523 +++---- src/p_doors.cpp | 119 +- src/p_glnodes.cpp | 1 + src/p_mobj.cpp | 1 - src/p_setup.cpp | 26 +- src/p_spec.cpp | 78 -- src/p_spec.h | 7 +- src/p_user.cpp | 3 +- src/r_blend.h | 4 + src/r_data.cpp | 304 ++++- src/r_data.h | 2 + src/r_defs.h | 95 +- src/r_draw.cpp | 140 +- src/r_draw.h | 7 +- src/r_drawt.cpp | 60 +- src/r_main.cpp | 27 +- src/r_main.h | 3 +- src/r_plane.cpp | 2 +- src/r_things.cpp | 1345 +++++++++++++++++-- src/r_things.h | 8 + src/resourcefiles/file_wad.cpp | 1 + src/resourcefiles/resourcefile.cpp | 3 +- src/sdl/crashcatcher.c | 419 +++--- src/sdl/i_main.cpp | 17 +- src/sdl/i_system.cpp | 51 + src/sound/fmodsound.cpp | 2 +- src/tables.h | 2 +- src/textures/buildtexture.cpp | 2 + src/thingdef/thingdef_properties.cpp | 9 + src/v_video.cpp | 56 +- src/v_video.h | 5 +- src/version.h | 4 +- src/w_wad.h | 1 + src/win32/fb_d3d9.cpp | 8 + wadsrc/static/actors/hexen/clericplayer.txt | 1 + wadsrc/static/actors/hexen/mageplayer.txt | 1 + wadsrc/static/actors/shared/player.txt | 1 + wadsrc/static/iwadinfo.txt | 1 - wadsrc/static/menudef.txt | 9 +- wadsrc/static/sbarinfo/hexen.txt | 91 +- zdoom.vcproj | 8 + 65 files changed, 3577 insertions(+), 924 deletions(-) create mode 100644 src/memarena.cpp create mode 100644 src/memarena.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3bfa9d136e..940e375eed 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -658,6 +658,7 @@ add_executable( zdoom WIN32 m_misc.cpp m_png.cpp m_random.cpp + memarena.cpp md5.cpp name.cpp nodebuild.cpp diff --git a/src/asm_ia32/a.asm b/src/asm_ia32/a.asm index d68fba116f..eaf7474550 100644 --- a/src/asm_ia32/a.asm +++ b/src/asm_ia32/a.asm @@ -28,6 +28,9 @@ %define setupmvlineasm _setupmvlineasm %define mvlineasm1 _mvlineasm1 %define mvlineasm4 _mvlineasm4 + +%define R_SetupDrawSlab _R_SetupDrawSlab +%define R_DrawSlab _R_DrawSlab %endif EXTERN ylookup ; near @@ -44,9 +47,6 @@ EXTERN dc_dest EXTERN dc_source EXTERN dc_texturefrac -mvlineasm4_counter: - dd 0 - SECTION .text ALIGN 16 @@ -59,8 +59,45 @@ setvlinebpl_: mov [fixchain2ma+2], eax mov [fixchain2mb+2], eax selfmod fixchain1a, fixchain2mb+6 + +setdrawslabbpl: + mov dword [voxbpl1+2], eax + mov dword [voxbpl2+2], eax + mov dword [voxbpl3+2], eax + mov dword [voxbpl4+2], eax + mov dword [voxbpl5+2], eax + mov dword [voxbpl6+2], eax + mov dword [voxbpl7+2], eax + mov dword [voxbpl8+2], eax + selfmod voxbpl1, voxpl8+6 ret + SECTION .data + +lastslabcolormap: + dd 4 + + SECTION .text + +GLOBAL R_SetupDrawSlab +GLOBAL @R_SetupDrawSlab@4 +R_SetupDrawSlab: + mov ecx, [esp+4] +@R_SetupDrawSlab@4: + cmp [lastslabcolormap], ecx + je .done + mov [lastslabcolormap], ecx + mov dword [voxpal1+2], ecx + mov dword [voxpal2+2], ecx + mov dword [voxpal3+2], ecx + mov dword [voxpal4+2], ecx + mov dword [voxpal5+2], ecx + mov dword [voxpal6+2], ecx + mov dword [voxpal7+2], ecx + mov dword [voxpal8+2], ecx +.done ret + + ; pass it log2(texheight) ALIGN 16 @@ -549,6 +586,226 @@ mvcase0: jmp beginmvlineasm4 align 16 + +;************************************************************************* +;***************************** Voxel Slabs ******************************* +;************************************************************************* + +GLOBAL R_DrawSlab +R_DrawSlab: + push ebx + push ebp + push esi + push edi + + mov eax, [esp+5*4+0] + mov ebx, [esp+5*4+4] + mov ecx, [esp+5*4+8] + mov edx, [esp+5*4+12] + mov esi, [esp+5*4+16] + mov edi, [esp+5*4+20] + + cmp eax, 2 + je voxbegdraw2 + ja voxskip2 + xor eax, eax +voxbegdraw1: + mov ebp, ebx + shr ebp, 16 + add ebx, edx + dec ecx + mov al, byte [esi+ebp] +voxpal1: mov al, byte [eax+88888888h] + mov byte [edi], al +voxbpl1: lea edi, [edi+88888888h] + jnz voxbegdraw1 + jmp voxskipslab5 + +voxbegdraw2: + mov ebp, ebx + shr ebp, 16 + add ebx, edx + xor eax, eax + dec ecx + mov al, byte [esi+ebp] +voxpal2: mov al, byte [eax+88888888h] + mov ah, al + mov word [edi], ax +voxbpl2: lea edi, [edi+88888888h] + jnz voxbegdraw2 + jmp voxskipslab5 + +voxskip2: + cmp eax, 4 + jne voxskip4 + xor eax, eax +voxbegdraw4: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal3: mov al, byte [eax+88888888h] + mov ah, al + shl eax, 8 + mov al, ah + shl eax, 8 + mov al, ah + mov dword [edi], eax +voxbpl3: add edi, 88888888h + dec ecx + jnz voxbegdraw4 + jmp voxskipslab5 + +voxskip4: + add eax, edi + + test edi, 1 + jz voxskipslab1 + cmp edi, eax + je voxskipslab1 + + push eax + push ebx + push ecx + push edi +voxbegslab1: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal4: mov al, byte [eax+88888888h] + mov byte [edi], al +voxbpl4: add edi, 88888888h + dec ecx + jnz voxbegslab1 + pop edi + pop ecx + pop ebx + pop eax + inc edi + +voxskipslab1: + push eax + test edi, 2 + jz voxskipslab2 + dec eax + cmp edi, eax + jge voxskipslab2 + + push ebx + push ecx + push edi +voxbegslab2: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal5: mov al, byte [eax+88888888h] + mov ah, al + mov word [edi], ax +voxbpl5: add edi, 88888888h + dec ecx + jnz voxbegslab2 + pop edi + pop ecx + pop ebx + add edi, 2 + +voxskipslab2: + mov eax, [esp] + + sub eax, 3 + cmp edi, eax + jge voxskipslab3 + +voxprebegslab3: + push ebx + push ecx + push edi +voxbegslab3: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal6: mov al, byte [eax+88888888h] + mov ah, al + shl eax, 8 + mov al, ah + shl eax, 8 + mov al, ah + mov dword [edi], eax +voxbpl6: add edi, 88888888h + dec ecx + jnz voxbegslab3 + pop edi + pop ecx + pop ebx + add edi, 4 + + mov eax, [esp] + + sub eax, 3 + cmp edi, eax + jl voxprebegslab3 + +voxskipslab3: + mov eax, [esp] + + dec eax + cmp edi, eax + jge voxskipslab4 + + push ebx + push ecx + push edi +voxbegslab4: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal7: mov al, byte [eax+88888888h] + mov ah, al + mov word [edi], ax +voxbpl7: add edi, 88888888h + dec ecx + jnz voxbegslab4 + pop edi + pop ecx + pop ebx + add edi, 2 + +voxskipslab4: + pop eax + + cmp edi, eax + je voxskipslab5 + +voxbegslab5: + mov ebp, ebx + add ebx, edx + shr ebp, 16 + xor eax, eax + mov al, byte [esi+ebp] +voxpal8: mov al, byte [eax+88888888h] + mov byte [edi], al +voxbpl8: add edi, 88888888h + dec ecx + jnz voxbegslab5 + +voxskipslab5: + pop edi + pop esi + pop ebp + pop ebx + ret + +align 16 + %ifdef M_TARGET_MACHO GLOBAL _rtext_a_end _rtext_a_end: diff --git a/src/asm_ia32/tmap.asm b/src/asm_ia32/tmap.asm index cbcd9f4f15..00e6333548 100644 --- a/src/asm_ia32/tmap.asm +++ b/src/asm_ia32/tmap.asm @@ -342,13 +342,13 @@ dsy3: shr ebp,26 mov edx,[ds_ystep] mov ecx,[ds_xfrac] dsy4: shr ecx,26 -dsm8: and edx,0xffffffc0 +dsm8: and edx,strict dword 0xffffffc0 or ebp,edx mov [esp+4],ebp mov ebp,[ds_yfrac] mov edx,[ds_xfrac] dsy2: shl edx,6 -dsm9: and ebp,0xffffffc0 +dsm9: and ebp,strict dword 0xffffffc0 or ecx,ebp shr esi,1 jnc dseven1 @@ -485,13 +485,13 @@ dmsy3: shr ebp,26 mov edx,[ds_ystep] mov ecx,[ds_xfrac] dmsy4: shr ecx,26 -dmsm8: and edx,0xffffffc0 +dmsm8: and edx,strict dword 0xffffffc0 or ebp,edx mov [esp+4],ebp mov ebp,[ds_yfrac] mov edx,[ds_xfrac] dmsy2: shl edx,6 -dmsm9: and ebp,0xffffffc0 +dmsm9: and ebp,strict dword 0xffffffc0 or ecx,ebp shr esi,1 jnc dmseven1 @@ -850,8 +850,8 @@ GLOBAL R_DrawColumnHorizP_ASM align 16 @R_DrawColumnHorizP_ASM@0: -R_DrawColumnHorizP_ASM: _R_DrawColumnHorizP_ASM: +R_DrawColumnHorizP_ASM: ; count = dc_yh - dc_yl; @@ -870,8 +870,10 @@ _R_DrawColumnHorizP_ASM: inc eax ; make 0 count mean 0 pixels and edx,3 push eax - mov esi,[dc_ctspan+edx*4] - lea eax,[dc_temp+ecx*4+edx] ; eax = top of column in buffer + mov eax,[dc_temp] + mov esi,[dc_ctspan+edx*4] + add eax,edx + lea eax,[eax+ecx*4] ; eax = top of column in buffer mov ebp,[dc_yh] mov [esi],ecx mov [esi+4],ebp @@ -1102,8 +1104,9 @@ _rt_copy1col_asm: lea esi,[eax*4] inc ebx ; ebx = count mov eax,edx - lea ecx,[dc_temp+ecx+esi] ; ecx = source + add ecx,esi mov edi,[ylookup+esi] + add ecx,[dc_temp] ; ecx = source mov esi,[dc_pitch] ; esi = pitch add eax,edi ; eax = dest add eax,[dc_destorg] @@ -1169,10 +1172,11 @@ _rt_copy4cols_asm: inc ebx ; ebx = count mov eax,ecx mov esi,[ylookup+edx*4] - lea ecx,[dc_temp+edx*4] ; ecx = source - mov edx,[dc_pitch] ; edx = pitch + mov ecx,[dc_temp] add eax,esi ; eax = dest add eax,[dc_destorg] + lea ecx,[ecx+edx*4] ; ecx = source + mov edx,[dc_pitch] ; edx = pitch shr ebx,1 jnc .even @@ -1241,7 +1245,8 @@ _rt_map1col_asm: mov esi,[dc_colormap] ; esi = colormap inc ebx ; ebx = count mov eax,edx - lea ebp,[dc_temp+ecx+edi] ; ebp = source + lea ebp,[ecx+edi] ; ebp = source + add ebp,[dc_temp] mov ecx,[ylookup+edi] mov edi,[dc_pitch] ; edi = pitch add eax,ecx ; eax = dest @@ -1320,7 +1325,8 @@ _rt_map4cols_asm1: mov eax,ecx inc ebx ; ebx = count mov edi,[ylookup+edx] - lea ebp,[dc_temp+edx] ; ebp = source + mov ebp,[dc_temp] + add ebp,edx ; ebp = source add eax,edi ; eax = dest mov edi,[dc_pitch] ; edi = pitch add eax,[dc_destorg] @@ -1414,7 +1420,8 @@ _rt_map4cols_asm2: mov eax,ecx inc ebx ; ebx = count mov edi,[ylookup+edx] - lea ebp,[dc_temp+edx] ; ebp = source + mov ebp,[dc_temp] + add ebp,edx ; ebp = source add eax,edi ; eax = dest mov edi,[dc_pitch] ; edi = pitch add eax,[dc_destorg] @@ -1493,10 +1500,11 @@ _rt_shaded4cols_asm: add eax,[dc_destorg] ; eax = destination push ebx push esi + mov esi,[dc_temp] inc ebp ; ebp = count add eax,[esp+16] push edi - lea esi,[dc_temp+ecx*4] ; esi = source + lea esi,[esi+ecx*4] ; esi = source align 16 @@ -1580,10 +1588,11 @@ _rt_add4cols_asm: add eax,[dc_destorg] push ebx push esi + mov esi,[dc_temp] push ebp inc edi add eax,[esp+20] - lea esi,[dc_temp+ecx*4] + lea esi,[esi+ecx*4] align 16 a4loop: @@ -1659,10 +1668,11 @@ _rt_addclamp4cols_asm: add eax,[dc_destorg] push ebx push esi + mov esi,[dc_temp] push ebp inc edi add eax,[esp+20] - lea esi,[dc_temp+ecx*4] + lea esi,[esi+ecx*4] push edi align 16 diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index 0831c805f2..b3e43f92f5 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -453,7 +453,7 @@ CCMD (puke) if (argc < 2 || argc > 5) { - Printf (" puke