diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index dc813f6e..102fd37e 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -59,7 +59,7 @@ void SoundEngine::playMusicTick() {}; #ifdef _WINDOWS64 char SoundEngine::m_szSoundPath[]={"Windows64Media\\Sound\\"}; char SoundEngine::m_szMusicPath[]={"music\\"}; -char SoundEngine::m_szRedistName[]={"redist64"}; +char SoundEngine::m_szRedistName[]={"Windows64\\redist64"}; //str1k3r - moved this to a the Windows64 dir so its out of plain view #elif defined _DURANGO char SoundEngine::m_szSoundPath[]={"Sound\\"}; char SoundEngine::m_szMusicPath[]={"music\\"}; @@ -791,7 +791,9 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa char *SoundName = (char *)ConvertSoundPathToName(name); strcat((char *)szSoundName,SoundName); -// app.DebugPrintf(6,"PlaySound - %d - %s - %s (%f %f %f, vol %f, pitch %f)\n",iSound, SoundName, szSoundName,x,y,z,volume,pitch); +#ifdef _DEBUG + app.DebugPrintf(6,"PlaySound - %d - %s - %s (%f %f %f, vol %f, pitch %f)\n",iSound, SoundName, szSoundName,x,y,z,volume,pitch); +#endif AUDIO_INFO AudioInfo; AudioInfo.x=x; @@ -846,9 +848,11 @@ void SoundEngine::playUI(int iSound, float volume, float pitch) char *SoundName = (char *)ConvertSoundPathToName(name); strcat((char *)szSoundName,SoundName); -// app.DebugPrintf("UI: Playing %s, volume %f, pitch %f\n",SoundName,volume,pitch); - //app.DebugPrintf("PlaySound - %d - %s\n",iSound, SoundName); +#ifdef _DEBUG + app.DebugPrintf("UI: Playing %s, volume %f, pitch %f\n",SoundName,volume,pitch); + app.DebugPrintf("PlaySound - %d - %s\n",iSound, SoundName); +#endif AUDIO_INFO AudioInfo; memset(&AudioInfo,0,sizeof(AUDIO_INFO)); @@ -1136,10 +1140,12 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter ) SoundEngine *soundEngine = (SoundEngine *)lpParameter; soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0); +#ifdef _DEBUG if(soundEngine->m_hStream==0) { app.DebugPrintf("SoundEngine::OpenStreamThreadProc - Could not open - %s\n",soundEngine->m_szStreamName); } +#endif return 0; } diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/iggy_w64.dll b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/iggy_w64.dll deleted file mode 100644 index 43430508..00000000 Binary files a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/iggy_w64.dll and /dev/null differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/binkawin64.asi b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/binkawin64.asi deleted file mode 100644 index d363b31d..00000000 Binary files a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/binkawin64.asi and /dev/null differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dolby.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dolby.flt deleted file mode 100644 index 7e9eb605..00000000 Binary files a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dolby.flt and /dev/null differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64ds3d.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64ds3d.flt deleted file mode 100644 index c6a6a125..00000000 Binary files a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64ds3d.flt and /dev/null differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dsp.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dsp.flt deleted file mode 100644 index 28caa28e..00000000 Binary files a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dsp.flt and /dev/null differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64eax.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64eax.flt deleted file mode 100644 index c91b6e16..00000000 Binary files a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64eax.flt and /dev/null differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64srs.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64srs.flt deleted file mode 100644 index 01baef15..00000000 Binary files a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64srs.flt and /dev/null differ diff --git a/Minecraft.Client/Common/Buildsteps/Durango-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/Durango-postbuild.ps1 index 001cfb11..2cc5d756 100644 --- a/Minecraft.Client/Common/Buildsteps/Durango-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/Durango-postbuild.ps1 @@ -26,7 +26,7 @@ foreach ($dir in $directories) { $folderCopies = @( @{ Source = "Common\Media"; Dest = "Common\Media" }, @{ Source = "Common\res"; Dest = "Common\res" }, - @{ Source = "Durango\Sound"; Dest = "Sound" }, + @{ Source = "DurangoMedia\Sound"; Dest = "Sound" }, @{ Source = "DurangoMedia\DLC"; Dest = "DLC" }, @{ Source = "DurangoMedia\Tutorial"; Dest = "Tutorial" }, @{ Source = "music"; Dest = "music" }, @@ -40,6 +40,8 @@ foreach ($copy in $folderCopies) { if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null + } else { + Write-Host "Durango Postbuild: Folder not found, skipping: $src" } } @@ -53,7 +55,9 @@ foreach ($copy in $fileCopies) { $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force - } + } else { + Write-Host "Durango Postbuild: File not found, skipping: $src" + } } $deleteDirs = @( diff --git a/Minecraft.Client/Common/Buildsteps/Orbis-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/Orbis-postbuild.ps1 index 45f78399..01bb431a 100644 --- a/Minecraft.Client/Common/Buildsteps/Orbis-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/Orbis-postbuild.ps1 @@ -22,15 +22,15 @@ foreach ($dir in $directories) { } $folderCopies = @( - @{ Source = "music"; Dest = "PS4_GAME\music" }, - @{ Source = "Common\Media"; Dest = "PS4_GAME\Common\Media" }, - @{ Source = "Common\res"; Dest = "PS4_GAME\Common\res" }, - @{ Source = "Orbis\Sound"; Dest = "PS4_GAME\Orbis\Sound" }, - @{ Source = "OrbisMedia\DLC"; Dest = "PS4_GAME\Orbis\DLC" }, - @{ Source = "Orbis\DLCImages"; Dest = "PS4_GAME\Orbis\DLCImages" }, + @{ Source = "music"; Dest = "PS4_GAME\music" }, + @{ Source = "Common\Media"; Dest = "PS4_GAME\Common\Media" }, + @{ Source = "Common\res"; Dest = "PS4_GAME\Common\res" }, + @{ Source = "OrbisMedia\Sound"; Dest = "PS4_GAME\Orbis\Sound" }, + @{ Source = "OrbisMedia\DLC"; Dest = "PS4_GAME\Orbis\DLC" }, + @{ Source = "Orbis\DLCImages"; Dest = "PS4_GAME\Orbis\DLCImages" }, @{ Source = "OrbisMedia\Tutorial"; Dest = "PS4_GAME\Orbis\Tutorial" }, - @{ Source = "$env:SCE_ORBIS_SDK_DIR\target\sce_module"; Dest = "PS4_GAME\sce_module" }, - @{ Source = Join-Path $PSScriptRoot "Contents\Orbis\sce_gls"; Dest = "PS4_GAME\sce_gls" }, + @{ Source = "$env:SCE_ORBIS_SDK_DIR\target\sce_module"; Dest = "PS4_GAME\sce_module" }, + @{ Source = Join-Path $PSScriptRoot "Contents\Orbis\sce_gls"; Dest = "PS4_GAME\sce_gls" }, @{ Source = Join-Path $PSScriptRoot "Contents\Orbis\sce_sys"; Dest = "PS4_GAME\sce_sys" } ) @@ -44,7 +44,9 @@ foreach ($copy in $folderCopies) { if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null - } + } else { + Write-Host "Orbis Postbuild: Folder not found, skipping: $src" + } } $fileCopies = @( @@ -57,7 +59,9 @@ foreach ($copy in $fileCopies) { $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force - } + } else { + Write-Host "Orbis Postbuild: File not found, skipping: $src" + } } $builtFile = Join-Path $OutDir "Minecraft.Client.elf" diff --git a/Minecraft.Client/Common/Buildsteps/PS3-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/PS3-postbuild.ps1 index c5158822..b7e8fa5a 100644 --- a/Minecraft.Client/Common/Buildsteps/PS3-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/PS3-postbuild.ps1 @@ -24,18 +24,24 @@ $folderCopies = @( @{ Source = "Common\Media"; Dest = "PS3_GAME\USRDIR\Common\Media" }, @{ Source = "Common\res"; Dest = "PS3_GAME\USRDIR\Common\res" }, @{ Source = "PS3Media\DLC"; Dest = "PS3_GAME\USRDIR\DLC" }, - @{ Source = "PS3\Sound"; Dest = "PS3_GAME\USRDIR\PS3\Sound" }, + @{ Source = "PS3Media\Sound"; Dest = "PS3_GAME\USRDIR\PS3\Sound" }, #@{ Source = "PSVita\Tutorial"; Dest = "PS3_GAME\USRDIR\PS3\Tutorial" }, # str1k3r - softlocks game @{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\LICDIR"; Dest = "PS3_GAME\LICDIR" }, @{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\TROPDIR"; Dest = "PS3_GAME\TROPDIR" } ) foreach ($copy in $folderCopies) { - $src = Join-Path $ProjectDir $copy.Source + if ([System.IO.Path]::IsPathRooted($copy.Source)) { + $src = $copy.Source + } else { + $src = Join-Path $ProjectDir $copy.Source + } $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null + } else { + Write-Host "PS3 Postbuild: Folder not found, skipping: $src" } } @@ -57,7 +63,9 @@ foreach ($copy in $fileCopies) { $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force - } + } else { + Write-Host "PS3 Postbuild: File not found, skipping: $src" + } } if ($Configuration -match "ContentPackage") { diff --git a/Minecraft.Client/Common/Buildsteps/PSVita-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/PSVita-postbuild.ps1 index 39bc2a37..7db32d2e 100644 --- a/Minecraft.Client/Common/Buildsteps/PSVita-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/PSVita-postbuild.ps1 @@ -20,14 +20,14 @@ foreach ($dir in $directories) { } $folderCopies = @( - @{ Source = "music"; Dest = "PSVITA_GAME\music" }, - @{ Source = "Common\Media"; Dest = "PSVITA_GAME\Common\Media" }, - @{ Source = "Common\res"; Dest = "PSVITA_GAME\Common\res" }, - @{ Source = "PSVita\Sound"; Dest = "PSVITA_GAME\PSVita\Sound" }, - @{ Source = "PSVitaMedia\DLC"; Dest = "PSVITA_GAME\PSVita\DLC" }, - @{ Source = "PSVita\Tutorial"; Dest = "PSVITA_GAME\PSVita\Tutorial" }, - @{ Source = "$env:SCE_PSP2_SDK_DIR\target\sce_module"; Dest = "PSVITA_GAME\sce_module" }, - @{ Source = Join-Path $PSScriptRoot "Contents\PSVita\sce_sys"; Dest = "PSVITA_GAME\sce_sys" } + @{ Source = "music"; Dest = "PSVITA_GAME\music" }, + @{ Source = "Common\Media"; Dest = "PSVITA_GAME\Common\Media" }, + @{ Source = "Common\res"; Dest = "PSVITA_GAME\Common\res" }, + @{ Source = "PSVitaMedia\Sound"; Dest = "PSVITA_GAME\PSVita\Sound" }, + @{ Source = "PSVitaMedia\DLC"; Dest = "PSVITA_GAME\PSVita\DLC" }, + @{ Source = "PSVita\Tutorial"; Dest = "PSVITA_GAME\PSVita\Tutorial" }, + @{ Source = "$env:SCE_PSP2_SDK_DIR\target\sce_module"; Dest = "PSVITA_GAME\sce_module" }, + @{ Source = Join-Path $PSScriptRoot "Contents\PSVita\sce_sys"; Dest = "PSVITA_GAME\sce_sys" } ) foreach ($copy in $folderCopies) { @@ -40,7 +40,9 @@ foreach ($copy in $folderCopies) { if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null - } + } else { + Write-Host "PSVita Postbuild: Folder not found, skipping: $src" + } } $fileCopies = @( @@ -54,7 +56,9 @@ foreach ($copy in $fileCopies) { if (Test-Path $src) { New-Item -ItemType Directory -Path (Split-Path $dst -Parent) -Force | Out-Null Copy-Item -Path $src -Destination $dst -Force - } + } else { + Write-Host "PSVita Postbuild: File not found, skipping: $src" + } } $builtFile = Join-Path $OutDir "Minecraft.Client.self" diff --git a/Minecraft.Client/Common/Buildsteps/Windows64-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/Windows64-postbuild.ps1 index 77a84ad2..3a744a40 100644 --- a/Minecraft.Client/Common/Buildsteps/Windows64-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/Windows64-postbuild.ps1 @@ -20,28 +20,34 @@ foreach ($dir in $directories) { $folderCopies = @( @{ Source = "music"; Dest = "music" }, - @{ Source = "Common\Media"; Dest = "Common\Media" }, @{ Source = "Common\res"; Dest = "Common\res" }, + @{ Source = "Common\Media"; Dest = "Common\Media" }, @{ Source = "DurangoMedia"; Dest = "Windows64Media" }, @{ Source = "Windows64Media"; Dest = "Windows64Media" }, - #@{ Source = "PSVita\Tutorial"; Dest = "Windows64Media\Tutorial" }, # str1k3r - doesnt even work bru - @{ Source = "Windows64\Sound"; Dest = "Windows64Media\Sound" }, - @{ Source = Join-Path $PSScriptRoot "Contents\Windows64\redist64"; Dest = "redist64" } + @{ Source = "Windows64Media\Sound"; Dest = "Windows64Media\Sound" }, + #@{ Source = "PSVita\Tutorial"; Dest = "Windows64Media\Tutorial" }, # str1k3r - doesnt even work bru + @{ Source = "Windows64\Miles\lib\redist64"; Dest = "Windows64\redist64" } ) foreach ($copy in $folderCopies) { - $src = Join-Path $ProjectDir $copy.Source + if ([System.IO.Path]::IsPathRooted($copy.Source)) { + $src = $copy.Source + } else { + $src = Join-Path $ProjectDir $copy.Source + } $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null + } else { + Write-Host "Windows64 Postbuild: Folder not found, skipping: $src" } } $fileCopies = @( @{ Source = Join-Path $ProjectDir "Windows64\4JLibs\4J_Input\Windows64\vendor\SDL\lib\x64\SDL3.dll"; Dest = "SDL3.dll" }, - @{ Source = Join-Path $PSScriptRoot "Contents\Windows64\iggy_w64.dll"; Dest = "iggy_w64.dll" }, - @{ Source = Join-Path $PSScriptRoot "Contents\Windows64\mss64.dll"; Dest = "mss64.dll" } + @{ Source = Join-Path $PSScriptRoot "Contents\Windows64\mss64.dll"; Dest = "mss64.dll" }, + @{ Source = "Windows64\Iggy\lib\redist64\iggy_w64.dll"; Dest = "iggy_w64.dll" } ) foreach ($copy in $fileCopies) { @@ -50,7 +56,7 @@ foreach ($copy in $fileCopies) { if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force } else { - Write-Host "Windows64 Postbuild: source not found, skipping: $src" + Write-Host "Windows64 Postbuild: File not found, skipping: $src" } } diff --git a/Minecraft.Client/Common/Buildsteps/Xbox-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/Xbox-postbuild.ps1 index 12279db5..8da63f72 100644 --- a/Minecraft.Client/Common/Buildsteps/Xbox-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/Xbox-postbuild.ps1 @@ -24,6 +24,8 @@ foreach ($copy in $copies) { if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null + } else { + Write-Host "Xbox Postbuild: Folder not found, skipping: $src" } } @@ -48,5 +50,7 @@ foreach ($copy in $fileCopies) { $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force - } + } else { + Write-Host "Xbox Postbuild: File not found, skipping: $src" + } } \ No newline at end of file diff --git a/Minecraft.Client/Common/DLC/DLCManager.cpp b/Minecraft.Client/Common/DLC/DLCManager.cpp index aa219db5..9d4c07ca 100644 --- a/Minecraft.Client/Common/DLC/DLCManager.cpp +++ b/Minecraft.Client/Common/DLC/DLCManager.cpp @@ -406,6 +406,12 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD unsigned int uiVersion=*(unsigned int *)pbData; uiCurrentByte+=sizeof(int); + if(uiVersion > CURRENT_DLC_VERSION_NUM) + { + if(pbData!=NULL) delete [] pbData; + app.DebugPrintf("DLC version of %d is newer than this build can read (%d)\n", uiVersion, CURRENT_DLC_VERSION_NUM); + return false; + } if(uiVersion < CURRENT_DLC_VERSION_NUM) { if(pbData!=NULL) delete [] pbData; @@ -613,6 +619,11 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack) unsigned int uiVersion=*(unsigned int *)pbData; uiCurrentByte+=sizeof(int); + if(uiVersion > CURRENT_DLC_VERSION_NUM) + { + app.DebugPrintf("DLC version of %d is newer than this build can read (%d)\n", uiVersion, CURRENT_DLC_VERSION_NUM); + return 0; + } if(uiVersion < CURRENT_DLC_VERSION_NUM) { app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion); diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.cpp index 15ec6f58..502033e9 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_AbstractContainer.cpp @@ -454,12 +454,7 @@ void CXuiSceneAbstractContainer::SetPointerText(vector *description, return; } - wstring combinedText; - for(size_t i = 0; i < description->size(); ++i) - { - combinedText += (*description)[i].text; - if(i + 1 < description->size()) combinedText += L"\n"; - } + wstring combinedText = HtmlString::Compose(description); vector unformattedStrings; for(size_t i = 0; i < description->size(); ++i) diff --git a/Minecraft.Client/Minecraft.Client.vcxproj b/Minecraft.Client/Minecraft.Client.vcxproj index b1e527e7..c1481c4f 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj +++ b/Minecraft.Client/Minecraft.Client.vcxproj @@ -482,6 +482,7 @@ $(SCE_PSP2_SDK_DIR)/target\src\npToolkit\include;$(ProjectDir)..\Minecraft.Client\PSVita\Assert;$(ProjectDir);$(ProjectDir)..\Minecraft.World\x64headers;$(ProjectDir)\..\Minecraft.Client\PSVita\PSVitaExtras + $(OutDir) true $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) @@ -501,6 +502,7 @@ + $(OutDir) false $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) @@ -592,21 +594,25 @@ $(ProjectDir)..\Minecraft.World\x64headers;$(ProjectDir)\..\Minecraft.Client\PSVita\PSVitaExtras + $(OutDir) false $(OutDir)default$(TargetExt) $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) + $(OutDir) false $(OutDir)default$(TargetExt) $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) + $(OutDir) false $(OutDir)default$(TargetExt) $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) + $(OutDir) false $(OutDir)default$(TargetExt) $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) @@ -932,7 +938,7 @@ true $(OutDir)$(ProjectName).pdb - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) NotSet false @@ -1044,7 +1050,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CU true $(OutDir)$(ProjectName).pdb - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) NotSet false @@ -1741,7 +1747,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUfalse $(OutDir)default.pdb true - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) false @@ -1785,7 +1791,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUfalse $(OutDir)default.pdb true - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) xapilib.lib false false @@ -1824,7 +1830,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CU true $(OutDir)$(ProjectName).pdb - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) NotSet false @@ -1865,7 +1871,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUfalse $(OutDir)default.pdb true - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) xapilib.lib false false diff --git a/Minecraft.Client/Orbis/Sound/Minecraft.msscmp b/Minecraft.Client/OrbisMedia/Sound/Minecraft.msscmp similarity index 100% rename from Minecraft.Client/Orbis/Sound/Minecraft.msscmp rename to Minecraft.Client/OrbisMedia/Sound/Minecraft.msscmp diff --git a/Minecraft.Client/PS3/Sound/Minecraft.msscmp b/Minecraft.Client/PS3/Sound/Minecraft.msscmp deleted file mode 100644 index 860c42cc..00000000 Binary files a/Minecraft.Client/PS3/Sound/Minecraft.msscmp and /dev/null differ diff --git a/Minecraft.Client/Durango/Sound/Minecraft.msscmp b/Minecraft.Client/PS3Media/Sound/Minecraft.msscmp similarity index 100% rename from Minecraft.Client/Durango/Sound/Minecraft.msscmp rename to Minecraft.Client/PS3Media/Sound/Minecraft.msscmp diff --git a/Minecraft.Client/PSVita/Sound/Minecraft.msscmp b/Minecraft.Client/PSVitaMedia/Sound/Minecraft.msscmp similarity index 100% rename from Minecraft.Client/PSVita/Sound/Minecraft.msscmp rename to Minecraft.Client/PSVitaMedia/Sound/Minecraft.msscmp diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 4ec1d043..861b22ad 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -4,6 +4,7 @@ #include "stdafx.h" #include +#include #include "GameConfig\Minecraft.spa.h" #include "..\MinecraftServer.h" #include "..\LocalPlayer.h" @@ -24,10 +25,6 @@ #include "..\..\Minecraft.World\ThreadName.h" #include "..\..\Minecraft.Client\StatsCounter.h" #include "..\ConnectScreen.h" -//#include "Social\SocialManager.h" -//#include "Leaderboards\LeaderboardManager.h" -//#include "XUI\XUI_Scene_Container.h" -//#include "NetworkManager.h" #include "..\..\Minecraft.Client\Tesselator.h" #include "..\..\Minecraft.Client\Options.h" #include "Sentient\SentientManager.h" @@ -42,12 +39,11 @@ HINSTANCE hMyInst; LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam); +WINDOWPLACEMENT g_wpPrev = { sizeof(g_wpPrev) }; + char chGlobalText[256]; uint16_t ui16GlobalText[256]; -#define THEME_NAME "584111F70AAAAAAA" -#define THEME_FILESIZE 2797568 - //#define THREE_MB 3145728 // minimum save size (checking for this on a selected device) //#define FIVE_MB 5242880 // minimum save size (checking for this on a selected device) //#define FIFTY_TWO_MB (1024*1024*52) // Maximum TCR space required for a save (checking for this on a selected device) @@ -58,27 +54,51 @@ uint16_t ui16GlobalText[256]; #define NUM_PROFILE_SETTINGS 4 DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]= { -#ifdef _XBOX - XPROFILE_OPTION_CONTROLLER_VIBRATION, - XPROFILE_GAMER_YAXIS_INVERSION, - XPROFILE_GAMER_CONTROL_SENSITIVITY, - XPROFILE_GAMER_ACTION_MOVEMENT_CONTROL, - XPROFILE_TITLE_SPECIFIC1, -#else 0,0,0,0,0 -#endif }; -//------------------------------------------------------------------------------------- -// Time Since fAppTime is a float, we need to keep the quadword app time -// as a LARGE_INTEGER so that we don't lose precision after running -// for a long time. -//------------------------------------------------------------------------------------- +//str1k3r - request dedicated GPU from AMD and NVIDIA drivers +extern "C" +{ + __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; + __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; +} +BOOL g_isFullscreen = FALSE; BOOL g_bWidescreen = TRUE; +BOOL g_bResolutionSetByCMD = FALSE; + int g_iScreenWidth = 1920; int g_iScreenHeight = 1080; +static Windows64LaunchArgs ParseLaunchArgs() +{ + Windows64LaunchArgs args = {}; + args.resolution = 0; + + int argc = 0; + LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc); + if (argv == nullptr) + return args; + + if (argc > 1 && lstrlenW(argv[1]) == 1) + { + if (argv[1][0] >= L'1' && argv[1][0] <= L'6') + args.resolution = argv[1][0] - L'0'; + } + + for (int i = 1; i < argc; ++i) + { + if (_wcsicmp(argv[i], L"-fullscreen") == 0) + { + args.fullscreen = true; + } + } + + LocalFree(argv); + return args; +} + void DefineActions(void) { // The app needs to define the actions required, and the possible mappings for these @@ -622,6 +642,39 @@ void Render() g_pSwapChain->Present( 0, 0 ); } +//-------------------------------------------------------------------------------------- +// Toggle borderless fullscreen +// Credits to the smartCMD repo for this +// This is the proper way to do this therefore we just took it +//-------------------------------------------------------------------------------------- +void ToggleFullscreen() +{ + const DWORD dwStyle = GetWindowLong(g_hWnd, GWL_STYLE); + if (!g_isFullscreen) + { + MONITORINFO mi = { sizeof(mi) }; + if (GetWindowPlacement(g_hWnd, &g_wpPrev) && + GetMonitorInfo(MonitorFromWindow(g_hWnd, MONITOR_DEFAULTTOPRIMARY), &mi)) + { + SetWindowLong(g_hWnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW); + SetWindowPos(g_hWnd, HWND_TOP, + mi.rcMonitor.left, mi.rcMonitor.top, + mi.rcMonitor.right - mi.rcMonitor.left, + mi.rcMonitor.bottom - mi.rcMonitor.top, + SWP_NOOWNERZORDER | SWP_FRAMECHANGED); + } + } + else + { + SetWindowLong(g_hWnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW); + SetWindowPlacement(g_hWnd, &g_wpPrev); + SetWindowPos(g_hWnd, nullptr, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_FRAMECHANGED); + } + g_isFullscreen = !g_isFullscreen; +} + + //-------------------------------------------------------------------------------------- // Clean up the objects we've created //-------------------------------------------------------------------------------------- @@ -635,8 +688,6 @@ void CleanupDevice() if( g_pd3dDevice ) g_pd3dDevice->Release(); } - - int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, @@ -645,44 +696,46 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); - if(lpCmdLine) + Windows64LaunchArgs launchArgs = ParseLaunchArgs(); + + if(launchArgs.resolution != 0) { - if(lpCmdLine[0] == '1') + if(launchArgs.resolution == 1) { // 2160p g_iScreenWidth = 3840; g_iScreenHeight = 2160; g_bResolutionSetByCMD = TRUE; } - else if(lpCmdLine[0] == '2') + else if(launchArgs.resolution == 2) { // 1440p g_iScreenWidth = 2560; g_iScreenHeight = 1440; g_bResolutionSetByCMD = TRUE; } - else if (lpCmdLine[0] == '3') + else if (launchArgs.resolution == 3) { // 1080p g_iScreenWidth = 1920; g_iScreenHeight = 1080; g_bResolutionSetByCMD = TRUE; } - else if(lpCmdLine[0] == '4') + else if(launchArgs.resolution == 4) { // 720p g_iScreenWidth = 1280; g_iScreenHeight = 720; g_bResolutionSetByCMD = TRUE; } - else if(lpCmdLine[0] == '5') + else if(launchArgs.resolution == 5) { // 480p g_iScreenWidth = 640; g_iScreenHeight = 480; g_bResolutionSetByCMD = TRUE; } - else if(lpCmdLine[0] == '6') + else if(launchArgs.resolution == 6) { // Vita Native, 544p g_iScreenWidth = 960; @@ -691,7 +744,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } } - // Initialize global strings MyRegisterClass(hInstance); @@ -709,6 +761,11 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, return 0; } + if(launchArgs.fullscreen) + { + ToggleFullscreen(); + } + #if 0 // Main message loop MSG msg = {0}; @@ -999,7 +1056,10 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, app.UpdateTime(); PIXBeginNamedEvent(0,"Input manager tick"); - InputManager.Tick(); + if (GetFocus()) + { + InputManager.Tick(); + } PIXEndNamedEvent(); PIXBeginNamedEvent(0,"Profile manager tick"); // ProfileManager.Tick(); @@ -1190,6 +1250,18 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, #if 0 PIXEndNamedEvent(); #endif + isF11Pressed = (GetAsyncKeyState(VK_F11) & 0x8000) != 0; + + if(isF11Pressed && !wasF11Pressed && GetFocus()) + { + ToggleFullscreen(); + } + else if(isF11Pressed && !wasF11Pressed && GetFocus()) + { + ToggleFullscreen(); + } + + wasF11Pressed = isF11Pressed; // 4J-PB - Update the trial timer display if we are in the trial version if(!ProfileManager.IsFullVersion()) diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.h b/Minecraft.Client/Windows64/Windows64_Minecraft.h index 186756bb..ef912fbb 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.h +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.h @@ -2,13 +2,22 @@ #include +static bool isF11Pressed = false; +static bool wasF11Pressed = false; + extern BOOL g_bWidescreen; extern int g_iScreenWidth; extern int g_iScreenHeight; -BOOL g_bResolutionSetByCMD = FALSE; +extern BOOL g_bResolutionSetByCMD; extern ID3D11Device* g_pd3dDevice; -void CleanupDevice(); \ No newline at end of file +void CleanupDevice(); + +struct Windows64LaunchArgs +{ + bool fullscreen; + int resolution; +}; \ No newline at end of file diff --git a/Minecraft.Client/Windows64/Sound/Minecraft.msscmp b/Minecraft.Client/Windows64Media/Sound/Minecraft.msscmp similarity index 84% rename from Minecraft.Client/Windows64/Sound/Minecraft.msscmp rename to Minecraft.Client/Windows64Media/Sound/Minecraft.msscmp index 0d0df508..ba22b635 100644 Binary files a/Minecraft.Client/Windows64/Sound/Minecraft.msscmp and b/Minecraft.Client/Windows64Media/Sound/Minecraft.msscmp differ