windows: continue the merge, handle some subprojects linking

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-05-15 17:34:31 +02:00 committed by Kojin
parent 763533060a
commit d5abf459bb
15 changed files with 59 additions and 39 deletions

View File

@ -18,12 +18,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Include", "Include", "{0FAD
common\include\afxresmw.h = common\include\afxresmw.h common\include\afxresmw.h = common\include\afxresmw.h
common\include\Pcsx2Defs.h = common\include\Pcsx2Defs.h common\include\Pcsx2Defs.h = common\include\Pcsx2Defs.h
common\include\Pcsx2Types.h = common\include\Pcsx2Types.h common\include\Pcsx2Types.h = common\include\Pcsx2Types.h
common\include\PluginCallbacks.h = common\include\PluginCallbacks.h
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{2D6F0A62-A247-4CCF-947F-FCD54BE16103}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{2D6F0A62-A247-4CCF-947F-FCD54BE16103}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcsx2", "pcsx2\windows\VCprojects\pcsx2.vcxproj", "{1CEFD830-2B76-4596-A4EE-BCD7280A60BD}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcsx2", "pcsx2\windows\VCprojects\pcsx2.vcxproj", "{1CEFD830-2B76-4596-A4EE-BCD7280A60BD}"
ProjectSection(ProjectDependencies) = postProject
{12728250-16EC-4DC6-94D7-E21DD88947F8} = {12728250-16EC-4DC6-94D7-E21DD88947F8}
{27F17499-A372-4408-8AFA-4F9F4584FBD3} = {27F17499-A372-4408-8AFA-4F9F4584FBD3}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "3rdparty\soundtouch\SoundTouch.vcxproj", "{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "3rdparty\soundtouch\SoundTouch.vcxproj", "{E9B51944-7E6D-4BCD-83F2-7BBD5A46182D}"
EndProject EndProject

View File

@ -16,17 +16,18 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include <stdio.h> #include <stdio.h>
#include <commdlg.h> #include <commdlg.h>
#include <commctrl.h>
#include <string> #include <string>
#include "ghc/filesystem.h" #include "ghc/filesystem.h"
#include "fmt/format.h" #include "fmt/format.h"
#include "..\Config.h" #include "DEV9/Config.h"
#include "resource.h" #include "resource.h"
#include "..\DEV9.h" #include "DEV9/DEV9.h"
#include "..\pcap_io.h" #include "DEV9/pcap_io.h"
#include "..\net.h" #include "DEV9/net.h"
#include "..\PacketReader\IP\IP_Address.h" #include "DEV9/PacketReader\IP\IP_Address.h"
#include "tap.h" #include "tap.h"
#include "AppCoreThread.h" #include "AppCoreThread.h"

View File

@ -25,8 +25,6 @@
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h> #include <windows.h>
#include <commctrl.h> #include <commctrl.h>
#include <commdlg.h> #include <commdlg.h>
@ -113,7 +111,11 @@
#include <memory> #include <memory>
#include <bitset> #include <bitset>
#ifdef __POSIX__
#include <zlib.h> #include <zlib.h>
#else
#include <zlib/zlib.h>
#endif
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
@ -1968,4 +1970,4 @@ extern bool gsopen_done;
void GSDoFreezeOut(void* dest); void GSDoFreezeOut(void* dest);
void GSDoFreezeIn(pxInputStream& infp); void GSDoFreezeIn(pxInputStream& infp);

View File

@ -54,6 +54,34 @@ typedef signed long long sint64;
#endif #endif
#ifdef _WIN32
inline std::string convert_utf16_to_utf8(const std::wstring& utf16_string)
{
const int size = WideCharToMultiByte(CP_UTF8, 0, utf16_string.c_str(), utf16_string.size(), nullptr, 0, nullptr, nullptr);
std::string converted_string(size, 0);
WideCharToMultiByte(CP_UTF8, 0, utf16_string.c_str(), utf16_string.size(), converted_string.data(), converted_string.size(), nullptr, nullptr);
return converted_string;
}
inline std::wstring convert_utf8_to_utf16(const std::string& utf8_string)
{
int size = MultiByteToWideChar(CP_UTF8, 0, utf8_string.c_str(), -1, nullptr, 0);
std::vector<wchar_t> converted_string(size);
MultiByteToWideChar(CP_UTF8, 0, utf8_string.c_str(), -1, converted_string.data(), converted_string.size());
return {converted_string.data()};
}
#endif
// _wfopen has to be used on Windows for pathnames containing non-ASCII characters.
inline FILE* px_fopen(const std::string& filename, const std::string& mode)
{
#ifdef _WIN32
return _wfopen(convert_utf8_to_utf16(filename).c_str(), convert_utf8_to_utf16(mode).c_str());
#else
return fopen(filename.c_str(), mode.c_str());
#endif
}
#define _MM_TRANSPOSE4_SI128(row0, row1, row2, row3) \ #define _MM_TRANSPOSE4_SI128(row0, row1, row2, row3) \
{ \ { \
__m128 tmp0 = _mm_shuffle_ps(_mm_castsi128_ps(row0), _mm_castsi128_ps(row1), 0x44); \ __m128 tmp0 = _mm_shuffle_ps(_mm_castsi128_ps(row0), _mm_castsi128_ps(row1), 0x44); \
@ -70,22 +98,10 @@ typedef signed long long sint64;
extern void* vmalloc(size_t size, bool code); extern void* vmalloc(size_t size, bool code);
extern void vmfree(void* ptr, size_t size); extern void vmfree(void* ptr, size_t size);
// _wfopen has to be used on Windows for pathnames containing non-ASCII characters.
inline FILE* px_fopen(const std::string& filename, const std::string& mode)
{
#ifdef _WIN32
return _wfopen(convert_utf8_to_utf16(filename).c_str(), convert_utf8_to_utf16(mode).c_str());
#else
return fopen(filename.c_str(), mode.c_str());
#endif
}
#define countof(a) (sizeof(a) / sizeof(a[0])) #define countof(a) (sizeof(a) / sizeof(a[0]))
#ifdef __cpp_constinit #ifdef __cpp_constinit
#define CONSTINIT constinit #define CONSTINIT constinit
#elif __has_attribute(require_constant_initialization)
#define CONSTINIT __attribute__((require_constant_initialization))
#else #else
#define CONSTINIT #define CONSTINIT
#endif #endif

View File

@ -19,7 +19,7 @@
#include "GS/GSVector.h" #include "GS/GSVector.h"
#include "GSVertex.h" #include "GSVertex.h"
#include "GSTexture.h" #include "GSTexture.h"
#include <ft2build.h> #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
class GSOsdManager class GSOsdManager

View File

@ -23,7 +23,7 @@
//#define ONLY_LINES //#define ONLY_LINES
#ifdef _WIN32 #ifdef _WIN32
#include "resource.h" #include "GS/resource.h"
#else #else
#include "GS_res.h" #include "GS_res.h"
#endif #endif

View File

@ -18,7 +18,7 @@
#include "GLState.h" #include "GLState.h"
#ifdef _WIN32 #ifdef _WIN32
#include "resource.h" #include "GS/resource.h"
#else #else
#include "GS_res.h" #include "GS_res.h"
#endif #endif

View File

@ -1554,7 +1554,7 @@ keyEvent* PADkeyEvent()
return &ev; return &ev;
} }
struct PadFreezeData struct PadFullFreezeData
{ {
char format[8]; char format[8];
// Currently all different versions are incompatible. // Currently all different versions are incompatible.
@ -1577,13 +1577,13 @@ s32 PADfreeze(int mode, freezeData* data)
if (mode == FREEZE_SIZE) if (mode == FREEZE_SIZE)
{ {
data->size = sizeof(PadFreezeData); data->size = sizeof(PadFullFreezeData);
} }
else if (mode == FREEZE_LOAD) else if (mode == FREEZE_LOAD)
{ {
PadFreezeData& pdata = *(PadFreezeData*)(data->data); PadFullFreezeData& pdata = *(PadFullFreezeData*)(data->data);
StopVibrate(); StopVibrate();
if (data->size != sizeof(PadFreezeData) || if (data->size != sizeof(PadFullFreezeData) ||
pdata.version != PAD_SAVE_STATE_VERSION || pdata.version != PAD_SAVE_STATE_VERSION ||
strcmp(pdata.format, "PadMode")) strcmp(pdata.format, "PadMode"))
return 0; return 0;
@ -1620,9 +1620,9 @@ s32 PADfreeze(int mode, freezeData* data)
} }
else if (mode == FREEZE_SAVE) else if (mode == FREEZE_SAVE)
{ {
if (data->size != sizeof(PadFreezeData)) if (data->size != sizeof(PadFullFreezeData))
return 0; return 0;
PadFreezeData& pdata = *(PadFreezeData*)(data->data); PadFullFreezeData& pdata = *(PadFullFreezeData*)(data->data);
// Tales of the Abyss - pad fix // Tales of the Abyss - pad fix

View File

@ -33,6 +33,7 @@
#include <mutex> #include <mutex>
#include <queue> #include <queue>
#include "App.h"
typedef struct typedef struct
{ {

View File

@ -1363,7 +1363,7 @@ void AddTooltip(UINT id, HWND hWnd)
{ {
static UINT tooltipStructSize = GetTooltipStructSize(); static UINT tooltipStructSize = GetTooltipStructSize();
bool hasTooltip; bool hasTooltip;
LPWSTR message = dialog_message(id, &hasTooltip); LPWSTR message = pad_dialog_message(id, &hasTooltip);
if (!hasTooltip) if (!hasTooltip)
return; return;

View File

@ -17,7 +17,7 @@
#include "Global.h" #include "Global.h"
#include "resource_pad.h" #include "resource_pad.h"
LPWSTR dialog_message(int ID, bool* updateText) LPWSTR pad_dialog_message(int ID, bool* updateText)
{ {
if (updateText) if (updateText)
*updateText = true; *updateText = true;

View File

@ -18,6 +18,6 @@
#include "Global.h" #include "Global.h"
LPWSTR dialog_message(int ID, bool* updateText = false); LPWSTR pad_dialog_message(int ID, bool* updateText = false);
#endif #endif

View File

@ -16,7 +16,7 @@
// Used OBS as example // Used OBS as example
#include "audiodeviceproxy.h" #include "audiodeviceproxy.h"
#include "USB/libsamplerate/samplerate.h" #include <libsamplerate/samplerate.h>
#include "USB/shared/ringbuffer.h" #include "USB/shared/ringbuffer.h"
#include <mmdeviceapi.h> #include <mmdeviceapi.h>

View File

@ -57,7 +57,7 @@
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup> <ItemDefinitionGroup>
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>$(ProjectRootDir)/gui;$(SvnRootDir)\3rdparty\xbyak;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectRootDir)/gui;$(SolutionDir)3rdparty\xbyak;$(SolutionDir)3rdparty\freetype\include;$(SolutionDir)3rdparty\xz\xz\src\liblzma\api;$(SolutionDir)3rdparty/baseclasses/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Async</ExceptionHandling> <ExceptionHandling>Async</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile> <PrecompiledHeaderFile>PrecompiledHeader.h</PrecompiledHeaderFile>
@ -475,7 +475,6 @@
<ClCompile Include="..\..\GS\Renderers\SW\GSDrawScanlineCodeGenerator.x86.avx2.cpp" /> <ClCompile Include="..\..\GS\Renderers\SW\GSDrawScanlineCodeGenerator.x86.avx2.cpp" />
<ClCompile Include="..\..\GS\Renderers\SW\GSDrawScanlineCodeGenerator.x86.cpp" /> <ClCompile Include="..\..\GS\Renderers\SW\GSDrawScanlineCodeGenerator.x86.cpp" />
<ClCompile Include="..\..\GS\GSDump.cpp" /> <ClCompile Include="..\..\GS\GSDump.cpp" />
<ClCompile Include="..\..\GS\GSdx.cpp" />
<ClCompile Include="..\..\GS\Renderers\Common\GSFunctionMap.cpp" /> <ClCompile Include="..\..\GS\Renderers\Common\GSFunctionMap.cpp" />
<ClCompile Include="..\..\GS\Renderers\HW\GSHwHack.cpp" /> <ClCompile Include="..\..\GS\Renderers\HW\GSHwHack.cpp" />
<ClCompile Include="..\..\GS\GSLocalMemory.cpp" /> <ClCompile Include="..\..\GS\GSLocalMemory.cpp" />

View File

@ -1392,9 +1392,6 @@
<ClCompile Include="..\..\GS\GSDump.cpp"> <ClCompile Include="..\..\GS\GSDump.cpp">
<Filter>System\Ps2\GS</Filter> <Filter>System\Ps2\GS</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\GS\GSdx.cpp">
<Filter>System\Ps2\GS</Filter>
</ClCompile>
<ClCompile Include="..\..\GS\Renderers\Common\GSFunctionMap.cpp"> <ClCompile Include="..\..\GS\Renderers\Common\GSFunctionMap.cpp">
<Filter>System\Ps2\GS</Filter> <Filter>System\Ps2\GS</Filter>
</ClCompile> </ClCompile>