Skip to content

Commit 85b0dbc

Browse files
committed
Add project files.
1 parent b39e17b commit 85b0dbc

27 files changed

Lines changed: 1690 additions & 0 deletions

WinSplitPlus.sln

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36327.8
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinSplitPlusIJ", "WinSplitPlusIJ\WinSplitPlusIJ.vcxproj", "{F3264E5F-9AA3-4FC9-BAEB-14EE02104CCD}"
7+
EndProject
8+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinSplitPlus", "WinSplitPlusApp\WinSplitPlus.vcxproj", "{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|x64 = Debug|x64
13+
Debug|x86 = Debug|x86
14+
Release|x64 = Release|x64
15+
Release|x86 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{F3264E5F-9AA3-4FC9-BAEB-14EE02104CCD}.Debug|x64.ActiveCfg = Debug|x64
19+
{F3264E5F-9AA3-4FC9-BAEB-14EE02104CCD}.Debug|x64.Build.0 = Debug|x64
20+
{F3264E5F-9AA3-4FC9-BAEB-14EE02104CCD}.Debug|x86.ActiveCfg = Debug|Win32
21+
{F3264E5F-9AA3-4FC9-BAEB-14EE02104CCD}.Debug|x86.Build.0 = Debug|Win32
22+
{F3264E5F-9AA3-4FC9-BAEB-14EE02104CCD}.Release|x64.ActiveCfg = Release|x64
23+
{F3264E5F-9AA3-4FC9-BAEB-14EE02104CCD}.Release|x64.Build.0 = Release|x64
24+
{F3264E5F-9AA3-4FC9-BAEB-14EE02104CCD}.Release|x86.ActiveCfg = Release|Win32
25+
{F3264E5F-9AA3-4FC9-BAEB-14EE02104CCD}.Release|x86.Build.0 = Release|Win32
26+
{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}.Debug|x64.ActiveCfg = Debug|x64
27+
{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}.Debug|x64.Build.0 = Debug|x64
28+
{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}.Debug|x86.ActiveCfg = Debug|Win32
29+
{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}.Debug|x86.Build.0 = Debug|Win32
30+
{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}.Release|x64.ActiveCfg = Release|x64
31+
{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}.Release|x64.Build.0 = Release|x64
32+
{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}.Release|x86.ActiveCfg = Release|Win32
33+
{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}.Release|x86.Build.0 = Release|Win32
34+
EndGlobalSection
35+
GlobalSection(SolutionProperties) = preSolution
36+
HideSolutionNode = FALSE
37+
EndGlobalSection
38+
GlobalSection(ExtensibilityGlobals) = postSolution
39+
SolutionGuid = {807C5302-D409-4833-BA63-2A308845E3D8}
40+
EndGlobalSection
41+
EndGlobal
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@echo off
2+
3+
START WinSplitPlus.exe ^
4+
-Player 1 ^
5+
-winclass ^
6+
-winname ^
7+
-mutex "Mutex Game" ^
8+
-width 960 ^
9+
-height 1080 ^
10+
-posx 0 ^
11+
-posy 0 ^
12+
"C:\Game\Game.exe" -window

WinSplitPlusApp/PlayerInfo.cpp

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
#include "include\PlayerInfo.hpp"
2+
3+
4+
5+
bool PlayerInfo::setName(std::wstring name)
6+
{
7+
if (name.length() > MAX_NAME_LENGTH)
8+
return false;
9+
10+
_playerName = name;
11+
12+
return true;
13+
}
14+
15+
std::wstring PlayerInfo::getName()
16+
{
17+
return _playerName;
18+
}
19+
20+
std::wstring PlayerInfo::getCommandLine()
21+
{
22+
if(! _windowInfo)
23+
throw std::exception("Window infomation not supplied, unable to generate commandline.");
24+
25+
_profilePath = L"SaveGames/";
26+
27+
_profilePath += _playerName + L".profile";
28+
29+
DWORD fileAttributes = GetFileAttributes(_profilePath.c_str());
30+
31+
if (fileAttributes != INVALID_FILE_ATTRIBUTES && !(fileAttributes & FILE_ATTRIBUTE_DIRECTORY))
32+
{
33+
_profileExisted = true;
34+
}
35+
36+
std::wstring commandLine = L" /win /resolution " +
37+
std::to_wstring(_wndSizeX) +
38+
L" "
39+
+
40+
std::to_wstring(_wndSizeY) +
41+
L" /lan /name SplitScreen";
42+
43+
return commandLine;
44+
}
45+
46+
void PlayerInfo::genWindowInfo(std::size_t playerCount, std::size_t screenSizeX, std::size_t screenSizeY)
47+
{
48+
if (playerCount > 4 || playerCount < 2)
49+
{
50+
throw std::exception("So sorry dear fellow but that many players simply won't work here.");
51+
}
52+
53+
std::size_t screenHalfSizeX = screenSizeX / 2;
54+
std::size_t screenHalfSizeY = screenSizeY / 2;
55+
56+
if (playerCount == 2)
57+
{
58+
_wndSizeX = screenHalfSizeX;
59+
_wndSizeY = screenHalfSizeX * 0.75f;
60+
_wndPosX = 0;
61+
_wndPosY = (screenSizeY - _wndSizeY) / 2;
62+
63+
if (_playerIndex == PlayerID::PlayerTwo)
64+
{
65+
_wndPosX = screenHalfSizeX;
66+
}
67+
68+
}
69+
else if (playerCount == 3)
70+
{
71+
_wndSizeX = screenHalfSizeX;
72+
_wndSizeY = screenHalfSizeY;
73+
_wndPosX = 0;
74+
_wndPosY = 0;
75+
76+
if (_playerIndex == PlayerID::PlayerTwo)
77+
{
78+
_wndPosX = screenHalfSizeX;
79+
}
80+
else if (_playerIndex == PlayerID::PlayerThree)
81+
{
82+
_wndPosX = screenSizeX / 4;
83+
_wndPosY = screenHalfSizeY;
84+
}
85+
}
86+
else
87+
{
88+
_wndSizeX = screenHalfSizeX;
89+
_wndSizeY = screenHalfSizeY;
90+
_wndPosX = 0;
91+
_wndPosY = 0;
92+
93+
if (_playerIndex == PlayerID::PlayerTwo)
94+
{
95+
_wndPosX = screenHalfSizeX;
96+
}
97+
else if (_playerIndex == PlayerID::PlayerThree)
98+
{
99+
_wndPosY = screenHalfSizeY;
100+
}
101+
else if (_playerIndex == PlayerID::PlayerFour)
102+
{
103+
_wndPosX = screenHalfSizeX;
104+
_wndPosY = screenHalfSizeY;
105+
}
106+
}
107+
108+
_windowInfo = true;
109+
}
110+
111+
112+
PlayerInfo::PlayerInfo(PlayerID playerID)
113+
{
114+
_playerIndex = playerID;
115+
_defaultName();
116+
}
117+
118+
void PlayerInfo::_defaultName()
119+
{
120+
_playerName = L"Player #" + std::to_wstring(int (_playerIndex) + 1);
121+
}
122+
123+
PlayerInfo::~PlayerInfo()
124+
{
125+
if (!_profileExisted)
126+
{
127+
DeleteFile(_profilePath.c_str());
128+
}
129+
}
115 KB
Binary file not shown.
360 KB
Loading

WinSplitPlusApp/WinSplitPlus.rc

3.59 KB
Binary file not shown.
Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<ProjectGuid>{ECFB77F2-74BA-44EA-AAEC-49FDA00A3768}</ProjectGuid>
23+
<Keyword>Win32Proj</Keyword>
24+
<RootNamespace>SWBFSplitScreen</RootNamespace>
25+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
26+
<ProjectName>WinSplitPlus</ProjectName>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v143</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v143</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v143</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v143</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<LinkIncremental>true</LinkIncremental>
75+
<OutDir>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\</OutDir>
76+
</PropertyGroup>
77+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
78+
<LinkIncremental>true</LinkIncremental>
79+
<OutDir>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\</OutDir>
80+
</PropertyGroup>
81+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
82+
<LinkIncremental>false</LinkIncremental>
83+
<OutDir>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\</OutDir>
84+
</PropertyGroup>
85+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
86+
<LinkIncremental>false</LinkIncremental>
87+
<OutDir>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\</OutDir>
88+
</PropertyGroup>
89+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
90+
<ClCompile>
91+
<PrecompiledHeader>
92+
</PrecompiledHeader>
93+
<WarningLevel>Level3</WarningLevel>
94+
<Optimization>Disabled</Optimization>
95+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
96+
<SDLCheck>true</SDLCheck>
97+
<AdditionalIncludeDirectories>$(SolutionDir)WinSplitPlusIJ\include\;$(SolutionDir)lib\EasyHook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
98+
</ClCompile>
99+
<Link>
100+
<SubSystem>Console</SubSystem>
101+
<GenerateDebugInformation>true</GenerateDebugInformation>
102+
<EntryPointSymbol>
103+
</EntryPointSymbol>
104+
<AdditionalLibraryDirectories>$(SolutionDir)lib\EasyHook;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
105+
<AdditionalDependencies>EasyHook32.lib;%(AdditionalDependencies)</AdditionalDependencies>
106+
</Link>
107+
</ItemDefinitionGroup>
108+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
109+
<ClCompile>
110+
<PrecompiledHeader>
111+
</PrecompiledHeader>
112+
<WarningLevel>Level3</WarningLevel>
113+
<Optimization>Disabled</Optimization>
114+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
115+
<SDLCheck>true</SDLCheck>
116+
<AdditionalIncludeDirectories>$(SolutionDir)WinSplitPlusIJ\include\;$(SolutionDir)lib\EasyHook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
117+
</ClCompile>
118+
<Link>
119+
<SubSystem>Console</SubSystem>
120+
<GenerateDebugInformation>true</GenerateDebugInformation>
121+
<AdditionalLibraryDirectories>$(SolutionDir)lib\EasyHook;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
122+
<AdditionalDependencies>EasyHook64.lib;%(AdditionalDependencies)</AdditionalDependencies>
123+
</Link>
124+
</ItemDefinitionGroup>
125+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
126+
<ClCompile>
127+
<WarningLevel>Level3</WarningLevel>
128+
<PrecompiledHeader>
129+
</PrecompiledHeader>
130+
<Optimization>MaxSpeed</Optimization>
131+
<FunctionLevelLinking>true</FunctionLevelLinking>
132+
<IntrinsicFunctions>true</IntrinsicFunctions>
133+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
134+
<SDLCheck>true</SDLCheck>
135+
<AdditionalIncludeDirectories>$(SolutionDir)WinSplitPlusIJ\include\;$(SolutionDir)lib\EasyHook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
136+
</ClCompile>
137+
<Link>
138+
<SubSystem>Console</SubSystem>
139+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
140+
<OptimizeReferences>true</OptimizeReferences>
141+
<GenerateDebugInformation>true</GenerateDebugInformation>
142+
<EntryPointSymbol>
143+
</EntryPointSymbol>
144+
<AdditionalLibraryDirectories>$(SolutionDir)lib\EasyHook;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
145+
<AdditionalDependencies>EasyHook32.lib;%(AdditionalDependencies)</AdditionalDependencies>
146+
</Link>
147+
<PostBuildEvent>
148+
<Command>echo Copying EasyHook DLL...
149+
copy "$(SolutionDir)lib\EasyHook\EasyHook32.dll" "$(TargetDir)"
150+
copy "$(ProjectDir)Examples\BatFileExample.txt" "$(TargetDir)"</Command>
151+
</PostBuildEvent>
152+
</ItemDefinitionGroup>
153+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
154+
<ClCompile>
155+
<WarningLevel>Level3</WarningLevel>
156+
<PrecompiledHeader>
157+
</PrecompiledHeader>
158+
<Optimization>MaxSpeed</Optimization>
159+
<FunctionLevelLinking>true</FunctionLevelLinking>
160+
<IntrinsicFunctions>true</IntrinsicFunctions>
161+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
162+
<SDLCheck>true</SDLCheck>
163+
<AdditionalIncludeDirectories>$(SolutionDir)WinSplitPlusIJ\include\;$(SolutionDir)lib\EasyHook;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
164+
</ClCompile>
165+
<Link>
166+
<SubSystem>Console</SubSystem>
167+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
168+
<OptimizeReferences>true</OptimizeReferences>
169+
<GenerateDebugInformation>true</GenerateDebugInformation>
170+
<AdditionalLibraryDirectories>$(SolutionDir)lib\EasyHook;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
171+
<AdditionalDependencies>EasyHook64.lib;%(AdditionalDependencies)</AdditionalDependencies>
172+
</Link>
173+
</ItemDefinitionGroup>
174+
<ItemGroup>
175+
<ClCompile Include="PlayerInfo.cpp" />
176+
<ClCompile Include="main.cpp" />
177+
</ItemGroup>
178+
<ItemGroup>
179+
<ClInclude Include="include\constants.h" />
180+
<ClInclude Include="include\PlayerInfo.hpp" />
181+
<ClInclude Include="resource.h" />
182+
</ItemGroup>
183+
<ItemGroup>
184+
<None Include="packages.config" />
185+
</ItemGroup>
186+
<ItemGroup>
187+
<ResourceCompile Include="WinSplitPlus.rc" />
188+
</ItemGroup>
189+
<ItemGroup>
190+
<Image Include="Resources\new_launcher_icon.ico" />
191+
<Image Include="Resources\new_launcher_icon.png" />
192+
</ItemGroup>
193+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
194+
<ImportGroup Label="ExtensionTargets">
195+
<Import Project="$(SolutionDir)packages\EasyHookNativePackage.redist.2.7.6035\build\native\EasyHookNativePackage.redist.targets" Condition="Exists('packages\EasyHookNativePackage.redist.2.7.6035\build\native\EasyHookNativePackage.redist.targets')" />
196+
<Import Project="$(SolutionDir)packages\EasyHookNativePackage.2.7.6035\build\native\EasyHookNativePackage.targets" Condition="Exists('packages\EasyHookNativePackage.2.7.6035\build\native\EasyHookNativePackage.targets')" />
197+
</ImportGroup>
198+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
199+
<PropertyGroup>
200+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
201+
</PropertyGroup>
202+
<Error Condition="!Exists('$(SolutionDir)packages\EasyHookNativePackage.redist.2.7.6035\build\native\EasyHookNativePackage.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\EasyHookNativePackage.redist.2.7.6035\build\native\EasyHookNativePackage.redist.targets'))" />
203+
<Error Condition="!Exists('$(SolutionDir)packages\EasyHookNativePackage.2.7.6035\build\native\EasyHookNativePackage.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\EasyHookNativePackage.2.7.6035\build\native\EasyHookNativePackage.targets'))" />
204+
</Target>
205+
</Project>

0 commit comments

Comments
 (0)