mirror of
https://github.com/libretro/RetroArch
synced 2025-03-27 23:37:39 +00:00
win32: make d3d9 compile in msvc, add linker pragmas to source files
This commit is contained in:
parent
46b958c7fa
commit
54d39dff74
@ -14,6 +14,11 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma comment( lib, "dsound" )
|
||||||
|
#pragma comment( lib, "dxguid" )
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
|
#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
|
||||||
#define DSERR_INVALIDPARAM E_INVALIDARG
|
#define DSERR_INVALIDPARAM E_INVALIDARG
|
||||||
|
@ -30,9 +30,6 @@ class ConfigFile
|
|||||||
conf = config_file_new(nullptr);
|
conf = config_file_new(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigFile(const ConfigFile&) = delete;
|
|
||||||
void operator=(const ConfigFile&) = delete;
|
|
||||||
|
|
||||||
operator bool() { return conf; }
|
operator bool() { return conf; }
|
||||||
|
|
||||||
ConfigFile& operator=(ConfigFile&& _in)
|
ConfigFile& operator=(ConfigFile&& _in)
|
||||||
@ -168,6 +165,9 @@ class ConfigFile
|
|||||||
private:
|
private:
|
||||||
config_file_t *conf;
|
config_file_t *conf;
|
||||||
std::string path;
|
std::string path;
|
||||||
|
|
||||||
|
ConfigFile(const ConfigFile&) {};
|
||||||
|
void operator=(const ConfigFile&) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,6 +19,13 @@
|
|||||||
// It is written in C++11 (should be compat with MSVC 2010).
|
// It is written in C++11 (should be compat with MSVC 2010).
|
||||||
// Might get rewritten in C99 if I have lots of time to burn.
|
// Might get rewritten in C99 if I have lots of time to burn.
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma comment( lib, "d3d9" )
|
||||||
|
#pragma comment( lib, "d3dx9" )
|
||||||
|
#pragma comment( lib, "cgd3d9" )
|
||||||
|
#pragma comment( lib, "dxguid" )
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "d3d9.hpp"
|
#include "d3d9.hpp"
|
||||||
#include "render_chain.hpp"
|
#include "render_chain.hpp"
|
||||||
#include "config_file.hpp"
|
#include "config_file.hpp"
|
||||||
|
@ -696,10 +696,10 @@ void RenderChain::bind_prev(Pass &pass)
|
|||||||
|
|
||||||
for (unsigned i = 0; i < Textures - 1; i++)
|
for (unsigned i = 0; i < Textures - 1; i++)
|
||||||
{
|
{
|
||||||
std::snprintf(attr_texture, sizeof(attr_texture), "%s.texture", prev_names[i]);
|
snprintf(attr_texture, sizeof(attr_texture), "%s.texture", prev_names[i]);
|
||||||
std::snprintf(attr_input_size, sizeof(attr_input_size), "%s.video_size", prev_names[i]);
|
snprintf(attr_input_size, sizeof(attr_input_size), "%s.video_size", prev_names[i]);
|
||||||
std::snprintf(attr_tex_size, sizeof(attr_tex_size), "%s.texture_size", prev_names[i]);
|
snprintf(attr_tex_size, sizeof(attr_tex_size), "%s.texture_size", prev_names[i]);
|
||||||
std::snprintf(attr_coord, sizeof(attr_coord), "%s.tex_coord", prev_names[i]);
|
snprintf(attr_coord, sizeof(attr_coord), "%s.tex_coord", prev_names[i]);
|
||||||
|
|
||||||
D3DXVECTOR2 video_size;
|
D3DXVECTOR2 video_size;
|
||||||
video_size.x = prev.last_width[(prev.ptr - (i + 1)) & TexturesMask];
|
video_size.x = prev.last_width[(prev.ptr - (i + 1)) & TexturesMask];
|
||||||
@ -1002,7 +1002,8 @@ void RenderChain::init_fvf(Pass &pass)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
pass.attrib_map.push_back(index);
|
pass.attrib_map.push_back(index);
|
||||||
decl[i] = DECL_FVF_TEXCOORD(index, 3, tex_index);
|
D3DVERTEXELEMENT9 elem = DECL_FVF_TEXCOORD(index, 3, tex_index);
|
||||||
|
decl[i] = elem;
|
||||||
|
|
||||||
// Find next vacant stream.
|
// Find next vacant stream.
|
||||||
index++;
|
index++;
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma comment( lib, "winmm" )
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "gfx_common.h"
|
#include "gfx_common.h"
|
||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
|
|
||||||
|
4
gfx/gl.c
4
gfx/gl.c
@ -14,6 +14,10 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma comment( lib, "opengl32" )
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../driver.h"
|
#include "../driver.h"
|
||||||
#include "../performance.h"
|
#include "../performance.h"
|
||||||
#include "scaler/scaler.h"
|
#include "scaler/scaler.h"
|
||||||
|
@ -13,6 +13,11 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma comment( lib, "cg" )
|
||||||
|
#pragma comment( lib, "cggl" )
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "shader_cg.h"
|
#include "shader_cg.h"
|
||||||
#include <Cg/cg.h>
|
#include <Cg/cg.h>
|
||||||
#include <Cg/cgGL.h>
|
#include <Cg/cgGL.h>
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma comment( lib, "Dinput8" )
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef DIRECTINPUT_VERSION
|
#undef DIRECTINPUT_VERSION
|
||||||
#define DIRECTINPUT_VERSION 0x0800
|
#define DIRECTINPUT_VERSION 0x0800
|
||||||
#include <dinput.h>
|
#include <dinput.h>
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
<CharacterSet>NotSet</CharacterSet>
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
@ -46,7 +45,6 @@
|
|||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>NotSet</CharacterSet>
|
<CharacterSet>NotSet</CharacterSet>
|
||||||
<PlatformToolset>v110</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
@ -98,7 +96,7 @@
|
|||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalDependencies>opengl32.lib;dsound.lib;Winmm.lib;Dinput8.lib;ws2_32.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>winmm.lib;Dinput8.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
@ -107,7 +105,7 @@
|
|||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_CONFIGFILE;HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;PACKAGE_VERSION="0.9.8-beta2";_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_CONFIGFILE;HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;PACKAGE_VERSION="0.9.8-beta2";_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<CompileAs>CompileAsCpp</CompileAs>
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
@ -115,7 +113,7 @@
|
|||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalDependencies>opengl32.lib;dsound.lib;Winmm.lib;Dinput8.lib;ws2_32.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>winmm.lib;Dinput8.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
@ -136,7 +134,7 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>opengl32.lib;dsound.lib;Winmm.lib;Dinput8.lib;ws2_32.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>winmm.lib;Dinput8.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
@ -147,7 +145,7 @@
|
|||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_CONFIGFILE;HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;PACKAGE_VERSION="0.9.8-beta2";_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;HAVE_WIN32_D3D9;HAVE_CG;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_CONFIGFILE;HAVE_SCREENSHOTS;HAVE_BSV_MOVIE;HAVE_DINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;PACKAGE_VERSION="0.9.8-beta2";_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<CompileAs>CompileAsCpp</CompileAs>
|
<CompileAs>CompileAsCpp</CompileAs>
|
||||||
@ -157,7 +155,7 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>opengl32.lib;dsound.lib;Winmm.lib;Dinput8.lib;ws2_32.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>winmm.lib;Dinput8.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -185,6 +183,7 @@
|
|||||||
<ClCompile Include="..\..\gfx\d3d9\render_chain.cpp" />
|
<ClCompile Include="..\..\gfx\d3d9\render_chain.cpp" />
|
||||||
<ClCompile Include="..\..\gfx\fonts\freetype.c">
|
<ClCompile Include="..\..\gfx\fonts\freetype.c">
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\gfx\shader_cg.c" />
|
||||||
<ClCompile Include="..\..\performance.c">
|
<ClCompile Include="..\..\performance.c">
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\command.c">
|
<ClCompile Include="..\..\command.c">
|
||||||
|
@ -186,6 +186,9 @@
|
|||||||
<ClCompile Include="..\..\gfx\d3d9\render_chain.cpp">
|
<ClCompile Include="..\..\gfx\d3d9\render_chain.cpp">
|
||||||
<Filter>Source Files\gfx\d3d9</Filter>
|
<Filter>Source Files\gfx\d3d9</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\gfx\shader_cg.c">
|
||||||
|
<Filter>Source Files\gfx</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="resource.h">
|
<ClInclude Include="resource.h">
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma comment( lib, "ws2_32" )
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "netplay_compat.h"
|
#include "netplay_compat.h"
|
||||||
#include "netplay.h"
|
#include "netplay.h"
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user