- Removed precompiled header option for GL code because it caused more problems than

the minimal amount of saved time was worth.
Update to ZDoom r833:
- Disabled scrolling of 3DMIDTEX textures. Due to the special needs this 
  cannot work properly.
- Added new Scroll_Wall special to allow more control over wall scrolling.
  Since it uses fixed point parameters it can only be used in scripts though.
- Added flags parameters to all wall scroller specials that didn't use
  all 5 args.
- Separated scrolling of the 3 different texture parts of a sidedef.
  While doing this I did some more restructuring of the sidedef structure
  and changed it so that all state changes to sidedefs that affect rendering 
  have to be made with access functions. This is not of much use to the
  software renderer but it allows far easier caching of rendering data
  for OpenGL because the only place I need to check is in the access functions.
- Added Karate Chris's ThingCountSector submission.
- Made texture indices in FSwitchDef full integers. Since that required
  some data restructuring I also eliminated the MAX_FRAMES limit of 128
  per switch.
- Removed some debug output from SBarInfo::ParseSBarInfo().
- Fixed: Heretic linetype translations included the wrong file.
- Removed ATTN_SURROUND, since FMOD Ex doesn't exactly support it, and it
  only worked as intended on stereo speakers anyway.
- Cleaned out ancient crud from i_sound.cpp.


git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@67 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2008-03-21 21:15:56 +00:00
parent ee2375fbc2
commit f42970b458
93 changed files with 737 additions and 1258 deletions

View file

@ -3743,386 +3743,66 @@
<File <File
RelativePath=".\src\gl\a_dynlight.cpp" RelativePath=".\src\gl\a_dynlight.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gfxfuncs.cpp" RelativePath=".\src\gl\gfxfuncs.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_bsp.cpp" RelativePath=".\src\gl\gl_bsp.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_clipper.cpp" RelativePath=".\src\gl\gl_clipper.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_cycler.cpp" RelativePath=".\src\gl\gl_cycler.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_data.cpp" RelativePath=".\src\gl\gl_data.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_decal.cpp" RelativePath=".\src\gl\gl_decal.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_drawinfo.cpp" RelativePath=".\src\gl\gl_drawinfo.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_dynlight.cpp" RelativePath=".\src\gl\gl_dynlight.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_fakeflat.cpp" RelativePath=".\src\gl\gl_fakeflat.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_flats.cpp" RelativePath=".\src\gl\gl_flats.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_framebuffer.cpp" RelativePath=".\src\gl\gl_framebuffer.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_geometric.cpp" RelativePath=".\src\gl\gl_geometric.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_glow.cpp" RelativePath=".\src\gl\gl_glow.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_hirestex.cpp" RelativePath=".\src\gl\gl_hirestex.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_light.cpp" RelativePath=".\src\gl\gl_light.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_menu.cpp" RelativePath=".\src\gl\gl_menu.cpp"
@ -4131,342 +3811,58 @@
<File <File
RelativePath=".\src\gl\gl_missinglines.cpp" RelativePath=".\src\gl\gl_missinglines.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_missingtexture.cpp" RelativePath=".\src\gl\gl_missingtexture.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_models.cpp" RelativePath=".\src\gl\gl_models.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_models_md2.cpp" RelativePath=".\src\gl\gl_models_md2.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_models_md3.cpp" RelativePath=".\src\gl\gl_models_md3.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_nodes.cpp" RelativePath=".\src\gl\gl_nodes.cpp"
> >
</File> </File>
<File
RelativePath=".\src\gl\gl_pch.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File>
<File <File
RelativePath=".\src\gl\gl_portal.cpp" RelativePath=".\src\gl\gl_portal.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_scene.cpp" RelativePath=".\src\gl\gl_scene.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_shader.cpp" RelativePath=".\src\gl\gl_shader.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_sky.cpp" RelativePath=".\src\gl\gl_sky.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_skydome.cpp" RelativePath=".\src\gl\gl_skydome.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_sprite.cpp" RelativePath=".\src\gl\gl_sprite.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_swshaders.cpp" RelativePath=".\src\gl\gl_swshaders.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_texture.cpp" RelativePath=".\src\gl\gl_texture.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_translate.cpp" RelativePath=".\src\gl\gl_translate.cpp"
@ -4475,98 +3871,18 @@
<File <File
RelativePath=".\src\gl\gl_vertex.cpp" RelativePath=".\src\gl\gl_vertex.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_walls.cpp" RelativePath=".\src\gl\gl_walls.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_walls_draw.cpp" RelativePath=".\src\gl\gl_walls_draw.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_weapon.cpp" RelativePath=".\src\gl\gl_weapon.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\src\gl\gl_wipe.cpp" RelativePath=".\src\gl\gl_wipe.cpp"
@ -4575,26 +3891,6 @@
<File <File
RelativePath=".\src\gl\gltexture.cpp" RelativePath=".\src\gl\gltexture.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pch.pch"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="gl_pch.h"
PrecompiledHeaderFile="gl_pchd.pch"
/>
</FileConfiguration>
</File> </File>
<Filter <Filter
Name="GL Header" Name="GL Header"
@ -4631,6 +3927,10 @@
RelativePath=".\src\gl\gl_glow.h" RelativePath=".\src\gl\gl_glow.h"
> >
</File> </File>
<File
RelativePath=".\src\gl\gl_include.h"
>
</File>
<File <File
RelativePath=".\src\gl\gl_intern.h" RelativePath=".\src\gl\gl_intern.h"
> >

View file

@ -49,6 +49,7 @@ DEFINE_SPECIAL(Sector_Attach3dMidtex, 48, -1, -1)
DEFINE_SPECIAL(GlassBreak, 49, 0, 1) DEFINE_SPECIAL(GlassBreak, 49, 0, 1)
DEFINE_SPECIAL(ExtraFloor_LightOnly, 50, -1, -1) DEFINE_SPECIAL(ExtraFloor_LightOnly, 50, -1, -1)
DEFINE_SPECIAL(Sector_SetLink, 51, 4, 4) DEFINE_SPECIAL(Sector_SetLink, 51, 4, 4)
DEFINE_SPECIAL(Scroll_Wall, 52, 5, 5)
DEFINE_SPECIAL(Plat_PerpetualRaise, 60, 3, 3) DEFINE_SPECIAL(Plat_PerpetualRaise, 60, 3, 3)
DEFINE_SPECIAL(Plat_Stop, 61, 1, 1) DEFINE_SPECIAL(Plat_Stop, 61, 1, 1)

View file

@ -664,6 +664,7 @@ public:
TObjPtr<AActor> master; // Thing which spawned this one (prevents mutual attacks) TObjPtr<AActor> master; // Thing which spawned this one (prevents mutual attacks)
fixed_t floorclip; // value to use for floor clipping fixed_t floorclip; // value to use for floor clipping
SWORD tid; // thing identifier SWORD tid; // thing identifier
BYTE SoundChans; // Bitfield indicating which sound channels are playing.
BYTE special; // special BYTE special; // special
int args[5]; // special arguments int args[5]; // special arguments

View file

@ -186,7 +186,7 @@ void DoVoiceAnnounce (const char *sound)
if (LastAnnounceTime == 0 || LastAnnounceTime <= level.time-5) if (LastAnnounceTime == 0 || LastAnnounceTime <= level.time-5)
{ {
LastAnnounceTime = level.time; LastAnnounceTime = level.time;
S_Sound (CHAN_VOICE, sound, 1, ATTN_SURROUND); S_Sound (CHAN_VOICE, sound, 1, ATTN_NONE);
} }
} }

View file

@ -46,7 +46,7 @@ class FDecalTemplate;
struct FDecalAnimator; struct FDecalAnimator;
struct PClass; struct PClass;
class DBaseDecal; class DBaseDecal;
struct side_s; struct side_t;
class FDecalBase class FDecalBase
{ {
@ -71,7 +71,7 @@ class FDecalTemplate : public FDecalBase
public: public:
FDecalTemplate () : Translation (0) {} FDecalTemplate () : Translation (0) {}
void ApplyToDecal (DBaseDecal *actor, side_s *wall) const; void ApplyToDecal (DBaseDecal *actor, side_t *wall) const;
const FDecalTemplate *GetDecal () const; const FDecalTemplate *GetDecal () const;
void ReplaceDecalRef (FDecalBase *from, FDecalBase *to); void ReplaceDecalRef (FDecalBase *from, FDecalBase *to);

View file

@ -599,8 +599,6 @@ void F_StartCast (void)
// //
void F_CastTicker (void) void F_CastTicker (void)
{ {
int atten;
if (--casttics > 0 && caststate != NULL) if (--casttics > 0 && caststate != NULL)
return; // not time to change state yet return; // not time to change state yet
@ -615,11 +613,7 @@ void F_CastTicker (void)
castnum = 0; castnum = 0;
if (castorder[castnum].info->SeeSound) if (castorder[castnum].info->SeeSound)
{ {
if (castorder[castnum].info->flags2 & MF2_BOSS) S_SoundID (CHAN_VOICE, castorder[castnum].info->SeeSound, 1, ATTN_NONE);
atten = ATTN_SURROUND;
else
atten = ATTN_NONE;
S_SoundID (CHAN_VOICE, castorder[castnum].info->SeeSound, 1, atten);
} }
caststate = castorder[castnum].info->SeeState; caststate = castorder[castnum].info->SeeState;
// [RH] Skip monsters that have been hacked to no longer have attack states // [RH] Skip monsters that have been hacked to no longer have attack states
@ -736,8 +730,7 @@ bool F_CastResponder (event_t* ev)
} }
else if (castorder[castnum].info->DeathSound) else if (castorder[castnum].info->DeathSound)
{ {
S_SoundID (CHAN_VOICE, castorder[castnum].info->DeathSound, 1, S_SoundID (CHAN_VOICE, castorder[castnum].info->DeathSound, 1, ATTN_NONE);
castnum == 15 || castnum == 14 ? ATTN_SURROUND : ATTN_NONE);
} }
} }

View file

@ -2322,17 +2322,9 @@ void FParser::SF_SetLineTexture(void)
if(line->sidenum[side]!=NO_SIDE) if(line->sidenum[side]!=NO_SIDE)
{ {
side_t * sided=&sides[line->sidenum[side]]; side_t * sided=&sides[line->sidenum[side]];
switch(position) if (position >=0 && position <=2)
{ {
case 0: sided->SetTexture(position, texturenum);
sided->toptexture=texturenum;
break;
case 1:
sided->midtexture=texturenum;
break;
case 2:
sided->bottomtexture=texturenum;
break;
} }
} }
} }
@ -2351,9 +2343,9 @@ void FParser::SF_SetLineTexture(void)
{ {
side_t * sided=&sides[lines[i].sidenum[side]]; side_t * sided=&sides[lines[i].sidenum[side]];
if(sections & 1) sided->toptexture = picnum; if(sections & 1) sided->SetTexture(side_t::top, picnum);
if(sections & 2) sided->midtexture = picnum; if(sections & 2) sided->SetTexture(side_t::mid, picnum);
if(sections & 4) sided->bottomtexture = picnum; if(sections & 4) sided->SetTexture(side_t::bottom, picnum);
} }
} }
} }

View file

@ -174,12 +174,12 @@ END_DEFAULTS
void A_BrainAwake (AActor *self) void A_BrainAwake (AActor *self)
{ {
// killough 3/26/98: only generates sound now // killough 3/26/98: only generates sound now
S_Sound (self, CHAN_VOICE, "brain/sight", 1, ATTN_SURROUND); S_Sound (self, CHAN_VOICE, "brain/sight", 1, ATTN_NONE);
} }
void A_BrainPain (AActor *self) void A_BrainPain (AActor *self)
{ {
S_Sound (self, CHAN_VOICE, "brain/pain", 1, ATTN_SURROUND); S_Sound (self, CHAN_VOICE, "brain/pain", 1, ATTN_NONE);
} }
static void BrainishExplosion (fixed_t x, fixed_t y, fixed_t z) static void BrainishExplosion (fixed_t x, fixed_t y, fixed_t z)
@ -206,7 +206,7 @@ void A_BrainScream (AActor *self)
BrainishExplosion (x, self->y - 320*FRACUNIT, BrainishExplosion (x, self->y - 320*FRACUNIT,
128 + (pr_brainscream() << (FRACBITS + 1))); 128 + (pr_brainscream() << (FRACBITS + 1)));
} }
S_Sound (self, CHAN_VOICE, "brain/death", 1, ATTN_SURROUND); S_Sound (self, CHAN_VOICE, "brain/death", 1, ATTN_NONE);
} }
void A_BrainExplode (AActor *self) void A_BrainExplode (AActor *self)
@ -264,7 +264,7 @@ void A_BrainSpit (AActor *self)
spit->reactiontime /= spit->state->GetTics(); spit->reactiontime /= spit->state->GetTics();
} }
S_Sound (self, CHAN_WEAPON, "brain/spit", 1, ATTN_SURROUND); S_Sound (self, CHAN_WEAPON, "brain/spit", 1, ATTN_NONE);
} }
} }

View file

@ -49,7 +49,7 @@ void AFourthWeaponPiece::PlayPickupSound (AActor *toucher)
if (TempFourthWeapon != NULL) if (TempFourthWeapon != NULL)
{ {
// Play the build-sound full volume for all players // Play the build-sound full volume for all players
S_Sound (toucher, CHAN_ITEM, "WeaponBuild", 1, ATTN_SURROUND); S_Sound (toucher, CHAN_ITEM, "WeaponBuild", 1, ATTN_NONE);
} }
else else
{ {

View file

@ -1497,7 +1497,7 @@ END_DEFAULTS
void APowerDamage::InitEffect( ) void APowerDamage::InitEffect( )
{ {
// Use sound channel 5 to avoid interference with other actions. // Use sound channel 5 to avoid interference with other actions.
if (Owner != NULL) S_SoundID(Owner, 5, SeeSound, 1.0f, ATTN_SURROUND); if (Owner != NULL) S_SoundID(Owner, 5, SeeSound, 1.0f, ATTN_NONE);
} }
//=========================================================================== //===========================================================================
@ -1509,7 +1509,7 @@ void APowerDamage::InitEffect( )
void APowerDamage::EndEffect( ) void APowerDamage::EndEffect( )
{ {
// Use sound channel 5 to avoid interference with other actions. // Use sound channel 5 to avoid interference with other actions.
if (Owner != NULL) S_SoundID(Owner, 5, DeathSound, 1.0f, ATTN_SURROUND); if (Owner != NULL) S_SoundID(Owner, 5, DeathSound, 1.0f, ATTN_NONE);
} }
//=========================================================================== //===========================================================================
@ -1532,7 +1532,7 @@ void APowerDamage::ModifyDamage(int damage, FName damageType, int &newdamage, bo
damage = newdamage = FixedMul(damage, *pdf); damage = newdamage = FixedMul(damage, *pdf);
if (*pdf > 0 && damage == 0) damage = newdamage = 1; // don't allow zero damage as result of an underflow if (*pdf > 0 && damage == 0) damage = newdamage = 1; // don't allow zero damage as result of an underflow
if (Owner != NULL && *pdf > FRACUNIT) S_SoundID(Owner, 5, ActiveSound, 1.0f, ATTN_SURROUND); if (Owner != NULL && *pdf > FRACUNIT) S_SoundID(Owner, 5, ActiveSound, 1.0f, ATTN_NONE);
} }
} }
if (Inventory != NULL) Inventory->ModifyDamage(damage, damageType, newdamage, passive); if (Inventory != NULL) Inventory->ModifyDamage(damage, damageType, newdamage, passive);
@ -1553,7 +1553,7 @@ END_DEFAULTS
void APowerProtection::InitEffect( ) void APowerProtection::InitEffect( )
{ {
// Use sound channel 5 to avoid interference with other actions. // Use sound channel 5 to avoid interference with other actions.
if (Owner != NULL) S_SoundID(Owner, 5, SeeSound, 1.0f, ATTN_SURROUND); if (Owner != NULL) S_SoundID(Owner, 5, SeeSound, 1.0f, ATTN_NONE);
} }
//=========================================================================== //===========================================================================
@ -1565,7 +1565,7 @@ void APowerProtection::InitEffect( )
void APowerProtection::EndEffect( ) void APowerProtection::EndEffect( )
{ {
// Use sound channel 5 to avoid interference with other actions. // Use sound channel 5 to avoid interference with other actions.
if (Owner != NULL) S_SoundID(Owner, 5, DeathSound, 1.0f, ATTN_SURROUND); if (Owner != NULL) S_SoundID(Owner, 5, DeathSound, 1.0f, ATTN_NONE);
} }
//=========================================================================== //===========================================================================
@ -1587,7 +1587,7 @@ void APowerProtection::ModifyDamage(int damage, FName damageType, int &newdamage
if (pdf == NULL) pdf = &def; if (pdf == NULL) pdf = &def;
damage = newdamage = FixedMul(damage, *pdf); damage = newdamage = FixedMul(damage, *pdf);
if (Owner != NULL && *pdf < FRACUNIT) S_SoundID(Owner, 5, ActiveSound, 1.0f, ATTN_SURROUND); if (Owner != NULL && *pdf < FRACUNIT) S_SoundID(Owner, 5, ActiveSound, 1.0f, ATTN_NONE);
} }
} }
if (Inventory != NULL) Inventory->ModifyDamage(damage, damageType, newdamage, passive); if (Inventory != NULL) Inventory->ModifyDamage(damage, damageType, newdamage, passive);

View file

@ -246,7 +246,7 @@ int DBaseDecal::StickToWall (side_t *wall, fixed_t x, fixed_t y, F3DFloor * fflo
Z -= front->floortexz; Z -= front->floortexz;
else else
Z -= front->ceilingtexz; Z -= front->ceilingtexz;
tex = wall->midtexture; tex = wall->GetTexture(side_t::mid);
} }
else if (back->floorplane.ZatPoint (x, y) >= Z) else if (back->floorplane.ZatPoint (x, y) >= Z)
{ {
@ -255,7 +255,7 @@ int DBaseDecal::StickToWall (side_t *wall, fixed_t x, fixed_t y, F3DFloor * fflo
Z -= front->ceilingtexz; Z -= front->ceilingtexz;
else else
Z -= back->floortexz; Z -= back->floortexz;
tex = wall->bottomtexture; tex = wall->GetTexture(side_t::bottom);
} }
else if (back->ceilingplane.ZatPoint (x, y) <= Z) else if (back->ceilingplane.ZatPoint (x, y) <= Z)
{ {
@ -264,7 +264,7 @@ int DBaseDecal::StickToWall (side_t *wall, fixed_t x, fixed_t y, F3DFloor * fflo
Z -= front->ceilingtexz; Z -= front->ceilingtexz;
else else
Z -= back->ceilingtexz; Z -= back->ceilingtexz;
tex = wall->toptexture; tex = wall->GetTexture(side_t::top);
} }
else if (ffloor) // this is a 3d-floor segment - do this only if we know which one! else if (ffloor) // this is a 3d-floor segment - do this only if we know which one!
{ {
@ -277,15 +277,15 @@ int DBaseDecal::StickToWall (side_t *wall, fixed_t x, fixed_t y, F3DFloor * fflo
if (ffloor->flags & FF_UPPERTEXTURE) if (ffloor->flags & FF_UPPERTEXTURE)
{ {
tex = wall->toptexture; tex = wall->GetTexture(side_t::top);
} }
else if (ffloor->flags & FF_LOWERTEXTURE) else if (ffloor->flags & FF_LOWERTEXTURE)
{ {
tex = wall->bottomtexture; tex = wall->GetTexture(side_t::bottom);
} }
else else
{ {
tex = sides[ffloor->master->sidenum[0]].midtexture; tex = sides[ffloor->master->sidenum[0]].GetTexture(side_t::mid);
} }
} }
else return 0; else return 0;

View file

@ -998,7 +998,7 @@ void AInventory::PlayPickupSound (AActor *toucher)
S_SoundID (toucher, CHAN_PICKUP, PickupSound, 1, S_SoundID (toucher, CHAN_PICKUP, PickupSound, 1,
(ItemFlags & IF_FANCYPICKUPSOUND) && (ItemFlags & IF_FANCYPICKUPSOUND) &&
(toucher == NULL || toucher->CheckLocalView (consoleplayer)) (toucher == NULL || toucher->CheckLocalView (consoleplayer))
? ATTN_SURROUND : ATTN_NORM); ? ATTN_NONE : ATTN_NORM);
} }
//=========================================================================== //===========================================================================

View file

@ -7,7 +7,7 @@
class FDecalTemplate; class FDecalTemplate;
struct vertex_s; struct vertex_s;
struct side_s; struct side_t;
extern void P_SpawnDirt (AActor *actor, fixed_t radius); extern void P_SpawnDirt (AActor *actor, fixed_t radius);
@ -18,7 +18,6 @@ bool P_MorphMonster (AActor *actor, const PClass *morphClass);
bool P_UpdateMorphedMonster (AActor *actor); bool P_UpdateMorphedMonster (AActor *actor);
struct side_s;
struct F3DFloor; struct F3DFloor;
class DBaseDecal : public DThinker class DBaseDecal : public DThinker
@ -34,12 +33,12 @@ public:
void Serialize (FArchive &arc); void Serialize (FArchive &arc);
void Destroy (); void Destroy ();
int StickToWall (side_s *wall, fixed_t x, fixed_t y, F3DFloor * ffloor = NULL); int StickToWall (side_t *wall, fixed_t x, fixed_t y, F3DFloor * ffloor = NULL);
fixed_t GetRealZ (const side_s *wall) const; fixed_t GetRealZ (const side_t *wall) const;
void SetShade (DWORD rgb); void SetShade (DWORD rgb);
void SetShade (int r, int g, int b); void SetShade (int r, int g, int b);
void Spread (const FDecalTemplate *tpl, side_s *wall, fixed_t x, fixed_t y, fixed_t z, F3DFloor * ffloor = NULL); void Spread (const FDecalTemplate *tpl, side_t *wall, fixed_t x, fixed_t y, fixed_t z, F3DFloor * ffloor = NULL);
void GetXY (side_s *side, fixed_t &x, fixed_t &y) const; void GetXY (side_t *side, fixed_t &x, fixed_t &y) const;
static void SerializeChain (FArchive &arc, DBaseDecal **firstptr); static void SerializeChain (FArchive &arc, DBaseDecal **firstptr);
@ -57,12 +56,12 @@ public:
sector_t * Sector; // required for 3D floors sector_t * Sector; // required for 3D floors
protected: protected:
virtual DBaseDecal *CloneSelf (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_s *wall, F3DFloor * ffloor = NULL) const; virtual DBaseDecal *CloneSelf (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor = NULL) const;
void CalcFracPos (side_s *wall, fixed_t x, fixed_t y); void CalcFracPos (side_t *wall, fixed_t x, fixed_t y);
void Remove (); void Remove ();
static void SpreadLeft (fixed_t r, vertex_s *v1, side_s *feelwall, F3DFloor * ffloor = NULL); static void SpreadLeft (fixed_t r, vertex_s *v1, side_t *feelwall, F3DFloor * ffloor = NULL);
static void SpreadRight (fixed_t r, side_s *feelwall, fixed_t wallsize, F3DFloor * ffloor = NULL); static void SpreadRight (fixed_t r, side_t *feelwall, fixed_t wallsize, F3DFloor * ffloor = NULL);
}; };
class DImpactDecal : public DBaseDecal class DImpactDecal : public DBaseDecal
@ -70,10 +69,10 @@ class DImpactDecal : public DBaseDecal
DECLARE_CLASS (DImpactDecal, DBaseDecal) DECLARE_CLASS (DImpactDecal, DBaseDecal)
public: public:
DImpactDecal (fixed_t z); DImpactDecal (fixed_t z);
DImpactDecal (side_s *wall, const FDecalTemplate *templ); DImpactDecal (side_t *wall, const FDecalTemplate *templ);
static DImpactDecal *StaticCreate (const char *name, fixed_t x, fixed_t y, fixed_t z, side_s *wall, F3DFloor * ffloor = NULL, PalEntry color=0); static DImpactDecal *StaticCreate (const char *name, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor = NULL, PalEntry color=0);
static DImpactDecal *StaticCreate (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_s *wall, F3DFloor * ffloor = NULL, PalEntry color=0); static DImpactDecal *StaticCreate (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor = NULL, PalEntry color=0);
void BeginPlay (); void BeginPlay ();
void Destroy (); void Destroy ();
@ -82,7 +81,7 @@ public:
static void SerializeTime (FArchive &arc); static void SerializeTime (FArchive &arc);
protected: protected:
DBaseDecal *CloneSelf (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_s *wall, F3DFloor * ffloor = NULL) const; DBaseDecal *CloneSelf (const FDecalTemplate *tpl, fixed_t x, fixed_t y, fixed_t z, side_t *wall, F3DFloor * ffloor = NULL) const;
static void CheckMax (); static void CheckMax ();
private: private:

