Remove win32 backend-specific files

This commit is contained in:
Eidolon 2022-07-17 19:34:19 -05:00
parent 8e398504f5
commit 5dac920ea4
20 changed files with 0 additions and 15620 deletions

View file

@ -1,13 +0,0 @@
file(GLOB SRB2_WIN_SOURCES *.c *.h *.rc)
add_executable(SRB2DD EXCLUDE_FROM_ALL WIN32
${SRB2_WIN_SOURCES}
)
target_compile_definitions(SRB2DD PRIVATE
-D_WINDOWS
)
set_target_properties(SRB2DD PROPERTIES OUTPUT_NAME ${SRB2_WIN_EXE_NAME})
target_link_libraries(SRB2DD PRIVATE SRB2Core)

View file

@ -1,479 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>Srb2DD</ProjectName>
<ProjectGuid>{0F554F1D-ED49-4D65-A9A7-F63C57F277BE}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Srb2win</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<PlatformToolset>v140</PlatformToolset>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
<Import Project="..\..\SRB2_common.props" />
<Import Project="..\..\comptime.props" />
<Import Project="..\..\libs\FMOD.props" />
<Import Project="..\..\libs\zlib.props" />
<Import Project="..\..\libs\libpng.props" />
<Import Project="..\..\libs\libgme.props" />
<Import Project="SRB2Win.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\SRB2_Debug.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\SRB2_Debug.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\SRB2_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\SRB2_Release.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\SRB2_Debug.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\SRB2_Debug.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\SRB2_Release.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\SRB2_Release.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Link>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<AdditionalDependencies>gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ClCompile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Link>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<AdditionalDependencies>gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
<Link>
<AdditionalDependencies>gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Link>
<AdditionalDependencies>gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Link>
<AdditionalDependencies>gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Link>
<AdditionalDependencies>gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Link>
<AdditionalDependencies>gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Link>
<AdditionalDependencies>gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\am_map.c" />
<ClCompile Include="..\apng.c" />
<ClCompile Include="..\blua\lapi.c" />
<ClCompile Include="..\blua\lauxlib.c" />
<ClCompile Include="..\blua\lbaselib.c" />
<ClCompile Include="..\blua\lcode.c" />
<ClCompile Include="..\blua\ldebug.c" />
<ClCompile Include="..\blua\ldo.c" />
<ClCompile Include="..\blua\ldump.c" />
<ClCompile Include="..\blua\lfunc.c" />
<ClCompile Include="..\blua\lgc.c" />
<ClCompile Include="..\blua\linit.c" />
<ClCompile Include="..\blua\llex.c" />
<ClCompile Include="..\blua\lmem.c" />
<ClCompile Include="..\blua\lobject.c" />
<ClCompile Include="..\blua\lopcodes.c" />
<ClCompile Include="..\blua\lparser.c" />
<ClCompile Include="..\blua\lstate.c" />
<ClCompile Include="..\blua\lstring.c" />
<ClCompile Include="..\blua\lstrlib.c" />
<ClCompile Include="..\blua\ltable.c" />
<ClCompile Include="..\blua\ltablib.c" />
<ClCompile Include="..\blua\ltm.c" />
<ClCompile Include="..\blua\lundump.c" />
<ClCompile Include="..\blua\lvm.c" />
<ClCompile Include="..\blua\lzio.c" />
<ClCompile Include="..\b_bot.c" />
<ClCompile Include="..\command.c" />
<ClCompile Include="..\comptime.c" />
<ClCompile Include="..\console.c" />
<ClCompile Include="..\dehacked.c" />
<ClCompile Include="..\d_clisrv.c" />
<ClCompile Include="..\d_main.c" />
<ClCompile Include="..\d_net.c" />
<ClCompile Include="..\d_netcmd.c" />
<ClCompile Include="..\d_netfil.c" />
<ClCompile Include="..\filesrch.c" />
<ClCompile Include="..\f_finale.c" />
<ClCompile Include="..\f_wipe.c" />
<ClCompile Include="..\g_game.c" />
<ClCompile Include="..\g_input.c" />
<ClCompile Include="..\hu_stuff.c" />
<ClCompile Include="..\info.c" />
<ClCompile Include="..\i_addrinfo.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\i_tcp.c" />
<ClCompile Include="..\lua_baselib.c" />
<ClCompile Include="..\lua_blockmaplib.c" />
<ClCompile Include="..\lua_consolelib.c" />
<ClCompile Include="..\lua_hooklib.c" />
<ClCompile Include="..\lua_hudlib.c" />
<ClCompile Include="..\lua_infolib.c" />
<ClCompile Include="..\lua_maplib.c" />
<ClCompile Include="..\lua_mathlib.c" />
<ClCompile Include="..\lua_mobjlib.c" />
<ClCompile Include="..\lua_playerlib.c" />
<ClCompile Include="..\lua_script.c" />
<ClCompile Include="..\lua_skinlib.c" />
<ClCompile Include="..\lua_thinkerlib.c" />
<ClCompile Include="..\lzf.c" />
<ClCompile Include="..\md5.c" />
<ClCompile Include="..\mserv.c" />
<ClCompile Include="..\m_aatree.c" />
<ClCompile Include="..\m_anigif.c" />
<ClCompile Include="..\m_argv.c" />
<ClCompile Include="..\m_bbox.c" />
<ClCompile Include="..\m_cheat.c" />
<ClCompile Include="..\m_cond.c" />
<ClCompile Include="..\m_fixed.c" />
<ClCompile Include="..\m_menu.c" />
<ClCompile Include="..\m_misc.c" />
<ClCompile Include="..\m_queue.c" />
<ClCompile Include="..\m_random.c" />
<ClCompile Include="..\p_ceilng.c" />
<ClCompile Include="..\p_enemy.c" />
<ClCompile Include="..\p_floor.c" />
<ClCompile Include="..\p_inter.c" />
<ClCompile Include="..\p_lights.c" />
<ClCompile Include="..\p_map.c" />
<ClCompile Include="..\p_maputl.c" />
<ClCompile Include="..\p_mobj.c" />
<ClCompile Include="..\p_polyobj.c" />
<ClCompile Include="..\p_saveg.c" />
<ClCompile Include="..\p_setup.c" />
<ClCompile Include="..\p_sight.c" />
<ClCompile Include="..\p_slopes.c" />
<ClCompile Include="..\p_spec.c" />
<ClCompile Include="..\p_telept.c" />
<ClCompile Include="..\p_tick.c" />
<ClCompile Include="..\p_user.c" />
<ClCompile Include="..\r_bsp.c" />
<ClCompile Include="..\r_data.c" />
<ClCompile Include="..\r_draw.c" />
<ClCompile Include="..\r_draw16.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\r_draw8.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\r_main.c" />
<ClCompile Include="..\r_plane.c" />
<ClCompile Include="..\r_segs.c" />
<ClCompile Include="..\r_sky.c" />
<ClCompile Include="..\r_splats.c" />
<ClCompile Include="..\r_things.c" />
<ClCompile Include="..\screen.c" />
<ClCompile Include="..\sounds.c" />
<ClCompile Include="..\string.c" />
<ClCompile Include="..\st_stuff.c" />
<ClCompile Include="..\s_sound.c" />
<ClCompile Include="..\tables.c" />
<ClCompile Include="..\t_facon.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\t_fsin.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\t_ftan.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\t_tan2a.c">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\v_video.c" />
<ClCompile Include="..\w_wad.c" />
<ClCompile Include="..\y_inter.c" />
<ClCompile Include="..\z_zone.c" />
<ClCompile Include="dx_error.c" />
<ClCompile Include="fabdxlib.c" />
<ClCompile Include="win_cd.c" />
<ClCompile Include="win_dbg.c" />
<ClCompile Include="win_dll.c" />
<ClCompile Include="win_main.c" />
<ClCompile Include="win_net.c" />
<ClCompile Include="win_snd.c" />
<ClCompile Include="win_sys.c" />
<ClCompile Include="win_vid.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\am_map.h" />
<ClInclude Include="..\apng.h" />
<ClInclude Include="..\blua\lapi.h" />
<ClInclude Include="..\blua\lauxlib.h" />
<ClInclude Include="..\blua\lcode.h" />
<ClInclude Include="..\blua\ldebug.h" />
<ClInclude Include="..\blua\ldo.h" />
<ClInclude Include="..\blua\lfunc.h" />
<ClInclude Include="..\blua\lgc.h" />
<ClInclude Include="..\blua\llex.h" />
<ClInclude Include="..\blua\llimits.h" />
<ClInclude Include="..\blua\lmem.h" />
<ClInclude Include="..\blua\lobject.h" />
<ClInclude Include="..\blua\lopcodes.h" />
<ClInclude Include="..\blua\lparser.h" />
<ClInclude Include="..\blua\lstate.h" />
<ClInclude Include="..\blua\lstring.h" />
<ClInclude Include="..\blua\ltable.h" />
<ClInclude Include="..\blua\ltm.h" />
<ClInclude Include="..\blua\lua.h" />
<ClInclude Include="..\blua\luaconf.h" />
<ClInclude Include="..\blua\lualib.h" />
<ClInclude Include="..\blua\lundump.h" />
<ClInclude Include="..\blua\lvm.h" />
<ClInclude Include="..\blua\lzio.h" />
<ClInclude Include="..\byteptr.h" />
<ClInclude Include="..\b_bot.h" />
<ClInclude Include="..\command.h" />
<ClInclude Include="..\comptime.h" />
<ClInclude Include="..\console.h" />
<ClInclude Include="..\dehacked.h" />
<ClInclude Include="..\doomdata.h" />
<ClInclude Include="..\doomdef.h" />
<ClInclude Include="..\doomstat.h" />
<ClInclude Include="..\doomtype.h" />
<ClInclude Include="..\d_clisrv.h" />
<ClInclude Include="..\d_event.h" />
<ClInclude Include="..\d_main.h" />
<ClInclude Include="..\d_net.h" />
<ClInclude Include="..\d_netcmd.h" />
<ClInclude Include="..\d_netfil.h" />
<ClInclude Include="..\d_player.h" />
<ClInclude Include="..\d_think.h" />
<ClInclude Include="..\d_ticcmd.h" />
<ClInclude Include="..\endian.h" />
<ClInclude Include="..\fastcmp.h" />
<ClInclude Include="..\filesrch.h" />
<ClInclude Include="..\f_finale.h" />
<ClInclude Include="..\g_game.h" />
<ClInclude Include="..\g_input.h" />
<ClInclude Include="..\g_state.h" />
<ClInclude Include="..\hardware\hw3dsdrv.h" />
<ClInclude Include="..\hardware\hw3sound.h" />
<ClInclude Include="..\hardware\hws_data.h" />
<ClInclude Include="..\hu_stuff.h" />
<ClInclude Include="..\info.h" />
<ClInclude Include="..\i_addrinfo.h" />
<ClInclude Include="..\i_joy.h" />
<ClInclude Include="..\i_net.h" />
<ClInclude Include="..\i_sound.h" />
<ClInclude Include="..\i_system.h" />
<ClInclude Include="..\i_tcp.h" />
<ClInclude Include="..\i_video.h" />
<ClInclude Include="..\keys.h" />
<ClInclude Include="..\lua_hook.h" />
<ClInclude Include="..\lua_hud.h" />
<ClInclude Include="..\lua_libs.h" />
<ClInclude Include="..\lua_script.h" />
<ClInclude Include="..\lzf.h" />
<ClInclude Include="..\md5.h" />
<ClInclude Include="..\mserv.h" />
<ClInclude Include="..\m_aatree.h" />
<ClInclude Include="..\m_anigif.h" />
<ClInclude Include="..\m_argv.h" />
<ClInclude Include="..\m_bbox.h" />
<ClInclude Include="..\m_cheat.h" />
<ClInclude Include="..\m_cond.h" />
<ClInclude Include="..\m_dllist.h" />
<ClInclude Include="..\m_fixed.h" />
<ClInclude Include="..\m_menu.h" />
<ClInclude Include="..\m_misc.h" />
<ClInclude Include="..\m_queue.h" />
<ClInclude Include="..\m_random.h" />
<ClInclude Include="..\m_swap.h" />
<ClInclude Include="..\p5prof.h" />
<ClInclude Include="..\p_local.h" />
<ClInclude Include="..\p_maputl.h" />
<ClInclude Include="..\p_mobj.h" />
<ClInclude Include="..\p_polyobj.h" />
<ClInclude Include="..\p_pspr.h" />
<ClInclude Include="..\p_saveg.h" />
<ClInclude Include="..\p_setup.h" />
<ClInclude Include="..\p_slopes.h" />
<ClInclude Include="..\p_spec.h" />
<ClInclude Include="..\p_tick.h" />
<ClInclude Include="..\r_bsp.h" />
<ClInclude Include="..\r_data.h" />
<ClInclude Include="..\r_defs.h" />
<ClInclude Include="..\r_draw.h" />
<ClInclude Include="..\r_local.h" />
<ClInclude Include="..\r_main.h" />
<ClInclude Include="..\r_plane.h" />
<ClInclude Include="..\r_segs.h" />
<ClInclude Include="..\r_sky.h" />
<ClInclude Include="..\r_splats.h" />
<ClInclude Include="..\r_state.h" />
<ClInclude Include="..\r_things.h" />
<ClInclude Include="..\screen.h" />
<ClInclude Include="..\sounds.h" />
<ClInclude Include="..\st_stuff.h" />
<ClInclude Include="..\s_sound.h" />
<ClInclude Include="..\tables.h" />
<ClInclude Include="..\v_video.h" />
<ClInclude Include="..\w_wad.h" />
<ClInclude Include="..\y_inter.h" />
<ClInclude Include="..\z_zone.h" />
<ClInclude Include="afxres.h" />
<ClInclude Include="dx_error.h" />
<ClInclude Include="fabdxlib.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="win_dbg.h" />
<ClInclude Include="win_dll.h" />
<ClInclude Include="win_main.h" />
</ItemGroup>
<ItemGroup>
<Image Include="Srb2win.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Srb2win.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\libs\libpng-src\projects\visualc10\libpng.vcxproj">
<Project>{72b01aca-7a1a-4f7b-acef-2607299cf052}</Project>
</ProjectReference>
<ProjectReference Include="..\..\libs\zlib\projects\visualc10\zlib.vcxproj">
<Project>{73a5729c-7323-41d4-ab48-8a03c9f81603}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\asm_defs.inc" />
<None Include="..\config.h.in" />
<CustomBuild Include="..\tmap.nas">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\tmap_mmx.nas">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\tmap_vc.nas">
<FileType>Document</FileType>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -1,837 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="BLUA">
<UniqueIdentifier>{20cba664-c3ef-48f1-85dd-42aafd5345cc}</UniqueIdentifier>
</Filter>
<Filter Include="LUA">
<UniqueIdentifier>{d3817a65-82f5-4989-9217-e5a7f43380a0}</UniqueIdentifier>
</Filter>
<Filter Include="B_Bots">
<UniqueIdentifier>{9c3ed4ae-dbed-4d00-a164-b8bb7fc1710c}</UniqueIdentifier>
</Filter>
<Filter Include="Docs">
<UniqueIdentifier>{4b8a8fb6-7c84-48c2-85d1-0583e6b8cacd}</UniqueIdentifier>
</Filter>
<Filter Include="W_Wad">
<UniqueIdentifier>{1907eee5-0ebf-4325-a2fa-793f089ed2e3}</UniqueIdentifier>
</Filter>
<Filter Include="S_Sounds">
<UniqueIdentifier>{b9e78a3f-3e2b-4f89-9817-b77c7a26d2aa}</UniqueIdentifier>
</Filter>
<Filter Include="R_Rend">
<UniqueIdentifier>{3f336df5-a1d7-4610-9728-4525e42c0abc}</UniqueIdentifier>
</Filter>
<Filter Include="P_Play">
<UniqueIdentifier>{b5090aa0-6645-4091-aa1a-ffc3bf4dc422}</UniqueIdentifier>
</Filter>
<Filter Include="M_Misc">
<UniqueIdentifier>{d59e82c9-68e5-44bf-827e-f7bb1676cd6c}</UniqueIdentifier>
</Filter>
<Filter Include="I_Interface">
<UniqueIdentifier>{29e746a2-3d91-4b69-af6e-5e03895516b7}</UniqueIdentifier>
</Filter>
<Filter Include="Hw_Hardware">
<UniqueIdentifier>{b295d364-61c3-4ebb-9b68-7d6c0bb891be}</UniqueIdentifier>
</Filter>
<Filter Include="H_Hud">
<UniqueIdentifier>{ba258ec5-13d7-4083-98bd-c2ee58700b66}</UniqueIdentifier>
</Filter>
<Filter Include="G_Game">
<UniqueIdentifier>{6163f1e5-da5d-4af2-b92c-753452f9e1d0}</UniqueIdentifier>
</Filter>
<Filter Include="F_Frame">
<UniqueIdentifier>{077b0966-1151-4afa-a533-120a4c931322}</UniqueIdentifier>
</Filter>
<Filter Include="D_Doom">
<UniqueIdentifier>{bded90bc-8019-42b1-ba19-32166743d3e3}</UniqueIdentifier>
</Filter>
<Filter Include="A_Asm">
<UniqueIdentifier>{c0ddfdb5-7494-4cca-b2ad-cb048be9cbdf}</UniqueIdentifier>
</Filter>
<Filter Include="Win32app">
<UniqueIdentifier>{d5157f99-43ef-49cc-ad76-658a1168fc0d}</UniqueIdentifier>
</Filter>
<Filter Include="O_Other">
<UniqueIdentifier>{2cedf139-53a1-40ea-b4de-19e9f4505a1f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dx_error.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="fabdxlib.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="win_cd.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="win_dbg.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="win_dll.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="win_main.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="win_net.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="win_snd.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="win_sys.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="win_vid.c">
<Filter>Win32app</Filter>
</ClCompile>
<ClCompile Include="..\hardware\hw3sound.c">
<Filter>Hw_Hardware</Filter>
</ClCompile>
<ClCompile Include="..\blua\lapi.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lauxlib.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lbaselib.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lcode.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\ldebug.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\ldo.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\ldump.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lfunc.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lgc.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\linit.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\llex.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lmem.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lobject.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lopcodes.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lparser.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lstate.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lstring.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lstrlib.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\ltable.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\ltablib.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\ltm.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lundump.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lvm.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\blua\lzio.c">
<Filter>BLUA</Filter>
</ClCompile>
<ClCompile Include="..\d_clisrv.c">
<Filter>D_Doom</Filter>
</ClCompile>
<ClCompile Include="..\d_main.c">
<Filter>D_Doom</Filter>
</ClCompile>
<ClCompile Include="..\d_net.c">
<Filter>D_Doom</Filter>
</ClCompile>
<ClCompile Include="..\d_netcmd.c">
<Filter>D_Doom</Filter>
</ClCompile>
<ClCompile Include="..\d_netfil.c">
<Filter>D_Doom</Filter>
</ClCompile>
<ClCompile Include="..\dehacked.c">
<Filter>D_Doom</Filter>
</ClCompile>
<ClCompile Include="..\g_game.c">
<Filter>G_Game</Filter>
</ClCompile>
<ClCompile Include="..\g_input.c">
<Filter>G_Game</Filter>
</ClCompile>
<ClCompile Include="..\f_finale.c">
<Filter>F_Frame</Filter>
</ClCompile>
<ClCompile Include="..\f_wipe.c">
<Filter>F_Frame</Filter>
</ClCompile>
<ClCompile Include="..\i_addrinfo.c">
<Filter>I_Interface</Filter>
</ClCompile>
<ClCompile Include="..\i_tcp.c">
<Filter>I_Interface</Filter>
</ClCompile>
<ClCompile Include="..\lua_thinkerlib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_baselib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_blockmaplib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_consolelib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_hooklib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_hudlib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_infolib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_maplib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_mathlib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_mobjlib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_playerlib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_script.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\lua_skinlib.c">
<Filter>LUA</Filter>
</ClCompile>
<ClCompile Include="..\m_aatree.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_anigif.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_argv.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_bbox.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_cheat.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_cond.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_fixed.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_menu.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_misc.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_queue.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\m_random.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\md5.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\am_map.c">
<Filter>H_Hud</Filter>
</ClCompile>
<ClCompile Include="..\b_bot.c">
<Filter>B_Bots</Filter>
</ClCompile>
<ClCompile Include="..\p_ceilng.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_enemy.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_floor.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_inter.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_lights.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_map.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_maputl.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_mobj.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_polyobj.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_saveg.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_setup.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_sight.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_slopes.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_spec.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_telept.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_tick.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\p_user.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\r_bsp.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_data.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_draw.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_draw8.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_draw16.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_main.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_plane.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_segs.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_sky.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_splats.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_things.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\t_facon.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\t_fsin.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\t_ftan.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\t_tan2a.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\tables.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\sounds.c">
<Filter>S_Sounds</Filter>
</ClCompile>
<ClCompile Include="..\w_wad.c">
<Filter>W_Wad</Filter>
</ClCompile>
<ClCompile Include="..\lzf.c">
<Filter>W_Wad</Filter>
</ClCompile>
<ClCompile Include="..\s_sound.c">
<Filter>S_Sounds</Filter>
</ClCompile>
<ClCompile Include="..\comptime.c">
<Filter>O_Other</Filter>
</ClCompile>
<ClCompile Include="..\command.c">
<Filter>H_Hud</Filter>
</ClCompile>
<ClCompile Include="..\console.c">
<Filter>H_Hud</Filter>
</ClCompile>
<ClCompile Include="..\filesrch.c">
<Filter>I_Interface</Filter>
</ClCompile>
<ClCompile Include="..\hu_stuff.c">
<Filter>H_Hud</Filter>
</ClCompile>
<ClCompile Include="..\info.c">
<Filter>P_Play</Filter>
</ClCompile>
<ClCompile Include="..\mserv.c">
<Filter>I_Interface</Filter>
</ClCompile>
<ClCompile Include="..\st_stuff.c">
<Filter>H_Hud</Filter>
</ClCompile>
<ClCompile Include="..\v_video.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\screen.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\y_inter.c">
<Filter>H_Hud</Filter>
</ClCompile>
<ClCompile Include="..\z_zone.c">
<Filter>D_Doom</Filter>
</ClCompile>
<ClCompile Include="..\string.c">
<Filter>M_Misc</Filter>
</ClCompile>
<ClCompile Include="..\hardware\hw_md2load.c" />
<ClCompile Include="..\hardware\hw_md3load.c" />
<ClCompile Include="..\hardware\hw_model.c" />
<ClCompile Include="..\hardware\u_list.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="afxres.h">
<Filter>Win32app</Filter>
</ClInclude>
<ClInclude Include="dx_error.h">
<Filter>Win32app</Filter>
</ClInclude>
<ClInclude Include="fabdxlib.h">
<Filter>Win32app</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Win32app</Filter>
</ClInclude>
<ClInclude Include="win_dbg.h">
<Filter>Win32app</Filter>
</ClInclude>
<ClInclude Include="win_dll.h">
<Filter>Win32app</Filter>
</ClInclude>
<ClInclude Include="win_main.h">
<Filter>Win32app</Filter>
</ClInclude>
<ClInclude Include="..\hardware\hw3dsdrv.h">
<Filter>Hw_Hardware</Filter>
</ClInclude>
<ClInclude Include="..\hardware\hw3sound.h">
<Filter>Hw_Hardware</Filter>
</ClInclude>
<ClInclude Include="..\hardware\hws_data.h">
<Filter>Hw_Hardware</Filter>
</ClInclude>
<ClInclude Include="..\hardware\u_list.h">
<Filter>Hw_Hardware</Filter>
</ClInclude>
<ClInclude Include="..\blua\lapi.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lauxlib.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lcode.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\ldebug.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\ldo.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lfunc.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lgc.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\llex.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\llimits.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lmem.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lobject.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lopcodes.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lparser.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lstate.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lstring.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\ltable.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\ltm.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lua.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\luaconf.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lualib.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lundump.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lvm.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\blua\lzio.h">
<Filter>BLUA</Filter>
</ClInclude>
<ClInclude Include="..\d_clisrv.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\d_event.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\d_main.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\d_net.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\d_netcmd.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\d_netfil.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\d_player.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\d_think.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\d_ticcmd.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\dehacked.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\doomdata.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\doomdef.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\doomstat.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\doomtype.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\g_game.h">
<Filter>G_Game</Filter>
</ClInclude>
<ClInclude Include="..\g_input.h">
<Filter>G_Game</Filter>
</ClInclude>
<ClInclude Include="..\g_state.h">
<Filter>G_Game</Filter>
</ClInclude>
<ClInclude Include="..\f_finale.h">
<Filter>F_Frame</Filter>
</ClInclude>
<ClInclude Include="..\i_addrinfo.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\i_joy.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\i_net.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\i_sound.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\i_system.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\i_tcp.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\i_video.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\lua_hook.h">
<Filter>LUA</Filter>
</ClInclude>
<ClInclude Include="..\lua_hud.h">
<Filter>LUA</Filter>
</ClInclude>
<ClInclude Include="..\lua_libs.h">
<Filter>LUA</Filter>
</ClInclude>
<ClInclude Include="..\lua_script.h">
<Filter>LUA</Filter>
</ClInclude>
<ClInclude Include="..\md5.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_aatree.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_anigif.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_argv.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_bbox.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_cheat.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_cond.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_dllist.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_fixed.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_menu.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_misc.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_queue.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_random.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\m_swap.h">
<Filter>M_Misc</Filter>
</ClInclude>
<ClInclude Include="..\am_map.h">
<Filter>H_Hud</Filter>
</ClInclude>
<ClInclude Include="..\b_bot.h">
<Filter>B_Bots</Filter>
</ClInclude>
<ClInclude Include="..\p_local.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\p_maputl.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\p_mobj.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\p_polyobj.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\p_pspr.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\p_saveg.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\p_setup.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\p_slopes.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\p_spec.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\p_tick.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\r_bsp.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_data.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_defs.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_draw.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_local.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_main.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_plane.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_segs.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_sky.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_splats.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_state.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_things.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\tables.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\sounds.h">
<Filter>S_Sounds</Filter>
</ClInclude>
<ClInclude Include="..\w_wad.h">
<Filter>W_Wad</Filter>
</ClInclude>
<ClInclude Include="..\lzf.h">
<Filter>W_Wad</Filter>
</ClInclude>
<ClInclude Include="..\byteptr.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\s_sound.h">
<Filter>S_Sounds</Filter>
</ClInclude>
<ClInclude Include="..\comptime.h">
<Filter>O_Other</Filter>
</ClInclude>
<ClInclude Include="..\keys.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\command.h">
<Filter>H_Hud</Filter>
</ClInclude>
<ClInclude Include="..\console.h">
<Filter>H_Hud</Filter>
</ClInclude>
<ClInclude Include="..\endian.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\filesrch.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\hu_stuff.h">
<Filter>H_Hud</Filter>
</ClInclude>
<ClInclude Include="..\info.h">
<Filter>P_Play</Filter>
</ClInclude>
<ClInclude Include="..\mserv.h">
<Filter>I_Interface</Filter>
</ClInclude>
<ClInclude Include="..\p5prof.h">
<Filter>A_Asm</Filter>
</ClInclude>
<ClInclude Include="..\st_stuff.h">
<Filter>H_Hud</Filter>
</ClInclude>
<ClInclude Include="..\v_video.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\screen.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\y_inter.h">
<Filter>H_Hud</Filter>
</ClInclude>
<ClInclude Include="..\z_zone.h">
<Filter>D_Doom</Filter>
</ClInclude>
<ClInclude Include="..\fastcmp.h">
<Filter>O_Other</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="Srb2win.ico">
<Filter>Win32app</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Srb2win.rc">
<Filter>Win32app</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\asm_defs.inc">
<Filter>A_Asm</Filter>
</None>
<None Include="..\config.h.in">
<Filter>O_Other</Filter>
</None>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\tmap.nas">
<Filter>A_Asm</Filter>
</CustomBuild>
<CustomBuild Include="..\tmap_mmx.nas">
<Filter>A_Asm</Filter>
</CustomBuild>
<CustomBuild Include="..\tmap_vc.nas">
<Filter>A_Asm</Filter>
</CustomBuild>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,77 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Srb2win"=.\Srb2win.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libpng
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
Project: "libpng"="..\..\libs\libpng-src\projects\visualc6\libpng.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
Project: "r_opengl"=..\hardware\r_opengl\r_opengl.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Srb2win
End Project Dependency
}}}
###############################################################################
Project: "zlib"=..\..\libs\zlib\projects\visualc6\zlib.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<!-- x86/x64 defines: has specific libraries that ARM does not -->
<PreprocessorDefinitions Condition="'$(Platform)' == 'Win32' OR '$(Platform)' == 'x64'">HAVE_ZLIB;HAVE_LIBGME;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- ARM defines -->
<PreprocessorDefinitions Condition="'$(Platform)' != 'Win32' AND '$(Platform)' != 'x64'">_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link />
<Link>
<AdditionalDependencies>dxguid.lib;winmm.lib;dinput8.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