View file

@ -87,7 +87,6 @@ void SBarInfo::Load()
void SBarInfo::ParseSBarInfo(int lump) void SBarInfo::ParseSBarInfo(int lump)
{ {
gameType = gameinfo.gametype; gameType = gameinfo.gametype;
Printf("%d=%d", gameinfo.gametype, GAME_Any);
bool baseSet = false; bool baseSet = false;
FScanner sc(lump, Wads.GetLumpFullName(lump)); FScanner sc(lump, Wads.GetLumpFullName(lump));
sc.SetCMode(true); sc.SetCMode(true);

View file

@ -72,8 +72,8 @@ void A_RemoveForceField (AActor *self)
{ {
line->flags &= ~(ML_BLOCKING|ML_BLOCKEVERYTHING); line->flags &= ~(ML_BLOCKING|ML_BLOCKEVERYTHING);
line->special = 0; line->special = 0;
sides[line->sidenum[0]].midtexture = 0; sides[line->sidenum[0]].SetTexture(side_t::mid, 0);
sides[line->sidenum[1]].midtexture = 0; sides[line->sidenum[1]].SetTexture(side_t::mid, 0);
} }
} }
} }

View file

@ -1,5 +1,3 @@
#include "gl_pch.h"
/* /*
** a_dynlight.cpp ** a_dynlight.cpp
** Implements actors representing dynamic lights (hardware independent) ** Implements actors representing dynamic lights (hardware independent)
@ -35,6 +33,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "templates.h" #include "templates.h"
#include "m_random.h" #include "m_random.h"
#include "r_main.h" #include "r_main.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gfxfuncs.cpp ** gfxfuncs.cpp
** True color graphics functions ** True color graphics functions
@ -40,6 +39,7 @@
#include "m_swap.h" #include "m_swap.h"
#include "m_png.h" #include "m_png.h"
#include "m_crc32.h" #include "m_crc32.h"
#include "templates.h"
//=========================================================================== //===========================================================================
// //
@ -73,13 +73,13 @@ PalEntry averageColor(const unsigned long *data, int size, bool maxout)
g = g/size; g = g/size;
b = b/size; b = b/size;
int maxv=max(max(r,g),b); int maxv=MAX(MAX(r,g),b);
if(maxv && maxout) if(maxv && maxout)
{ {
r *= 255.0f / maxv; r = Scale(r, 255, maxv);
g *= 255.0f / maxv; g = Scale(g, 255, maxv);
b *= 255.0f / maxv; b = Scale(b, 255, maxv);
} }
return PalEntry(r,g,b); return PalEntry(r,g,b);
} }

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_bsp.cpp ** gl_bsp.cpp
** Main rendering loop / BSP traversal / visibility clipping ** Main rendering loop / BSP traversal / visibility clipping
@ -37,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "p_lnspec.h" #include "p_lnspec.h"
#include "p_local.h" #include "p_local.h"
#include "a_sharedglobal.h" #include "a_sharedglobal.h"
@ -128,7 +128,7 @@ static bool CheckClip(seg_t * seg, sector_t * frontsector, sector_t * backsector
// now check for closed sectors! // now check for closed sectors!
if (bs_ceilingheight1<=fs_floorheight1 && bs_ceilingheight2<=fs_floorheight2) if (bs_ceilingheight1<=fs_floorheight1 && bs_ceilingheight2<=fs_floorheight2)
{ {
FTexture * tex = TexMan(seg->sidedef->toptexture); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::top));
if (!tex || tex->UseType==FTexture::TEX_Null) return false; if (!tex || tex->UseType==FTexture::TEX_Null) return false;
if (backsector->ceilingpic==skyflatnum && frontsector->ceilingpic==skyflatnum) return false; if (backsector->ceilingpic==skyflatnum && frontsector->ceilingpic==skyflatnum) return false;
return true; return true;
@ -136,7 +136,7 @@ static bool CheckClip(seg_t * seg, sector_t * frontsector, sector_t * backsector
if (fs_ceilingheight1<=bs_floorheight1 && fs_ceilingheight2<=bs_floorheight2) if (fs_ceilingheight1<=bs_floorheight1 && fs_ceilingheight2<=bs_floorheight2)
{ {
FTexture * tex = TexMan(seg->sidedef->bottomtexture); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
if (!tex || tex->UseType==FTexture::TEX_Null) return false; if (!tex || tex->UseType==FTexture::TEX_Null) return false;
// properly render skies (consider door "open" if both floors are sky): // properly render skies (consider door "open" if both floors are sky):
@ -149,12 +149,12 @@ static bool CheckClip(seg_t * seg, sector_t * frontsector, sector_t * backsector
// preserve a kind of transparent door/lift special effect: // preserve a kind of transparent door/lift special effect:
if (bs_ceilingheight1 < fs_ceilingheight1 || bs_ceilingheight2 < fs_ceilingheight2) if (bs_ceilingheight1 < fs_ceilingheight1 || bs_ceilingheight2 < fs_ceilingheight2)
{ {
FTexture * tex = TexMan(seg->sidedef->toptexture); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::top));
if (!tex || tex->UseType==FTexture::TEX_Null) return false; if (!tex || tex->UseType==FTexture::TEX_Null) return false;
} }
if (bs_floorheight1 > fs_floorheight1 || bs_floorheight2 > fs_floorheight2) if (bs_floorheight1 > fs_floorheight1 || bs_floorheight2 > fs_floorheight2)
{ {
FTexture * tex = TexMan(seg->sidedef->bottomtexture); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
if (!tex || tex->UseType==FTexture::TEX_Null) return false; if (!tex || tex->UseType==FTexture::TEX_Null) return false;
} }
if (backsector->ceilingpic==skyflatnum && frontsector->ceilingpic==skyflatnum) return false; if (backsector->ceilingpic==skyflatnum && frontsector->ceilingpic==skyflatnum) return false;
@ -215,7 +215,7 @@ static void AddLine (seg_t *seg,sector_t * sector,subsector_t * polysub)
{ {
if (sector->sectornum == seg->backsector->sectornum) if (sector->sectornum == seg->backsector->sectornum)
{ {
FTexture * tex = TexMan(seg->sidedef->midtexture); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::mid));
if (!tex || tex->UseType==FTexture::TEX_Null) if (!tex || tex->UseType==FTexture::TEX_Null)
{ {
// nothing to do here! // nothing to do here!

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
* *
** gl_clipper.cpp ** gl_clipper.cpp
@ -36,6 +35,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "r_main.h" #include "r_main.h"
#include "gl/gl_clipper.h" #include "gl/gl_clipper.h"
#include "gl/gl_values.h" #include "gl/gl_values.h"

View file

@ -1,5 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_cycler.cpp ** gl_cycler.cpp
** Implements the cycler for dynamic lights and texture shaders. ** Implements the cycler for dynamic lights and texture shaders.
@ -34,6 +32,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "gl/gl_cycler.h" #include "gl/gl_cycler.h"
//========================================================================== //==========================================================================

View file

@ -1,5 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_data.cpp ** gl_data.cpp
** Maintenance data for GL renderer (mostly to handle rendering hacks) ** Maintenance data for GL renderer (mostly to handle rendering hacks)
@ -38,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "i_system.h" #include "i_system.h"
#include "p_local.h" #include "p_local.h"
#include "p_lnspec.h" #include "p_lnspec.h"
@ -378,8 +377,8 @@ static void PrepareTransparentDoors(sector_t * sector)
sector->transdoor=false; sector->transdoor=false;
return; return;
} }
if (sides[sector->lines[i]->sidenum[1-side]].toptexture==0) notextures++; if (sides[sector->lines[i]->sidenum[1-side]].GetTexture(side_t::top) == 0) notextures++;
if (sides[sector->lines[i]->sidenum[1-side]].bottomtexture==0) nobtextures++; if (sides[sector->lines[i]->sidenum[1-side]].GetTexture(side_t::bottom) == 0) nobtextures++;
} }
} }
if (selfref+notextures==sector->linecount || sector->ceilingpic==skyflatnum) if (selfref+notextures==sector->linecount || sector->ceilingpic==skyflatnum)

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_decal.cpp ** gl_decal.cpp
** OpenGL decal rendering code ** OpenGL decal rendering code
@ -37,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "a_sharedglobal.h" #include "a_sharedglobal.h"
#include "gl/gl_renderstruct.h" #include "gl/gl_renderstruct.h"
#include "gl/gl_texture.h" #include "gl/gl_texture.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_drawinfo.cpp ** gl_drawinfo.cpp
** Implements the draw info structure which contains most of the ** Implements the draw info structure which contains most of the
@ -38,6 +37,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "gl/gl_renderstruct.h" #include "gl/gl_renderstruct.h"
#include "gl/gl_texture.h" #include "gl/gl_texture.h"
#include "gl/gl_intern.h" #include "gl/gl_intern.h"

View file

@ -1,5 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_dynlight.cpp ** gl_dynlight.cpp
** Light definitions for actors. ** Light definitions for actors.
@ -40,6 +38,7 @@
*/ */
#include "gl/gl_include.h"
#include "a_doomglobal.h" #include "a_doomglobal.h"
#include "c_cvars.h" #include "c_cvars.h"
#include "c_dispatch.h" #include "c_dispatch.h"

View file

@ -1,5 +1,4 @@
#include "gl_pch.h" #include "gl/gl_include.h"
#include "gl/gl_intern.h" #include "gl/gl_intern.h"
#include "p_local.h" #include "p_local.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_flat.cpp ** gl_flat.cpp
** Flat rendering ** Flat rendering
@ -37,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "a_sharedglobal.h" #include "a_sharedglobal.h"
#include "gl/gl_renderstruct.h" #include "gl/gl_renderstruct.h"
#include "gl/gl_functions.h" #include "gl/gl_functions.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_framebuffer.cpp ** gl_framebuffer.cpp
** Implementation of the non-hardware specific parts of the ** Implementation of the non-hardware specific parts of the
@ -38,6 +37,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "files.h" #include "files.h"
#include "m_swap.h" #include "m_swap.h"
#include "r_draw.h" #include "r_draw.h"

View file

@ -1,6 +1,6 @@
#include "gl_pch.h"
#include "gl/gl_include.h"
#include "gl/gl_geometric.h" #include "gl/gl_geometric.h"
#include "gl/gl_intern.h" #include "gl/gl_intern.h"
#include "gl/gl_values.h" #include "gl/gl_values.h"

View file

@ -1,6 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_glow.cpp ** gl_glow.cpp
** Glowing flats like Doomsday ** Glowing flats like Doomsday
@ -40,6 +37,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "w_wad.h" #include "w_wad.h"
#include "sc_man.h" #include "sc_man.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** Hires texture management ** Hires texture management
** **
@ -35,6 +34,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "w_wad.h" #include "w_wad.h"
#include "m_png.h" #include "m_png.h"
#include "r_draw.h" #include "r_draw.h"

1
src/gl/gl_include.h Normal file
View file

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

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_light.cpp ** gl_light.cpp
** Light level / fog management / dynamic lights ** Light level / fog management / dynamic lights
@ -37,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "c_dispatch.h" #include "c_dispatch.h"
#include "p_local.h" #include "p_local.h"
#include "vectors.h" #include "vectors.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_missinglines.cpp ** gl_missinglines.cpp
** This mess is only needed because ZDBSP likes to throw out lines ** This mess is only needed because ZDBSP likes to throw out lines
@ -37,6 +36,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "p_local.h" #include "p_local.h"
#include "gl/gl_struct.h" #include "gl/gl_struct.h"
#include "gl/gl_renderstruct.h" #include "gl/gl_renderstruct.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_missingtexture.cpp ** gl_missingtexture.cpp
** Handles missing upper and lower textures and self referencing sector hacks ** Handles missing upper and lower textures and self referencing sector hacks
@ -36,6 +35,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "a_sharedglobal.h" #include "a_sharedglobal.h"
#include "r_main.h" #include "r_main.h"
#include "gl/gl_struct.h" #include "gl/gl_struct.h"
@ -265,7 +265,7 @@ bool GLDrawInfo::DoOneSectorUpper(subsector_t * subsec, fixed_t planez)
if (sec->ceilingtexz==planez) if (sec->ceilingtexz==planez)
{ {
// If there's a texture abort // If there's a texture abort
FTexture * tex = TexMan[seg->sidedef->toptexture]; FTexture * tex = TexMan[seg->sidedef->GetTexture(side_t::top)];
if (!tex || tex->UseType==FTexture::TEX_Null) continue; if (!tex || tex->UseType==FTexture::TEX_Null) continue;
else return false; else return false;
} }
@ -323,7 +323,7 @@ bool GLDrawInfo::DoOneSectorLower(subsector_t * subsec, fixed_t planez)
if (sec->floortexz==planez) if (sec->floortexz==planez)
{ {
// If there's a texture abort // If there's a texture abort
FTexture * tex = TexMan[seg->sidedef->bottomtexture]; FTexture * tex = TexMan[seg->sidedef->GetTexture(side_t::bottom)];
if (!tex || tex->UseType==FTexture::TEX_Null) continue; if (!tex || tex->UseType==FTexture::TEX_Null) continue;
else return false; else return false;
} }

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_models.cpp ** gl_models.cpp
** **
@ -38,6 +37,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "w_wad.h" #include "w_wad.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "sc_man.h" #include "sc_man.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_models.cpp ** gl_models.cpp
** **
@ -38,6 +37,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "w_wad.h" #include "w_wad.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "sc_man.h" #include "sc_man.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_models_md3.cpp ** gl_models_md3.cpp
** **
@ -36,6 +35,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "w_wad.h" #include "w_wad.h"
#include "cmdlib.h" #include "cmdlib.h"
#include "sc_man.h" #include "sc_man.h"

View file

@ -1 +0,0 @@
#include "gl_pch.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_portal.cpp ** gl_portal.cpp
** Generalized portal maintenance classes for skyboxes, horizons etc. ** Generalized portal maintenance classes for skyboxes, horizons etc.
@ -38,6 +37,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "p_local.h" #include "p_local.h"
#include "vectors.h" #include "vectors.h"
#include "gl/gl_struct.h" #include "gl/gl_struct.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_scene.cpp ** gl_scene.cpp
** manages the rendering of the player's view ** manages the rendering of the player's view
@ -37,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "gi.h" #include "gi.h"
#include "m_png.h" #include "m_png.h"
#include "st_stuff.h" #include "st_stuff.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_shader.cpp ** gl_shader.cpp
** **
@ -37,6 +36,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "gl/gl_values.h" #include "gl/gl_values.h"
#include "c_cvars.h" #include "c_cvars.h"
#include "v_video.h" #include "v_video.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_sky.cpp ** gl_sky.cpp
** Sky preparation code. ** Sky preparation code.
@ -37,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "a_sharedglobal.h" #include "a_sharedglobal.h"
#include "r_sky.h" #include "r_sky.h"
#include "gl/gl_renderstruct.h" #include "gl/gl_renderstruct.h"
@ -114,16 +114,28 @@ void GLWall::SkyTexture(int sky1,ASkyViewpoint * skyboxx, bool ceiling)
{ {
const line_t *l = &lines[(sky1&(PL_SKYFLAT-1))-1]; const line_t *l = &lines[(sky1&(PL_SKYFLAT-1))-1];
const side_t *s = &sides[l->sidenum[0]]; const side_t *s = &sides[l->sidenum[0]];
int pos;
skyinfo.texture[0]=FGLTexture::ValidateTexture(s->toptexture); if (level.flags & LEVEL_SWAPSKIES && s->GetTexture(side_t::bottom) != 0)
if (!skyinfo.texture[0]) return; {
skyinfo.skytexno1=s->toptexture; pos = side_t::bottom;
skyinfo.x_offset[0] = ANGLE_TO_FLOAT(s->textureoffset); }
skyinfo.y_offset = TO_MAP(s->rowoffset); else
{
pos = side_t::top;
}
int texno = s->GetTexture(pos);
skyinfo.texture[0] = FGLTexture::ValidateTexture(texno);
if (!skyinfo.texture[0] || skyinfo.texture[0]->tex->UseType == FTexture::TEX_Null) goto normalsky;
skyinfo.skytexno1 = texno;
skyinfo.x_offset[0] = ANGLE_TO_FLOAT(s->GetTextureXOffset(pos));
skyinfo.y_offset = TO_MAP(s->GetTextureYOffset(pos));
skyinfo.mirrored = !l->args[2]; skyinfo.mirrored = !l->args[2];
} }
else else
{ {
normalsky:
if (level.flags&LEVEL_DOUBLESKY) if (level.flags&LEVEL_DOUBLESKY)
{ {
skyinfo.texture[1]=FGLTexture::ValidateTexture(sky1texture); skyinfo.texture[1]=FGLTexture::ValidateTexture(sky1texture);
@ -211,14 +223,14 @@ void GLWall::SkyTop(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex
if (bs->floorplane.a==0 && bs->floorplane.b==0 && fs->floorplane.a==0 && fs->floorplane.b==0 && if (bs->floorplane.a==0 && bs->floorplane.b==0 && fs->floorplane.a==0 && fs->floorplane.b==0 &&
bs->floortexz==fs->floortexz+FRACUNIT) bs->floortexz==fs->floortexz+FRACUNIT)
{ {
FTexture * tex = TexMan(seg->sidedef->bottomtexture); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
if (!tex || tex->UseType==FTexture::TEX_Null) return; if (!tex || tex->UseType==FTexture::TEX_Null) return;
} }
} }
ztop[0]=ztop[1]=32768.0f; ztop[0]=ztop[1]=32768.0f;
FTexture * tex = TexMan(seg->sidedef->toptexture); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::top));
if (/*tex && tex->UseType!=FTexture::TEX_Null &&*/ bs->ceilingpic != skyflatnum) if (/*tex && tex->UseType!=FTexture::TEX_Null &&*/ bs->ceilingpic != skyflatnum)
{ {
@ -263,7 +275,7 @@ void GLWall::SkyBottom(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,ver
if (fs->floorpic==skyflatnum) if (fs->floorpic==skyflatnum)
{ {
if ((bs->special&0xff) == NoSkyDraw) return; if ((bs->special&0xff) == NoSkyDraw) return;
FTexture * tex = TexMan(seg->sidedef->bottomtexture); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
// For lower skies the normal logic only applies to walls with no lower texture! // For lower skies the normal logic only applies to walls with no lower texture!
if (tex->UseType==FTexture::TEX_Null) if (tex->UseType==FTexture::TEX_Null)

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_sky.cpp ** gl_sky.cpp
** **
@ -34,6 +33,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "doomtype.h" #include "doomtype.h"
#include "sc_man.h" #include "sc_man.h"
#include "w_wad.h" #include "w_wad.h"

View file

@ -1,5 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_sprite.cpp ** gl_sprite.cpp
** Sprite/Particle rendering ** Sprite/Particle rendering
@ -37,6 +35,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "p_local.h" #include "p_local.h"
#include "r_translate.h" #include "r_translate.h"
#include "gl/gl_struct.h" #include "gl/gl_struct.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
#if 0 #if 0
/* /*
** gl_shaders.cpp ** gl_shaders.cpp
@ -34,6 +33,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "c_cvars.h" #include "c_cvars.h"
#include "c_dispatch.h" #include "c_dispatch.h"
#include "gl/gl_swshaders.h" #include "gl/gl_swshaders.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gltexture.cpp ** gltexture.cpp
** The texture classes for hardware rendering ** The texture classes for hardware rendering
@ -39,6 +38,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "w_wad.h" #include "w_wad.h"
#include "m_png.h" #include "m_png.h"
#include "r_draw.h" #include "r_draw.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_translate.cpp ** gl_translate.cpp
** GL-related translation stuff ** GL-related translation stuff

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_vertex.cpp ** gl_vertex.cpp
** **
@ -38,6 +37,7 @@
#include "gl/gl_include.h"
#include "gl/gl_struct.h" #include "gl/gl_struct.h"
#include "gl/gl_renderstruct.h" #include "gl/gl_renderstruct.h"
#include "gl/gl_portal.h" #include "gl/gl_portal.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_wall.cpp ** gl_wall.cpp
** Wall rendering preparation ** Wall rendering preparation
@ -37,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "p_local.h" #include "p_local.h"
#include "p_lnspec.h" #include "p_lnspec.h"
#include "a_sharedglobal.h" #include "a_sharedglobal.h"
@ -671,14 +671,29 @@ void GLWall::DoTexture(int _type,seg_t * seg,int peg,
// The Vertex values can be destroyed in this function and must be restored aferward! // The Vertex values can be destroyed in this function and must be restored aferward!
GLSeg glsave=glseg; GLSeg glsave=glseg;
int lh=ceilingrefheight-floorrefheight; int lh=ceilingrefheight-floorrefheight;
int texpos;
switch (_type)
{
case RENDERWALL_TOP:
texpos = side_t::top;
break;
case RENDERWALL_BOTTOM:
texpos = side_t::bottom;
break;
default:
texpos = side_t::mid;
break;
}
type = (seg->linedef->special == Line_Mirror && _type == RENDERWALL_M1S && type = (seg->linedef->special == Line_Mirror && _type == RENDERWALL_M1S &&
!(gl.flags & RFL_NOSTENCIL) && gl_mirrors) ? RENDERWALL_MIRROR : _type; !(gl.flags & RFL_NOSTENCIL) && gl_mirrors) ? RENDERWALL_MIRROR : _type;
ceilingrefheight+= gltexture->RowOffset(seg->sidedef->rowoffset)+ ceilingrefheight+= gltexture->RowOffset(seg->sidedef->GetTextureYOffset(texpos))+
(peg ? (gltexture->TextureHeight()<<FRACBITS)-lh-v_offset:0); (peg ? (gltexture->TextureHeight()<<FRACBITS)-lh-v_offset:0);
if (!SetWallCoordinates(seg, ceilingrefheight, topleft, topright, bottomleft, bottomright, seg->sidedef->textureoffset)) return; if (!SetWallCoordinates(seg, ceilingrefheight, topleft, topright, bottomleft, bottomright,
seg->sidedef->GetTextureXOffset(texpos))) return;
// Add this wall to the render list // Add this wall to the render list
sector_t * sec = sub? sub->sector : seg->frontsector; sector_t * sec = sub? sub->sector : seg->frontsector;
@ -713,7 +728,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
// Align the texture to the ORIGINAL sector's height!! // Align the texture to the ORIGINAL sector's height!!
// At this point slopes don't matter because they don't affect the texture's z-position // At this point slopes don't matter because they don't affect the texture's z-position
fixed_t rowoffset=gltexture->RowOffset(seg->sidedef->rowoffset); fixed_t rowoffset=gltexture->RowOffset(seg->sidedef->GetTextureYOffset(side_t::mid));
if ( (seg->linedef->flags & ML_DONTPEGBOTTOM) >0) if ( (seg->linedef->flags & ML_DONTPEGBOTTOM) >0)
{ {
texturebottom=max(realfront->floortexz,realback->floortexz)+rowoffset; texturebottom=max(realfront->floortexz,realback->floortexz)+rowoffset;
@ -742,7 +757,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
// Set up the top // Set up the top
// //
// //
FTexture * tex = TexMan(seg->sidedef->toptexture); FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::top));
if (!tex || tex->UseType==FTexture::TEX_Null) if (!tex || tex->UseType==FTexture::TEX_Null)
{ {
// texture is missing - use the higher plane // texture is missing - use the higher plane
@ -769,7 +784,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
// Set up the bottom // Set up the bottom
// //
// //
tex = TexMan(seg->sidedef->bottomtexture); tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
if (!tex || tex->UseType==FTexture::TEX_Null) if (!tex || tex->UseType==FTexture::TEX_Null)
{ {
// texture is missing - use the lower plane // texture is missing - use the lower plane
@ -824,7 +839,7 @@ void GLWall::DoMidTexture(seg_t * seg, bool drawfogboundary,
// set up texture coordinate stuff // set up texture coordinate stuff
// //
// //
fixed_t t_ofs = seg->sidedef->textureoffset; fixed_t t_ofs = seg->sidedef->GetTextureXOffset(side_t::mid);
if (gltexture) if (gltexture)
{ {
@ -1012,9 +1027,9 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover,
{ {
int texno; int texno;
if (rover->flags&FF_UPPERTEXTURE) texno = seg->sidedef->toptexture; if (rover->flags&FF_UPPERTEXTURE) texno = seg->sidedef->GetTexture(side_t::top);
else if (rover->flags&FF_LOWERTEXTURE) texno = seg->sidedef->bottomtexture; else if (rover->flags&FF_LOWERTEXTURE) texno = seg->sidedef->GetTexture(side_t::bottom);
else texno = mastersd->midtexture; else texno = mastersd->GetTexture(side_t::mid);
gltexture = FGLTexture::ValidateTexture(texno); gltexture = FGLTexture::ValidateTexture(texno);
@ -1024,16 +1039,16 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover,
to=(rover->flags&(FF_UPPERTEXTURE|FF_LOWERTEXTURE))? to=(rover->flags&(FF_UPPERTEXTURE|FF_LOWERTEXTURE))?
0:gltexture->TextureOffset(mastersd->textureoffset); 0:gltexture->TextureOffset(mastersd->GetTextureXOffset(side_t::mid));
ul=wti->FixToTexU(to+gltexture->TextureOffset(seg->sidedef->textureoffset)); ul=wti->FixToTexU(to+gltexture->TextureOffset(seg->sidedef->GetTextureXOffset(side_t::mid)));
texlength = wti->FloatToTexU(seg->sidedef->TexelLength); texlength = wti->FloatToTexU(seg->sidedef->TexelLength);
uplft.u = lolft.u = ul + texlength * glseg.fracleft; uplft.u = lolft.u = ul + texlength * glseg.fracleft;
uprgt.u = lorgt.u = ul + texlength * glseg.fracright; uprgt.u = lorgt.u = ul + texlength * glseg.fracright;
fixed_t rowoffset=gltexture->RowOffset(seg->sidedef->rowoffset); fixed_t rowoffset=gltexture->RowOffset(seg->sidedef->GetTextureYOffset(side_t::mid));
to=(rover->flags&(FF_UPPERTEXTURE|FF_LOWERTEXTURE))? to=(rover->flags&(FF_UPPERTEXTURE|FF_LOWERTEXTURE))?
0:gltexture->RowOffset(mastersd->rowoffset); 0:gltexture->RowOffset(mastersd->GetTextureYOffset(side_t::mid));
uplft.v=wti->FixToTexV(to+rowoffset+*rover->top.texheight-ff_topleft); uplft.v=wti->FixToTexV(to+rowoffset+*rover->top.texheight-ff_topleft);
uprgt.v=wti->FixToTexV(to+rowoffset+*rover->top.texheight-ff_topright); uprgt.v=wti->FixToTexV(to+rowoffset+*rover->top.texheight-ff_topright);
@ -1482,7 +1497,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector,
SkyNormal(frontsector,v1,v2); SkyNormal(frontsector,v1,v2);
// normal texture // normal texture
gltexture=FGLTexture::ValidateTexture(seg->sidedef->midtexture); gltexture=FGLTexture::ValidateTexture(seg->sidedef->GetTexture(side_t::mid));
if (!gltexture) return; if (!gltexture) return;
DoTexture(RENDERWALL_M1S,seg,(seg->linedef->flags & ML_DONTPEGBOTTOM)>0, DoTexture(RENDERWALL_M1S,seg,(seg->linedef->flags & ML_DONTPEGBOTTOM)>0,
@ -1536,7 +1551,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector,
if (bch1a<fch1 || bch2a<fch2) if (bch1a<fch1 || bch2a<fch2)
{ {
gltexture=FGLTexture::ValidateTexture(seg->sidedef->toptexture); gltexture=FGLTexture::ValidateTexture(seg->sidedef->GetTexture(side_t::top));
if (gltexture) if (gltexture)
{ {
DoTexture(RENDERWALL_TOP,seg,(seg->linedef->flags & (ML_DONTPEGTOP))==0, DoTexture(RENDERWALL_TOP,seg,(seg->linedef->flags & (ML_DONTPEGTOP))==0,
@ -1572,7 +1587,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector,
!gl_fixedcolormap && !gl_fixedcolormap &&
(frontsector->ceilingpic!=skyflatnum || backsector->ceilingpic!=skyflatnum)); (frontsector->ceilingpic!=skyflatnum || backsector->ceilingpic!=skyflatnum));
gltexture=FGLTexture::ValidateTexture(seg->sidedef->midtexture); gltexture=FGLTexture::ValidateTexture(seg->sidedef->GetTexture(side_t::mid));
if (gltexture || drawfogboundary) if (gltexture || drawfogboundary)
{ {
DoMidTexture(seg, drawfogboundary, realfront, realback, fch1, fch2, ffh1, ffh2, bch1, bch2, bfh1, bfh2); DoMidTexture(seg, drawfogboundary, realfront, realback, fch1, fch2, ffh1, ffh2, bch1, bch2, bfh1, bfh2);
@ -1598,7 +1613,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector,
if (bfh1>ffh1 || bfh2>ffh2) if (bfh1>ffh1 || bfh2>ffh2)
{ {
gltexture=FGLTexture::ValidateTexture(seg->sidedef->bottomtexture); gltexture=FGLTexture::ValidateTexture(seg->sidedef->GetTexture(side_t::bottom));
if (gltexture) if (gltexture)
{ {
DoTexture(RENDERWALL_BOTTOM,seg,(seg->linedef->flags & ML_DONTPEGBOTTOM)>0, DoTexture(RENDERWALL_BOTTOM,seg,(seg->linedef->flags & ML_DONTPEGBOTTOM)>0,

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_walls_draw.cpp ** gl_walls_draw.cpp
** Wall rendering ** Wall rendering
@ -37,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "p_local.h" #include "p_local.h"
#include "p_lnspec.h" #include "p_lnspec.h"
#include "a_sharedglobal.h" #include "a_sharedglobal.h"

View file

@ -1,5 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_weapon.cpp ** gl_weapon.cpp
** Weapon sprite drawing ** Weapon sprite drawing
@ -37,6 +35,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "sbar.h" #include "sbar.h"
#include "gl/gl_struct.h" #include "gl/gl_struct.h"
#include "gl/gl_glow.h" #include "gl/gl_glow.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gl_wipe.cpp ** gl_wipe.cpp
** Screen wipe stuff ** Screen wipe stuff
@ -37,6 +36,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "files.h" #include "files.h"
#include "f_wipe.h" #include "f_wipe.h"
#include "m_random.h" #include "m_random.h"

View file

@ -1,4 +1,3 @@
#include "gl_pch.h"
/* /*
** gltexture.cpp ** gltexture.cpp
** Low level OpenGL texture handling. These classes are also ** Low level OpenGL texture handling. These classes are also
@ -38,6 +37,7 @@
** **
*/ */
#include "gl/gl_include.h"
#include "templates.h" #include "templates.h"
#include "r_draw.h" #include "r_draw.h"
#include "m_crc32.h" #include "m_crc32.h"
@ -245,7 +245,7 @@ GLTexture::GLTexture(int _width, int _height, bool _mipmap, bool wrap)
scaleyfac=MIN<float>(1.f,(float)texheight/GLTexture::GetTexDimension(texheight)); scaleyfac=MIN<float>(1.f,(float)texheight/GLTexture::GetTexDimension(texheight));
} }
cm_arraysize=(byte)CM_FIRSTCOLORMAP;// + numfakecmaps); cm_arraysize=(BYTE)CM_FIRSTCOLORMAP;// + numfakecmaps);
glTexID = new unsigned[cm_arraysize]; glTexID = new unsigned[cm_arraysize];
memset(glTexID,0,sizeof(unsigned int)*cm_arraysize); memset(glTexID,0,sizeof(unsigned int)*cm_arraysize);
clampmode=0; clampmode=0;

View file

@ -1,4 +1,3 @@
#include "../gl_pch.h"
/* /*
** r_opengl.cpp ** r_opengl.cpp
** **
@ -34,6 +33,7 @@
**--------------------------------------------------------------------------- **---------------------------------------------------------------------------
** **
*/ */
#include "gl/gl_include.h"
#include "tarray.h" #include "tarray.h"
#include "doomtype.h" #include "doomtype.h"
#include "gl/gl_intern.h" #include "gl/gl_intern.h"
@ -756,7 +756,7 @@ static void APIENTRY Shutdown()
#ifndef unix #ifndef unix
static BOOL APIENTRY SetFullscreen(int w, int h, int bits, int hz) static bool APIENTRY SetFullscreen(int w, int h, int bits, int hz)
{ {
DEVMODE dm; DEVMODE dm;
@ -810,13 +810,13 @@ static void APIENTRY SetGammaRamp (Uint16 *redtable, Uint16 *greentable, Uint16
} }
#ifndef unix #ifndef unix
static BOOL APIENTRY GetGammaRamp (void * ramp) static bool APIENTRY GetGammaRamp (void * ramp)
#else #else
static BOOL APIENTRY GetGammaRamp (Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable) static bool APIENTRY GetGammaRamp (Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable)
#endif #endif
{ {
#ifndef unix #ifndef unix
return GetDeviceGammaRamp(m_hDC, ramp); return !!GetDeviceGammaRamp(m_hDC, ramp);
#else #else
return (SDL_GetGammaRamp(redtable, greentable, bluetable) >= 0); return (SDL_GetGammaRamp(redtable, greentable, bluetable) >= 0);
#endif #endif

View file

@ -1,7 +1,6 @@
#ifndef R_RENDER #ifndef R_RENDER
#define R_RENDER #define R_RENDER
enum RenderFlags enum RenderFlags
{ {
RFL_NPOT_TEXTURE=1, RFL_NPOT_TEXTURE=1,
@ -50,12 +49,12 @@ struct RenderContext
void (APIENTRY * SwapBuffers) (); void (APIENTRY * SwapBuffers) ();
#ifndef unix #ifndef unix
void (APIENTRY * SetGammaRamp) (void * ramp); void (APIENTRY * SetGammaRamp) (void * ramp);
BOOL (APIENTRY * GetGammaRamp) (void * ramp); bool (APIENTRY * GetGammaRamp) (void * ramp);
#else #else
void (APIENTRY * SetGammaRamp) (Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable); void (APIENTRY * SetGammaRamp) (Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);
BOOL (APIENTRY * GetGammaRamp) (Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable); bool (APIENTRY * GetGammaRamp) (Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable);
#endif #endif
BOOL (APIENTRY * SetFullscreen) (int w, int h, int bits, int hz); bool (APIENTRY * SetFullscreen) (int w, int h, int bits, int hz);
void (APIENTRY * Begin) (GLenum mode); void (APIENTRY * Begin) (GLenum mode);

View file

@ -1951,7 +1951,7 @@ void M_QuitResponse(int ch)
{ {
if (gameinfo.quitSound) if (gameinfo.quitSound)
{ {
S_Sound (CHAN_VOICE, gameinfo.quitSound, 1, ATTN_SURROUND); S_Sound (CHAN_VOICE, gameinfo.quitSound, 1, ATTN_NONE);
I_WaitVBL (105); I_WaitVBL (105);
} }
} }

View file

@ -1159,7 +1159,7 @@ static value_t SampleRates[] =
{ 32000.f, "32000 Hz" }, { 32000.f, "32000 Hz" },
{ 44100.f, "44100 Hz" }, { 44100.f, "44100 Hz" },
{ 48000.f, "48000 Hz" }, { 48000.f, "48000 Hz" },
{ 65535.f, "65535 Hz" } { 96000.f, "96000 Hz" }
}; };
static value_t BufferSizes[] = static value_t BufferSizes[] =

View file

@ -198,9 +198,9 @@ static int P_Set3DFloor(line_t * line, int param,int param2, int alpha)
if (param2&32) flags|=FF_LOWERTEXTURE; if (param2&32) flags|=FF_LOWERTEXTURE;
if (param2&64) flags|=FF_ADDITIVETRANS|FF_TRANSLUCENT; if (param2&64) flags|=FF_ADDITIVETRANS|FF_TRANSLUCENT;
if (param2&512) flags|=FF_FADEWALLS; if (param2&512) flags|=FF_FADEWALLS;
if (sides[line->sidenum[0]].toptexture<0 && alpha<255) if (sides[line->sidenum[0]].GetTexture(side_t::top)<0 && alpha<255)
{ {
alpha=clamp(-sides[line->sidenum[0]].toptexture, 0, 255); alpha=clamp(-sides[line->sidenum[0]].GetTexture(side_t::top), 0, 255);
} }
if (alpha==0) flags&=~(FF_RENDERALL|FF_BOTHPLANES|FF_ALLSIDES); if (alpha==0) flags&=~(FF_RENDERALL|FF_BOTHPLANES|FF_ALLSIDES);
else if (alpha!=255) flags|=FF_TRANSLUCENT; else if (alpha!=255) flags|=FF_TRANSLUCENT;
@ -209,7 +209,7 @@ static int P_Set3DFloor(line_t * line, int param,int param2, int alpha)
P_Add3DFloor(ss, sec, line, flags, alpha); P_Add3DFloor(ss, sec, line, flags, alpha);
} }
// To be 100% safe this should be done even if the alpha by texture value isn't used. // To be 100% safe this should be done even if the alpha by texture value isn't used.
if (sides[line->sidenum[0]].toptexture<0) sides[line->sidenum[0]].toptexture=0; if (sides[line->sidenum[0]].GetTexture(side_t::top)<0) sides[line->sidenum[0]].SetTexture(side_t::top, 0);
return 1; return 1;
} }

View file

@ -56,7 +56,7 @@ struct F3DFloor
fixed_t delta; fixed_t delta;
int flags; int flags;
line_s* master; line_t* master;
sector_t * model; sector_t * model;
sector_t * target; sector_t * target;
@ -92,9 +92,8 @@ lightlist_t * P_GetPlaneLight(sector_t * , secplane_t * plane, bool underside);
void P_SpawnSpecials2( void ); void P_SpawnSpecials2( void );
struct FLineOpening; struct FLineOpening;
struct line_s;
void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_s *linedef, void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *linedef,
fixed_t x, fixed_t y, fixed_t refx, fixed_t refy); fixed_t x, fixed_t y, fixed_t refx, fixed_t refy);

View file

@ -57,8 +57,8 @@ bool P_Scroll3dMidtex(sector_t *sector, int crush, fixed_t move, bool ceiling)
{ {
line_t *l = scrollplane.AttachedLines[i]; line_t *l = scrollplane.AttachedLines[i];
sides[l->sidenum[0]].rowoffset += move; sides[l->sidenum[0]].AddTextureYOffset(side_t::mid, move);
sides[l->sidenum[1]].rowoffset += move; sides[l->sidenum[1]].AddTextureYOffset(side_t::mid, move);
} }
// Second step: Check all sectors whether the move is ok. // Second step: Check all sectors whether the move is ok.
@ -88,8 +88,8 @@ void P_Start3dMidtexInterpolations(sector_t *sector, bool ceiling)
{ {
line_t *l = scrollplane.AttachedLines[i]; line_t *l = scrollplane.AttachedLines[i];
setinterpolation(INTERP_WallPanning, &sides[l->sidenum[0]]); sides[l->sidenum[0]].SetInterpolation(side_t::mid);
setinterpolation(INTERP_WallPanning, &sides[l->sidenum[1]]); sides[l->sidenum[1]].SetInterpolation(side_t::mid);
} }
} }
@ -110,8 +110,8 @@ void P_Stop3dMidtexInterpolations(sector_t *sector, bool ceiling)
{ {
line_t *l = scrollplane.AttachedLines[i]; line_t *l = scrollplane.AttachedLines[i];
stopinterpolation(INTERP_WallPanning, &sides[l->sidenum[0]]); sides[l->sidenum[0]].StopInterpolation(side_t::mid);
stopinterpolation(INTERP_WallPanning, &sides[l->sidenum[1]]); sides[l->sidenum[1]].StopInterpolation(side_t::mid);
} }
} }
@ -237,28 +237,28 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, fixed_t *ptextop, f
{ {
side_t *side = &sides[line->sidenum[sideno]]; side_t *side = &sides[line->sidenum[sideno]];
if (line->sidenum[0]==NO_SIDE || line->sidenum[1]==NO_SIDE || !side->midtexture) return false; if (line->sidenum[0]==NO_SIDE || line->sidenum[1]==NO_SIDE || !side->GetTexture(side_t::mid)) return false;
FTexture * tex= TexMan(side->midtexture); FTexture * tex= TexMan(side->GetTexture(side_t::mid));
if (!tex) return false; if (!tex) return false;
fixed_t rowoffset = side->rowoffset; fixed_t y_offset = side->GetTextureYOffset(side_t::mid);
fixed_t textureheight = tex->GetScaledHeight() << FRACBITS; fixed_t textureheight = tex->GetScaledHeight() << FRACBITS;
if (tex->yScale != FRACUNIT && !tex->bWorldPanning) if (tex->yScale != FRACUNIT && !tex->bWorldPanning)
{ {
rowoffset = FixedDiv(rowoffset, tex->yScale); y_offset = FixedDiv(y_offset, tex->yScale);
} }
if(line->flags & ML_DONTPEGBOTTOM) if(line->flags & ML_DONTPEGBOTTOM)
{ {
*ptexbot = rowoffset + *ptexbot = y_offset +
MAX<fixed_t>(line->frontsector->floortexz, line->backsector->floortexz); MAX<fixed_t>(line->frontsector->floortexz, line->backsector->floortexz);
*ptextop = *ptexbot + textureheight; *ptextop = *ptexbot + textureheight;
} }
else else
{ {
*ptextop = rowoffset + *ptextop = y_offset +
MIN<fixed_t>(line->frontsector->ceilingtexz, line->backsector->ceilingtexz); MIN<fixed_t>(line->frontsector->ceilingtexz, line->backsector->ceilingtexz);
*ptexbot = *ptextop - textureheight; *ptexbot = *ptextop - textureheight;
@ -305,4 +305,4 @@ bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, fixed_t &opent
return; return;
} }
*/ */
} }

View file

@ -1796,7 +1796,7 @@ int DLevelScript::Random (int min, int max)
return min + pr_acs(max - min + 1); return min + pr_acs(max - min + 1);
} }
int DLevelScript::ThingCount (int type, int stringid, int tid) int DLevelScript::ThingCount (int type, int stringid, int tid, int tag)
{ {
AActor *actor; AActor *actor;
const PClass *kind; const PClass *kind;
@ -1838,11 +1838,14 @@ do_count:
if (actor->health > 0 && if (actor->health > 0 &&
(kind == NULL || actor->IsA (kind))) (kind == NULL || actor->IsA (kind)))
{ {
// Don't count items in somebody's inventory if (actor->Sector->tag == tag || tag == -1)
if (!actor->IsKindOf (RUNTIME_CLASS(AInventory)) ||
static_cast<AInventory *>(actor)->Owner == NULL)
{ {
count++; // Don't count items in somebody's inventory
if (!actor->IsKindOf (RUNTIME_CLASS(AInventory)) ||
static_cast<AInventory *>(actor)->Owner == NULL)
{
count++;
}
} }
} }
} }
@ -1855,11 +1858,14 @@ do_count:
if (actor->health > 0 && if (actor->health > 0 &&
(kind == NULL || actor->IsA (kind))) (kind == NULL || actor->IsA (kind)))
{ {
// Don't count items in somebody's inventory if (actor->Sector->tag == tag || tag == -1)
if (!actor->IsKindOf (RUNTIME_CLASS(AInventory)) ||
static_cast<AInventory *>(actor)->Owner == NULL)
{ {
count++; // Don't count items in somebody's inventory
if (!actor->IsKindOf (RUNTIME_CLASS(AInventory)) ||
static_cast<AInventory *>(actor)->Owner == NULL)
{
count++;
}
} }
} }
} }
@ -1939,13 +1945,13 @@ void DLevelScript::SetLineTexture (int lineid, int side, int position, int name)
switch (position) switch (position)
{ {
case TEXTURE_TOP: case TEXTURE_TOP:
sidedef->toptexture = texture; sidedef->SetTexture(side_t::top, texture);
break; break;
case TEXTURE_MIDDLE: case TEXTURE_MIDDLE:
sidedef->midtexture = texture; sidedef->SetTexture(side_t::mid, texture);
break; break;
case TEXTURE_BOTTOM: case TEXTURE_BOTTOM:
sidedef->bottomtexture = texture; sidedef->SetTexture(side_t::bottom, texture);
break; break;
default: default:
break; break;
@ -1972,9 +1978,14 @@ void DLevelScript::ReplaceTextures (int fromnamei, int tonamei, int flags)
{ {
side_t *wal = &sides[i]; side_t *wal = &sides[i];
if (!(flags & NOT_BOTTOM) && wal->bottomtexture == picnum1) wal->bottomtexture = picnum2; for(int j=0;j<3;j++)
if (!(flags & NOT_MIDDLE) && wal->midtexture == picnum1) wal->midtexture = picnum2; {
if (!(flags & NOT_TOP) && wal->toptexture == picnum1) wal->toptexture = picnum2; static BYTE bits[]={NOT_TOP, NOT_MIDDLE, NOT_BOTTOM};
if (!(flags & bits[j]) && wal->GetTexture(j) == picnum1)
{
wal->SetTexture(j, picnum2);
}
}
} }
} }
if ((flags ^ (NOT_FLOOR | NOT_CEILING)) != 0) if ((flags ^ (NOT_FLOOR | NOT_CEILING)) != 0)
@ -3572,17 +3583,27 @@ int DLevelScript::RunScript ()
break; break;
case PCD_THINGCOUNT: case PCD_THINGCOUNT:
STACK(2) = ThingCount (STACK(2), -1, STACK(1)); STACK(2) = ThingCount (STACK(2), -1, STACK(1), -1);
sp--; sp--;
break; break;
case PCD_THINGCOUNTDIRECT: case PCD_THINGCOUNTDIRECT:
PushToStack (ThingCount (pc[0], -1, pc[1])); PushToStack (ThingCount (pc[0], -1, pc[1], -1));
pc += 2; pc += 2;
break; break;
case PCD_THINGCOUNTNAME: case PCD_THINGCOUNTNAME:
STACK(2) = ThingCount (-1, STACK(2), STACK(1)); STACK(2) = ThingCount (-1, STACK(2), STACK(1), -1);
sp--;
break;
case PCD_THINGCOUNTNAMESECTOR:
STACK(2) = ThingCount (-1, STACK(3), STACK(2), STACK(1));
sp--;
break;
case PCD_THINGCOUNTSECTOR:
STACK(2) = ThingCount (STACK(3), -1, STACK(2), STACK(1));
sp--; sp--;
break; break;
@ -4678,7 +4699,7 @@ int DLevelScript::RunScript ()
case PCD_GETLINEROWOFFSET: case PCD_GETLINEROWOFFSET:
if (activationline) if (activationline)
{ {
PushToStack (sides[activationline->sidenum[0]].rowoffset >> FRACBITS); PushToStack (sides[activationline->sidenum[0]].GetTextureYOffset(side_t::mid) >> FRACBITS);
} }
else else
{ {

View file

@ -548,6 +548,8 @@ public:
PCD_CHECKACTORFLOORTEXTURE, PCD_CHECKACTORFLOORTEXTURE,
/*340*/ PCD_GETACTORLIGHTLEVEL, /*340*/ PCD_GETACTORLIGHTLEVEL,
PCD_SETMUGSHOTSTATE, PCD_SETMUGSHOTSTATE,
PCD_THINGCOUNTSECTOR,
PCD_THINGCOUNTNAMESECTOR,
PCODE_COMMAND_COUNT PCODE_COMMAND_COUNT
}; };
@ -668,7 +670,7 @@ protected:
void PutLast (); void PutLast ();
void PutFirst (); void PutFirst ();
static int Random (int min, int max); static int Random (int min, int max);
static int ThingCount (int type, int stringid, int tid); static int ThingCount (int type, int stringid, int tid, int tag);
static void ChangeFlat (int tag, int name, bool floorOrCeiling); static void ChangeFlat (int tag, int name, bool floorOrCeiling);
static int CountPlayers (); static int CountPlayers ();
static void SetLineTexture (int lineid, int side, int position, int name); static void SetLineTexture (int lineid, int side, int position, int name);

View file

@ -459,21 +459,22 @@ static void LoadWalls (walltype *walls, int numwalls, sectortype *bsec)
walls[i].nextwall = LittleShort(walls[i].nextwall); walls[i].nextwall = LittleShort(walls[i].nextwall);
walls[i].nextsector = LittleShort(walls[i].nextsector); walls[i].nextsector = LittleShort(walls[i].nextsector);
sides[i].textureoffset = walls[i].xpanning << FRACBITS; sides[i].SetTextureXOffset(walls[i].xpanning << FRACBITS);
sides[i].rowoffset = walls[i].ypanning << FRACBITS; sides[i].SetTextureYOffset(walls[i].ypanning << FRACBITS);
sides[i].toptexture = sides[i].bottomtexture = pic; sides[i].SetTexture(side_t::top, pic);
sides[i].SetTexture(side_t::bottom, pic);
if (walls[i].nextsector < 0 || (walls[i].cstat & 32)) if (walls[i].nextsector < 0 || (walls[i].cstat & 32))
{ {
sides[i].midtexture = pic; sides[i].SetTexture(side_t::mid, pic);
} }
else if (walls[i].cstat & 16) else if (walls[i].cstat & 16)
{ {
sides[i].midtexture = overpic; sides[i].SetTexture(side_t::mid, overpic);
} }
else else
{ {
sides[i].midtexture = 0; sides[i].SetTexture(side_t::mid, 0);
} }
sides[i].TexelLength = walls[i].xrepeat * 8; sides[i].TexelLength = walls[i].xrepeat * 8;

View file