View file

@ -1,276 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief DirectX error messages
/// adapted from DirectX6 sample code
#include <stdarg.h>
//#define WIN32_LEAN_AND_MEAN
#define RPC_NO_WINDOWS_H
#include <windows.h>
#define DIRECTSOUND_VERSION 0x0600 /* version 6.0 */
#define DXVERSION_NTCOMPATIBLE 0x0300
#ifdef _MSC_VER
#pragma warning(disable : 4201)
#endif
#include <ddraw.h>
#include <dsound.h>
#include <mmsystem.h>
#include "dx_error.h"
// -----------------
// DXErrorMessageBox
// Displays a message box containing the given formatted string.
// -----------------
/*
VOID DXErrorMessageBox (HRESULT error) LPSTR fmt, ...)
{
char buff[256];
va_list args;
va_start(args, fmt);
wvsprintf(buff, fmt, args);
va_end(args);
lstrcat(buff, "\r\n");
MessageBoxA(NULL, buff, "DirectX Error:", MB_ICONEXCLAMATION + MB_OK);
}*/
// ---------------
// DXErrorToString
// Returns a pointer to a string describing the given DD, D3D or D3DRM error code.
// ---------------
LPCSTR DXErrorToString (HRESULT error)
{
switch (error) {
case DD_OK:
/* Also includes D3D_OK and D3DRM_OK */
return "No error.";
case DDERR_ALREADYINITIALIZED:
return "This object is already initialized.";
case DDERR_BLTFASTCANTCLIP:
return "Return if a clipper object is attached to the source surface passed into a BltFast call.";
case DDERR_CANNOTATTACHSURFACE:
return "This surface can not be attached to the requested surface.";
case DDERR_CANNOTDETACHSURFACE:
return "This surface can not be detached from the requested surface.";
case DDERR_CANTCREATEDC:
return "Windows can not create any more DCs.";
case DDERR_CANTDUPLICATE:
return "Can't duplicate primary & 3D surfaces, or surfaces that are implicitly created.";
case DDERR_CLIPPERISUSINGHWND:
return "An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd.";
case DDERR_COLORKEYNOTSET:
return "No src color key specified for this operation.";
case DDERR_CURRENTLYNOTAVAIL:
return "Support is currently not available.";
case DDERR_DIRECTDRAWALREADYCREATED:
return "A DirectDraw object representing this driver has already been created for this process.";
case DDERR_EXCEPTION:
return "An exception was encountered while performing the requested operation.";
case DDERR_EXCLUSIVEMODEALREADYSET:
return "An attempt was made to set the cooperative level when it was already set to exclusive.";
case DDERR_GENERIC:
return "Generic failure.";
case DDERR_HEIGHTALIGN:
return "Height of rectangle provided is not a multiple of reqd alignment.";
case DDERR_HWNDALREADYSET:
return "The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or palettes created.";
case DDERR_HWNDSUBCLASSED:
return "HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring state.";
case DDERR_IMPLICITLYCREATED:
return "This surface can not be restored because it is an implicitly created surface.";
case DDERR_INCOMPATIBLEPRIMARY:
return "Unable to match primary surface creation request with existing primary surface.";
case DDERR_INVALIDCAPS:
return "One or more of the caps bits passed to the callback are incorrect.";
case DDERR_INVALIDCLIPLIST:
return "DirectDraw does not support the provided cliplist.";
case DDERR_INVALIDDIRECTDRAWGUID:
return "The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.";
case DDERR_INVALIDMODE:
return "DirectDraw does not support the requested mode.";
case DDERR_INVALIDOBJECT:
return "DirectDraw received a pointer that was an invalid DIRECTDRAW object.";
case DDERR_INVALIDPARAMS:
return "One or more of the parameters passed to the function are incorrect.";
case DDERR_INVALIDPIXELFORMAT:
return "The pixel format was invalid as specified.";
case DDERR_INVALIDPOSITION:
return "Returned when the position of the overlay on the destination is no longer legal for that destination.";
case DDERR_INVALIDRECT:
return "Rectangle provided was invalid.";
case DDERR_LOCKEDSURFACES:
return "Operation could not be carried out because one or more surfaces are locked.";
case DDERR_NO3D:
return "There is no 3D present.";
case DDERR_NOALPHAHW:
return "Operation could not be carried out because there is no alpha accleration hardware present or available.";
case DDERR_NOBLTHW:
return "No blitter hardware present.";
case DDERR_NOCLIPLIST:
return "No cliplist available.";
case DDERR_NOCLIPPERATTACHED:
return "No clipper object attached to surface object.";
case DDERR_NOCOLORCONVHW:
return "Operation could not be carried out because there is no color conversion hardware present or available.";
case DDERR_NOCOLORKEY:
return "Surface doesn't currently have a color key";
case DDERR_NOCOLORKEYHW:
return "Operation could not be carried out because there is no hardware support of the destination color key.";
case DDERR_NOCOOPERATIVELEVELSET:
return "Create function called without DirectDraw object method SetCooperativeLevel being called.";
case DDERR_NODC:
return "No DC was ever created for this surface.";
case DDERR_NODDROPSHW:
return "No DirectDraw ROP hardware.";
case DDERR_NODIRECTDRAWHW:
return "A hardware-only DirectDraw object creation was attempted but the driver did not support any hardware.";
case DDERR_NOEMULATION:
return "Software emulation not available.";
case DDERR_NOEXCLUSIVEMODE:
return "Operation requires the application to have exclusive mode but the application does not have exclusive mode.";
case DDERR_NOFLIPHW:
return "Flipping visible surfaces is not supported.";
case DDERR_NOGDI:
return "There is no GDI present.";
case DDERR_NOHWND:
return "Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND.";
case DDERR_NOMIRRORHW:
return "Operation could not be carried out because there is no hardware present or available.";
case DDERR_NOOVERLAYDEST:
return "Returned when GetOverlayPosition is called on an overlay that UpdateOverlay has never been called on to establish a destination.";
case DDERR_NOOVERLAYHW:
return "Operation could not be carried out because there is no overlay hardware present or available.";
case DDERR_NOPALETTEATTACHED:
return "No palette object attached to this surface.";
case DDERR_NOPALETTEHW:
return "No hardware support for 16 or 256 color palettes.";
case DDERR_NORASTEROPHW:
return "Operation could not be carried out because there is no appropriate raster op hardware present or available.";
case DDERR_NOROTATIONHW:
return "Operation could not be carried out because there is no rotation hardware present or available.";
case DDERR_NOSTRETCHHW:
return "Operation could not be carried out because there is no hardware support for stretching.";
case DDERR_NOT4BITCOLOR:
return "DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette.";
case DDERR_NOT4BITCOLORINDEX:
return "DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette.";
case DDERR_NOT8BITCOLOR:
return "DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color.";
case DDERR_NOTAOVERLAYSURFACE:
return "Returned when an overlay member is called for a non-overlay surface.";
case DDERR_NOTEXTUREHW:
return "Operation could not be carried out because there is no texture mapping hardware present or available.";
case DDERR_NOTFLIPPABLE:
return "An attempt has been made to flip a surface that is not flippable.";
case DDERR_NOTFOUND:
return "Requested item was not found.";
case DDERR_NOTLOCKED:
return "Surface was not locked. An attempt to unlock a surface that was not locked at all, or by this process, has been attempted.";
case DDERR_NOTPALETTIZED:
return "The surface being used is not a palette-based surface.";
case DDERR_NOVSYNCHW:
return "Operation could not be carried out because there is no hardware support for vertical blank synchronized operations.";
case DDERR_NOZBUFFERHW:
return "Operation could not be carried out because there is no hardware support for zbuffer blitting.";
case DDERR_NOZOVERLAYHW:
return "Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays.";
case DDERR_OUTOFCAPS:
return "The hardware needed for the requested operation has already been allocated.";
case DDERR_OUTOFMEMORY:
return "There is not enough memory to perform the operation.";
case DDERR_OUTOFVIDEOMEMORY:
return "DirectDraw does not have enough memory to perform the operation.";
case DDERR_OVERLAYCANTCLIP:
return "The hardware does not support clipped overlays.";
case DDERR_OVERLAYCOLORKEYONLYONEACTIVE:
return "Can only have ony color key active at one time for overlays.";
case DDERR_OVERLAYNOTVISIBLE:
return "Returned when GetOverlayPosition is called on a hidden overlay.";
case DDERR_PALETTEBUSY:
return "Access to this palette is being refused because the palette is already locked by another thread.";
case DDERR_PRIMARYSURFACEALREADYEXISTS:
return "This process already has created a primary surface.";
case DDERR_REGIONTOOSMALL:
return "Region passed to Clipper::GetClipList is too small.";
case DDERR_SURFACEALREADYATTACHED:
return "This surface is already attached to the surface it is being attached to.";
case DDERR_SURFACEALREADYDEPENDENT:
return "This surface is already a dependency of the surface it is being made a dependency of.";
case DDERR_SURFACEBUSY:
return "Access to this surface is being refused because the surface is already locked by another thread.";
case DDERR_SURFACEISOBSCURED:
return "Access to surface refused because the surface is obscured.";
case DDERR_SURFACELOST:
return "Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it.";
case DDERR_SURFACENOTATTACHED:
return "The requested surface is not attached.";
case DDERR_TOOBIGHEIGHT:
return "Height requested by DirectDraw is too large.";
case DDERR_TOOBIGSIZE:
return "Size requested by DirectDraw is too large, but the individual height and width are OK.";
case DDERR_TOOBIGWIDTH:
return "Width requested by DirectDraw is too large.";
case DDERR_UNSUPPORTED:
return "Function call not supported.";
case DDERR_UNSUPPORTEDFORMAT:
return "FOURCC format requested is unsupported by DirectDraw.";
case DDERR_UNSUPPORTEDMASK:
return "Bitmask in the pixel format requested is unsupported by DirectDraw.";
case DDERR_VERTICALBLANKINPROGRESS:
return "Vertical blank is in progress.";
case DDERR_WASSTILLDRAWING:
return "Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is incomplete.";
case DDERR_WRONGMODE:
return "This surface can not be restored because it was created in a different mode.";
case DDERR_XALIGN:
return "Rectangle provided was not horizontally aligned on required boundary.";
//
// DirectSound errors
//
case DSERR_ALLOCATED:
return "The request failed because resources, such as a priority level, were already in use by another caller.";
case DSERR_ALREADYINITIALIZED:
return "The object is already initialized.";
case DSERR_BADFORMAT:
return "The specified wave format is not supported.";
case DSERR_BUFFERLOST:
return "The buffer memory has been lost and must be restored.";
case DSERR_CONTROLUNAVAIL:
return "The control (volume, pan, and so forth) requested by the caller is not available.";
case DSERR_INVALIDCALL:
return "This function is not valid for the current state of this object.";
case DSERR_NOAGGREGATION:
return "The object does not support aggregation.";
case DSERR_NODRIVER:
return "No sound driver is available for use.";
case DSERR_NOINTERFACE:
return "The requested COM interface is not available.";
case DSERR_OTHERAPPHASPRIO:
return "Another application has a higher priority level, preventing this call from succeeding";
case DSERR_PRIOLEVELNEEDED:
return "The caller does not have the priority level required for the function to succeed.";
case DSERR_UNINITIALIZED:
return "The IDirectSound::Initialize method has not been called or has not been called successfully before other methods were called.";
default:
return "Unrecognized error value.";
}
}