@ -265,8 +265,9 @@ void DDoor::DoorSound (bool raise) const
if (line->backsector == NULL) if (line->backsector == NULL)
continue; continue;
texname = TexMan[sides[line->sidenum[0]].toptexture]->Name; FTexture *tex = TexMan[sides[line->sidenum[0]].GetTexture(side_t::top)];
if (texname[0] == 'D' && texname[1] == 'O' && texname[2] == 'R') texname = tex? tex->Name : NULL;
if (texname != NULL && texname[0] == 'D' && texname[1] == 'O' && texname[2] == 'R')
{ {
switch (texname[3]) switch (texname[3])
{ {
@ -606,11 +607,10 @@ void DAnimatedDoor::Tick ()
// IF DOOR NEEDS TO ANIMATE TO NEXT FRAME... // IF DOOR NEEDS TO ANIMATE TO NEXT FRAME...
m_Timer = m_Speed; m_Timer = m_Speed;
sides[m_Line1->sidenum[0]].midtexture = sides[m_Line1->sidenum[0]].SetTexture(side_t::mid, ani.TextureFrames[m_Frame]);
sides[m_Line1->sidenum[1]].midtexture = sides[m_Line1->sidenum[1]].SetTexture(side_t::mid, ani.TextureFrames[m_Frame]);
sides[m_Line2->sidenum[0]].midtexture = sides[m_Line2->sidenum[0]].SetTexture(side_t::mid, ani.TextureFrames[m_Frame]);
sides[m_Line2->sidenum[1]].midtexture = sides[m_Line2->sidenum[1]].SetTexture(side_t::mid, ani.TextureFrames[m_Frame]);
ani.TextureFrames[m_Frame];
} }
} }
break; break;
@ -642,11 +642,10 @@ void DAnimatedDoor::Tick ()
// IF DOOR NEEDS TO ANIMATE TO NEXT FRAME... // IF DOOR NEEDS TO ANIMATE TO NEXT FRAME...
m_Timer = m_Speed; m_Timer = m_Speed;
sides[m_Line1->sidenum[0]].midtexture = sides[m_Line1->sidenum[0]].SetTexture(side_t::mid, ani.TextureFrames[m_Frame]);
sides[m_Line1->sidenum[1]].midtexture = sides[m_Line1->sidenum[1]].SetTexture(side_t::mid, ani.TextureFrames[m_Frame]);
sides[m_Line2->sidenum[0]].midtexture = sides[m_Line2->sidenum[0]].SetTexture(side_t::mid, ani.TextureFrames[m_Frame]);
sides[m_Line2->sidenum[1]].midtexture = sides[m_Line2->sidenum[1]].SetTexture(side_t::mid, ani.TextureFrames[m_Frame]);
ani.TextureFrames[m_Frame];
} }
} }
break; break;
@ -699,7 +698,7 @@ DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay)
// The DMovingCeiling constructor automatically sets up an interpolation for us. // The DMovingCeiling constructor automatically sets up an interpolation for us.
// Stop it, since the ceiling is moving instantly here. // Stop it, since the ceiling is moving instantly here.
stopinterpolation (INTERP_SectorCeiling, sec); stopinterpolation (INTERP_SectorCeiling, sec);
m_WhichDoorIndex = P_FindSlidingDoorType (sides[line->sidenum[0]].toptexture); m_WhichDoorIndex = P_FindSlidingDoorType (sides[line->sidenum[0]].GetTexture(side_t::top));
if (m_WhichDoorIndex < 0) if (m_WhichDoorIndex < 0)
{ {
Printf ("EV_SlidingDoor: Textures are not defined for sliding door!"); Printf ("EV_SlidingDoor: Textures are not defined for sliding door!");
@ -715,16 +714,16 @@ DAnimatedDoor::DAnimatedDoor (sector_t *sec, line_t *line, int speed, int delay)
if (sec->lines[i] == line) if (sec->lines[i] == line)
continue; continue;
if (sides[sec->lines[i]->sidenum[0]].toptexture == sides[line->sidenum[0]].toptexture) if (sides[sec->lines[i]->sidenum[0]].GetTexture(side_t::top) == sides[line->sidenum[0]].GetTexture(side_t::top))
{ {
m_Line2 = sec->lines[i]; m_Line2 = sec->lines[i];
break; break;
} }
} }
picnum = sides[m_Line1->sidenum[0]].toptexture; picnum = sides[m_Line1->sidenum[0]].GetTexture(side_t::top);
sides[m_Line1->sidenum[0]].midtexture = picnum; sides[m_Line1->sidenum[0]].SetTexture(side_t::mid, picnum);
sides[m_Line2->sidenum[0]].midtexture = picnum; sides[m_Line2->sidenum[0]].SetTexture(side_t::mid, picnum);
// don't forget texture scaling here! // don't forget texture scaling here!
FTexture *tex = TexMan[picnum]; FTexture *tex = TexMan[picnum];
@ -783,7 +782,7 @@ bool EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay)
} }
return false; return false;
} }
if (P_FindSlidingDoorType (sides[line->sidenum[0]].toptexture) >= 0) if (P_FindSlidingDoorType (sides[line->sidenum[0]].GetTexture(side_t::top)) >= 0)
{ {
new DAnimatedDoor (sec, line, speed, delay); new DAnimatedDoor (sec, line, speed, delay);
return true; return true;
@ -806,7 +805,7 @@ bool EV_SlidingDoor (line_t *line, AActor *actor, int tag, int speed, int delay)
{ {
continue; continue;
} }
if (P_FindSlidingDoorType (sides[line->sidenum[0]].toptexture) >= 0) if (P_FindSlidingDoorType (sides[line->sidenum[0]].GetTexture(side_t::top)) >= 0)
{ {
rtn = true; rtn = true;
new DAnimatedDoor (sec, line, speed, delay); new DAnimatedDoor (sec, line, speed, delay);

View file

@ -1642,7 +1642,7 @@ void A_Look (AActor *actor)
{ {
if (actor->flags2 & MF2_BOSS) if (actor->flags2 & MF2_BOSS)
{ // full volume { // full volume
S_SoundID (actor, CHAN_VOICE, actor->SeeSound, 1, ATTN_SURROUND); S_SoundID (actor, CHAN_VOICE, actor->SeeSound, 1, ATTN_NONE);
} }
else else
{ {
@ -2396,7 +2396,7 @@ void A_Scream (AActor *actor)
if (actor->flags2 & MF2_BOSS) if (actor->flags2 & MF2_BOSS)
{ {
// full volume // full volume
S_SoundID (actor, CHAN_VOICE, actor->DeathSound, 1, ATTN_SURROUND); S_SoundID (actor, CHAN_VOICE, actor->DeathSound, 1, ATTN_NONE);
} }
else else
{ {

View file

@ -867,7 +867,7 @@ void A_LookEx (AActor *actor)
{ {
if (flags & LOF_FULLVOLSEESOUND) if (flags & LOF_FULLVOLSEESOUND)
{ // full volume { // full volume
S_SoundID (actor, CHAN_VOICE, actor->SeeSound, 1, ATTN_SURROUND); S_SoundID (actor, CHAN_VOICE, actor->SeeSound, 1, ATTN_NONE);
} }
else else
{ {

View file

@ -1889,8 +1889,11 @@ FUNC(LS_Sector_SetLink)
} }
static void SetWallScroller (int id, int sidechoice, fixed_t dx, fixed_t dy) static void SetWallScroller (int id, int sidechoice, fixed_t dx, fixed_t dy, int Where)
{ {
Where &=7;
if (Where == 0) return;
if ((dx | dy) == 0) if ((dx | dy) == 0)
{ {
// Special case: Remove the scroller, because the deltas are both 0. // Special case: Remove the scroller, because the deltas are both 0.
@ -1902,7 +1905,8 @@ static void SetWallScroller (int id, int sidechoice, fixed_t dx, fixed_t dy)
int wallnum = scroller->GetWallNum (); int wallnum = scroller->GetWallNum ();
if (wallnum >= 0 && lines[sides[wallnum].linenum].id == id && if (wallnum >= 0 && lines[sides[wallnum].linenum].id == id &&
lines[sides[wallnum].linenum].sidenum[sidechoice] == (DWORD)wallnum) lines[sides[wallnum].linenum].sidenum[sidechoice] == (DWORD)wallnum &&
Where == scroller->GetScrollParts())
{ {
scroller->Destroy (); scroller->Destroy ();
} }
@ -1920,7 +1924,8 @@ static void SetWallScroller (int id, int sidechoice, fixed_t dx, fixed_t dy)
{ {
if ((collect.RefNum = ((DScroller *)collect.Obj)->GetWallNum ()) != -1 && if ((collect.RefNum = ((DScroller *)collect.Obj)->GetWallNum ()) != -1 &&
lines[sides[collect.RefNum].linenum].id == id && lines[sides[collect.RefNum].linenum].id == id &&
lines[sides[collect.RefNum].linenum].sidenum[sidechoice] == (DWORD)collect.RefNum) lines[sides[collect.RefNum].linenum].sidenum[sidechoice] == (DWORD)collect.RefNum &&
Where == ((DScroller *)collect.Obj)->GetScrollParts())
{ {
((DScroller *)collect.Obj)->SetRate (dx, dy); ((DScroller *)collect.Obj)->SetRate (dx, dy);
Collection.Push (collect); Collection.Push (collect);
@ -1944,7 +1949,7 @@ static void SetWallScroller (int id, int sidechoice, fixed_t dx, fixed_t dy)
{ {
if (lines[linenum].sidenum[sidechoice] != NO_SIDE) if (lines[linenum].sidenum[sidechoice] != NO_SIDE)
{ {
new DScroller (DScroller::sc_side, dx, dy, -1, lines[linenum].sidenum[sidechoice], 0); new DScroller (DScroller::sc_side, dx, dy, -1, lines[linenum].sidenum[sidechoice], 0, Where);
} }
} }
} }
@ -1972,11 +1977,21 @@ FUNC(LS_Scroll_Texture_Both)
sidechoice = 0; sidechoice = 0;
} }
SetWallScroller (arg0, sidechoice, dx, dy); SetWallScroller (arg0, sidechoice, dx, dy, 7);
return true; return true;
} }
FUNC(LS_Scroll_Wall)
// Scroll_Wall (id, x, y, side, flags)
{
if (arg0 == 0)
return false;
SetWallScroller (arg0, !!arg3, arg1, arg2, arg4);
return true;
}
static void SetScroller (int tag, DScroller::EScrollType type, fixed_t dx, fixed_t dy) static void SetScroller (int tag, DScroller::EScrollType type, fixed_t dx, fixed_t dy)
{ {
TThinkerIterator<DScroller> iterator (STAT_SCROLLER); TThinkerIterator<DScroller> iterator (STAT_SCROLLER);
@ -2685,8 +2700,8 @@ FUNC(LS_ClearForceField)
{ {
line->flags &= ~(ML_BLOCKING|ML_BLOCKEVERYTHING); line->flags &= ~(ML_BLOCKING|ML_BLOCKEVERYTHING);
line->special = 0; line->special = 0;
sides[line->sidenum[0]].midtexture = 0; sides[line->sidenum[0]].SetTexture(side_t::mid, 0);
sides[line->sidenum[1]].midtexture = 0; sides[line->sidenum[1]].SetTexture(side_t::mid, 0);
} }
} }
} }
@ -2860,7 +2875,7 @@ lnSpecFunc LineSpecials[256] =
LS_GlassBreak, LS_GlassBreak,
LS_NOP, // 50: ExtraFloor_LightOnly LS_NOP, // 50: ExtraFloor_LightOnly
LS_Sector_SetLink, LS_Sector_SetLink,
LS_NOP, // 52 LS_Scroll_Wall,
LS_NOP, // 53 LS_NOP, // 53
LS_NOP, // 54 LS_NOP, // 54
LS_NOP, // 55 LS_NOP, // 55

View file

@ -155,12 +155,12 @@ typedef enum {
#define FRICTION_MASK 0x0800 #define FRICTION_MASK 0x0800
#define PUSH_MASK 0x1000 #define PUSH_MASK 0x1000
struct line_s; struct line_t;
class AActor; class AActor;
FName MODtoDamageType (int mod); FName MODtoDamageType (int mod);
typedef int (*lnSpecFunc)(struct line_s *line, typedef int (*lnSpecFunc)(struct line_t *line,
class AActor *activator, class AActor *activator,
bool backSide, bool backSide,
int arg1, int arg1,

View file

@ -368,22 +368,10 @@ void P_SerializeWorld (FArchive &arc)
continue; continue;
side_t *si = &sides[li->sidenum[j]]; side_t *si = &sides[li->sidenum[j]];
arc << si->textureoffset arc << si->textures[side_t::top]
<< si->rowoffset; << si->textures[side_t::mid]
<< si->textures[side_t::bottom]
if (arc.IsStoring ()) << si->Light
{
TexMan.WriteTexture (arc, si->toptexture);
TexMan.WriteTexture (arc, si->bottomtexture);
TexMan.WriteTexture (arc, si->midtexture);
}
else
{
si->toptexture = TexMan.ReadTexture (arc);
si->bottomtexture = TexMan.ReadTexture (arc);
si->midtexture = TexMan.ReadTexture (arc);
}
arc << si->Light
<< si->Flags << si->Flags
<< si->LeftSide << si->LeftSide
<< si->RightSide; << si->RightSide;

View file

@ -474,8 +474,8 @@ fixed_t sector_t::FindShortestTextureAround () const
{ {
if (lines[i]->flags & ML_TWOSIDED) if (lines[i]->flags & ML_TWOSIDED)
{ {
CheckShortestTex (sides[lines[i]->sidenum[0]].bottomtexture, minsize); CheckShortestTex (sides[lines[i]->sidenum[0]].GetTexture(side_t::bottom), minsize);
CheckShortestTex (sides[lines[i]->sidenum[1]].bottomtexture, minsize); CheckShortestTex (sides[lines[i]->sidenum[1]].GetTexture(side_t::bottom), minsize);
} }
} }
return minsize < FIXED_MAX ? minsize : TexMan[0]->GetHeight() * FRACUNIT; return minsize < FIXED_MAX ? minsize : TexMan[0]->GetHeight() * FRACUNIT;
@ -500,8 +500,8 @@ fixed_t sector_t::FindShortestUpperAround () const
{ {
if (lines[i]->flags & ML_TWOSIDED) if (lines[i]->flags & ML_TWOSIDED)
{ {
CheckShortestTex (sides[lines[i]->sidenum[0]].toptexture, minsize); CheckShortestTex (sides[lines[i]->sidenum[0]].GetTexture(side_t::top), minsize);
CheckShortestTex (sides[lines[i]->sidenum[1]].toptexture, minsize); CheckShortestTex (sides[lines[i]->sidenum[1]].GetTexture(side_t::top), minsize);
} }
} }
return minsize < FIXED_MAX ? minsize : TexMan[0]->GetHeight() * FRACUNIT; return minsize < FIXED_MAX ? minsize : TexMan[0]->GetHeight() * FRACUNIT;

View file

@ -389,14 +389,15 @@ MapData *P_OpenMapData(const char * mapname)
// //
//=========================================================================== //===========================================================================
static void SetTexture (int *texture, DWORD *blend, char *name8) static void SetTexture (side_t *side, int position, DWORD *blend, char *name8)
{ {
char name[9]; char name[9];
strncpy (name, name8, 8); strncpy (name, name8, 8);
name[8] = 0; name[8] = 0;
int texture;
if ((*blend = R_ColormapNumForName (name)) == 0) if ((*blend = R_ColormapNumForName (name)) == 0)
{ {
if ((*texture = TexMan.CheckForTexture (name, FTexture::TEX_Wall, if ((texture = TexMan.CheckForTexture (name, FTexture::TEX_Wall,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny) FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny)
) == -1) ) == -1)
{ {
@ -405,7 +406,7 @@ static void SetTexture (int *texture, DWORD *blend, char *name8)
strncpy (name2, name, 8); strncpy (name2, name, 8);
name2[8] = 0; name2[8] = 0;
*blend = strtoul (name2, &stop, 16); *blend = strtoul (name2, &stop, 16);
*texture = 0; texture = 0;
} }
else else
{ {
@ -414,17 +415,19 @@ static void SetTexture (int *texture, DWORD *blend, char *name8)
} }
else else
{ {
*texture = 0; texture = 0;
} }
side->SetTexture(position, texture);
} }
static void SetTextureNoErr (int *texture, DWORD *color, char *name8, bool *validcolor, bool isfog) static void SetTextureNoErr (side_t *side, int position, DWORD *color, char *name8, bool *validcolor, bool isFog)
{ {
char name[9]; char name[9];
int texture;
strncpy (name, name8, 8); strncpy (name, name8, 8);
name[8] = 0; name[8] = 0;
*validcolor = false; *validcolor = false;
if ((*texture = TexMan.CheckForTexture (name, FTexture::TEX_Wall, if ((texture = TexMan.CheckForTexture (name, FTexture::TEX_Wall,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny) FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny)
) == -1) ) == -1)
{ {
@ -435,14 +438,14 @@ static void SetTextureNoErr (int *texture, DWORD *color, char *name8, bool *vali
if (*name != '#') if (*name != '#')
{ {
*color = strtoul (name, &stop, 16); *color = strtoul (name, &stop, 16);
*texture = 0; texture = 0;
*validcolor = (*stop == 0) && (stop >= name + 2) && (stop <= name + 6); *validcolor = (*stop == 0) && (stop >= name + 2) && (stop <= name + 6);
return; return;
} }
else // Support for Legacy's color format! else // Support for Legacy's color format!
{ {
int l=(int)strlen(name); int l=(int)strlen(name);
*texture = 0; texture = 0;
*validcolor = false; *validcolor = false;
if (l>=7) if (l>=7)
{ {
@ -454,7 +457,7 @@ static void SetTextureNoErr (int *texture, DWORD *color, char *name8, bool *vali
name2[4]=0; int green=strtol(name2+2,NULL,16); name2[4]=0; int green=strtol(name2+2,NULL,16);
name2[2]=0; int red=strtol(name2,NULL,16); name2[2]=0; int red=strtol(name2,NULL,16);
if (!isfog) if (!isFog)
{ {
if (factor==0) if (factor==0)
{ {
@ -469,13 +472,14 @@ static void SetTextureNoErr (int *texture, DWORD *color, char *name8, bool *vali
} }
*color=MAKEARGB(factor, red, green, blue); *color=MAKEARGB(factor, red, green, blue);
*texture = 0; texture = 0;
*validcolor = true; *validcolor = true;
return; return;
} }
} }
*texture = 0; texture = 0;
} }
side->SetTexture(position, texture);
} }
//=========================================================================== //===========================================================================
@ -2322,8 +2326,8 @@ void P_LoadSideDefs2 (MapData * map)
msd->rowoffset += 102; msd->rowoffset += 102;
} }
sd->textureoffset = LittleShort(msd->textureoffset)<<FRACBITS; sd->SetTextureXOffset(LittleShort(msd->textureoffset)<<FRACBITS);
sd->rowoffset = LittleShort(msd->rowoffset)<<FRACBITS; sd->SetTextureYOffset(LittleShort(msd->rowoffset)<<FRACBITS);
sd->linenum = NO_INDEX; sd->linenum = NO_INDEX;
// killough 4/4/98: allow sidedef texture names to be overloaded // killough 4/4/98: allow sidedef texture names to be overloaded
@ -2348,9 +2352,9 @@ void P_LoadSideDefs2 (MapData * map)
// instead of figuring something out from the colormap. // instead of figuring something out from the colormap.
if (sec != NULL) if (sec != NULL)
{ {
SetTexture (&sd->bottomtexture, &sec->bottommap, msd->bottomtexture); SetTexture (sd, side_t::bottom, &sec->bottommap, msd->bottomtexture);
SetTexture (&sd->midtexture, &sec->midmap, msd->midtexture); SetTexture (sd, side_t::mid, &sec->midmap, msd->midtexture);
SetTexture (&sd->toptexture, &sec->topmap, msd->toptexture); SetTexture (sd, side_t::top, &sec->topmap, msd->toptexture);
} }
break; break;
@ -2362,10 +2366,11 @@ void P_LoadSideDefs2 (MapData * map)
DWORD color, fog; DWORD color, fog;
bool colorgood, foggood; bool colorgood, foggood;
SetTextureNoErr (&sd->bottomtexture, &fog, msd->bottomtexture, &foggood, true); SetTextureNoErr (sd, side_t::bottom, &fog, msd->bottomtexture, &foggood, true);
SetTextureNoErr (&sd->toptexture, &color, msd->toptexture, &colorgood, false); SetTextureNoErr (sd, side_t::top, &color, msd->toptexture, &colorgood, false);
strncpy (name, msd->midtexture, 8); strncpy (name, msd->midtexture, 8);
sd->midtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::mid,
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
if (colorgood | foggood) if (colorgood | foggood)
{ {
@ -2395,20 +2400,20 @@ void P_LoadSideDefs2 (MapData * map)
if (msd->toptexture[0]=='#') if (msd->toptexture[0]=='#')
{ {
strncpy (name, msd->toptexture, 8); strncpy (name, msd->toptexture, 8);
sd->toptexture = -strtol(name+1, NULL, 10); // store the alpha as a negative texture index sd->SetTexture(side_t::top, -strtol(name+1, NULL, 10)); // store the alpha as a negative texture index
// This will be sorted out by the 3D-floor code later. // This will be sorted out by the 3D-floor code later.
} }
else else
{ {
strncpy (name, msd->toptexture, 8); strncpy (name, msd->toptexture, 8);
sd->toptexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::top, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
} }
strncpy (name, msd->midtexture, 8); strncpy (name, msd->midtexture, 8);
sd->midtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::mid, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
strncpy (name, msd->bottomtexture, 8); strncpy (name, msd->bottomtexture, 8);
sd->bottomtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::bottom, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
break; break;
case TranslucentLine: // killough 4/11/98: apply translucency to 2s normal texture case TranslucentLine: // killough 4/11/98: apply translucency to 2s normal texture
@ -2419,47 +2424,42 @@ void P_LoadSideDefs2 (MapData * map)
if (strnicmp ("TRANMAP", msd->midtexture, 8) == 0) if (strnicmp ("TRANMAP", msd->midtexture, 8) == 0)
{ {
// The translator set the alpha argument already; no reason to do it again. // The translator set the alpha argument already; no reason to do it again.
sd->midtexture = 0; sd->SetTexture(side_t::mid, 0);
} }
else if ((lumpnum = Wads.CheckNumForName (msd->midtexture)) > 0 && else if ((lumpnum = Wads.CheckNumForName (msd->midtexture)) > 0 &&
Wads.LumpLength (lumpnum) == 65536) Wads.LumpLength (lumpnum) == 65536)
{ {
sidetemp[i].a.alpha = P_DetermineTranslucency (lumpnum); sidetemp[i].a.alpha = P_DetermineTranslucency (lumpnum);
sd->midtexture = 0; sd->SetTexture(side_t::mid, 0);
} }
else else
{ {
strncpy (name, msd->midtexture, 8); strncpy (name, msd->midtexture, 8);
sd->midtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::mid,
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
} }
strncpy (name, msd->toptexture, 8); strncpy (name, msd->toptexture, 8);
sd->toptexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::top, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
strncpy (name, msd->bottomtexture, 8); strncpy (name, msd->bottomtexture, 8);
sd->bottomtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::bottom, TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
break; break;
} }
// Fallthrough for Hexen maps is intentional // Fallthrough for Hexen maps is intentional
#if 0
sd->midtexture = strncasecmp("TRANMAP", msd->midtexture, 8) ?
(sd->special = W_CheckNumForName(msd->midtexture)) < 0 ||
W_LumpLength(sd->special) != 65536 ?
sd->special=0, R_TextureNumForName(msd->midtexture) :
(sd->special++, 0) : (sd->special=0);
sd->toptexture = R_TextureNumForName(msd->toptexture);
sd->bottomtexture = R_TextureNumForName(msd->bottomtexture);
#endif
default: // normal cases default: // normal cases
strncpy (name, msd->midtexture, 8); strncpy (name, msd->midtexture, 8);
sd->midtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::mid,
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
strncpy (name, msd->toptexture, 8); strncpy (name, msd->toptexture, 8);
sd->toptexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::top,
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
strncpy (name, msd->bottomtexture, 8); strncpy (name, msd->bottomtexture, 8);
sd->bottomtexture = TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable); sd->SetTexture(side_t::bottom,
TexMan.GetTexture (name, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable));
break; break;
} }
} }

View file

@ -92,7 +92,8 @@ void DScroller::Serialize (FArchive &arc)
<< m_Control << m_Control
<< m_LastHeight << m_LastHeight
<< m_vdx << m_vdy << m_vdx << m_vdy
<< m_Accel; << m_Accel
<< m_Parts;
} }
DPusher::DPusher () DPusher::DPusher ()
@ -1113,8 +1114,22 @@ void DScroller::Tick ()
switch (m_Type) switch (m_Type)
{ {
case sc_side: // killough 3/7/98: Scroll wall texture case sc_side: // killough 3/7/98: Scroll wall texture
sides[m_Affectee].textureoffset += dx; if (m_Parts & scw_top)
sides[m_Affectee].rowoffset += dy; {
sides[m_Affectee].AddTextureXOffset(side_t::top, dx);
sides[m_Affectee].AddTextureYOffset(side_t::top, dy);
}
if (m_Parts & scw_mid && (lines[sides[m_Affectee].linenum].backsector == NULL ||
!(lines[sides[m_Affectee].linenum].flags&ML_3DMIDTEX)))
{
sides[m_Affectee].AddTextureXOffset(side_t::mid, dx);
sides[m_Affectee].AddTextureYOffset(side_t::mid, dy);
}
if (m_Parts & scw_bottom)
{
sides[m_Affectee].AddTextureXOffset(side_t::bottom, dx);
sides[m_Affectee].AddTextureYOffset(side_t::bottom, dy);
}
break; break;
case sc_floor: // killough 3/7/98: Scroll floor texture case sc_floor: // killough 3/7/98: Scroll floor texture
@ -1157,13 +1172,14 @@ void DScroller::Tick ()
// //
DScroller::DScroller (EScrollType type, fixed_t dx, fixed_t dy, DScroller::DScroller (EScrollType type, fixed_t dx, fixed_t dy,
int control, int affectee, int accel) int control, int affectee, int accel, int scrollpos)
: DThinker (STAT_SCROLLER) : DThinker (STAT_SCROLLER)
{ {
m_Type = type; m_Type = type;
m_dx = dx; m_dx = dx;
m_dy = dy; m_dy = dy;
m_Accel = accel; m_Accel = accel;
m_Parts = scrollpos;
m_vdx = m_vdy = 0; m_vdx = m_vdy = 0;
if ((m_Control = control) != -1) if ((m_Control = control) != -1)
m_LastHeight = m_LastHeight =
@ -1177,7 +1193,19 @@ DScroller::DScroller (EScrollType type, fixed_t dx, fixed_t dy,
case sc_side: case sc_side:
sides[affectee].Flags |= WALLF_NOAUTODECALS; sides[affectee].Flags |= WALLF_NOAUTODECALS;
setinterpolation (INTERP_WallPanning, &sides[affectee]); if (m_Parts & scw_top)
{
sides[m_Affectee].SetInterpolation(side_t::top);
}
if (m_Parts & scw_mid && (lines[sides[m_Affectee].linenum].backsector == NULL ||
!(lines[sides[m_Affectee].linenum].flags&ML_3DMIDTEX)))
{
sides[m_Affectee].SetInterpolation(side_t::mid);
}
if (m_Parts & scw_bottom)
{
sides[m_Affectee].SetInterpolation(side_t::bottom);
}
break; break;
case sc_floor: case sc_floor:
@ -1198,7 +1226,19 @@ DScroller::~DScroller ()
switch (m_Type) switch (m_Type)
{ {
case sc_side: case sc_side:
stopinterpolation (INTERP_WallPanning, &sides[m_Affectee]); if (m_Parts & scw_top)
{
sides[m_Affectee].StopInterpolation(side_t::top);
}
if (m_Parts & scw_mid && (lines[sides[m_Affectee].linenum].backsector == NULL ||
!(lines[sides[m_Affectee].linenum].flags&ML_3DMIDTEX)))
{
sides[m_Affectee].StopInterpolation(side_t::mid);
}
if (m_Parts & scw_bottom)
{
sides[m_Affectee].StopInterpolation(side_t::bottom);
}
break; break;
case sc_floor: case sc_floor:
@ -1222,7 +1262,7 @@ DScroller::~DScroller ()
// killough 5/25/98: cleaned up arithmetic to avoid drift due to roundoff // killough 5/25/98: cleaned up arithmetic to avoid drift due to roundoff
DScroller::DScroller (fixed_t dx, fixed_t dy, const line_t *l, DScroller::DScroller (fixed_t dx, fixed_t dy, const line_t *l,
int control, int accel) int control, int accel, int scrollpos)
: DThinker (STAT_SCROLLER) : DThinker (STAT_SCROLLER)
{ {
fixed_t x = abs(l->dx), y = abs(l->dy), d; fixed_t x = abs(l->dx), y = abs(l->dy), d;
@ -1238,16 +1278,30 @@ DScroller::DScroller (fixed_t dx, fixed_t dy, const line_t *l,
m_dy = y; m_dy = y;
m_vdx = m_vdy = 0; m_vdx = m_vdy = 0;
m_Accel = accel; m_Accel = accel;
m_Parts = scrollpos;
if ((m_Control = control) != -1) if ((m_Control = control) != -1)
m_LastHeight = sectors[control].CenterFloor() + sectors[control].CenterCeiling(); m_LastHeight = sectors[control].CenterFloor() + sectors[control].CenterCeiling();
m_Affectee = *l->sidenum; m_Affectee = *l->sidenum;
sides[m_Affectee].Flags |= WALLF_NOAUTODECALS; sides[m_Affectee].Flags |= WALLF_NOAUTODECALS;
setinterpolation (INTERP_WallPanning, &sides[m_Affectee]); if (m_Parts & scw_top)
{
sides[m_Affectee].SetInterpolation(side_t::top);
}
if (m_Parts & scw_mid && (lines[sides[m_Affectee].linenum].backsector == NULL ||
!(lines[sides[m_Affectee].linenum].flags&ML_3DMIDTEX)))
{
sides[m_Affectee].SetInterpolation(side_t::mid);
}
if (m_Parts & scw_bottom)
{
sides[m_Affectee].SetInterpolation(side_t::bottom);
}
} }
// Amount (dx,dy) vector linedef is shifted right to get scroll amount // Amount (dx,dy) vector linedef is shifted right to get scroll amount
#define SCROLL_SHIFT 5 #define SCROLL_SHIFT 5
#define SCROLLTYPE(i) ((i)<=0 ? 7:(i))
// Initialize the scrollers // Initialize the scrollers
static void P_SpawnScrollers(void) static void P_SpawnScrollers(void)
@ -1337,28 +1391,28 @@ static void P_SpawnScrollers(void)
case Scroll_Texture_Offsets: case Scroll_Texture_Offsets:
// killough 3/2/98: scroll according to sidedef offsets // killough 3/2/98: scroll according to sidedef offsets
s = lines[i].sidenum[0]; s = lines[i].sidenum[0];
new DScroller (DScroller::sc_side, -sides[s].textureoffset, new DScroller (DScroller::sc_side, -sides[s].GetTextureXOffset(side_t::mid),
sides[s].rowoffset, -1, s, accel); sides[s].GetTextureYOffset(side_t::mid), -1, s, accel, SCROLLTYPE(l->args[0]));
break; break;
case Scroll_Texture_Left: case Scroll_Texture_Left:
new DScroller (DScroller::sc_side, l->args[0] * (FRACUNIT/64), 0, new DScroller (DScroller::sc_side, l->args[0] * (FRACUNIT/64), 0,
-1, lines[i].sidenum[0], accel); -1, lines[i].sidenum[0], accel, SCROLLTYPE(l->args[1]));
break; break;
case Scroll_Texture_Right: case Scroll_Texture_Right:
new DScroller (DScroller::sc_side, l->args[0] * (-FRACUNIT/64), 0, new DScroller (DScroller::sc_side, l->args[0] * (-FRACUNIT/64), 0,
-1, lines[i].sidenum[0], accel); -1, lines[i].sidenum[0], accel, SCROLLTYPE(l->args[1]));
break; break;
case Scroll_Texture_Up: case Scroll_Texture_Up:
new DScroller (DScroller::sc_side, 0, l->args[0] * (FRACUNIT/64), new DScroller (DScroller::sc_side, 0, l->args[0] * (FRACUNIT/64),
-1, lines[i].sidenum[0], accel); -1, lines[i].sidenum[0], accel, SCROLLTYPE(l->args[1]));
break; break;
case Scroll_Texture_Down: case Scroll_Texture_Down:
new DScroller (DScroller::sc_side, 0, l->args[0] * (-FRACUNIT/64), new DScroller (DScroller::sc_side, 0, l->args[0] * (-FRACUNIT/64),
-1, lines[i].sidenum[0], accel); -1, lines[i].sidenum[0], accel, SCROLLTYPE(l->args[1]));
break; break;
case Scroll_Texture_Both: case Scroll_Texture_Both:

View file

@ -52,9 +52,16 @@ public:
sc_carry, sc_carry,
sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings sc_carry_ceiling, // killough 4/11/98: carry objects hanging on ceilings
}; };
enum EScrollPos
{
scw_top=1,
scw_mid=2,
scw_bottom=4,
scw_all=7,
};
DScroller (EScrollType type, fixed_t dx, fixed_t dy, int control, int affectee, int accel); DScroller (EScrollType type, fixed_t dx, fixed_t dy, int control, int affectee, int accel, int scrollpos = scw_all);
DScroller (fixed_t dx, fixed_t dy, const line_t *l, int control, int accel); DScroller (fixed_t dx, fixed_t dy, const line_t *l, int control, int accel, int scrollpos = scw_all);
~DScroller (); ~DScroller ();
void Serialize (FArchive &arc); void Serialize (FArchive &arc);
@ -65,6 +72,7 @@ public:
void SetRate (fixed_t dx, fixed_t dy) { m_dx = dx; m_dy = dy; } void SetRate (fixed_t dx, fixed_t dy) { m_dx = dx; m_dy = dy; }
bool IsType (EScrollType type) const { return type == m_Type; } bool IsType (EScrollType type) const { return type == m_Type; }
int GetAffectee () const { return m_Affectee; } int GetAffectee () const { return m_Affectee; }
int GetScrollParts() const { return m_Parts; }
protected: protected:
EScrollType m_Type; // Type of scroll effect EScrollType m_Type; // Type of scroll effect
@ -74,6 +82,7 @@ protected:
fixed_t m_LastHeight; // Last known height of control sector fixed_t m_LastHeight; // Last known height of control sector
fixed_t m_vdx, m_vdy; // Accumulated velocity if accelerative fixed_t m_vdx, m_vdy; // Accumulated velocity if accelerative
int m_Accel; // Whether it's accelerative int m_Accel; // Whether it's accelerative
int m_Parts; // Which parts of a sidedef are being scrolled?
private: private:
DScroller (); DScroller ();

View file

@ -58,22 +58,14 @@ class DActiveButton : public DThinker
{ {
DECLARE_CLASS (DActiveButton, DThinker) DECLARE_CLASS (DActiveButton, DThinker)
public: public:
enum EWhere
{
BUTTON_Top,
BUTTON_Middle,
BUTTON_Bottom,
BUTTON_Nowhere
};
DActiveButton (); DActiveButton ();
DActiveButton (side_t *, EWhere, WORD switchnum, fixed_t x, fixed_t y, bool flippable); DActiveButton (side_t *, int, WORD switchnum, fixed_t x, fixed_t y, bool flippable);
void Serialize (FArchive &arc); void Serialize (FArchive &arc);
void Tick (); void Tick ();
side_t *m_Side; side_t *m_Side;
EWhere m_Where; SBYTE m_Part;
WORD m_SwitchDef; WORD m_SwitchDef;
WORD m_Frame; WORD m_Frame;
WORD m_Timer; WORD m_Timer;
@ -82,29 +74,20 @@ public:
protected: protected:
bool AdvanceFrame (); bool AdvanceFrame ();
void StoreTexture (short tex) const;
friend FArchive &operator<< (FArchive &arc, EWhere &where)
{
BYTE val = (BYTE)where;
arc << val;
where = (EWhere)val;
return arc;
}
}; };
struct FSwitchDef struct FSwitchDef
{ {
SWORD PreTexture; // texture to switch from int PreTexture; // texture to switch from
WORD PairIndex; // switch def to use to return to PreTexture WORD PairIndex; // switch def to use to return to PreTexture
SWORD Sound; // sound to play at start of animation SWORD Sound; // sound to play at start of animation
WORD NumFrames; // # of animation frames WORD NumFrames; // # of animation frames
bool QuestPanel; // Special texture for Strife mission bool QuestPanel; // Special texture for Strife mission
union // Array of times followed by array of textures struct frame // Array of times followed by array of textures
{ // actual length of each array is <NumFrames> { // actual length of each array is <NumFrames>
DWORD Times[1]; DWORD Time;
SWORD Textures[3]; int Texture;
} u; } u[1];
}; };
static int STACK_ARGS SortSwitchDefs (const void *a, const void *b); static int STACK_ARGS SortSwitchDefs (const void *a, const void *b);
@ -167,11 +150,11 @@ void P_InitSwitchList ()
{ {
def1 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef)); def1 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef));
def2 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef)); def2 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef));
def1->PreTexture = def2->u.Textures[2] = TexMan.CheckForTexture (list_p /* .name1 */, FTexture::TEX_Wall, texflags); def1->PreTexture = def2->u[0].Texture = TexMan.CheckForTexture (list_p /* .name1 */, FTexture::TEX_Wall, texflags);
def2->PreTexture = def1->u.Textures[2] = TexMan.CheckForTexture (list_p + 9, FTexture::TEX_Wall, texflags); def2->PreTexture = def1->u[0].Texture = TexMan.CheckForTexture (list_p + 9, FTexture::TEX_Wall, texflags);
def1->Sound = def2->Sound = 0; def1->Sound = def2->Sound = 0;
def1->NumFrames = def2->NumFrames = 1; def1->NumFrames = def2->NumFrames = 1;
def1->u.Times[0] = def2->u.Times[0] = 0; def1->u[0].Time = def2->u[0].Time = 0;
def2->PairIndex = AddSwitchDef (def1); def2->PairIndex = AddSwitchDef (def1);
def1->PairIndex = AddSwitchDef (def2); def1->PairIndex = AddSwitchDef (def2);
} }
@ -317,12 +300,12 @@ void P_ProcessSwitchDef (FScanner &sc)
def2 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef)); def2 = (FSwitchDef *)M_Malloc (sizeof(FSwitchDef));
def2->Sound = def1->Sound; def2->Sound = def1->Sound;
def2->NumFrames = 1; def2->NumFrames = 1;
def2->u.Times[0] = 0; def2->u[0].Time = 0;
def2->u.Textures[2] = picnum; def2->u[0].Texture = picnum;
} }
def1->PreTexture = picnum; def1->PreTexture = picnum;
def2->PreTexture = def1->u.Textures[def1->NumFrames*2+def1->NumFrames-1]; def2->PreTexture = def1->u[def1->NumFrames-1].Texture;
if (def1->PreTexture == def2->PreTexture) if (def1->PreTexture == def2->PreTexture)
{ {
sc.ScriptError ("The on state for switch %s must end with a texture other than %s", picname.GetChars(), picname.GetChars()); sc.ScriptError ("The on state for switch %s must end with a texture other than %s", picname.GetChars(), picname.GetChars());
@ -336,14 +319,12 @@ FSwitchDef *ParseSwitchDef (FScanner &sc, bool ignoreBad)
{ {
const BITFIELD texflags = FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny; const BITFIELD texflags = FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny;
FSwitchDef *def; FSwitchDef *def;
SWORD pics[MAX_FRAMES]; TArray<FSwitchDef::frame> frames;
DWORD times[MAX_FRAMES]; FSwitchDef::frame thisframe;
int numframes;
int picnum; int picnum;
bool bad; bool bad;
SWORD sound; SWORD sound;
numframes = 0;
sound = 0; sound = 0;
bad = false; bad = false;
@ -360,10 +341,6 @@ FSwitchDef *ParseSwitchDef (FScanner &sc, bool ignoreBad)
} }
else if (sc.Compare ("pic")) else if (sc.Compare ("pic"))
{ {
if (numframes == MAX_FRAMES)
{
sc.ScriptError ("Switch has too many frames");
}
sc.MustGetString (); sc.MustGetString ();
picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Wall, texflags); picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Wall, texflags);
if (picnum < 0 && !ignoreBad) if (picnum < 0 && !ignoreBad)
@ -371,12 +348,12 @@ FSwitchDef *ParseSwitchDef (FScanner &sc, bool ignoreBad)
//Printf ("Unknown switch texture %s\n", sc.String); //Printf ("Unknown switch texture %s\n", sc.String);
bad = true; bad = true;
} }
pics[numframes] = picnum; thisframe.Texture = picnum;
sc.MustGetString (); sc.MustGetString ();
if (sc.Compare ("tics")) if (sc.Compare ("tics"))
{ {
sc.MustGetNumber (); sc.MustGetNumber ();
times[numframes] = sc.Number & 65535; thisframe.Time = sc.Number & 65535;
} }
else if (sc.Compare ("rand")) else if (sc.Compare ("rand"))
{ {
@ -390,13 +367,13 @@ FSwitchDef *ParseSwitchDef (FScanner &sc, bool ignoreBad)
{ {
swap (min, max); swap (min, max);
} }
times[numframes] = ((max - min + 1) << 16) | min; thisframe.Time = ((max - min + 1) << 16) | min;
} }
else else
{ {
sc.ScriptError ("Must specify a duration for switch frame"); sc.ScriptError ("Must specify a duration for switch frame");
} }
numframes++; frames.Push(thisframe);
} }
else else
{ {
@ -404,7 +381,7 @@ FSwitchDef *ParseSwitchDef (FScanner &sc, bool ignoreBad)
break; break;
} }
} }
if (numframes == 0) if (frames.Size() == 0)
{ {
sc.ScriptError ("Switch state needs at least one frame"); sc.ScriptError ("Switch state needs at least one frame");
} }
@ -412,11 +389,11 @@ FSwitchDef *ParseSwitchDef (FScanner &sc, bool ignoreBad)
{ {
return NULL; return NULL;
} }
def = (FSwitchDef *)M_Malloc (myoffsetof (FSwitchDef, u.Times[0]) + numframes * 6);
def = (FSwitchDef *)M_Malloc (myoffsetof (FSwitchDef, u[0]) + frames.Size()*sizeof(frames[0]));
def->Sound = sound; def->Sound = sound;
def->NumFrames = numframes; def->NumFrames = frames.Size();
memcpy (&def->u.Times[0], times, numframes * 4); memcpy (&def->u[0], &frames[0], frames.Size() * sizeof(frames[0]));
memcpy (&def->u.Textures[numframes*2], pics, numframes * 2);
def->PairIndex = 65535; def->PairIndex = 65535;
return def; return def;
} }
@ -441,7 +418,7 @@ static WORD AddSwitchDef (FSwitchDef *def)
// Start a button counting down till it turns off. // Start a button counting down till it turns off.
// [RH] Rewritten to remove MAXBUTTONS limit. // [RH] Rewritten to remove MAXBUTTONS limit.
// //
static bool P_StartButton (side_t *side, DActiveButton::EWhere w, int switchnum, static bool P_StartButton (side_t *side, int Where, int switchnum,
fixed_t x, fixed_t y, bool useagain) fixed_t x, fixed_t y, bool useagain)
{ {
DActiveButton *button; DActiveButton *button;
@ -457,14 +434,15 @@ static bool P_StartButton (side_t *side, DActiveButton::EWhere w, int switchnum,
} }
} }
new DActiveButton (side, w, switchnum, x, y, useagain); new DActiveButton (side, Where, switchnum, x, y, useagain);
return true; return true;
} }
static int TryFindSwitch (SWORD texture) static int TryFindSwitch (side_t *side, int Where)
{ {
int mid, low, high; int mid, low, high;
int texture = side->GetTexture(Where);
high = (int)(SwitchList.Size () - 1); high = (int)(SwitchList.Size () - 1);
if (high >= 0) if (high >= 0)
{ {
@ -525,15 +503,15 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno)
P_LineOpening(open, NULL, line, checkx, checky, user->x, user->y); P_LineOpening(open, NULL, line, checkx, checky, user->x, user->y);
if (open.range <= 0) return true; if (open.range <= 0) return true;
if ((TryFindSwitch (side->toptexture)) != -1) if ((TryFindSwitch (side, side_t::top)) != -1)
{ {
return (user->z + user->height >= open.top); return (user->z + user->height >= open.top);
} }
else if ((TryFindSwitch (side->bottomtexture)) != -1) else if ((TryFindSwitch (side, side_t::bottom)) != -1)
{ {
return (user->z <= open.bottom); return (user->z <= open.bottom);
} }
else if ((line->flags & (ML_3DMIDTEX)) || (TryFindSwitch (side->midtexture)) != -1) else if ((line->flags & (ML_3DMIDTEX)) || (TryFindSwitch (side, side_t::mid)) != -1)
{ {
// 3DMIDTEX lines will force a mid texture check if no switch is found on this line // 3DMIDTEX lines will force a mid texture check if no switch is found on this line
// to keep compatibility with Eternity's implementation. // to keep compatibility with Eternity's implementation.
@ -553,24 +531,20 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno)
// //
bool P_ChangeSwitchTexture (side_t *side, int useAgain, BYTE special, bool *quest) bool P_ChangeSwitchTexture (side_t *side, int useAgain, BYTE special, bool *quest)
{ {
DActiveButton::EWhere Where; int texture;
int *texture;
int i, sound; int i, sound;
if ((i = TryFindSwitch (side->toptexture)) != -1) if ((i = TryFindSwitch (side, side_t::top)) != -1)
{ {
texture = &side->toptexture; texture = side_t::top;
Where = DActiveButton::BUTTON_Top;
} }
else if ((i = TryFindSwitch (side->bottomtexture)) != -1) else if ((i = TryFindSwitch (side, side_t::bottom)) != -1)
{ {
texture = &side->bottomtexture; texture = side_t::bottom;
Where = DActiveButton::BUTTON_Bottom;
} }
else if ((i = TryFindSwitch (side->midtexture)) != -1) else if ((i = TryFindSwitch (side, side_t::mid)) != -1)
{ {
texture = &side->midtexture; texture = side_t::mid;
Where = DActiveButton::BUTTON_Middle;
} }
else else
{ {
@ -606,9 +580,9 @@ bool P_ChangeSwitchTexture (side_t *side, int useAgain, BYTE special, bool *ques
pt[0] = line->v1->x + (line->dx >> 1); pt[0] = line->v1->x + (line->dx >> 1);
pt[1] = line->v1->y + (line->dy >> 1); pt[1] = line->v1->y + (line->dy >> 1);
*texture = SwitchList[i]->u.Textures[SwitchList[i]->NumFrames*2]; side->SetTexture(texture, SwitchList[i]->u[0].Texture);
if (useAgain || SwitchList[i]->NumFrames > 1) if (useAgain || SwitchList[i]->NumFrames > 1)
playsound = P_StartButton (side, Where, i, pt[0], pt[1], !!useAgain); playsound = P_StartButton (side, texture, i, pt[0], pt[1], !!useAgain);
else else
playsound = true; playsound = true;
if (playsound) S_SoundID (pt, CHAN_VOICE|CHAN_LISTENERZ|CHAN_IMMOBILE, sound, 1, ATTN_STATIC); if (playsound) S_SoundID (pt, CHAN_VOICE|CHAN_LISTENERZ|CHAN_IMMOBILE, sound, 1, ATTN_STATIC);
@ -624,7 +598,7 @@ IMPLEMENT_CLASS (DActiveButton)
DActiveButton::DActiveButton () DActiveButton::DActiveButton ()
{ {
m_Side = NULL; m_Side = NULL;
m_Where = BUTTON_Nowhere; m_Part = -1;
m_SwitchDef = 0; m_SwitchDef = 0;
m_Timer = 0; m_Timer = 0;
m_X = 0; m_X = 0;
@ -632,11 +606,11 @@ DActiveButton::DActiveButton ()
bFlippable = false; bFlippable = false;
} }
DActiveButton::DActiveButton (side_t *side, EWhere where, WORD switchnum, DActiveButton::DActiveButton (side_t *side, int Where, WORD switchnum,
fixed_t x, fixed_t y, bool useagain) fixed_t x, fixed_t y, bool useagain)
{ {
m_Side = side; m_Side = side;
m_Where = where; m_Part = SBYTE(Where);
m_X = x; m_X = x;
m_Y = y; m_Y = y;
bFlippable = useagain; bFlippable = useagain;
@ -655,7 +629,7 @@ void DActiveButton::Serialize (FArchive &arc)
{ {
sidenum = m_Side ? m_Side - sides : -1; sidenum = m_Side ? m_Side - sides : -1;
} }
arc << sidenum << m_Where << m_SwitchDef << m_Frame << m_Timer << bFlippable << m_X << m_Y; arc << sidenum << m_Part << m_SwitchDef << m_Frame << m_Timer << bFlippable << m_X << m_Y;
if (arc.IsLoading ()) if (arc.IsLoading ())
{ {
m_Side = sidenum >= 0 ? sides + sidenum : NULL; m_Side = sidenum >= 0 ? sides + sidenum : NULL;
@ -691,7 +665,7 @@ void DActiveButton::Tick ()
} }
bool killme = AdvanceFrame (); bool killme = AdvanceFrame ();
StoreTexture (def->u.Textures[def->NumFrames*2+m_Frame]); m_Side->SetTexture(m_Part, def->u[m_Frame].Texture);
if (killme) if (killme)
{ {
@ -718,39 +692,19 @@ bool DActiveButton::AdvanceFrame ()
} }
else else
{ {
if (def->u.Times[m_Frame] & 0xffff0000) if (def->u[m_Frame].Time & 0xffff0000)
{ {
int t = pr_switchanim(); int t = pr_switchanim();
m_Timer = (WORD)((((t | (pr_switchanim() << 8)) m_Timer = (WORD)((((t | (pr_switchanim() << 8))
% def->u.Times[m_Frame]) >> 16) % def->u[m_Frame].Time) >> 16)
+ (def->u.Times[m_Frame] & 0xffff)); + (def->u[m_Frame].Time & 0xffff));
} }
else else
{ {
m_Timer = (WORD)def->u.Times[m_Frame]; m_Timer = (WORD)def->u[m_Frame].Time;
} }
} }
return ret; return ret;
} }
void DActiveButton::StoreTexture (short tex) const
{
switch (m_Where)
{
case BUTTON_Middle:
m_Side->midtexture = tex;
break;
case BUTTON_Bottom:
m_Side->bottomtexture = tex;
break;
case BUTTON_Top:
m_Side->toptexture = tex;
break;
default:
return;
}
}

View file

@ -147,12 +147,12 @@ static int WriteSIDEDEFS (FILE *file)
for (int i = 0; i < numsides; ++i) for (int i = 0; i < numsides; ++i)
{ {
msd.textureoffset = LittleShort(short(sides[i].textureoffset >> FRACBITS)); msd.textureoffset = LittleShort(short(sides[i].GetTextureXOffset(side_t::mid) >> FRACBITS));
msd.rowoffset = LittleShort(short(sides[i].rowoffset >> FRACBITS)); msd.rowoffset = LittleShort(short(sides[i].GetTextureYOffset(side_t::mid) >> FRACBITS));
msd.sector = LittleShort(short(sides[i].sector - sectors)); msd.sector = LittleShort(short(sides[i].sector - sectors));
uppercopy (msd.toptexture, GetTextureName (sides[i].toptexture)); uppercopy (msd.toptexture, GetTextureName (sides[i].GetTexture(side_t::top)));
uppercopy (msd.bottomtexture, GetTextureName (sides[i].bottomtexture)); uppercopy (msd.bottomtexture, GetTextureName (sides[i].GetTexture(side_t::bottom)));
uppercopy (msd.midtexture, GetTextureName (sides[i].midtexture)); uppercopy (msd.midtexture, GetTextureName (sides[i].GetTexture(side_t::mid)));
fwrite (&msd, sizeof(msd), 1, file); fwrite (&msd, sizeof(msd), 1, file);
} }
return numsides * sizeof(msd); return numsides * sizeof(msd);

View file

@ -756,8 +756,8 @@ void R_AddLine (seg_t *line)
&& rw_backcz1 <= rw_backfz1 && rw_backcz2 <= rw_backfz2 && rw_backcz1 <= rw_backfz1 && rw_backcz2 <= rw_backfz2
// preserve a kind of transparent door/lift special effect: // preserve a kind of transparent door/lift special effect:
&& ((rw_backcz1 >= rw_frontcz1 && rw_backcz2 >= rw_frontcz2) || line->sidedef->toptexture != 0) && ((rw_backcz1 >= rw_frontcz1 && rw_backcz2 >= rw_frontcz2) || line->sidedef->GetTexture(side_t::top) != 0)
&& ((rw_backfz1 <= rw_frontfz1 && rw_backfz2 <= rw_frontfz2) || line->sidedef->bottomtexture != 0)) && ((rw_backfz1 <= rw_frontfz1 && rw_backfz2 <= rw_frontfz2) || line->sidedef->GetTexture(side_t::bottom) != 0))
{ {
// killough 1/18/98 -- This function is used to fix the automap bug which // killough 1/18/98 -- This function is used to fix the automap bug which
// showed lines behind closed doors simply because the door had a dropoff. // showed lines behind closed doors simply because the door had a dropoff.
@ -779,7 +779,7 @@ void R_AddLine (seg_t *line)
else if (backsector->lightlevel != frontsector->lightlevel else if (backsector->lightlevel != frontsector->lightlevel
|| backsector->floorpic != frontsector->floorpic || backsector->floorpic != frontsector->floorpic
|| backsector->ceilingpic != frontsector->ceilingpic || backsector->ceilingpic != frontsector->ceilingpic
|| curline->sidedef->midtexture != 0 || curline->sidedef->GetTexture(side_t::mid) != 0
// killough 3/7/98: Take flats offsets into account: // killough 3/7/98: Take flats offsets into account:
|| backsector->floor_xoffs != frontsector->floor_xoffs || backsector->floor_xoffs != frontsector->floor_xoffs
@ -834,12 +834,12 @@ void R_AddLine (seg_t *line)
#if 0 // Maybe later... #if 0 // Maybe later...
if (!solid) if (!solid)
{ {
if (rw_ceilstat == 12 && line->sidedef->toptexture != 0) if (rw_ceilstat == 12 && line->sidedef->GetTexture(side_t::top) != 0)
{ {
rw_mustmarkceiling = true; rw_mustmarkceiling = true;
solid = true; solid = true;
} }
if (rw_floorstat == 3 && line->sidedef->bottomtexture != 0) if (rw_floorstat == 3 && line->sidedef->GetTexture(side_t::bottom) != 0)
{ {
rw_mustmarkfloor = true; rw_mustmarkfloor = true;
solid = true; solid = true;

View file

@ -462,9 +462,9 @@ void R_PrecacheLevel (void)
for (i = numsides - 1; i >= 0; i--) for (i = numsides - 1; i >= 0; i--)
{ {
hitlist[sides[i].toptexture] = hitlist[sides[i].GetTexture(side_t::top)] =
hitlist[sides[i].midtexture] = hitlist[sides[i].GetTexture(side_t::mid)] =
hitlist[sides[i].bottomtexture] = 1; hitlist[sides[i].GetTexture(side_t::bottom)] = 1;
} }
// Sky texture is always present. // Sky texture is always present.

View file

@ -36,6 +36,7 @@
struct FLightNode; struct FLightNode;
#include "dthinker.h" #include "dthinker.h"
#include "r_interpolate.h"
@ -83,7 +84,7 @@ struct vertex_s
typedef struct vertex_s vertex_t; typedef struct vertex_s vertex_t;
// Forward of LineDefs, for Sectors. // Forward of LineDefs, for Sectors.
struct line_s; struct line_t;
class player_s; class player_s;
@ -266,12 +267,11 @@ struct FExtraLight
WORD NumUsedLights; WORD NumUsedLights;
FLightStack *Lights; // Lights arranged from top to bottom FLightStack *Lights; // Lights arranged from top to bottom
void InsertLight (const secplane_t &plane, line_s *line, int type); void InsertLight (const secplane_t &plane, line_t *line, int type);
}; };
// this substructure contains a few sector properties that are stored in dynamic arrays // this substructure contains a few sector properties that are stored in dynamic arrays
// These must not be copied by R_FakeFlat etc. or bad things will happen. // These must not be copied by R_FakeFlat etc. or bad things will happen.
struct line_s;
struct sector_t; struct sector_t;
struct FLinkedSector struct FLinkedSector
@ -289,7 +289,7 @@ struct extsector_t
struct plane struct plane
{ {
TArray<sector_t *> AttachedSectors; // all sectors containing 3dMidtex lines attached to this sector TArray<sector_t *> AttachedSectors; // all sectors containing 3dMidtex lines attached to this sector
TArray<line_s *> AttachedLines; // all 3dMidtex lines attached to this sector TArray<line_t *> AttachedLines; // all 3dMidtex lines attached to this sector
} Floor, Ceiling; } Floor, Ceiling;
} Midtex; } Midtex;
@ -396,7 +396,7 @@ struct sector_t
SWORD nextsec; // -1 or number of next step sector SWORD nextsec; // -1 or number of next step sector
short linecount; short linecount;
struct line_s **lines; // [linecount] size struct line_t **lines; // [linecount] size
// killough 3/7/98: support flat heights drawn at another sector's heights // killough 3/7/98: support flat heights drawn at another sector's heights
sector_t *heightsec; // other sector, or NULL if no other sector sector_t *heightsec; // other sector, or NULL if no other sector
@ -432,7 +432,7 @@ struct sector_t
vertex_t *Triangle[3]; // Three points that can define a plane vertex_t *Triangle[3]; // Three points that can define a plane
short oldspecial; //jff 2/16/98 remembers if sector WAS secret (automap) short oldspecial; //jff 2/16/98 remembers if sector WAS secret (automap)
extsector_t * e; extsector_t * e; // This stores data that requires construction/destruction. Such data must not be copied by R_FakeFlat.
float ceiling_reflect, floor_reflect; float ceiling_reflect, floor_reflect;
int sectornum; // for comparing sector copies int sectornum; // for comparing sector copies
@ -461,16 +461,28 @@ enum
WALLF_ABSLIGHTING = 1, // Light is absolute instead of relative WALLF_ABSLIGHTING = 1, // Light is absolute instead of relative
WALLF_NOAUTODECALS = 2, // Do not attach impact decals to this wall WALLF_NOAUTODECALS = 2, // Do not attach impact decals to this wall
WALLF_ADDTRANS = 4, // Use additive instead of normal translucency WALLF_ADDTRANS = 4, // Use additive instead of normal translucency
WALLF_AUTOCONTRAST = 8, // Automatically handle fake contrast in side_s::GetLightLevel WALLF_AUTOCONTRAST = 8, // Automatically handle fake contrast in side_t::GetLightLevel
}; };
struct side_s struct side_t
{ {
fixed_t textureoffset; // add this to the calculated texture column enum ETexpart
fixed_t rowoffset; // add this to the calculated texture top {
top=0,
mid=1,
bottom=2
};
struct part
{
fixed_t xoffset;
fixed_t yoffset;
int texture;
//int Light;
};
sector_t* sector; // Sector the SideDef is facing. sector_t* sector; // Sector the SideDef is facing.
DBaseDecal* AttachedDecals; // [RH] Decals bound to the wall DBaseDecal* AttachedDecals; // [RH] Decals bound to the wall
int toptexture, bottomtexture, midtexture; // texture indices part textures[3];
WORD linenum; WORD linenum;
DWORD LeftSide, RightSide; // [RH] Group walls into loops DWORD LeftSide, RightSide; // [RH] Group walls into loops
WORD TexelLength; WORD TexelLength;
@ -479,11 +491,66 @@ struct side_s
int GetLightLevel (bool foggy, int baselight) const; int GetLightLevel (bool foggy, int baselight) const;
int GetTexture(int which) const
{
return textures[which].texture;
}
void SetTexture(int which, int tex)
{
textures[which].texture = tex;
}
void SetTextureXOffset(int which, fixed_t offset)
{
textures[which].xoffset = offset;
}
void SetTextureXOffset(fixed_t offset)
{
textures[top].xoffset =
textures[mid].xoffset =
textures[bottom].xoffset = offset;
}
fixed_t GetTextureXOffset(int which) const
{
return textures[which].xoffset;
}
void AddTextureXOffset(int which, fixed_t delta)
{
textures[which].xoffset += delta;
}
void SetTextureYOffset(int which, fixed_t offset)
{
textures[which].yoffset = offset;
}
void SetTextureYOffset(fixed_t offset)
{
textures[top].yoffset =
textures[mid].yoffset =
textures[bottom].yoffset = offset;
}
fixed_t GetTextureYOffset(int which) const
{
return textures[which].yoffset;
}
void AddTextureYOffset(int which, fixed_t delta)
{
textures[which].yoffset += delta;
}
void SetInterpolation(int position)
{
setinterpolation(EInterpType(INTERP_WallPanning_Top+position), this);
}
void StopInterpolation(int position)
{
setinterpolation(EInterpType(INTERP_WallPanning_Top+position), this);
}
//For GL //For GL
FLightNode * lighthead[2]; // all blended lights that may affect this wall FLightNode * lighthead[2]; // all blended lights that may affect this wall
}; };
typedef struct side_s side_t;
FArchive &operator<< (FArchive &arc, side_t::part &p);
// //
// Move clipping aid for LineDefs. // Move clipping aid for LineDefs.
@ -497,7 +564,7 @@ enum slopetype_t
}; };
struct line_s struct line_t
{ {
vertex_t *v1, *v2; // vertices, from v1 to v2 vertex_t *v1, *v2; // vertices, from v1 to v2
fixed_t dx, dy; // precalculated v2 - v1 for side checking fixed_t dx, dy; // precalculated v2 - v1 for side checking
@ -507,14 +574,13 @@ struct line_s
short id; // <--- same as tag or set with Line_SetIdentification short id; // <--- same as tag or set with Line_SetIdentification
int args[5]; // <--- hexen-style arguments (expanded to ZDoom's full width) int args[5]; // <--- hexen-style arguments (expanded to ZDoom's full width)
int firstid, nextid; int firstid, nextid;
DWORD sidenum[2]; // sidenum[1] will be 0xffffffff if one sided DWORD sidenum[2]; // sidenum[1] will be NO_SIDE if one sided
fixed_t bbox[4]; // bounding box, for the extent of the LineDef. fixed_t bbox[4]; // bounding box, for the extent of the LineDef.
slopetype_t slopetype; // To aid move clipping. slopetype_t slopetype; // To aid move clipping.
sector_t *frontsector, *backsector; sector_t *frontsector, *backsector;
int validcount; // if == validcount, already checked int validcount; // if == validcount, already checked
}; };
typedef struct line_s line_t;
// phares 3/14/98 // phares 3/14/98
// //

64
src/r_interpolate.h Normal file
View file

@ -0,0 +1,64 @@
#ifndef R_INTERPOLATE_H
#define R_INTERPOLATE_H
#include "doomtype.h"
// BUILD stuff for interpolating between frames, but modified (rather a lot)
#define INTERPOLATION_BUCKETS 107
class FArchive;
enum EInterpType
{
INTERP_SectorFloor, // Pass a sector_t *
INTERP_SectorCeiling, // Pass a sector_t *
INTERP_Vertex, // Pass a vertex_t *
INTERP_FloorPanning, // Pass a sector_t *
INTERP_CeilingPanning, // Pass a sector_t *
INTERP_WallPanning_Top, // Pass a side_t *
INTERP_WallPanning_Mid,
INTERP_WallPanning_Bottom,
};
struct FActiveInterpolation
{
FActiveInterpolation *Next;
void *Address;
EInterpType Type;
friend FArchive &operator << (FArchive &arc, FActiveInterpolation *&interp);
static int CountInterpolations ();
static int CountInterpolations (int *usedbuckets, int *minbucketfill, int *maxbucketfill);
private:
fixed_t oldipos[2], bakipos[2];
void CopyInterpToOld();
void CopyBakToInterp();
void DoAnInterpolation(fixed_t smoothratio);
static size_t HashKey(EInterpType type, void *interptr);
static FActiveInterpolation *FindInterpolation(EInterpType, void *interptr, FActiveInterpolation **&interp_p);
friend void updateinterpolations();
friend void setinterpolation(EInterpType, void *interptr, bool dolinks);
friend void stopinterpolation(EInterpType, void *interptr, bool dolinks);
friend void dointerpolations(fixed_t smoothratio);
friend void restoreinterpolations();
friend void clearinterpolations();
friend void SerializeInterpolations(FArchive &arc);
static FActiveInterpolation *curiposhash[INTERPOLATION_BUCKETS];
};
void updateinterpolations();
void setinterpolation(EInterpType, void *interptr, bool dolinks = true);
void stopinterpolation(EInterpType, void *interptr, bool dolinks = true);
void dointerpolations(fixed_t smoothratio);
void restoreinterpolations();
void clearinterpolations();
void SerializeInterpolations(FArchive &arc);
#endif

View file

@ -1874,9 +1874,11 @@ void FActiveInterpolation::CopyInterpToOld ()
oldipos[0] = ((sector_t*)Address)->ceiling_xoffs; oldipos[0] = ((sector_t*)Address)->ceiling_xoffs;
oldipos[1] = ((sector_t*)Address)->ceiling_yoffs; oldipos[1] = ((sector_t*)Address)->ceiling_yoffs;
break; break;
case INTERP_WallPanning: case INTERP_WallPanning_Top:
oldipos[0] = ((side_t*)Address)->rowoffset; case INTERP_WallPanning_Mid:
oldipos[1] = ((side_t*)Address)->textureoffset; case INTERP_WallPanning_Bottom:
oldipos[0] = ((side_t*)Address)->GetTextureYOffset(Type - INTERP_WallPanning_Top);
oldipos[1] = ((side_t*)Address)->GetTextureXOffset(Type - INTERP_WallPanning_Top);
break; break;
} }
} }
@ -1888,12 +1890,10 @@ void FActiveInterpolation::CopyBakToInterp ()
case INTERP_SectorFloor: case INTERP_SectorFloor:
((sector_t*)Address)->floorplane.d = bakipos[0]; ((sector_t*)Address)->floorplane.d = bakipos[0];
((sector_t*)Address)->floortexz = bakipos[1]; ((sector_t*)Address)->floortexz = bakipos[1];
P_RecalculateAttached3DFloors((sector_t*)Address);
break; break;
case INTERP_SectorCeiling: case INTERP_SectorCeiling:
((sector_t*)Address)->ceilingplane.d = bakipos[0]; ((sector_t*)Address)->ceilingplane.d = bakipos[0];
((sector_t*)Address)->ceilingtexz = bakipos[1]; ((sector_t*)Address)->ceilingtexz = bakipos[1];
P_RecalculateAttached3DFloors((sector_t*)Address);
break; break;
case INTERP_Vertex: case INTERP_Vertex:
((vertex_t*)Address)->x = bakipos[0]; ((vertex_t*)Address)->x = bakipos[0];
@ -1907,9 +1907,11 @@ void FActiveInterpolation::CopyBakToInterp ()
((sector_t*)Address)->ceiling_xoffs = bakipos[0]; ((sector_t*)Address)->ceiling_xoffs = bakipos[0];
((sector_t*)Address)->ceiling_yoffs = bakipos[1]; ((sector_t*)Address)->ceiling_yoffs = bakipos[1];
break; break;
case INTERP_WallPanning: case INTERP_WallPanning_Top:
((side_t*)Address)->rowoffset = bakipos[0]; case INTERP_WallPanning_Mid:
((side_t*)Address)->textureoffset = bakipos[1]; case INTERP_WallPanning_Bottom:
((side_t*)Address)->SetTextureYOffset(Type - INTERP_WallPanning_Top, bakipos[0]);
((side_t*)Address)->SetTextureXOffset(Type - INTERP_WallPanning_Top, bakipos[1]);
break; break;
} }
} }
@ -1917,19 +1919,17 @@ void FActiveInterpolation::CopyBakToInterp ()
void FActiveInterpolation::DoAnInterpolation (fixed_t smoothratio) void FActiveInterpolation::DoAnInterpolation (fixed_t smoothratio)
{ {
fixed_t *adr1, *adr2, pos; fixed_t *adr1, *adr2, pos;
bool recalc=false; int v1, v2;
switch (Type) switch (Type)
{ {
case INTERP_SectorFloor: case INTERP_SectorFloor:
adr1 = &((sector_t*)Address)->floorplane.d; adr1 = &((sector_t*)Address)->floorplane.d;
adr2 = &((sector_t*)Address)->floortexz; adr2 = &((sector_t*)Address)->floortexz;
recalc=true;
break; break;
case INTERP_SectorCeiling: case INTERP_SectorCeiling:
adr1 = &((sector_t*)Address)->ceilingplane.d; adr1 = &((sector_t*)Address)->ceilingplane.d;
adr2 = &((sector_t*)Address)->ceilingtexz; adr2 = &((sector_t*)Address)->ceilingtexz;
recalc=true;
break; break;
case INTERP_Vertex: case INTERP_Vertex:
adr1 = &((vertex_t*)Address)->x; adr1 = &((vertex_t*)Address)->x;
@ -1943,9 +1943,13 @@ void FActiveInterpolation::DoAnInterpolation (fixed_t smoothratio)
adr1 = &((sector_t*)Address)->ceiling_xoffs; adr1 = &((sector_t*)Address)->ceiling_xoffs;
adr2 = &((sector_t*)Address)->ceiling_yoffs; adr2 = &((sector_t*)Address)->ceiling_yoffs;
break; break;
case INTERP_WallPanning: case INTERP_WallPanning_Top:
adr1 = &((side_t*)Address)->rowoffset; case INTERP_WallPanning_Mid:
adr2 = &((side_t*)Address)->textureoffset; case INTERP_WallPanning_Bottom:
v1 = ((side_t*)Address)->GetTextureYOffset(Type - INTERP_WallPanning_Top);
v2 = ((side_t*)Address)->GetTextureXOffset(Type - INTERP_WallPanning_Top);
adr1 = &v1;
adr2 = &v2;
break; break;
default: default:
return; return;
@ -1957,7 +1961,18 @@ void FActiveInterpolation::DoAnInterpolation (fixed_t smoothratio)
pos = bakipos[1] = *adr2; pos = bakipos[1] = *adr2;
*adr2 = oldipos[1] + FixedMul (pos - oldipos[1], smoothratio); *adr2 = oldipos[1] + FixedMul (pos - oldipos[1], smoothratio);
if (recalc) P_RecalculateAttached3DFloors((sector_t*)Address); switch (Type)
{
case INTERP_WallPanning_Top:
case INTERP_WallPanning_Mid:
case INTERP_WallPanning_Bottom:
((side_t*)Address)->SetTextureYOffset(Type - INTERP_WallPanning_Top, v1);
((side_t*)Address)->SetTextureXOffset(Type - INTERP_WallPanning_Top, v2);
break;
default:
return;
}
} }
size_t FActiveInterpolation::HashKey (EInterpType type, void *interptr) size_t FActiveInterpolation::HashKey (EInterpType type, void *interptr)
@ -2200,7 +2215,10 @@ FArchive &operator << (FArchive &arc, FActiveInterpolation *&interp)
switch (type) switch (type)
{ {
case INTERP_Vertex: arc << ptr.vert; break; case INTERP_Vertex: arc << ptr.vert; break;
case INTERP_WallPanning: arc << ptr.side; break; case INTERP_WallPanning_Top:
case INTERP_WallPanning_Mid:
case INTERP_WallPanning_Bottom:
arc << ptr.side; break;
default: arc << ptr.sect; break; default: arc << ptr.sect; break;
} }
} }
@ -2212,7 +2230,10 @@ FArchive &operator << (FArchive &arc, FActiveInterpolation *&interp)
switch (type) switch (type)
{ {
case INTERP_Vertex: arc << ptr.vert; break; case INTERP_Vertex: arc << ptr.vert; break;
case INTERP_WallPanning: arc << ptr.side; break; case INTERP_WallPanning_Top:
case INTERP_WallPanning_Mid:
case INTERP_WallPanning_Bottom:
arc << ptr.side; break;
default: arc << ptr.sect; break; default: arc << ptr.sect; break;
} }
interp->Address = ptr.ptr; interp->Address = ptr.ptr;

View file

@ -207,58 +207,6 @@ void R_SetViewSize (int blocks);
// [RH] Initialize multires stuff for renderer // [RH] Initialize multires stuff for renderer
void R_MultiresInit (void); void R_MultiresInit (void);
// BUILD stuff for interpolating between frames, but modified (rather a lot)
#define INTERPOLATION_BUCKETS 107
enum EInterpType
{
INTERP_SectorFloor, // Pass a sector_t *
INTERP_SectorCeiling, // Pass a sector_t *
INTERP_Vertex, // Pass a vertex_t *
INTERP_FloorPanning, // Pass a sector_t *
INTERP_CeilingPanning, // Pass a sector_t *
INTERP_WallPanning, // Pass a side_t *
};
struct FActiveInterpolation
{
FActiveInterpolation *Next;
void *Address;
EInterpType Type;
friend FArchive &operator << (FArchive &arc, FActiveInterpolation *&interp);
static int CountInterpolations ();
static int CountInterpolations (int *usedbuckets, int *minbucketfill, int *maxbucketfill);
private:
fixed_t oldipos[2], bakipos[2];
void CopyInterpToOld();
void CopyBakToInterp();
void DoAnInterpolation(fixed_t smoothratio);
static size_t HashKey(EInterpType type, void *interptr);
static FActiveInterpolation *FindInterpolation(EInterpType, void *interptr, FActiveInterpolation **&interp_p);
friend void updateinterpolations();
friend void setinterpolation(EInterpType, void *interptr, bool dolinks);
friend void stopinterpolation(EInterpType, void *interptr, bool dolinks);
friend void dointerpolations(fixed_t smoothratio);
friend void restoreinterpolations();
friend void clearinterpolations();
friend void SerializeInterpolations(FArchive &arc);
static FActiveInterpolation *curiposhash[INTERPOLATION_BUCKETS];
};
void updateinterpolations();
void setinterpolation(EInterpType, void *interptr, bool dolinks = true);
void stopinterpolation(EInterpType, void *interptr, bool dolinks = true);
void dointerpolations(fixed_t smoothratio);
void restoreinterpolations();
void clearinterpolations();
void SerializeInterpolations(FArchive &arc);
extern void R_FreePastViewers (); extern void R_FreePastViewers ();
extern void R_ClearPastViewer (AActor *actor); extern void R_ClearPastViewer (AActor *actor);

View file

@ -1276,17 +1276,20 @@ sky1:
// Sky transferred from first sidedef // Sky transferred from first sidedef
const side_t *s = *l->sidenum + sides; const side_t *s = *l->sidenum + sides;
int pos;
// Texture comes from upper texture of reference sidedef // Texture comes from upper texture of reference sidedef
// [RH] If swapping skies, then use the lower sidedef // [RH] If swapping skies, then use the lower sidedef
if (level.flags & LEVEL_SWAPSKIES && s->bottomtexture != 0) if (level.flags & LEVEL_SWAPSKIES && s->GetTexture(side_t::bottom) != 0)
{ {
frontskytex = TexMan(s->bottomtexture); pos = side_t::bottom;
} }
else else
{ {
frontskytex = TexMan(s->toptexture); pos = side_t::top;
} }
frontskytex = TexMan(s->GetTexture(pos));
if (frontskytex->UseType == FTexture::TEX_Null) if (frontskytex->UseType == FTexture::TEX_Null)
{ // [RH] The blank texture: Use normal sky instead. { // [RH] The blank texture: Use normal sky instead.
goto sky1; goto sky1;
@ -1297,10 +1300,10 @@ sky1:
// to allow sky rotation as well as careful positioning. // to allow sky rotation as well as careful positioning.
// However, the offset is scaled very small, so that it // However, the offset is scaled very small, so that it
// allows a long-period of sky rotation. // allows a long-period of sky rotation.
frontpos = (-s->textureoffset) >> 6; frontpos = (-s->GetTextureXOffset(pos)) >> 6;
// Vertical offset allows careful sky positioning. // Vertical offset allows careful sky positioning.
dc_texturemid = s->rowoffset - 28*FRACUNIT; dc_texturemid = s->GetTextureYOffset(pos) - 28*FRACUNIT;
// We sometimes flip the picture horizontally. // We sometimes flip the picture horizontally.
// //

View file

@ -1275,7 +1275,7 @@ void RP_AddLine (seg_t *line)
// preserve a kind of transparent door/lift special effect: // preserve a kind of transparent door/lift special effect:
&& bcz0 >= fcz0 && bcz1 >= fcz1 && bcz0 >= fcz0 && bcz1 >= fcz1
&& ((bfz0 <= ffz0 && bfz1 <= ffz1) || line->sidedef->bottomtexture != 0)) && ((bfz0 <= ffz0 && bfz1 <= ffz1) || line->sidedef->GetTexture(side_t::bottom) != 0))
{ {
// killough 1/18/98 -- This function is used to fix the automap bug which // killough 1/18/98 -- This function is used to fix the automap bug which
// showed lines behind closed doors simply because the door had a dropoff. // showed lines behind closed doors simply because the door had a dropoff.
@ -1297,7 +1297,7 @@ void RP_AddLine (seg_t *line)
else if (backsector->lightlevel != frontsector->lightlevel else if (backsector->lightlevel != frontsector->lightlevel
|| backsector->floorpic != frontsector->floorpic || backsector->floorpic != frontsector->floorpic
|| backsector->ceilingpic != frontsector->ceilingpic || backsector->ceilingpic != frontsector->ceilingpic
|| curline->sidedef->midtexture != 0 || curline->sidedef->GetTexture(side_t::mid) != 0
// killough 3/7/98: Take flats offsets into account: // killough 3/7/98: Take flats offsets into account:
|| backsector->floor_xoffs != frontsector->floor_xoffs || backsector->floor_xoffs != frontsector->floor_xoffs
@ -1342,7 +1342,8 @@ void RP_AddLine (seg_t *line)
markceiling = markfloor = true; markceiling = markfloor = true;
} }
rw_offset = line->sidedef->textureoffset; // must be fixed in case the polymost renderer ever gets developed further!
rw_offset = line->sidedef->GetTextureXOffset(side_t::mid);
R_NewWall (false); R_NewWall (false);
if (rw_markmirror) if (rw_markmirror)

View file

@ -71,6 +71,9 @@ bool markceiling;
FTexture *toptexture; FTexture *toptexture;
FTexture *bottomtexture; FTexture *bottomtexture;
FTexture *midtexture; FTexture *midtexture;
fixed_t rw_offset_top;
fixed_t rw_offset_mid;
fixed_t rw_offset_bottom;
int OWallMost (short *mostbuf, fixed_t z); int OWallMost (short *mostbuf, fixed_t z);
int WallMost (short *mostbuf, const secplane_t &plane); int WallMost (short *mostbuf, const secplane_t &plane);
@ -219,7 +222,7 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
frontsector = curline->frontsector; frontsector = curline->frontsector;
backsector = curline->backsector; backsector = curline->backsector;
tex = TexMan(curline->sidedef->midtexture); tex = TexMan(curline->sidedef->GetTexture(side_t::mid));
// killough 4/13/98: get correct lightlevel for 2s normal textures // killough 4/13/98: get correct lightlevel for 2s normal textures
const sector_t *sec = R_FakeFlat (frontsector, &tempsec, NULL, NULL, false); const sector_t *sec = R_FakeFlat (frontsector, &tempsec, NULL, NULL, false);
@ -259,11 +262,13 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
{ {
dc_texturemid = MIN (frontsector->ceilingtexz, backsector->ceilingtexz); dc_texturemid = MIN (frontsector->ceilingtexz, backsector->ceilingtexz);
} }
fixed_t rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid);
if (tex->bWorldPanning) if (tex->bWorldPanning)
{ {
// rowoffset is added before the MulScale3 so that the masked texture will // rowoffset is added before the MulScale3 so that the masked texture will
// still be positioned in world units rather than texels. // still be positioned in world units rather than texels.
dc_texturemid += curline->sidedef->rowoffset - viewz; dc_texturemid += rowoffset - viewz;
textop = dc_texturemid; textop = dc_texturemid;
dc_texturemid = MulScale16 (dc_texturemid, tex->yScale); dc_texturemid = MulScale16 (dc_texturemid, tex->yScale);
} }
@ -271,8 +276,8 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
{ {
// rowoffset is added outside the multiply so that it positions the texture // rowoffset is added outside the multiply so that it positions the texture
// by texels instead of world units. // by texels instead of world units.
textop = dc_texturemid - viewz + SafeDivScale16 (curline->sidedef->rowoffset, tex->yScale); textop = dc_texturemid - viewz + SafeDivScale16 (rowoffset, tex->yScale);
dc_texturemid = MulScale16 (dc_texturemid - viewz, tex->yScale) + curline->sidedef->rowoffset; dc_texturemid = MulScale16 (dc_texturemid - viewz, tex->yScale) + rowoffset;
} }
if (fixedlightlev) if (fixedlightlev)
@ -1058,7 +1063,11 @@ void R_RenderSegLoop ()
} }
if (midtexture->bWorldPanning) if (midtexture->bWorldPanning)
{ {
rw_offset = MulScale16 (xoffset, midtexture->xScale); rw_offset = MulScale16 (rw_offset_mid, midtexture->xScale);
}
else
{
rw_offset = rw_offset_mid;
} }
if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights) if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights)
{ {
@ -1092,7 +1101,11 @@ void R_RenderSegLoop ()
} }
if (toptexture->bWorldPanning) if (toptexture->bWorldPanning)
{ {
rw_offset = MulScale16 (xoffset, toptexture->xScale); rw_offset = MulScale16 (rw_offset_top, toptexture->xScale);
}
else
{
rw_offset = rw_offset_top;
} }
if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights) if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights)
{ {
@ -1129,11 +1142,11 @@ void R_RenderSegLoop ()
} }
if (bottomtexture->bWorldPanning) if (bottomtexture->bWorldPanning)
{ {
rw_offset = MulScale16 (xoffset, bottomtexture->xScale); rw_offset = MulScale16 (rw_offset_bottom, bottomtexture->xScale);
} }
else else
{ {
rw_offset = xoffset; rw_offset = rw_offset_bottom;
} }
if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights) if (fixedlightlev || fixedcolormap || !frontsector->ExtraLights)
{ {
@ -1179,8 +1192,9 @@ void R_NewWall (bool needlights)
// [RH] Horizon lines do not need to be textured // [RH] Horizon lines do not need to be textured
if (linedef->special != Line_Horizon) if (linedef->special != Line_Horizon)
{ {
midtexture = TexMan(sidedef->midtexture); midtexture = TexMan(sidedef->GetTexture(side_t::mid));
rowoffset = sidedef->rowoffset; rw_offset_mid = sidedef->GetTextureXOffset(side_t::mid);
rowoffset = sidedef->GetTextureYOffset(side_t::mid);
if (linedef->flags & ML_DONTPEGBOTTOM) if (linedef->flags & ML_DONTPEGBOTTOM)
{ // bottom of texture at bottom { // bottom of texture at bottom
rw_midtexturemid = frontsector->floortexz + (midtexture->GetHeight() << FRACBITS); rw_midtexturemid = frontsector->floortexz + (midtexture->GetHeight() << FRACBITS);
@ -1271,7 +1285,7 @@ void R_NewWall (bool needlights)
|| (backsector->floor_angle + backsector->base_floor_angle) != (frontsector->floor_angle + frontsector->base_floor_angle) || (backsector->floor_angle + backsector->base_floor_angle) != (frontsector->floor_angle + frontsector->base_floor_angle)
|| (sidedef->midtexture && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX)) || (sidedef->GetTexture(side_t::mid) && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX))
; ;
markceiling = (frontsector->ceilingpic != skyflatnum || markceiling = (frontsector->ceilingpic != skyflatnum ||
@ -1300,16 +1314,17 @@ void R_NewWall (bool needlights)
|| (backsector->ceiling_angle + backsector->base_ceiling_angle) != (frontsector->ceiling_angle + frontsector->base_ceiling_angle) || (backsector->ceiling_angle + backsector->base_ceiling_angle) != (frontsector->ceiling_angle + frontsector->base_ceiling_angle)
|| (sidedef->midtexture && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX)) || (sidedef->GetTexture(side_t::mid) && linedef->flags & (ML_CLIP_MIDTEX|ML_WRAP_MIDTEX))
); );
} }
if (rw_havehigh) if (rw_havehigh)
{ // top texture { // top texture
toptexture = TexMan(sidedef->toptexture); toptexture = TexMan(sidedef->GetTexture(side_t::top));
const fixed_t scale = toptexture->yScale; const fixed_t scale = toptexture->yScale;
rowoffset = sidedef->rowoffset; rw_offset_top = sidedef->GetTextureXOffset(side_t::top);
rowoffset = sidedef->GetTextureYOffset(side_t::top);
if (linedef->flags & ML_DONTPEGTOP) if (linedef->flags & ML_DONTPEGTOP)
{ // top of texture at top { // top of texture at top
rw_toptexturemid = MulScale16 (frontsector->ceilingtexz - viewz, scale); rw_toptexturemid = MulScale16 (frontsector->ceilingtexz - viewz, scale);
@ -1333,9 +1348,10 @@ void R_NewWall (bool needlights)
} }
if (rw_havelow) if (rw_havelow)
{ // bottom texture { // bottom texture
bottomtexture = TexMan(sidedef->bottomtexture); bottomtexture = TexMan(sidedef->GetTexture(side_t::bottom));
rowoffset = sidedef->rowoffset; rw_offset_bottom = sidedef->GetTextureXOffset(side_t::bottom);
rowoffset = sidedef->GetTextureYOffset(side_t::bottom);
if (linedef->flags & ML_DONTPEGBOTTOM) if (linedef->flags & ML_DONTPEGBOTTOM)
{ // bottom of texture at bottom { // bottom of texture at bottom
rw_bottomtexturemid = rw_frontlowertop; rw_bottomtexturemid = rw_frontlowertop;
@ -1375,12 +1391,14 @@ void R_NewWall (bool needlights)
markceiling = false; markceiling = false;
} }
segtextured = TexMan(sidedef->midtexture) != NULL || toptexture != NULL || bottomtexture != NULL; FTexture *midtex = TexMan(sidedef->GetTexture(side_t::mid));
segtextured = midtex != NULL || toptexture != NULL || bottomtexture != NULL;
// calculate light table // calculate light table
if (needlights && (segtextured || (backsector && IsFogBoundary (frontsector, backsector)))) if (needlights && (segtextured || (backsector && IsFogBoundary (frontsector, backsector))))
{ {
lwallscale = TexMan(sidedef->midtexture) ? TexMan(sidedef->midtexture)->xScale : lwallscale = midtex ? midtex->xScale :
toptexture ? toptexture->xScale : toptexture ? toptexture->xScale :
bottomtexture ? bottomtexture->xScale : FRACUNIT; bottomtexture ? bottomtexture->xScale : FRACUNIT;
@ -1402,7 +1420,7 @@ void R_NewWall (bool needlights)
} }
} }
int side_s::GetLightLevel (bool foggy, int baselight) const int side_t::GetLightLevel (bool foggy, int baselight) const
{ {
// [RH] Get wall light level // [RH] Get wall light level
if (this->Flags & WALLF_ABSLIGHTING && (!(this->Flags & WALLF_AUTOCONTRAST) || foggy)) if (this->Flags & WALLF_ABSLIGHTING && (!(this->Flags & WALLF_AUTOCONTRAST) || foggy))
@ -1431,6 +1449,24 @@ int side_s::GetLightLevel (bool foggy, int baselight) const
} }
} }
FArchive &operator<< (FArchive &arc, side_t::part &p)
{
arc << p.xoffset << p.yoffset;// << p.Light;
if (arc.IsStoring())
{
if (arc.IsStoring ())
{
TexMan.WriteTexture (arc, p.texture);
}
else
{
p.texture = TexMan.ReadTexture (arc);
}
}
return arc;
}
// //
// R_CheckDrawSegs // R_CheckDrawSegs
@ -1491,7 +1527,7 @@ void R_StoreWallRange (int start, int stop)
R_NewWall (true); R_NewWall (true);
} }
rw_offset = sidedef->textureoffset; rw_offset = sidedef->GetTextureXOffset(side_t::mid);
rw_light = rw_lightleft + rw_lightstep * (start - WallSX1); rw_light = rw_lightleft + rw_lightstep * (start - WallSX1);
ds_p->sx1 = WallSX1; ds_p->sx1 = WallSX1;
@ -1568,9 +1604,9 @@ void R_StoreWallRange (int start, int stop)
// allocate space for masked texture tables, if needed // allocate space for masked texture tables, if needed
// [RH] Don't just allocate the space; fill it in too. // [RH] Don't just allocate the space; fill it in too.
if ((TexMan(sidedef->midtexture)->UseType != FTexture::TEX_Null || IsFogBoundary (frontsector, backsector)) && if ((TexMan(sidedef->GetTexture(side_t::mid))->UseType != FTexture::TEX_Null || IsFogBoundary (frontsector, backsector)) &&
(rw_ceilstat != 12 || sidedef->toptexture == 0) && (rw_ceilstat != 12 || sidedef->GetTexture(side_t::top) == 0) &&
(rw_floorstat != 3 || sidedef->bottomtexture == 0) && (rw_floorstat != 3 || sidedef->GetTexture(side_t::bottom) == 0) &&
(WallSZ1 >= TOO_CLOSE_Z && WallSZ2 >= TOO_CLOSE_Z)) (WallSZ1 >= TOO_CLOSE_Z && WallSZ2 >= TOO_CLOSE_Z))
{ {
fixed_t *swal; fixed_t *swal;
@ -1580,15 +1616,15 @@ void R_StoreWallRange (int start, int stop)
maskedtexture = true; maskedtexture = true;
ds_p->bFogBoundary = IsFogBoundary (frontsector, backsector); ds_p->bFogBoundary = IsFogBoundary (frontsector, backsector);
if (sidedef->midtexture != 0) if (sidedef->GetTexture(side_t::mid) != 0)
{ {
ds_p->maskedtexturecol = R_NewOpening ((stop - start) * 2); ds_p->maskedtexturecol = R_NewOpening ((stop - start) * 2);
ds_p->swall = R_NewOpening ((stop - start) * 2); ds_p->swall = R_NewOpening ((stop - start) * 2);
lwal = (fixed_t *)(openings + ds_p->maskedtexturecol); lwal = (fixed_t *)(openings + ds_p->maskedtexturecol);
swal = (fixed_t *)(openings + ds_p->swall); swal = (fixed_t *)(openings + ds_p->swall);
int scaley = TexMan(sidedef->midtexture)->yScale; int scaley = TexMan(sidedef->GetTexture(side_t::mid))->yScale;
int xoffset = rw_offset; int xoffset = sidedef->GetTextureXOffset(side_t::mid);
for (i = start; i < stop; i++) for (i = start; i < stop; i++)
{ {
*lwal++ = lwall[i] + xoffset; *lwal++ = lwall[i] + xoffset;
@ -1667,7 +1703,7 @@ void R_StoreWallRange (int start, int stop)
memcpy (openings + ds_p->sprbottomclip, &floorclip[start], sizeof(short)*(stop-start)); memcpy (openings + ds_p->sprbottomclip, &floorclip[start], sizeof(short)*(stop-start));
} }
if (maskedtexture && curline->sidedef->midtexture != 0) if (maskedtexture && curline->sidedef->GetTexture(side_t::mid) != 0)
{ {
ds_p->silhouette |= SIL_TOP | SIL_BOTTOM; ds_p->silhouette |= SIL_TOP | SIL_BOTTOM;
} }

View file

@ -1858,9 +1858,9 @@ void AAmbientSound::Activate (AActor *activator)
if (!bActive) if (!bActive)
{ {
if (!(amb->type & 3) && !amb->periodmin) if ((amb->type & 3) == 0 && amb->periodmin == 0)
{ {
int sndnum = S_FindSound (amb->sound); int sndnum = S_FindSound(amb->sound);
if (sndnum == 0) if (sndnum == 0)
{ {
Destroy (); Destroy ();

View file

@ -62,8 +62,7 @@
#define O_BINARY 0 #define O_BINARY 0
#endif #endif
#define SELECT_ATTEN(a) ((a)==ATTN_NONE ? 0 : (a)==ATTN_SURROUND ? -1 : \ #define SELECT_ATTEN(a) ((a)==ATTN_NONE ? 0 : (a)==ATTN_STATIC ? 3 : 1)
(a)==ATTN_STATIC ? 3 : 1)
#ifndef FIXED2FLOAT #ifndef FIXED2FLOAT
#define FIXED2FLOAT(f) (((float)(f))/(float)65536) #define FIXED2FLOAT(f) (((float)(f))/(float)65536)
#endif #endif

View file

@ -127,7 +127,6 @@ void S_LoopedSoundID (fixed_t *pt, int channel, int sfxid, float volume, int att
#define ATTN_NORM 1 #define ATTN_NORM 1
#define ATTN_IDLE 2 #define ATTN_IDLE 2
#define ATTN_STATIC 3 // diminish very rapidly with distance #define ATTN_STATIC 3 // diminish very rapidly with distance
#define ATTN_SURROUND 4 // like ATTN_NONE, but plays in surround sound
int S_PickReplacement (int refid); int S_PickReplacement (int refid);
void S_CacheRandomSound (sfxinfo_t *sfx); void S_CacheRandomSound (sfxinfo_t *sfx);

View file

@ -3,5 +3,5 @@
// This file was automatically generated by the // This file was automatically generated by the
// updaterevision tool. Do not edit by hand. // updaterevision tool. Do not edit by hand.
#define ZD_SVN_REVISION_STRING "825" #define ZD_SVN_REVISION_STRING "832"
#define ZD_SVN_REVISION_NUMBER 825 #define ZD_SVN_REVISION_NUMBER 832

View file

@ -319,11 +319,11 @@ void A_PlaySoundEx (AActor *self)
int attenuation; int attenuation;
switch (attenuation_raw) switch (attenuation_raw)
{ {
case -1: attenuation=ATTN_STATIC; break; // drop off rapidly case -1: attenuation = ATTN_STATIC; break; // drop off rapidly
default: default:
case 0: attenuation=ATTN_NORM; break; // normal case 0: attenuation = ATTN_NORM; break; // normal
case 1: attenuation=ATTN_NONE; break; // full volume case 1:
case 2: attenuation=ATTN_SURROUND; break; // full volume surround case 2: attenuation = ATTN_NONE; break; // full volume
} }
if (channel < NAME_Auto || channel > NAME_SoundSlot7) if (channel < NAME_Auto || channel > NAME_SoundSlot7)

View file

@ -77,7 +77,7 @@
// SAVESIG should match SAVEVER. // SAVESIG should match SAVEVER.
// MINSAVEVER is the minimum level snapshot version that can be loaded. // MINSAVEVER is the minimum level snapshot version that can be loaded.
#define MINSAVEVER 825 #define MINSAVEVER 832
#if SVN_REVISION_NUMBER < MINSAVEVER #if SVN_REVISION_NUMBER < MINSAVEVER
// Never write a savegame with a version lower than what we need // Never write a savegame with a version lower than what we need

View file

@ -1,4 +1,4 @@
#include "gl/gl_pch.h" #include "gl/gl_include.h"
#include "win32iface.h" #include "win32iface.h"
#include "win32gliface.h" #include "win32gliface.h"

View file

@ -1,5 +1,4 @@
MAKEWAD=../tools/makewad/makewad MAKEWAD=../tools/makewad/makewad
XLATCC=../tools/xlatcc/xlatcc
DEHSUPP=../tools/dehsupp/dehsupp DEHSUPP=../tools/dehsupp/dehsupp
ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),clean)
@ -9,14 +8,14 @@ ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
export OSTYPE=msys export OSTYPE=msys
endif endif
wadmake: zdoom.lst $(MAKEWAD).exe $(XLATCC).exe $(DEHSUPP).exe wadmake: zdoom.lst $(MAKEWAD).exe $(DEHSUPP).exe
$(MAKEWAD) -make wadmake zdoom.lst $(MAKEWAD) -make wadmake zdoom.lst
clean: clean:
ifeq ($(OSTYPE),msys) ifeq ($(OSTYPE),msys)
rm -f wadmake zdoom.pk3 xlat/*.x dehsupp.lmp rm -f wadmake zdoom.pk3 dehsupp.lmp
else else
del /q /f wadmake zdoom.pk3 xlat\*.x dehsupp.lmp 2>nul del /q /f wadmake zdoom.pk3 dehsupp.lmp 2>nul
endif endif
../tools/makewad/makewad.exe: ../tools/makewad/makewad.exe:

View file

@ -1,4 +1,4 @@
include "xlat/doomxlat.txt" include "xlat/doom.txt"
7 = USE, Stairs_BuildUpDoom (tag, F_SLOW, 8) 7 = USE, Stairs_BuildUpDoom (tag, F_SLOW, 8)
8 = WALK, Stairs_BuildUpDoom (tag, F_SLOW, 8) 8 = WALK, Stairs_BuildUpDoom (tag, F_SLOW, 8)