View file

@ -1,39 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief transform an unreadable DirectX error code
/// into a meaningful error message.
#ifndef __DX_ERROR_H__
#define __DX_ERROR_H__
//#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
// Displays a message box containing the given formatted string.
//VOID DXErrorMessageBox (LPSTR fmt, ...);
// Returns a pointer to a string describing the given DD, D3D or D3DRM error code.
LPCSTR DXErrorToString (HRESULT error);
#ifdef __cplusplus
};
#endif
#endif // __DX_ERROR_H__

View file

@ -1,677 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//-----------------------------------------------------------------------------
/// \file
/// \brief faB's DirectX library v1.0
/// - converted to C for Doom Legacy
#include "../doomdef.h"
#ifdef _WINDOWS
//#define WIN32_LEAN_AND_MEAN
#define RPC_NO_WINDOWS_H
#include <windows.h>
#include <windowsx.h>
#include "../i_system.h"
#include "dx_error.h"
#include "fabdxlib.h"
#define NT4COMPAT //always defined, always compatible
// globals
IDirectDraw2* DDr2 = NULL;
IDirectDrawSurface* ScreenReal = NULL; // DirectDraw primary surface
IDirectDrawSurface* ScreenVirtual = NULL; // DirectDraw back surface
IDirectDrawPalette* DDPalette = NULL; // The primary surface palette
static IDirectDrawClipper *windclip = NULL; // clipper for windowed mode
BOOL bAppFullScreen; // true for fullscreen exclusive mode,
int windowPosX = 0; // current position in windowed mode
int windowPosY = 0;
int ScreenWidth;
int ScreenHeight;
BOOL ScreenLocked; // Screen surface is being locked
int ScreenPitch; // offset from one line to the next
LPBYTE ScreenPtr; // memory of the surface
//
// CreateNewSurface
//
static inline IDirectDrawSurface* CreateNewSurface(int dwWidth,
int dwHeight,
int dwSurfaceCaps)
{
DDSURFACEDESC ddsd;
HRESULT hr;
LPDIRECTDRAWSURFACE psurf;
ZeroMemory(&ddsd, sizeof (ddsd));
ddsd.dwSize = sizeof (ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT |DDSD_WIDTH;
ddsd.ddsCaps.dwCaps = dwSurfaceCaps;
ddsd.dwHeight = dwHeight;
ddsd.dwWidth = dwWidth;
hr = IDirectDraw2_CreateSurface (DDr2, &ddsd, &psurf, NULL);
if (hr == DD_OK)
{
//DDCOLORKEY ddck;
IDirectDrawSurface_Restore(psurf);
//hr = IDirectDrawSurface_GetColorKey(DDCKEY_SRCBLT, &ddck);
//psurf->SetColorKey(DDCKEY_SRCBLT, &ddck);
}
else
psurf = NULL;
return psurf;
}
//
// wow! from 320x200x8 up to 1600x1200x32 thanks Banshee! :)
//
static HRESULT WINAPI myEnumModesCallback (LPDDSURFACEDESC surf, LPVOID lpContext)
{
APPENUMMODESCALLBACK pfnContext = lpContext;
if (pfnContext) pfnContext(surf->dwWidth,
surf->dwHeight,surf->ddpfPixelFormat.
#ifdef DUMMYUNIONNAMEN
DUMMYUNIONNAMEN(1).
#endif
dwRGBBitCount
);
/*I_OutputMsg("%dx%dx%d bpp %d refresh\n",
surf->dwWidth,
surf->dwHeight,
surf->ddpfPixelFormat.dwRGBBitCount,
surf->dwRefreshRate);*/
return DDENUMRET_OK;
}
//
// Application call here to enumerate display modes
//
BOOL EnumDirectDrawDisplayModes (APPENUMMODESCALLBACK appFunc)
{
LPVOID lpappFunc = appFunc;
if (DDr2 == NULL)
return FALSE;
// enumerate display modes
// Carl: DirectX 3.x apparently does not support VGA modes. Who cares. :)
// faB: removed DDEDM_REFRESHRATES, detects too many modes, plus we don't care of refresh rate.
if (bDX0300)
IDirectDraw2_EnumDisplayModes (DDr2, 0 /*| DDEDM_REFRESHRATES*/,
NULL, lpappFunc, myEnumModesCallback);
else
IDirectDraw2_EnumDisplayModes (DDr2, DDEDM_STANDARDVGAMODES /*| DDEDM_REFRESHRATES*/,
NULL, lpappFunc, myEnumModesCallback);
return TRUE;
}
static HINSTANCE DDrawDLL = NULL;
typedef HRESULT(WINAPI *DDCreate)(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter);
static DDCreate pfnDirectDrawCreate = NULL;
static inline BOOL LoadDirectDraw(VOID)
{
// load ddraw.dll
DDrawDLL = LoadLibraryA("DDRAW.DLL");
if (DDrawDLL == NULL)
return false;
pfnDirectDrawCreate = (DDCreate)(LPVOID)GetProcAddress(DDrawDLL, "DirectDrawCreate");
if (pfnDirectDrawCreate == NULL)
return false;
return true;
}
static inline VOID UnLoadDirectDraw(VOID)
{
if (!DDrawDLL)
return;
FreeLibrary(DDrawDLL);
pfnDirectDrawCreate = NULL;
DDrawDLL = NULL;
}
//
// Create the DirectDraw object for later
//
BOOL CreateDirectDrawInstance (VOID)
{
HRESULT hr;
IDirectDraw* DDr;
IDirectDraw** rp = &DDr;
IDirectDraw2** rp2 = &DDr2;
LPVOID *tp = (LPVOID *)rp2;
if (!LoadDirectDraw())
return FALSE;
//
// create an instance of DirectDraw object
//
if (FAILED(hr = pfnDirectDrawCreate(NULL, rp, NULL)))
I_Error("DirectDrawCreate FAILED: %s", DXErrorToString(hr));
// change interface to IDirectDraw2
if (FAILED(hr = IDirectDraw_QueryInterface(DDr, &IID_IDirectDraw2, tp)))
I_Error("Failed to query DirectDraw2 interface: %s", DXErrorToString(hr));
// release the interface we don't need
IDirectDraw_Release (DDr);
return TRUE;
}
//
// - returns true if DirectDraw was initialized properly
//
int InitDirectDrawe (HWND appWin, int width, int height, int bpp, int fullScr)
{
DDSURFACEDESC ddsd; // DirectDraw surface description for allocating
DDSCAPS ddscaps;
HRESULT ddrval;
DWORD dwStyle;
RECT rect;
// enumerate directdraw devices
//if (FAILED(DirectDrawEnumerate (myEnumDDDevicesCallback, NULL)))
// I_Error("Error with DirectDrawEnumerate");
if (!DDr2)
CreateDirectDrawInstance();
// remember what screen mode we are in
bAppFullScreen = fullScr;
ScreenHeight = height;
ScreenWidth = width;
if (bAppFullScreen)
{
// Change window attributes
dwStyle = WS_POPUP | WS_VISIBLE;
SetWindowLong (appWin, GWL_STYLE, dwStyle);
SetWindowPos(appWin, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE |
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
// Get exclusive mode
ddrval = IDirectDraw2_SetCooperativeLevel(DDr2, appWin, DDSCL_EXCLUSIVE |
DDSCL_FULLSCREEN |
DDSCL_ALLOWREBOOT);
if (ddrval != DD_OK)
I_Error("SetCooperativeLevel FAILED: %s\n", DXErrorToString(ddrval));
// Switch from windows desktop to fullscreen
#ifdef NT4COMPAT
ddrval = IDirectDraw2_SetDisplayMode(DDr2, width, height, bpp, 0, 0);
#else
ddrval = IDirectDraw2_SetDisplayMode(DDr2, width, height, bpp, 0, DDSDM_STANDARDVGAMODE);
#endif
if (ddrval != DD_OK)
I_Error("SetDisplayMode FAILED: %s\n", DXErrorToString(ddrval));
// This is not really needed, except in certain cases. One case
// is while using MFC. When the desktop is initally at 16bpp, a mode
// switch to 8bpp somehow causes the MFC window to not fully initialize
// and a CreateSurface will fail with DDERR_NOEXCLUSIVEMODE. This will
// ensure that the window is initialized properly after a mode switch.
ShowWindow(appWin, SW_SHOW);
// Create the primary surface with 1 back buffer. Always zero the
// DDSURFACEDESC structure and set the dwSize member!
ZeroMemory(&ddsd, sizeof (ddsd));
ddsd.dwSize = sizeof (ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
// for fullscreen we use page flipping, for windowed mode, we blit the hidden surface to
// the visible surface, in both cases we have a visible (or 'real') surface, and a hidden
// (or 'virtual', or 'backbuffer') surface.
ddsd.dwBackBufferCount = 2;
ddrval = IDirectDraw2_CreateSurface(DDr2,&ddsd, &ScreenReal, NULL);
if (ddrval != DD_OK)
I_Error("CreateSurface Primary Screen FAILED");
// Get a pointer to the back buffer
ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
ddrval = IDirectDrawSurface_GetAttachedSurface(ScreenReal,&ddscaps, &ScreenVirtual);
if (ddrval != DD_OK)
I_Error("GetAttachedSurface FAILED");
}
else
{
rect.top = 0;
rect.left = 0;
rect.bottom = height;
rect.right = width;
// Change window attributes
dwStyle = GetWindowStyle(appWin);
dwStyle &= ~WS_POPUP;
dwStyle |= WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION;
SetWindowLong(appWin, GWL_STYLE, dwStyle);
// Resize the window so that the client area is the requested width/height
AdjustWindowRectEx(&rect, GetWindowStyle(appWin), GetMenu(appWin) != NULL,
GetWindowExStyle(appWin));
// Just in case the window was moved off the visible area of the
// screen.
SetWindowPos(appWin, NULL, 0, 0, rect.right-rect.left,
rect.bottom-rect.top, SWP_NOMOVE | SWP_NOZORDER |
SWP_NOACTIVATE);
SetWindowPos(appWin, HWND_NOTOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
// Exclusive mode is normal since it's in windowed mode and needs
// to cooperate with GDI
ddrval = IDirectDraw2_SetCooperativeLevel(DDr2,appWin, DDSCL_NORMAL);
if (ddrval != DD_OK)
I_Error("SetCooperativeLevel FAILED");
// Always zero the DDSURFACEDESC structure and set the dwSize member!
ZeroMemory(&ddsd, sizeof (ddsd));
ddsd.dwSize = sizeof (ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
// Create the primary surface
ddrval = IDirectDraw2_CreateSurface(DDr2,&ddsd, &ScreenReal, NULL);
if (ddrval != DD_OK)
I_Error("CreateSurface Primary Screen FAILED");
// Create a back buffer for offscreen rendering, this will be used to
// blt to the primary
ScreenVirtual = CreateNewSurface(width, height, DDSCAPS_OFFSCREENPLAIN |
DDSCAPS_SYSTEMMEMORY);
if (ScreenVirtual == NULL)
I_Error("CreateSurface Secondary Screen FAILED");
/// \todo get the desktop bit depth, and build a lookup table
/// for quick conversions of 8bit color indexes 0-255 to desktop colors
/// eg: 256 entries of equivalent of palette colors 0-255 in 15,16,24,32 bit format
/// when blit virtual to real, convert pixels through lookup table..
// Use a clipper object for clipping when in windowed mode
// (make sure our drawing doesn't affect other windows)
ddrval = IDirectDraw2_CreateClipper (DDr2, 0, &windclip, 0);
if (ddrval != DD_OK)
I_Error("CreateClipper FAILED");
// Associate the clipper with the window.
ddrval = IDirectDrawClipper_SetHWnd (windclip,0, appWin);
if (ddrval != DD_OK)
I_Error("Clipper -> SetHWnd FAILED");
// Attach the clipper to the surface.
ddrval = IDirectDrawSurface_SetClipper (ScreenReal,windclip);
if (ddrval != DD_OK)
I_Error("PrimaryScreen -> SetClipperClipper FAILED");
}
return TRUE;
}
//
// Free all memory
//
VOID CloseDirectDraw (VOID)
{
ReleaseChtuff();
if (DDr2)
{
IDirectDraw2_Release(DDr2);
DDr2 = NULL;
}
UnLoadDirectDraw();
}
//
// Release DirectDraw stuff before display mode change
//
VOID ReleaseChtuff (VOID)
{
if (!DDr2)
return;
if (windclip)
{
IDirectDrawClipper_Release(windclip);
windclip = NULL;
}
if (DDPalette)
{
IDirectDrawPalette_Release(DDPalette);
DDPalette = NULL;
}
// If the app is fullscreen, the back buffer is attached to the
// primary. Releasing the primary buffer will also release any
// attached buffers, so explicitly releasing the back buffer is not
// necessary.
if (!bAppFullScreen && ScreenVirtual)
{
IDirectDrawSurface_Release(ScreenVirtual); // release hidden surface
ScreenVirtual = NULL;
}
if (ScreenReal)
{
IDirectDrawSurface_Release(ScreenReal); // and attached backbuffers for bAppFullScreen mode
ScreenReal = NULL;
}
}
//
// Clear the surface to color
//
VOID ClearSurface(IDirectDrawSurface* surface, int color)
{
DDBLTFX ddbltfx;
// Use the blter to do a color fill to clear the back buffer
ddbltfx.dwSize = sizeof (ddbltfx);
ddbltfx.
#ifdef DUMMYUNIONNAMEN
DUMMYUNIONNAMEN(5).
#endif
dwFillColor = color;
IDirectDrawSurface_Blt(surface,NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);
}
//
// Flip the real page with virtual page
// - in bAppFullScreen mode, do page flipping
// - in windowed mode, copy the hidden surface to the visible surface
//
// waitflip : if not 0, wait for page flip to end
BOOL ScreenFlip(int waitflip)
{
HRESULT hr;
RECT rect;
if (bAppFullScreen)
{
//hr = IDirectDrawSurface_GetFlipStatus (ScreenReal, DDGFS_);
// In full-screen exclusive mode, do a hardware flip.
hr = IDirectDrawSurface_Flip(ScreenReal, NULL, DDFLIP_WAIT | (waitflip ? 0 : DDFLIP_NOVSYNC)); //return immediately
// If the surface was lost, restore it.
if (hr == DDERR_SURFACELOST)
{
IDirectDrawSurface_Restore(ScreenReal);
// The restore worked, so try the flip again.
hr = IDirectDrawSurface_Flip(ScreenReal, 0, DDFLIP_WAIT | (waitflip ? 0 : DDFLIP_NOVSYNC));
}
}
else
{
rect.left = windowPosX;
rect.top = windowPosY;
rect.right = windowPosX + ScreenWidth - 1;
rect.bottom = windowPosY + ScreenHeight - 1;
// Copy the back buffer to front.
hr = IDirectDrawSurface_Blt(ScreenReal, &rect, ScreenVirtual, 0, DDBLT_WAIT, 0);
if (hr != DD_OK)
{
// If the surfaces were lost, restore them.
if (IDirectDrawSurface_IsLost(ScreenReal) == DDERR_SURFACELOST)
IDirectDrawSurface_Restore(ScreenReal);
if (IDirectDrawSurface_IsLost(ScreenVirtual) == DDERR_SURFACELOST)
IDirectDrawSurface_Restore(ScreenVirtual);
// Retry the copy.
hr = IDirectDrawSurface_Blt(ScreenReal,&rect, ScreenVirtual, 0, DDBLT_WAIT, 0);
}
}
if (hr != DD_OK)
I_Error("ScreenFlip() : couldn't Flip surfaces because %s", DXErrorToString(hr));
return FALSE;
}
//
// Print a text to the surface
//
VOID TextPrint(int x, int y, LPCSTR message)
{
HRESULT hr;
HDC hdc = NULL;
// Get the device context handle.
hr = IDirectDrawSurface_GetDC(ScreenVirtual,&hdc);
if (hr != DD_OK)
return;
// Write the message.
SetBkMode(hdc, TRANSPARENT);
SetTextColor(hdc, RGB(255, 255, 255));
TextOutA(hdc, x, y, message, (int)strlen(message));
// Release the device context.
hr = IDirectDrawSurface_ReleaseDC(ScreenVirtual,hdc);
}
//
// Lock surface before multiple drawings by hand, for speed
//
boolean LockScreen(VOID)
{
DDSURFACEDESC ddsd;
HRESULT ddrval;
ZeroMemory(&ddsd, sizeof (ddsd));
ddsd.dwSize = sizeof (ddsd);
// attempt to Lock the surface
ddrval = IDirectDrawSurface_Lock(ScreenVirtual, NULL, &ddsd, DDLOCK_WAIT, NULL);
// Always, always check for errors with DirectX!
// If the surface was lost, restore it.
if (ddrval == DDERR_SURFACELOST)
{
ddrval = IDirectDrawSurface_Restore(ScreenReal);
// now retry to get the lock
ddrval = IDirectDrawSurface_Lock(ScreenVirtual, NULL, &ddsd, DDLOCK_WAIT, NULL);
}
if (ddrval == DD_OK)
{
ScreenLocked = TRUE;
ScreenPtr = (LPBYTE)ddsd.lpSurface;
ScreenPitch = ddsd.
#ifdef DUMMYUNIONNAMEN
DUMMYUNIONNAMEN(1).
#endif
lPitch;
}
else
{
ScreenLocked = FALSE;
ScreenPtr = NULL;
ScreenPitch = 0;
//I_Error("LockScreen() : couldn't restore the surface.");
return false;
}
return true;
}
//
// Unlock surface
//
VOID UnlockScreen(VOID)
{
if (DD_OK != IDirectDrawSurface_Unlock(ScreenVirtual,NULL))
I_Error("Couldn't UnLock the renderer!");
ScreenLocked = FALSE;
ScreenPtr = NULL;
ScreenPitch = 0;
}
// Blit virtual screen to real screen
//faB: note: testing 14/03/1999, see if it is faster than memcopy of virtual to
/*
static LPDIRECTDRAWSURFACE lpDDS = NULL;
VOID BlitScreen(VOID)
{
HRESULT hr;
if (!lpDDS)
I_Error("lpDDS NULL");
hr = IDirectDrawSurface_BltFast(ScreenVirtual,
0, 0, // Upper left xy of destination
lpDDS, // Source surface
NULL, // Source rectangle = entire surface
DDBLTFAST_WAIT | DDBLTFAST_NOCOLORKEY);
if (FAILED(hr))
I_Error("BltFast FAILED");
}
VOID MakeScreen(int width, int height, BYTE* lpSurface)
{
HRESULT hr;
DDSURFACEDESC ddsd;
// Initialize the surface description.
ZeroMemory (&ddsd, sizeof ddsd);
ZeroMemory (&ddsd.ddpfPixelFormat, sizeof (DDPIXELFORMAT));
ddsd.dwSize = sizeof ddsd;
ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | //DDSD_LPSURFACE |
DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_CAPS;
ddsd.dwWidth = width;
ddsd.dwHeight= height;
ddsd.lPitch = width;
ddsd.lpSurface = lpSurface;
ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN;
// Set up the pixel format for 8-bit
ddsd.ddpfPixelFormat.dwSize = sizeof (DDPIXELFORMAT);
ddsd.ddpfPixelFormat.dwFlags= DDPF_RGB | DDPF_PALETTEINDEXED8;
ddsd.ddpfPixelFormat.dwRGBBitCount = 8;
//
ddsd.ddpfPixelFormat.dwRGBBitCount = (DWORD)DEPTH*8;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00FF0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF;
// Create the surface
hr = IDirectDraw2_CreateSurface(DDr2, &ddsd, &lpDDS, NULL);
if (FAILED(hr))
I_Error("MakeScreen FAILED: %s",DDError(hr));
//ddsd.lpSurface = lpSurface;
}
*/
//
// Create a palette object
//
VOID CreateDDPalette (PALETTEENTRY* colorTable)
{
HRESULT ddrval;
ddrval = IDirectDraw2_CreatePalette(DDr2,DDPCAPS_8BIT|DDPCAPS_ALLOW256, colorTable, &DDPalette, NULL);
if (ddrval != DD_OK)
I_Error("couldn't CreatePalette");
};
//
// Free the palette object
//
VOID DestroyDDPalette (VOID)
{
if (DDPalette)
{
IDirectDrawPalette_Release(DDPalette);
DDPalette = NULL;
}
}
//
// Set a a full palette of 256 PALETTEENTRY entries
//
VOID SetDDPalette(PALETTEENTRY* pal)
{
// create palette first time
if (DDPalette == NULL)
CreateDDPalette(pal);
else
IDirectDrawPalette_SetEntries(DDPalette, 0, 0, 256, pal);
// setting the same palette to the same surface again does not increase
// the reference count
IDirectDrawSurface_SetPalette(ScreenReal, DDPalette);
}
//
// Wait for vsync, gross
//
VOID WaitVbl(VOID)
{
IDirectDraw2_WaitForVerticalBlank(DDr2, DDWAITVB_BLOCKBEGIN, NULL);
}
//
// Restore the palette. Useful when we regain focus.
//
VOID RestoreDDPalette(VOID)
{
if (DDPalette)
IDirectDrawSurface_SetPalette(ScreenReal, DDPalette);
}
#endif

View file

@ -1,82 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief faB's DirectX library v1.0
#ifndef _H_FABDXLIB_
#define _H_FABDXLIB_
//#define WIN32_LEAN_AND_MEAN
#define RPC_NO_WINDOWS_H
#include <windows.h>
#ifdef __MINGW32__
//#define NONAMELESSUNION
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4201)
#endif
#include <ddraw.h>
#if (defined (DIRECTDRAW_VERSION) && (DIRECTDRAW_VERSION >= 0x0700))
#undef DUMMYUNIONNAMEN
#endif
// format of function in app called with width,height
typedef BOOL (*APPENUMMODESCALLBACK)(int width, int height, int bpp);
// globals
extern IDirectDraw2* DDr2;
extern IDirectDrawSurface* ScreenReal;
extern IDirectDrawSurface* ScreenVirtual;
extern IDirectDrawPalette* DDPalette;
extern BOOL bAppFullScreen; // main code might need this to know the current
// fullscreen or windowed state
extern int windowPosX; // current position in windowed mode
extern int windowPosY;
extern int ScreenWidth;
extern int ScreenHeight;
extern BOOL ScreenLocked; // Screen surface is being locked
extern int ScreenPitch; // offset from one line to the next
extern LPBYTE ScreenPtr; // memory of the surface
extern BOOL bDX0300;
BOOL EnumDirectDrawDisplayModes (APPENUMMODESCALLBACK appFunc);
BOOL CreateDirectDrawInstance (VOID);
int InitDirectDrawe (HWND appWin, int width, int height, int bpp, int fullScr);
VOID CloseDirectDraw (VOID);
VOID ReleaseChtuff (VOID);
VOID ClearSurface (IDirectDrawSurface* surface, int color);
BOOL ScreenFlip (int wait);
VOID TextPrint (int x, int y, LPCSTR message);
VOID CreateDDPalette (PALETTEENTRY* colorTable);
VOID DestroyDDPalette (VOID);
VOID SetDDPalette (PALETTEENTRY* pal);
VOID RestoreDDPalette(VOID);
VOID WaitVbl (VOID);
boolean LockScreen (VOID);
VOID UnlockScreen (VOID);
#endif /* _H_FABDXLIB_ */

View file

@ -1,539 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief cd music interface (uses MCI).
#include "../doomdef.h"
#include "../doomstat.h"
#ifdef _WINDOWS
#include "win_main.h"
#include <mmsystem.h>
#include "../command.h"
#include "../doomtype.h"
#include "../i_sound.h"
#include "../i_system.h"
#include "../s_sound.h"
#define MAX_CD_TRACKS 255
typedef struct {
BOOL IsAudio;
DWORD Start, End;
DWORD Length; // minutes
} CDTrack;
// -------
// private
// -------
static CDTrack m_nTracks[MAX_CD_TRACKS];
static int m_nTracksCount; // up to MAX_CD_TRACKS
static MCI_STATUS_PARMS m_MCIStatus;
static MCI_OPEN_PARMS m_MCIOpen;
// ------
// protos
// ------
static void Command_Cd_f (void);
// -------------------
// MCIErrorMessageBox
// Retrieve error message corresponding to return value from
// mciSendCommand() or mciSenString()
// -------------------
static VOID MCIErrorMessageBox (MCIERROR iErrorCode)
{
char szErrorText[128];
if (!mciGetErrorStringA (iErrorCode, szErrorText, sizeof (szErrorText)))
wsprintfA(szErrorText,"MCI CD Audio Unknown Error #%lu\n", iErrorCode);
I_OutputMsg("%s", szErrorText);
/*MessageBox (GetActiveWindow(), szTemp+1, "LEGACY",
MB_OK | MB_ICONSTOP);*/
}
// --------
// CD_Reset
// --------
static VOID CD_Reset (VOID)
{
// no win32 equivalent
//faB: for DOS, some odd drivers like to be reset sometimes.. useless in MCI I guess
}
// ----------------
// CD_ReadTrackInfo
// Read in number of tracks, and length of each track in minutes/seconds
// returns true if error
// ----------------
static BOOL CD_ReadTrackInfo(VOID)
{
UINT nTrackLength;
INT i;
MCIERROR iErr;
m_nTracksCount = 0;
m_MCIStatus.dwItem = MCI_STATUS_NUMBER_OF_TRACKS;
iErr = mciSendCommand(m_MCIOpen.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM|MCI_WAIT, (DWORD_PTR)&m_MCIStatus);
if (iErr)
{
MCIErrorMessageBox (iErr);
return FALSE;
}
m_nTracksCount = (int)m_MCIStatus.dwReturn;
if (m_nTracksCount > MAX_CD_TRACKS)
m_nTracksCount = MAX_CD_TRACKS;
for (i = 0; i < m_nTracksCount; i++)
{
m_MCIStatus.dwTrack = (DWORD)(i+1);
m_MCIStatus.dwItem = MCI_STATUS_LENGTH;
iErr = mciSendCommand(m_MCIOpen.wDeviceID, MCI_STATUS, MCI_TRACK|MCI_STATUS_ITEM|MCI_WAIT, (DWORD_PTR)&m_MCIStatus);
if (iErr)
{
MCIErrorMessageBox (iErr);
return FALSE;
}
nTrackLength = (DWORD)(MCI_MSF_MINUTE(m_MCIStatus.dwReturn)*60 + MCI_MSF_SECOND(m_MCIStatus.dwReturn));
m_nTracks[i].Length = nTrackLength;
m_MCIStatus.dwItem = MCI_CDA_STATUS_TYPE_TRACK;
iErr = mciSendCommand(m_MCIOpen.wDeviceID, MCI_STATUS, MCI_TRACK|MCI_STATUS_ITEM|MCI_WAIT, (DWORD_PTR)&m_MCIStatus);
if (iErr)
{
MCIErrorMessageBox (iErr);
return FALSE;
}
m_nTracks[i].IsAudio = (m_MCIStatus.dwReturn == MCI_CDA_TRACK_AUDIO);
}
return TRUE;
}
// ------------
// CD_TotalTime
// returns total time for all audio tracks in seconds
// ------------
static UINT CD_TotalTime(VOID)
{
UINT nTotalLength = 0;
INT nTrack;
for (nTrack = 0; nTrack < m_nTracksCount; nTrack++)
{
if (m_nTracks[nTrack].IsAudio)
nTotalLength += m_nTracks[nTrack].Length;
}
return nTotalLength;
}
//======================================================================
// CD AUDIO MUSIC SUBSYSTEM
//======================================================================
UINT8 cdaudio_started = 0; // for system startup/shutdown
static BOOL cdPlaying = FALSE;
static INT cdPlayTrack; // when cdPlaying is true
static BOOL cdLooping = FALSE;
static BYTE cdRemap[MAX_CD_TRACKS];
static BOOL cdEnabled = TRUE; // cd info available
static BOOL cdValid; // true when last cd audio info was ok
static BOOL wasPlaying;
//static INT cdVolume = 0; // current cd volume (0-31)
// 0-31 like Music & Sfx, though CD hardware volume is 0-255.
consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// allow Update for next/loop track
// some crap cd drivers take up to
// a second for a simple 'busy' check..
// (on those Update can be disabled)
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
#if (__GNUC__ > 6)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-overflow"
#endif
// hour,minutes,seconds
static LPSTR hms(UINT seconds)
{
UINT hours, minutes;
static CHAR s[9];
minutes = seconds / 60;
seconds %= 60;
hours = minutes / 60;
minutes %= 60;
if (hours > 0)
sprintf (s, "%lu:%02lu:%02lu", (long unsigned int)hours, (long unsigned int)minutes, (long unsigned int)seconds);
else
sprintf (s, "%2lu:%02lu", (long unsigned int)minutes, (long unsigned int)seconds);
return s;
}
#if (__GNUC__ > 6)
#pragma GCC diagnostic pop
#endif
static void Command_Cd_f(void)
{
LPCSTR s;
int i,j;
if (!cdaudio_started)
return;
if (COM_Argc() < 2)
{
CONS_Printf (M_GetText(
"cd [on] [off] [remap] [reset] [select]\n"
" [open] [info] [play <track>] [resume]\n"
" [stop] [pause] [loop <track>]\n"));
return;
}
s = COM_Argv(1);
// activate cd music
if (!strncmp(s,"on",2))
{
cdEnabled = TRUE;
return;
}
// stop/deactivate cd music
if (!strncmp(s, "off", 3))
{
if (cdPlaying)
I_StopCD();
cdEnabled = FALSE;
return;
}
// remap tracks
if (!strncmp(s, "remap", 5))
{
i = (int)COM_Argc() - 2;
if (i <= 0)
{
CONS_Printf(M_GetText("CD tracks remapped in that order :\n"));
for (j = 1; j < MAX_CD_TRACKS; j++)
if (cdRemap[j] != j)
CONS_Printf(" %2d -> %2d\n", j, cdRemap[j]);
return;
}
for (j = 1; j <= i; j++)
cdRemap[j] = (UINT8)atoi(COM_Argv(j+1));
return;
}
// reset the CD driver, useful on some odd cd's
if (!strncmp(s,"reset",5))
{
cdEnabled = TRUE;
if (cdPlaying)
I_StopCD ();
for (i = 0; i < MAX_CD_TRACKS; i++)
cdRemap[i] = (UINT8)i;
CD_Reset();
cdValid = CD_ReadTrackInfo();
return;
}
// any other command is not allowed until we could retrieve cd information
if (!cdValid)
{
CONS_Printf(M_GetText("CD is not ready.\n"));
return;
}
/* faB: not with MCI, didn't find it, useless anyway
if (!strncmp(s,"open",4))
{
if (cdPlaying)
I_StopCD ();
bcd_open_door();
cdValid = FALSE;
return;
}*/
if (!strncmp(s,"info",4))
{
if (!CD_ReadTrackInfo())
{
cdValid = FALSE;
return;
}
cdValid = TRUE;
if (m_nTracksCount <= 0)
CONS_Printf(M_GetText("No audio tracks\n"));
else
{
// display list of tracks
// highlight current playing track
for (i = 0; i < m_nTracksCount; i++)
{
CONS_Printf("%s%2d. %s %s\n",
cdPlaying && (cdPlayTrack == i) ? "\x82 " : " ",
i+1, m_nTracks[i].IsAudio ? M_GetText("audio") : M_GetText("data "),
hms(m_nTracks[i].Length));
}
CONS_Printf(M_GetText("\x82Total time : %s\n"), hms(CD_TotalTime()));
}
if (cdPlaying)
{
CONS_Printf(M_GetText("Currently %s track %u\n"), cdLooping ? M_GetText("looping") : M_GetText("playing"), cdPlayTrack);
}
return;
}
if (!strncmp(s,"play",4))
{
I_PlayCD ((UINT8)atoi (COM_Argv (2)), false);
return;
}
if (!strncmp(s,"stop",4))
{
I_StopCD ();
return;
}
if (!strncmp(s,"loop",4))
{
I_PlayCD((UINT8)atoi (COM_Argv (2)), true);
return;
}
if (!strncmp(s,"resume",4))
{
I_ResumeCD ();
return;
}
CONS_Printf (M_GetText("Invalid CD command \"CD %s\"\n"), s);
}
// ------------
// I_ShutdownCD
// Shutdown CD Audio subsystem, release whatever was allocated
// ------------
void I_ShutdownCD(void)
{
MCIERROR iErr;
if (!cdaudio_started)
return;
CONS_Printf("I_ShutdownCD: ");
I_StopCD();
// closes MCI CD
iErr = mciSendCommand(m_MCIOpen.wDeviceID, MCI_CLOSE, 0, 0);
if (iErr)
MCIErrorMessageBox (iErr);
}
// --------
// I_InitCD
// Init CD Audio subsystem
// --------
void I_InitCD(void)
{
MCI_SET_PARMS mciSet;
MCIERROR iErr;
int i;
// We don't have an open device yet
m_MCIOpen.wDeviceID = 0;
m_nTracksCount = 0;
cdaudio_started = false;
m_MCIOpen.lpstrDeviceType = (LPCTSTR)MCI_DEVTYPE_CD_AUDIO;
iErr = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE|MCI_OPEN_TYPE_ID, (DWORD_PTR)&m_MCIOpen);
if (iErr)
{
MCIErrorMessageBox (iErr);
return;
}
// Set the time format to track/minute/second/frame (TMSF).
mciSet.dwTimeFormat = MCI_FORMAT_TMSF;
iErr = mciSendCommand(m_MCIOpen.wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD_PTR)&mciSet);
if (iErr)
{
MCIErrorMessageBox (iErr);
mciSendCommand(m_MCIOpen.wDeviceID, MCI_CLOSE, 0, 0);
return;
}
I_AddExitFunc (I_ShutdownCD);
cdaudio_started = true;
CONS_Printf (M_GetText("CD audio Initialized\n"));
// last saved in config.cfg
i = cd_volume.value;
//I_SetVolumeCD (0); // initialize to 0 for some odd cd drivers
I_SetVolumeCD (i); // now set the last saved volume
for (i = 0; i < MAX_CD_TRACKS; i++)
cdRemap[i] = (UINT8)i;
if (!CD_ReadTrackInfo())
{
CONS_Printf(M_GetText("No CD in drive\n"));
cdEnabled = FALSE;
cdValid = FALSE;
}
else
{
cdEnabled = TRUE;
cdValid = TRUE;
}
COM_AddCommand ("cd", Command_Cd_f);
}
// loop/go to next track when track is finished (if cd_update var is true)
// update the volume when it has changed (from console/menu)
void I_UpdateCD(void)
{
/// \todo check for cd change and restart music ?
}
//
void I_PlayCD(UINT8 nTrack, UINT8 bLooping)
{
MCI_PLAY_PARMS mciPlay;
MCIERROR iErr;
if (!cdaudio_started || !cdEnabled)
return;
//faB: try again if it didn't work (just free the user of typing 'cd reset' command)
if (!cdValid)
cdValid = CD_ReadTrackInfo();
if (!cdValid)
return;
// tracks start at 0 in the code..
nTrack--;
if (nTrack >= m_nTracksCount)
nTrack = (UINT8) (nTrack % m_nTracksCount);
nTrack = cdRemap[nTrack];
if (cdPlaying)
{
if (cdPlayTrack == nTrack)
return;
I_StopCD ();
}
cdPlayTrack = nTrack;
if (!m_nTracks[nTrack].IsAudio)
{
//I_OutputMsg("\x82""CD Play: not an audio track\n"); // Tails 03-25-2001
return;
}
cdLooping = bLooping;
//faB: stop MIDI music, MIDI music will restart if volume is upped later
cv_digmusicvolume.value = 0;
cv_midimusicvolume.value = 0;
I_StopSong();
//faB: I don't use the notify message, I'm trying to minimize the delay
mciPlay.dwCallback = (DWORD)((size_t)hWndMain);
mciPlay.dwFrom = MCI_MAKE_TMSF(nTrack+1, 0, 0, 0);
iErr = mciSendCommand(m_MCIOpen.wDeviceID, MCI_PLAY, MCI_FROM|MCI_NOTIFY, (DWORD_PTR)&mciPlay);
if (iErr)
{
MCIErrorMessageBox (iErr);
cdValid = FALSE;
cdPlaying = FALSE;
return;
}
cdPlaying = TRUE;
}
// pause cd music
void I_StopCD(void)
{
MCIERROR iErr;
if (!cdaudio_started || !cdEnabled)
return;
iErr = mciSendCommand(m_MCIOpen.wDeviceID, MCI_PAUSE, MCI_WAIT, 0);
if (iErr)
MCIErrorMessageBox (iErr);
else
{
wasPlaying = cdPlaying;
cdPlaying = FALSE;
}
}
// continue after a pause
void I_ResumeCD(void)
{
MCIERROR iErr;
if (!cdaudio_started || !cdEnabled)
return;
if (!cdValid)
return;
if (!wasPlaying)
return;
iErr = mciSendCommand(m_MCIOpen.wDeviceID, MCI_RESUME, MCI_WAIT, 0);
if (iErr)
MCIErrorMessageBox (iErr);
else
cdPlaying = TRUE;
}
// volume : logical cd audio volume 0-31 (hardware is 0-255)
boolean I_SetVolumeCD (INT32 volume)
{
UNREFERENCED_PARAMETER(volume);
return false;
}
#endif

View file

@ -1,143 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief load and initialise the 3D driver DLL
#include "../doomdef.h"
#ifdef HW3SOUND
#include "../hardware/hw3dsdrv.h" // get the 3D sound driver DLL export prototypes
#endif
#ifdef _WINDOWS
#include "win_dll.h"
#include "win_main.h" // I_ShowLastError()
#if defined(HW3SOUND)
typedef struct loadfunc_s {
LPCSTR fnName;
LPVOID fnPointer;
} loadfunc_t;
// --------------------------------------------------------------------------
// Load a DLL, returns the HMODULE handle or NULL
// --------------------------------------------------------------------------
static HMODULE LoadDLL (LPCSTR dllName, loadfunc_t *funcTable)
{
LPVOID funcPtr;
loadfunc_t *loadfunc;
HMODULE hModule;
if ((hModule = LoadLibraryA(dllName)) != NULL)
{
// get function pointers for all functions we use
for (loadfunc = funcTable; loadfunc->fnName != NULL; loadfunc++)
{
funcPtr = GetProcAddress(hModule, loadfunc->fnName);
if (!funcPtr) {
I_ShowLastError(FALSE);
MessageBoxA(NULL, va("The '%s' haven't the good specification (function %s missing)\n\n"
"You must use dll from the same zip of this exe\n", dllName, loadfunc->fnName),
"Error", MB_OK|MB_ICONINFORMATION);
return FALSE;
}
// store function address
*((LPVOID*)loadfunc->fnPointer) = funcPtr;
}
}
else
{
I_ShowLastError(FALSE);
MessageBoxA(NULL, va("LoadLibrary() FAILED : couldn't load '%s'\r\n", dllName), "Warning", MB_OK|MB_ICONINFORMATION);
}
return hModule;
}
// --------------------------------------------------------------------------
// Unload the DLL
// --------------------------------------------------------------------------
static VOID UnloadDLL (HMODULE* pModule)
{
if (FreeLibrary(*pModule))
*pModule = NULL;
else
I_ShowLastError(TRUE);
}
#endif
#ifdef HW3SOUND
static HMODULE hwsModule = NULL;
static loadfunc_t hwsFuncTable[] = {
#ifdef _X86_
{"Startup@8", &hw3ds_driver.pfnStartup},
{"Shutdown@0", &hw3ds_driver.pfnShutdown},
{"AddSfx@4", &hw3ds_driver.pfnAddSfx},
{"AddSource@8", &hw3ds_driver.pfnAddSource},
{"StartSource@4", &hw3ds_driver.pfnStartSource},
{"StopSource@4", &hw3ds_driver.pfnStopSource},
{"GetHW3DSVersion@0", &hw3ds_driver.pfnGetHW3DSVersion},
{"BeginFrameUpdate@0", &hw3ds_driver.pfnBeginFrameUpdate},
{"EndFrameUpdate@0", &hw3ds_driver.pfnEndFrameUpdate},
{"IsPlaying@4", &hw3ds_driver.pfnIsPlaying},
{"UpdateListener@8", &hw3ds_driver.pfnUpdateListener},
{"UpdateSourceParms@12", &hw3ds_driver.pfnUpdateSourceParms},
{"SetCone@8", &hw3ds_driver.pfnSetCone},
{"SetGlobalSfxVolume@4", &hw3ds_driver.pfnSetGlobalSfxVolume},
{"Update3DSource@8", &hw3ds_driver.pfnUpdate3DSource},
{"ReloadSource@8", &hw3ds_driver.pfnReloadSource},
{"KillSource@4", &hw3ds_driver.pfnKillSource},
{"KillSfx@4", &hw3ds_driver.pfnKillSfx},
{"GetHW3DSTitle@8", &hw3ds_driver.pfnGetHW3DSTitle},
#else
{"Startup", &hw3ds_driver.pfnStartup},
{"Shutdown", &hw3ds_driver.pfnShutdown},
{"AddSfx", &hw3ds_driver.pfnAddSfx},
{"AddSource", &hw3ds_driver.pfnAddSource},
{"StartSource", &hw3ds_driver.pfnStartSource},
{"StopSource", &hw3ds_driver.pfnStopSource},
{"GetHW3DSVersion", &hw3ds_driver.pfnGetHW3DSVersion},
{"BeginFrameUpdate", &hw3ds_driver.pfnBeginFrameUpdate},
{"EndFrameUpdate", &hw3ds_driver.pfnEndFrameUpdate},
{"IsPlaying", &hw3ds_driver.pfnIsPlaying},
{"UpdateListener", &hw3ds_driver.pfnUpdateListener},
{"UpdateSourceParms", &hw3ds_driver.pfnUpdateSourceParms},
{"SetCone", &hw3ds_driver.pfnSetCone},
{"SetGlobalSfxVolume", &hw3ds_driver.pfnSetGlobalSfxVolume},
{"Update3DSource", &hw3ds_driver.pfnUpdate3DSource},
{"ReloadSource", &hw3ds_driver.pfnReloadSource},
{"KillSource", &hw3ds_driver.pfnKillSource},
{"KillSfx", &hw3ds_driver.pfnKillSfx},
{"GetHW3DSTitle", &hw3ds_driver.pfnGetHW3DSTitle},
#endif
{NULL, NULL}
};
BOOL Init3DSDriver(LPCSTR dllName)
{
hwsModule = LoadDLL(dllName, hwsFuncTable);
return (hwsModule != NULL);
}
VOID Shutdown3DSDriver (VOID)
{
UnloadDLL(&hwsModule);
}
#endif
#endif //_WINDOWS

View file

@ -1,26 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief load/unload a DLL at run-time
//#define WIN32_LEAN_AND_MEAN
#define RPC_NO_WINDOWS_H
#include <windows.h>
#ifdef HW3SOUND
BOOL Init3DSDriver(LPCSTR dllName);
VOID Shutdown3DSDriver(VOID);
#endif

View file

@ -1,683 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief Win32 WinMain Entry Point
///
/// Win32 Sonic Robo Blast 2
///
/// NOTE:
/// To compile WINDOWS SRB2 version : define a '_WINDOWS' symbol.
/// to do this go to Project/Settings/ menu, click C/C++ tab, in
/// 'Preprocessor definitions:' add '_WINDOWS'
#include "../doomdef.h"
#include <stdio.h>
#ifdef _WINDOWS
#include "../doomstat.h" // netgame
#include "resource.h"
#include "../m_argv.h"
#include "../d_main.h"
#include "../i_system.h"
#include "../keys.h" //hack quick test
#include "../console.h"
#include "fabdxlib.h"
#include "win_main.h"
#include "win_dbg.h"
#include "../i_sound.h" // midi pause/unpause
#include "../g_input.h" // KEY_MOUSEWHEELxxx
#include "../screen.h" // for BASEVID*
// MSWheel support for Win95/NT3.51
#include <zmouse.h>
#ifndef WM_XBUTTONDOWN
#define WM_XBUTTONDOWN 523
#endif
#ifndef WM_XBUTTONUP
#define WM_XBUTTONUP 524
#endif
#ifndef MK_XBUTTON1
#define MK_XBUTTON1 32
#endif
#ifndef MK_XBUTTON2
#define MK_XBUTTON2 64
#endif
typedef BOOL (WINAPI *p_IsDebuggerPresent)(VOID);
HWND hWndMain = NULL;
static HCURSOR windowCursor = NULL; // main window cursor
static LPCSTR wClassName = "SRB2WC";
INT appActive = false; // app window is active
#ifdef LOGMESSAGES
FILE *logstream;
#endif
BOOL nodinput = FALSE;
static LRESULT CALLBACK MainWndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
event_t ev; //Doom input event
int mouse_keys;
// judgecutor:
// Response MSH Mouse Wheel event
if (message == MSHWheelMessage)
{
message = WM_MOUSEWHEEL;
wParam <<= 16;
}
//I_OutputMsg("MainWndproc: %p,%i,%i,%i",hWnd, message, wParam, (UINT)lParam);
switch (message)
{
case WM_CREATE:
nodinput = M_CheckParm("-nodinput");
if (!nodinput && !LoadDirectInput())
nodinput = true;
break;
case WM_ACTIVATEAPP: // Handle task switching
appActive = (int)wParam;
//coming back from alt-tab? reset the palette.
if (appActive)
vid.recalc = true;
// pause music when alt-tab
if (appActive && !paused)
I_ResumeSong();
else if (!paused)
I_PauseSong();
{
HANDLE ci = GetStdHandle(STD_INPUT_HANDLE);
DWORD mode;
if (ci != INVALID_HANDLE_VALUE && GetFileType(ci) == FILE_TYPE_CHAR && GetConsoleMode(ci, &mode))
appActive = true;
}
InvalidateRect (hWnd, NULL, TRUE);
break;
case WM_PAINT:
if (!appActive && !bAppFullScreen && !netgame)
// app becomes inactive (if windowed)
{
// Paint "Game Paused" in the middle of the screen
PAINTSTRUCT ps;
RECT rect;
HDC hdc = BeginPaint (hWnd, &ps);
GetClientRect (hWnd, &rect);
DrawText (hdc, TEXT("Game Paused"), -1, &rect,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
EndPaint (hWnd, &ps);
return 0;
}
break;
case WM_QUERYNEWPALETTE:
RestoreDDPalette();
return TRUE;
case WM_PALETTECHANGED:
if((HWND)wParam != hWnd)
RestoreDDPalette();
break;
//case WM_RBUTTONDOWN:
//case WM_LBUTTONDOWN:
case WM_MOVE:
if (bAppFullScreen)
{
SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
return 0;
}
else
{
windowPosX = (SHORT) LOWORD(lParam); // horizontal position
windowPosY = (SHORT) HIWORD(lParam); // vertical position
break;
}
break;
// This is where switching windowed/fullscreen is handled. DirectDraw
// objects must be destroyed, recreated, and artwork reloaded.
case WM_DISPLAYCHANGE:
case WM_SIZE:
break;
case WM_SETCURSOR:
if (bAppFullScreen)
SetCursor(NULL);
else
SetCursor(windowCursor);
return TRUE;
case WM_KEYUP:
ev.type = ev_keyup;
goto handleKeyDoom;
break;
case WM_KEYDOWN:
ev.type = ev_keydown;
handleKeyDoom:
ev.data1 = 0;
if (wParam == VK_PAUSE)
// intercept PAUSE key
{
ev.data1 = KEY_PAUSE;
}
else if (!keyboard_started)
// post some keys during the game startup
// (allow escaping from network synchronization, or pressing enter after
// an error message in the console)
{
switch (wParam)
{
case VK_ESCAPE: ev.data1 = KEY_ESCAPE; break;
case VK_RETURN: ev.data1 = KEY_ENTER; break;
case VK_SHIFT: ev.data1 = KEY_LSHIFT; break;
default: ev.data1 = MapVirtualKey((DWORD)wParam,2); // convert in to char
}
}
if (ev.data1)
D_PostEvent (&ev);
return 0;
break;
// judgecutor:
// Handle mouse events
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_MOUSEMOVE:
if (nodinput)
{
mouse_keys = 0;
if (wParam & MK_LBUTTON)
mouse_keys |= 1;
if (wParam & MK_RBUTTON)
mouse_keys |= 2;
if (wParam & MK_MBUTTON)
mouse_keys |= 4;
I_GetSysMouseEvents(mouse_keys);
}
break;
case WM_XBUTTONUP:
if (nodinput)
{
ev.type = ev_keyup;
ev.data1 = KEY_MOUSE1 + 3 + HIWORD(wParam);
D_PostEvent(&ev);
return TRUE;
}
break;
case WM_XBUTTONDOWN:
if (nodinput)
{
ev.type = ev_keydown;
ev.data1 = KEY_MOUSE1 + 3 + HIWORD(wParam);
D_PostEvent(&ev);
return TRUE;
}
break;
case WM_MOUSEWHEEL:
//I_OutputMsg("MW_WHEEL dispatched.\n");
ev.type = ev_keydown;
if ((INT16)HIWORD(wParam) > 0)
ev.data1 = KEY_MOUSEWHEELUP;
else
ev.data1 = KEY_MOUSEWHEELDOWN;
D_PostEvent(&ev);
break;
case WM_SETTEXT:
COM_BufAddText((LPCSTR)lParam);
return TRUE;
break;
case WM_CLOSE:
PostQuitMessage(0); //to quit while in-game
ev.data1 = KEY_ESCAPE; //to exit network synchronization
ev.type = ev_keydown;
D_PostEvent (&ev);
return 0;
case WM_DESTROY:
//faB: main app loop will exit the loop and proceed with I_Quit()
PostQuitMessage(0);
break;
case WM_SYSCOMMAND:
// Don't allow the keyboard to activate the menu.
if(wParam == SC_KEYMENU)
return 0;
break;
default:
break;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
static inline VOID OpenTextConsole(VOID)
{
HANDLE ci, co;
BOOL console;
#ifdef _DEBUG
console = M_CheckParm("-noconsole") == 0;
#else
console = M_CheckParm("-console") != 0;
#endif
dedicated = M_CheckParm("-dedicated") != 0;
if (M_CheckParm("-detachconsole"))
{
if (FreeConsole())
{
I_OutputMsg("Detatched console.\n");
console = TRUE; //lets get back a console
}
else
{
I_OutputMsg("No console to detatch.\n");
I_ShowLastError(FALSE);
}
}
if (dedicated || console)
{
if (AllocConsole()) //Let get the real console HANDLEs, because Mingw's Bash is bad!
{
SetConsoleTitleA("SRB2Kart Console");
CONS_Printf(M_GetText("Hello, it's me, SRB2Kart's Console Window\n"));
}
else
{
I_OutputMsg("We have a console already.\n");
I_ShowLastError(FALSE);
return;
}
}
else
return;
ci = CreateFile(TEXT("CONIN$") , GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (ci != INVALID_HANDLE_VALUE)
{
HANDLE sih = GetStdHandle(STD_INPUT_HANDLE);
if (sih != ci)
{
I_OutputMsg("Old STD_INPUT_HANDLE: %p\nNew STD_INPUT_HANDLE: %p\n", sih, ci);
SetStdHandle(STD_INPUT_HANDLE,ci);
}
else
I_OutputMsg("STD_INPUT_HANDLE already set at %p\n", ci);
if (GetFileType(ci) == FILE_TYPE_CHAR)
{
#if 0
const DWORD CM = ENABLE_LINE_INPUT|ENABLE_ECHO_INPUT|ENABLE_PROCESSED_INPUT; //default mode but no ENABLE_MOUSE_INPUT
if (SetConsoleMode(ci,CM))
{
I_OutputMsg("Disabled mouse input on the console\n");
}
else
{
I_OutputMsg("Could not disable mouse input on the console\n");
I_ShowLastError(FALSE);
}
#endif
}
else
I_OutputMsg("Handle CONIN$ in not a Console HANDLE\n");
}
else
{
I_OutputMsg("Could not get a CONIN$ HANDLE\n");
I_ShowLastError(FALSE);
}
co = CreateFile(TEXT("CONOUT$"), GENERIC_WRITE|GENERIC_READ, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (co != INVALID_HANDLE_VALUE)
{
HANDLE soh = GetStdHandle(STD_OUTPUT_HANDLE);
HANDLE seh = GetStdHandle(STD_ERROR_HANDLE);
if (soh != co)
{
I_OutputMsg("Old STD_OUTPUT_HANDLE: %p\nNew STD_OUTPUT_HANDLE: %p\n", soh, co);
SetStdHandle(STD_OUTPUT_HANDLE,co);
}
else
I_OutputMsg("STD_OUTPUT_HANDLE already set at %p\n", co);
if (seh != co)
{
I_OutputMsg("Old STD_ERROR_HANDLE: %p\nNew STD_ERROR_HANDLE: %p\n", seh, co);
SetStdHandle(STD_ERROR_HANDLE,co);
}
else
I_OutputMsg("STD_ERROR_HANDLE already set at %p\n", co);
}
else
I_OutputMsg("Could not get a CONOUT$ HANDLE\n");
}
//
// Do that Windows initialization stuff...
//
static HWND OpenMainWindow (HINSTANCE hInstance, LPSTR wTitle)
{
const LONG styles = WS_CAPTION|WS_POPUP|WS_SYSMENU, exstyles = 0;
HWND hWnd;
WNDCLASSEXA wc;
RECT bounds;
// Set up and register window class
ZeroMemory(&wc, sizeof(wc));
wc.cbSize = sizeof(wc);
wc.style = CS_HREDRAW | CS_VREDRAW /*| CS_DBLCLKS*/;
wc.lpfnWndProc = MainWndproc;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DLICON1));
windowCursor = LoadCursor(NULL, IDC_WAIT); //LoadCursor(hInstance, MAKEINTRESOURCE(IDC_DLCURSOR1));
wc.hCursor = windowCursor;
wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wc.lpszClassName = wClassName;
if (!RegisterClassExA(&wc))
{
I_OutputMsg("Error doing RegisterClassExA\n");
I_ShowLastError(TRUE);
return INVALID_HANDLE_VALUE;
}
// Create a window
// CreateWindowEx - seems to create just the interior, not the borders
bounds.left = 0;
bounds.right = dedicated ? 0 : specialmodes[0].width;
bounds.top = 0;
bounds.bottom = dedicated ? 0 : specialmodes[0].height;
AdjustWindowRectEx(&bounds, styles, FALSE, exstyles);
hWnd = CreateWindowExA(
exstyles, //ExStyle
wClassName, //Classname
wTitle, //Windowname
styles, //dwStyle //WS_VISIBLE|WS_POPUP for bAppFullScreen
0,
0,
bounds.right - bounds.left, //GetSystemMetrics(SM_CXSCREEN),
bounds.bottom - bounds.top, //GetSystemMetrics(SM_CYSCREEN),
NULL, //hWnd Parent
NULL, //hMenu Menu
hInstance,
NULL);
if (hWnd == INVALID_HANDLE_VALUE)
{
I_OutputMsg("Error doing CreateWindowExA\n");
I_ShowLastError(TRUE);
}
return hWnd;
}
static inline BOOL tlErrorMessage(const TCHAR *err)
{
/* make the cursor visible */
SetCursor(LoadCursor(NULL, IDC_ARROW));
//
// warn user if there is one
//
printf("Error %s..\n", err);
fflush(stdout);
MessageBox(hWndMain, err, TEXT("ERROR"), MB_OK);
return FALSE;
}
// ------------------
// Command line stuff
// ------------------
#define MAXCMDLINEARGS 64
static char * myWargv[MAXCMDLINEARGS+1];
static char myCmdline[512];
static VOID GetArgcArgv (LPSTR cmdline)
{
LPSTR tokenstr;
size_t i = 0, len;
char cSep = ' ';
BOOL bCvar = FALSE, prevCvar = FALSE;
// split arguments of command line into argv
strlcpy (myCmdline, cmdline, sizeof(myCmdline)); // in case window's cmdline is in protected memory..for strtok
len = strlen (myCmdline);
myargc = 0;
while (myargc < MAXCMDLINEARGS)
{
// get token
while (myCmdline[i] == cSep)
i++;
if (i >= len)
break;
tokenstr = myCmdline + i;
if (myCmdline[i] == '"')
{
cSep = '"';
i++;
if (!prevCvar) //cvar leave the "" in
tokenstr++;
}
else
cSep = ' ';
//cvar
if (myCmdline[i] == '+' && cSep == ' ') //a + begins a cvarname, but not after quotes
bCvar = TRUE;
else
bCvar = FALSE;
while (myCmdline[i] &&
myCmdline[i] != cSep)
i++;
if (myCmdline[i] == '"')
{
cSep = ' ';
if (prevCvar)
i++; // get ending " quote in arg
}
prevCvar = bCvar;
if (myCmdline + i > tokenstr)
{
myWargv[myargc++] = tokenstr;
}
if (!myCmdline[i] || i >= len)
break;
myCmdline[i++] = '\0';
}
myWargv[myargc] = NULL;
// m_argv.c uses myargv[], we used myWargv because we fill the arguments ourselves
// and myargv is just a pointer, so we set it to point myWargv
myargv = myWargv;
}
static inline VOID MakeCodeWritable(VOID)
{
#ifdef USEASM // Disable write-protection of code segment
DWORD OldRights;
const DWORD NewRights = PAGE_EXECUTE_READWRITE;
PBYTE pBaseOfImage = (PBYTE)GetModuleHandle(NULL);
PIMAGE_DOS_HEADER dosH =(PIMAGE_DOS_HEADER)pBaseOfImage;
PIMAGE_NT_HEADERS ntH = (PIMAGE_NT_HEADERS)(pBaseOfImage + dosH->e_lfanew);
PIMAGE_OPTIONAL_HEADER oH = (PIMAGE_OPTIONAL_HEADER)
((PBYTE)ntH + sizeof (IMAGE_NT_SIGNATURE) + sizeof (IMAGE_FILE_HEADER));
LPVOID pA = pBaseOfImage+oH->BaseOfCode;
SIZE_T pS = oH->SizeOfCode;
#if 1 // try to find the text section
PIMAGE_SECTION_HEADER ntS = IMAGE_FIRST_SECTION (ntH);
WORD s;
for (s = 0; s < ntH->FileHeader.NumberOfSections; s++)
{
if (memcmp (ntS[s].Name, ".text\0\0", 8) == 0)
{
pA = pBaseOfImage+ntS[s].VirtualAddress;
pS = ntS[s].Misc.VirtualSize;
break;
}
}
#endif
if (!VirtualProtect(pA,pS,NewRights,&OldRights))
I_Error("Could not make code writable\n");
#endif
}
// -----------------------------------------------------------------------------
// HandledWinMain : called by exception handler
// -----------------------------------------------------------------------------
static int WINAPI HandledWinMain(HINSTANCE hInstance)
{
LPSTR args;
#ifdef LOGMESSAGES
// DEBUG!!! - set logstream to NULL to disable debug log
// Replace WIN32 filehandle with standard C calls, because WIN32 doesn't handle \n properly.
logstream = fopen(va("%s"PATHSEP"%s", srb2home, "log.txt"), "wt");
#endif
// fill myargc,myargv for m_argv.c retrieval of cmdline arguments
args = GetCommandLineA();
CONS_Printf("Command line arguments: '%s'\n", args);
GetArgcArgv(args);
// Create a text console window
OpenTextConsole();
#ifdef _DEBUG
{
int i;
CONS_Printf("Myargc: %d\n", myargc);
for (i = 0; i < myargc; i++)
CONS_Printf("myargv[%d] : '%s'\n", i, myargv[i]);
}
#endif
// open a dummy window, both OpenGL and DirectX need one.
if ((hWndMain = OpenMainWindow(hInstance, va("SRB2Kart "VERSIONSTRING))) == INVALID_HANDLE_VALUE)
{
tlErrorMessage(TEXT("Couldn't open window"));
return FALSE;
}
// currently starts DirectInput
CONS_Printf("I_StartupSystem() ...\n");
I_StartupSystem();
MakeCodeWritable();
// startup SRB2
CONS_Printf("Setting up SRB2Kart...\n");
D_SRB2Main();
CONS_Printf("Entering main game loop...\n");
// never return
D_SRB2Loop();
// back to Windoze
return 0;
}
// -----------------------------------------------------------------------------
// Exception handler calls WinMain for catching exceptions
// -----------------------------------------------------------------------------
int WINAPI WinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int Result = -1;
#if 0
// Win95 and NT <4 don't have this, so link at runtime.
p_IsDebuggerPresent pfnIsDebuggerPresent = (p_IsDebuggerPresent)GetProcAddress(GetModuleHandleA("kernel32.dll"),"IsDebuggerPresent");
#endif
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);
#if 0
#ifdef BUGTRAP
// Try BugTrap first.
if((!pfnIsDebuggerPresent || !pfnIsDebuggerPresent()) && InitBugTrap())
Result = HandledWinMain(hInstance);
else
{
#endif
// Try Dr MinGW's exception handler.
if (!pfnIsDebuggerPresent || !pfnIsDebuggerPresent())
#endif
LoadLibraryA("exchndl.dll");
#ifndef __MINGW32__
prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo);
#endif
Result = HandledWinMain(hInstance);
#ifdef BUGTRAP
} // BT failure clause.
// This is safe even if BT didn't start.
ShutdownBugTrap();
#endif
return Result;
}
#endif //_WINDOWS

View file

@ -1,45 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief Win32 Sharing
//#define WIN32_LEAN_AND_MEAN
#define RPC_NO_WINDOWS_H
#include <windows.h>
#include <stdio.h>
extern HWND hWndMain;
extern INT appActive;
VOID I_GetSysMouseEvents(INT mouse_state);
extern UINT MSHWheelMessage;
extern BOOL nodinput;
BOOL LoadDirectInput(VOID);
//faB: midi channel Volume set is delayed by the MIDI stream callback thread, see win_snd.c
#define WM_MSTREAM_UPDATEVOLUME (WM_USER + 101)
// defined in win_sys.c
VOID I_BeginProfile(VOID); //for timing code
DWORD I_EndProfile(VOID);
VOID I_ShowLastError(BOOL MB);
VOID I_LoadingScreen (LPCSTR msg);
VOID I_RestartSysMouse(VOID);
VOID I_DoStartupMouse(VOID);

View file

@ -1,42 +0,0 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// Copyright (C) 1998-2000 by DooM Legacy Team.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//-----------------------------------------------------------------------------
/// \file
/// \brief Win32 network interface
#include "../doomdef.h"
#include "../m_argv.h"
#include "../i_net.h"
#ifdef _WINDOWS
//
// NETWORKING
//
//
// I_InitNetwork
//
boolean I_InitNetwork(void)
{
if (M_CheckParm ("-net"))
{
I_Error("The Win32 version of SRB2Kart doesn't work with external drivers like ipxsetup, sersetup, or doomatic\n"
"Read the documentation about \"-server\" and \"-connect\" parameters or just use the launcher\n");
}
return false;
}
#endif

View file

@ -1,958 +0,0 @@
/// \file
/// \brief FMOD Ex interface for sound
#include "../doomdef.h"
#include "../sounds.h"
#include "../i_sound.h"
#include "../s_sound.h"
#include "../w_wad.h"
#include "../z_zone.h"
#include "../byteptr.h"
#include <fmod.h> // FMOD Ex
#define errcode _errcode
#include <fmod_errors.h>
#undef errcode
#ifdef HAVE_LIBGME
#include "gme/gme.h"
#define GME_TREBLE 5.0
#define GME_BASS 1.0
#ifdef HAVE_ZLIB
#ifndef _MSC_VER
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE
#endif
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 0
#endif
#include "zlib.h"
#endif // HAVE_ZLIB
#endif // HAVE_LIBGME
static FMOD_SYSTEM *fsys;
static FMOD_SOUND *music_stream;
static FMOD_CHANNEL *music_channel;
static UINT8 music_volume, midi_volume, sfx_volume;
static INT32 current_track;
#ifdef HAVE_LIBGME
static Music_Emu *gme;
#endif
//
// SYSTEM
//
// spew console messages for general errors.
static void FMR_Debug(FMOD_RESULT e, int line)
{
if (e != FMOD_OK)
CONS_Alert(CONS_ERROR, "FMOD:%d - %s\n", line, FMOD_ErrorString(e));
}
#define FMR(x) FMR_Debug(x, __LINE__)
// for operations on music_channel ONLY.
// returns false if music was released.
// (in other words, if !FMR_MUSIC(op) return immediately,
// because music_stream and music_channel are no longer valid.)
static boolean FMR_Music_Debug(FMOD_RESULT e, int line)
{
switch(e)
{
case FMOD_ERR_INVALID_HANDLE: // non-looping song ended
case FMOD_ERR_CHANNEL_STOLEN: // song ended and then sfx was played
FMOD_Sound_Release(music_stream);
music_stream = NULL;
return false;
default:
FMR_Debug(e, line);
break;
}
return true;
}
#define FMR_MUSIC(x) FMR_Music_Debug(x, __LINE__)
void I_StartupSound(void)
{
I_Assert(!sound_started);
sound_started = true;
FMR(FMOD_System_Create(&fsys));
FMR(FMOD_System_SetDSPBufferSize(fsys, 44100 / 30, 2));
FMR(FMOD_System_Init(fsys, 64, FMOD_INIT_VOL0_BECOMES_VIRTUAL, NULL));
music_stream = NULL;
#ifdef HAVE_LIBGME
gme = NULL;
#endif
current_track = -1;
}
void I_ShutdownSound(void)
{
I_Assert(sound_started);
sound_started = false;
#ifdef HAVE_LIBGME
if (gme)
gme_delete(gme);
#endif
FMR(FMOD_System_Release(fsys));
}
void I_UpdateSound(void)
{
FMR(FMOD_System_Update(fsys));
}
#ifdef HAVE_LIBGME
// Callback hook to read streaming GME data.
static FMOD_RESULT F_CALLBACK GMEReadCallback(FMOD_SOUND *sound, void *data, unsigned int datalen)
{
Music_Emu *emu;
void *emuvoid = NULL;
// get our emu
FMR(FMOD_Sound_GetUserData(sound, &emuvoid));
emu = emuvoid;
// no emu? no play.
if (!emu)
return FMOD_ERR_FILE_EOF;
if (gme_track_ended(emu))
{
// don't delete the primary music stream
if (emu == gme)
return FMOD_ERR_FILE_EOF;
// do delete sfx streams
FMR(FMOD_Sound_SetUserData(sound, NULL));
gme_delete(emu);
return FMOD_ERR_FILE_EOF;
}
// play beautiful musics theme of ancient land.
if (gme_play(emu, datalen/2, data))
return FMOD_ERR_FILE_BAD;
// O.K
return FMOD_OK;
}
#endif
//
// SFX
//
// convert doom format sound (signed 8bit)
// to an fmod format sound (unsigned 8bit)
// and return the FMOD_SOUND.
static inline FMOD_SOUND *ds2fmod(char *stream)
{
FMOD_SOUND *sound;
UINT16 ver;
UINT16 freq;
UINT32 samples;
FMOD_CREATESOUNDEXINFO fmt;
UINT32 i;
UINT8 *p;
// lump header
ver = READUINT16(stream); // sound version format?
if (ver != 3) // It should be 3 if it's a doomsound...
return NULL; // onos! it's not a doomsound!
freq = READUINT16(stream);
samples = READUINT32(stream);
//CONS_Printf("FMT: v%d f%d, s%d, b%d\n", ver, freq, samples, bps);
memset(&fmt, 0, sizeof(FMOD_CREATESOUNDEXINFO));
fmt.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
// convert to unsigned
fmt.format = FMOD_SOUND_FORMAT_PCM8; // 8bit
fmt.length = samples*1; // 1 bps
fmt.numchannels = 1; // mono
fmt.defaultfrequency = freq;
// Make a duplicate of the stream to change format.
p = Z_Malloc(fmt.length, PU_SOUND, NULL);
for (i = 0; i < fmt.length; i++)
p[i] = (UINT8)(stream[i]+0x80); // convert from signed to unsigned
stream = (char *)p;
// Create FMOD_SOUND.
FMR(FMOD_System_CreateSound(fsys, stream, FMOD_CREATESAMPLE|FMOD_OPENMEMORY|FMOD_OPENRAW|FMOD_SOFTWARE|FMOD_LOWMEM, &fmt, &sound));
Z_Free(stream); // FMOD made its own copy, so we don't need this anymore.
return sound;
}
void *I_GetSfx(sfxinfo_t *sfx)
{
FMOD_SOUND *sound;
char *lump;
FMOD_CREATESOUNDEXINFO fmt;
#ifdef HAVE_LIBGME
Music_Emu *emu;
gme_info_t *info;
#endif
if (sfx->lumpnum == LUMPERROR)
sfx->lumpnum = S_GetSfxLumpNum(sfx);
sfx->length = W_LumpLength(sfx->lumpnum);
lump = W_CacheLumpNum(sfx->lumpnum, PU_SOUND);
sound = ds2fmod(lump);
if (sound)
{
Z_Free(lump);
return sound;
}
// It's not a doom sound.
// Try to read it as an FMOD sound?
memset(&fmt, 0, sizeof(FMOD_CREATESOUNDEXINFO));
fmt.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
fmt.length = sfx->length;
#ifdef HAVE_LIBGME
// VGZ format
if ((UINT8)lump[0] == 0x1F
&& (UINT8)lump[1] == 0x8B)
{
#ifdef HAVE_ZLIB
UINT8 *inflatedData;
size_t inflatedLen;
z_stream stream;
int zErr; // Somewhere to handle any error messages zlib tosses out
memset(&stream, 0x00, sizeof (z_stream)); // Init zlib stream
// Begin the inflation process
inflatedLen = *(UINT32 *)(lump + (sfx->length-4)); // Last 4 bytes are the decompressed size, typically
inflatedData = (UINT8 *)Z_Malloc(inflatedLen, PU_SOUND, NULL); // Make room for the decompressed data
stream.total_in = stream.avail_in = sfx->length;
stream.total_out = stream.avail_out = inflatedLen;
stream.next_in = (UINT8 *)lump;
stream.next_out = inflatedData;
zErr = inflateInit2(&stream, 32 + MAX_WBITS);
if (zErr == Z_OK) // We're good to go
{
zErr = inflate(&stream, Z_FINISH);
if (zErr == Z_STREAM_END) {
// Run GME on new data
if (!gme_open_data(inflatedData, inflatedLen, &emu, 44100))
{
Z_Free(inflatedData); // GME supposedly makes a copy for itself, so we don't need this lying around
Z_Free(lump); // We're done with the uninflated lump now, too.
gme_start_track(emu, 0);
gme_track_info(emu, &info, 0);
fmt.format = FMOD_SOUND_FORMAT_PCM16;
fmt.defaultfrequency = 44100;
fmt.numchannels = 2;
fmt.length = ((UINT32)info->play_length * 441 / 10) * 4;
fmt.decodebuffersize = (44100 * 2) / 35;
fmt.pcmreadcallback = GMEReadCallback;
fmt.userdata = emu;
FMR(FMOD_System_CreateSound(fsys, NULL, FMOD_CREATESAMPLE|FMOD_OPENUSER|FMOD_SOFTWARE|FMOD_LOWMEM, &fmt, &sound));
return sound;
}
}
else
{
const char *errorType;
switch (zErr)
{
case Z_ERRNO:
errorType = "Z_ERRNO"; break;
case Z_STREAM_ERROR:
errorType = "Z_STREAM_ERROR"; break;
case Z_DATA_ERROR:
errorType = "Z_DATA_ERROR"; break;
case Z_MEM_ERROR:
errorType = "Z_MEM_ERROR"; break;
case Z_BUF_ERROR:
errorType = "Z_BUF_ERROR"; break;
case Z_VERSION_ERROR:
errorType = "Z_VERSION_ERROR"; break;
default:
errorType = "unknown error";
}
CONS_Alert(CONS_ERROR,"Encountered %s when running inflate: %s\n", errorType, stream.msg);
}
(void)inflateEnd(&stream);
}
else // Hold up, zlib's got a problem
{
const char *errorType;
switch (zErr)
{
case Z_ERRNO:
errorType = "Z_ERRNO"; break;
case Z_STREAM_ERROR:
errorType = "Z_STREAM_ERROR"; break;
case Z_DATA_ERROR:
errorType = "Z_DATA_ERROR"; break;
case Z_MEM_ERROR:
errorType = "Z_MEM_ERROR"; break;
case Z_BUF_ERROR:
errorType = "Z_BUF_ERROR"; break;
case Z_VERSION_ERROR:
errorType = "Z_VERSION_ERROR"; break;
default:
errorType = "unknown error";
}
CONS_Alert(CONS_ERROR,"Encountered %s when running inflateInit: %s\n", errorType, stream.msg);
}
Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up
#else
//CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n");
#endif
}
// Try to read it as a GME sound
else if (!gme_open_data(lump, sfx->length, &emu, 44100))
{
Z_Free(lump);
gme_start_track(emu, 0);
gme_track_info(emu, &info, 0);
fmt.format = FMOD_SOUND_FORMAT_PCM16;
fmt.defaultfrequency = 44100;
fmt.numchannels = 2;
fmt.length = ((UINT32)info->play_length * 441 / 10) * 4;
fmt.decodebuffersize = (44100 * 2) / 35;
fmt.pcmreadcallback = GMEReadCallback;
fmt.userdata = emu;
gme_free_info(info);
FMR(FMOD_System_CreateSound(fsys, NULL, FMOD_CREATESAMPLE|FMOD_OPENUSER|FMOD_SOFTWARE|FMOD_LOWMEM, &fmt, &sound));
return sound;
}
#endif
// Ogg, Mod, Midi, etc.
FMR(FMOD_System_CreateSound(fsys, lump, FMOD_CREATESAMPLE|FMOD_OPENMEMORY|FMOD_SOFTWARE|FMOD_LOWMEM, &fmt, &sound));
Z_Free(lump); // We're done with the lump now, at least.
return sound;
}
void I_FreeSfx(sfxinfo_t *sfx)
{
if (sfx->data)
FMOD_Sound_Release(sfx->data);
sfx->data = NULL;
}
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
{
FMOD_SOUND *sound;
FMOD_CHANNEL *chan;
INT32 i;
float frequency;
(void)channel;
sound = (FMOD_SOUND *)S_sfx[id].data;
I_Assert(sound != NULL);
FMR(FMOD_System_PlaySound(fsys, FMOD_CHANNEL_FREE, sound, true, &chan));
if (sep == 0)
sep = 1;
FMR(FMOD_Channel_SetVolume(chan, (vol / 255.0) * (sfx_volume / 31.0)));
FMR(FMOD_Channel_SetPan(chan, (sep - 128) / 127.0));
FMR(FMOD_Sound_GetDefaults(sound, &frequency, NULL, NULL, NULL));
FMR(FMOD_Channel_SetFrequency(chan, (pitch / 128.0) * frequency));
FMR(FMOD_Channel_SetPriority(chan, priority));
//UNREFERENCED_PARAMETER(priority);
//FMR(FMOD_Channel_SetPriority(chan, 1 + ((0xff-vol)>>1))); // automatic priority 1 - 128 based on volume (priority 0 is music)
FMR(FMOD_Channel_GetIndex(chan, &i));
FMR(FMOD_Channel_SetPaused(chan, false));
return i;
}
void I_StopSound(INT32 handle)
{
FMOD_CHANNEL *chan;
FMR(FMOD_System_GetChannel(fsys, handle, &chan));
if (music_stream && chan == music_channel)
return;
FMR(FMOD_Channel_Stop(chan));
}
boolean I_SoundIsPlaying(INT32 handle)
{
FMOD_CHANNEL *chan;
FMOD_BOOL playing;
FMOD_RESULT e;
FMR(FMOD_System_GetChannel(fsys, handle, &chan));
if (music_stream && chan == music_channel)
return false;
e = FMOD_Channel_IsPlaying(chan, &playing);
switch(e)
{
case FMOD_ERR_INVALID_HANDLE: // Sound effect finished.
case FMOD_ERR_CHANNEL_STOLEN: // Sound effect interrupted. -- technically impossible due to GetChannel by handle. :(
return false; // therefore, it's not playing anymore.
default:
FMR(e);
break;
}
return (boolean)playing;
}
// seems to never be called on an invalid channel (calls I_SoundIsPlaying first?)
// so I'm not gonna worry about it.
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch)
{
FMOD_CHANNEL *chan;
FMOD_SOUND *sound;
float frequency;
FMR(FMOD_System_GetChannel(fsys, handle, &chan));
FMR(FMOD_Channel_SetVolume(chan, (vol / 255.0) * (sfx_volume / 31.0)));
FMR(FMOD_Channel_SetPan(chan, (sep - 128) / 127.0));
FMR(FMOD_Channel_GetCurrentSound(chan, &sound));
FMR(FMOD_Sound_GetDefaults(sound, &frequency, NULL, NULL, NULL));
FMR(FMOD_Channel_SetFrequency(chan, (pitch / 128.0) * frequency));
//FMR(FMOD_Channel_SetPriority(chan, 1 + ((0xff-vol)>>1))); // automatic priority 1 - 128 based on volume (priority 0 is music)
}
void I_SetSfxVolume(UINT8 volume)
{
// volume is 0 to 31.
sfx_volume = volume;
}
/// ------------------------
// MUSIC SYSTEM
/// ------------------------
void I_InitMusic(void)
{
}
void I_ShutdownMusic(void)
{
I_StopSong();
}
/// ------------------------
// MUSIC PROPERTIES
/// ------------------------
musictype_t I_SongType(void)
{
FMOD_SOUND_TYPE type;
#ifdef HAVE_LIBGME
if (gme)
return MU_GME;
#endif
if (!music_stream)
return MU_NONE;
if (FMOD_Sound_GetFormat(music_stream, &type, NULL, NULL, NULL) == FMOD_OK)
{
switch(type)
{
case FMOD_SOUND_TYPE_WAV:
return MU_WAV;
case FMOD_SOUND_TYPE_MOD:
return MU_MOD;
case FMOD_SOUND_TYPE_MIDI:
return MU_MID;
case FMOD_SOUND_TYPE_OGGVORBIS:
return MU_OGG;
case FMOD_SOUND_TYPE_MPEG:
return MU_MP3;
case FMOD_SOUND_TYPE_FLAC:
return MU_FLAC;
default:
return MU_NONE;
}
}
else
return MU_NONE;
}
boolean I_SongPlaying(void)
{
return (music_stream != NULL);
}
boolean I_SongPaused(void)
{
FMOD_BOOL fmpaused = false;
if (music_stream)
FMOD_Channel_GetPaused(music_channel, &fmpaused);
return (boolean)fmpaused;
}
/// ------------------------
// MUSIC EFFECTS
/// ------------------------
boolean I_SetSongSpeed(float speed)
{
FMOD_RESULT e;
float frequency;
if (!music_stream)
return false;
if (speed > 250.0f)
speed = 250.0f; //limit speed up to 250x
#ifdef HAVE_LIBGME
// Try to set GME speed
if (gme)
{
gme_set_tempo(gme, speed);
return true;
}
#endif
// Try to set Mod/Midi speed
e = FMOD_Sound_SetMusicSpeed(music_stream, speed);
if (e == FMOD_ERR_FORMAT)
{
// Just change pitch instead for Ogg/etc.
FMR(FMOD_Sound_GetDefaults(music_stream, &frequency, NULL, NULL, NULL));
FMR_MUSIC(FMOD_Channel_SetFrequency(music_channel, speed*frequency));
}
else
FMR_MUSIC(e);
return true;
}
/// ------------------------
// MUSIC PLAYBACK
/// ------------------------
boolean I_LoadSong(char *data, size_t len)
{
FMOD_CREATESOUNDEXINFO fmt;
FMOD_RESULT e;
FMOD_TAG tag;
unsigned int loopstart, loopend;
if (
#ifdef HAVE_LIBGME
gme ||
#endif
music_stream
)
I_UnloadSong();
memset(&fmt, 0, sizeof(FMOD_CREATESOUNDEXINFO));
fmt.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
#ifdef HAVE_LIBGME
if ((UINT8)data[0] == 0x1F
&& (UINT8)data[1] == 0x8B)
{
#ifdef HAVE_ZLIB
UINT8 *inflatedData;
size_t inflatedLen;
z_stream stream;
int zErr; // Somewhere to handle any error messages zlib tosses out
memset(&stream, 0x00, sizeof (z_stream)); // Init zlib stream
// Begin the inflation process
inflatedLen = *(UINT32 *)(data + (len-4)); // Last 4 bytes are the decompressed size, typically
inflatedData = (UINT8 *)Z_Calloc(inflatedLen, PU_MUSIC, NULL); // Make room for the decompressed data
stream.total_in = stream.avail_in = len;
stream.total_out = stream.avail_out = inflatedLen;
stream.next_in = (UINT8 *)data;
stream.next_out = inflatedData;
zErr = inflateInit2(&stream, 32 + MAX_WBITS);
if (zErr == Z_OK) // We're good to go
{
zErr = inflate(&stream, Z_FINISH);
if (zErr == Z_STREAM_END) {
// Run GME on new data
if (!gme_open_data(inflatedData, inflatedLen, &gme, 44100))
{
gme_equalizer_t gmeq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0};
Z_Free(inflatedData); // GME supposedly makes a copy for itself, so we don't need this lying around
Z_Free(data); // We don't need this, either.
gme_set_equalizer(gme,&gmeq);
fmt.format = FMOD_SOUND_FORMAT_PCM16;
fmt.defaultfrequency = 44100;
fmt.numchannels = 2;
fmt.length = -1;
fmt.decodebuffersize = (44100 * 2) / 35;
fmt.pcmreadcallback = GMEReadCallback;
fmt.userdata = gme;
FMR(FMOD_System_CreateStream(fsys, NULL, FMOD_OPENUSER, &fmt, &music_stream));
return true;
}
}
else
{
const char *errorType;
switch (zErr)
{
case Z_ERRNO:
errorType = "Z_ERRNO"; break;
case Z_STREAM_ERROR:
errorType = "Z_STREAM_ERROR"; break;
case Z_DATA_ERROR:
errorType = "Z_DATA_ERROR"; break;
case Z_MEM_ERROR:
errorType = "Z_MEM_ERROR"; break;
case Z_BUF_ERROR:
errorType = "Z_BUF_ERROR"; break;
case Z_VERSION_ERROR:
errorType = "Z_VERSION_ERROR"; break;
default:
errorType = "unknown error";
}
CONS_Alert(CONS_ERROR,"Encountered %s when running inflate: %s\n", errorType, stream.msg);
}
(void)inflateEnd(&stream);
}
else // Hold up, zlib's got a problem
{
const char *errorType;
switch (zErr)
{
case Z_ERRNO:
errorType = "Z_ERRNO"; break;
case Z_STREAM_ERROR:
errorType = "Z_STREAM_ERROR"; break;
case Z_DATA_ERROR:
errorType = "Z_DATA_ERROR"; break;
case Z_MEM_ERROR:
errorType = "Z_MEM_ERROR"; break;
case Z_BUF_ERROR:
errorType = "Z_BUF_ERROR"; break;
case Z_VERSION_ERROR:
errorType = "Z_VERSION_ERROR"; break;
default:
errorType = "unknown error";
}
CONS_Alert(CONS_ERROR,"Encountered %s when running inflateInit: %s\n", errorType, stream.msg);
}
Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up
#else
//CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n");
#endif
}
else if (!gme_open_data(data, len, &gme, 44100))
{
gme_equalizer_t gmeq = {GME_TREBLE, GME_BASS, 0,0,0,0,0,0,0,0};
Z_Free(data); // We don't need this anymore.
gme_set_equalizer(gme,&gmeq);
fmt.format = FMOD_SOUND_FORMAT_PCM16;
fmt.defaultfrequency = 44100;
fmt.numchannels = 2;
fmt.length = -1;
fmt.decodebuffersize = (44100 * 2) / 35;
fmt.pcmreadcallback = GMEReadCallback;
fmt.userdata = gme;
FMR(FMOD_System_CreateStream(fsys, NULL, FMOD_OPENUSER, &fmt, &music_stream));
return true;
}
#endif
fmt.length = len;
e = FMOD_System_CreateStream(fsys, data, FMOD_OPENMEMORY_POINT, &fmt, &music_stream);
if (e != FMOD_OK)
{
if (e == FMOD_ERR_FORMAT)
CONS_Alert(CONS_WARNING, "Failed to play music lump due to invalid format.\n");
else
FMR(e);
return false;
}
// Try to find a loop point in streaming music formats (ogg, mp3)
// A proper LOOPPOINT is its own tag, stupid.
e = FMOD_Sound_GetTag(music_stream, "LOOPPOINT", 0, &tag);
if (e != FMOD_ERR_TAGNOTFOUND)
{
FMR(e);
loopstart = atoi((char *)tag.data); // assumed to be a string data tag.
FMR(FMOD_Sound_GetLoopPoints(music_stream, NULL, FMOD_TIMEUNIT_PCM, &loopend, FMOD_TIMEUNIT_PCM));
if (loopstart > 0)
FMR(FMOD_Sound_SetLoopPoints(music_stream, loopstart, FMOD_TIMEUNIT_PCM, loopend, FMOD_TIMEUNIT_PCM));
return true;
}
// Use LOOPMS for time in miliseconds.
e = FMOD_Sound_GetTag(music_stream, "LOOPMS", 0, &tag);
if (e != FMOD_ERR_TAGNOTFOUND)
{
FMR(e);
loopstart = atoi((char *)tag.data); // assumed to be a string data tag.
FMR(FMOD_Sound_GetLoopPoints(music_stream, NULL, FMOD_TIMEUNIT_MS, &loopend, FMOD_TIMEUNIT_PCM));
if (loopstart > 0)
FMR(FMOD_Sound_SetLoopPoints(music_stream, loopstart, FMOD_TIMEUNIT_MS, loopend, FMOD_TIMEUNIT_PCM));
return true;
}
// Try to fetch it from the COMMENT tag, like A.J. Freda
e = FMOD_Sound_GetTag(music_stream, "COMMENT", 0, &tag);
if (e != FMOD_ERR_TAGNOTFOUND)
{
char *loopText;
// Handle any errors that arose, first
FMR(e);
// Figure out where the number starts
loopText = strstr((char *)tag.data,"LOOPPOINT=");
if (loopText != NULL)
{
// Skip the "LOOPPOINT=" part.
loopText += 10;
// Convert it to our looppoint
// FMOD seems to ensure the tag is properly NULL-terminated.
// atoi will stop when it reaches anything that's not a number.
loopstart = atoi(loopText);
// Now do the rest like above
FMR(FMOD_Sound_GetLoopPoints(music_stream, NULL, FMOD_TIMEUNIT_PCM, &loopend, FMOD_TIMEUNIT_PCM));
if (loopstart > 0)
FMR(FMOD_Sound_SetLoopPoints(music_stream, loopstart, FMOD_TIMEUNIT_PCM, loopend, FMOD_TIMEUNIT_PCM));
}
return true;
}
// No special loop point
return true;
}
void I_UnloadSong(void)
{
I_StopSong();
#ifdef HAVE_LIBGME
if (gme)
{
gme_delete(gme);
gme = NULL;
}
#endif
if (music_stream)
{
FMR(FMOD_Sound_Release(music_stream));
music_stream = NULL;
}
}
boolean I_PlaySong(boolean looping)
{
#ifdef HAVE_LIBGME
if (gme)
{
gme_start_track(gme, 0);
current_track = 0;
FMR(FMOD_System_PlaySound(fsys, FMOD_CHANNEL_FREE, music_stream, false, &music_channel));
FMR(FMOD_Channel_SetVolume(music_channel, music_volume / 31.0));
FMR(FMOD_Channel_SetPriority(music_channel, 0));
return true;
}
#endif
FMR(FMOD_Sound_SetMode(music_stream, (looping ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF)));
FMR(FMOD_System_PlaySound(fsys, FMOD_CHANNEL_FREE, music_stream, false, &music_channel));
if (I_SongType() != MU_MID)
FMR(FMOD_Channel_SetVolume(music_channel, midi_volume / 31.0));
else
FMR(FMOD_Channel_SetVolume(music_channel, music_volume / 31.0));
FMR(FMOD_Channel_SetPriority(music_channel, 0));
current_track = 0;
return true;
}
void I_StopSong(void)
{
if (music_channel)
FMR_MUSIC(FMOD_Channel_Stop(music_channel));
}
void I_PauseSong(void)
{
if (music_channel)
FMR_MUSIC(FMOD_Channel_SetPaused(music_channel, true));
}
void I_ResumeSong(void)
{
if (music_channel)
FMR_MUSIC(FMOD_Channel_SetPaused(music_channel, false));
}
void I_SetMusicVolume(UINT8 volume)
{
if (!music_channel)
return;
// volume is 0 to 31.
if (I_SongType() == MU_MID)
music_volume = 31; // windows bug hack
else
music_volume = volume;
FMR_MUSIC(FMOD_Channel_SetVolume(music_channel, music_volume / 31.0));
}
UINT32 I_GetSongLength(void)
{
UINT32 length;
if (I_SongType() == MU_MID)
return 0;
FMR_MUSIC(FMOD_Sound_GetLength(music_stream, &length, FMOD_TIMEUNIT_MS));
return length;
}
boolean I_SetSongLoopPoint(UINT32 looppoint)
{
(void)looppoint;
return false;
}
UINT32 I_GetSongLoopPoint(void)
{
return 0;
}
boolean I_SetSongPosition(UINT32 position)
{
FMOD_RESULT e;
if(I_SongType() == MU_MID)
// Dummy out; this works for some MIDI, but not others.
// SDL does not support this for any MIDI.
return false;
e = FMOD_Channel_SetPosition(music_channel, position, FMOD_TIMEUNIT_MS);
if (e == FMOD_OK)
return true;
else if (e == FMOD_ERR_UNSUPPORTED // Only music modules, numbnuts!
|| e == FMOD_ERR_INVALID_POSITION) // Out-of-bounds!
return false;
else // Congrats, you horribly broke it somehow
{
FMR_MUSIC(e);
return false;
}
}
UINT32 I_GetSongPosition(void)
{
FMOD_RESULT e;
unsigned int fmposition = 0;
if(I_SongType() == MU_MID)
// Dummy out because unsupported, even though FMOD does this correctly.
return 0;
e = FMOD_Channel_GetPosition(music_channel, &fmposition, FMOD_TIMEUNIT_MS);
if (e == FMOD_OK)
return (UINT32)fmposition;
else
return 0;
}
boolean I_SetSongTrack(INT32 track)
{
if (track != current_track) // If the track's already playing, then why bother?
{
FMOD_RESULT e;
#ifdef HAVE_LIBGME
// If the specified track is within the number of tracks playing, then change it
if (gme)
{
if (track >= 0
&& track < gme_track_count(gme))
{
gme_err_t gme_e = gme_start_track(gme,track);
if (gme_e == NULL)
{
current_track = track;
return true;
}
else
CONS_Alert(CONS_ERROR, "Encountered GME error: %s\n", gme_e);
}
return false;
}
#endif // HAVE_LIBGME
// Try to set it via FMOD
e = FMOD_Channel_SetPosition(music_channel, (UINT32)track, FMOD_TIMEUNIT_MODORDER);
if (e == FMOD_OK) // We good
{
current_track = track;
return true;
}
else if (e == FMOD_ERR_UNSUPPORTED // Only music modules, numbnuts!
|| e == FMOD_ERR_INVALID_POSITION) // Out-of-bounds!
return false;
else // Congrats, you horribly broke it somehow
{
FMR_MUSIC(e);
return false;
}
}
return false;
}
/// ------------------------
/// MUSIC FADING
/// ------------------------
void I_SetInternalMusicVolume(UINT8 volume)
{
(void)volume;
}
void I_StopFadingSong(void)
{
}
boolean I_FadeSongFromVolume(UINT8 target_volume, UINT8 source_volume, UINT32 ms, void (*callback)(void))
{
(void)target_volume;
(void)source_volume;
(void)ms;
(void)callback;
return false;
}
boolean I_FadeSong(UINT8 target_volume, UINT32 ms, void (*callback)(void))
{
(void)target_volume;
(void)ms;
(void)callback;
return false;
}
boolean I_FadeOutStopSong(UINT32 ms)
{
(void)ms;
return false;
}
boolean I_FadeInPlaySong(UINT32 ms, boolean looping)
{
(void)ms;
(void)looping;
return false;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff